From owner-svn-src-head@freebsd.org Sun Jan 10 00:06:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FD07A6A8CB; Sun, 10 Jan 2016 00:06:05 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [65.19.130.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.strugglingcoder.info", Issuer "mail.strugglingcoder.info" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B9ED1014; Sun, 10 Jan 2016 00:06:05 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 7297AC9BB1; Sat, 9 Jan 2016 16:05:58 -0800 (PST) Date: Sat, 9 Jan 2016 16:05:58 -0800 From: hiren panchasara To: Gleb Smirnoff Cc: NGie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat Message-ID: <20160110000558.GI6605@strugglingcoder.info> References: <201601082034.u08KYvLv075281@repo.freebsd.org> <96B980EE-FD2F-490E-BA5E-4F23A67CEB18@gmail.com> <20160108211041.GG1906@FreeBSD.org> <88B48C42-DFEF-4CAE-973E-BDF2A408B4A3@gmail.com> <20160108213202.GI1906@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="n8884J15jRwcBTvu" Content-Disposition: inline In-Reply-To: <20160108213202.GI1906@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 00:06:05 -0000 --n8884J15jRwcBTvu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I'd also stress on having important details in commit-log itself. On 01/08/16 at 01:32P, Gleb Smirnoff wrote: > I'm writing status report on this right now. Looking forward to it. >=20 > Also there is slideshare: http://www.slideshare.net/facepalmtarbz2/new-se= ndfile-in-english Thanks. Cheers, Hiren --n8884J15jRwcBTvu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJWkaBiXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lwDAH/RMfH7NH2cyHhGxVjZBObcGn OVRVF1wG5McGzq7mpFYoouf+PUxiRHq14PcsIg9+y4FVNN8GKO2L+ICi6GRKSOSS v/ODsG9V1+hy6+G8/Nn/rJCBuMii647db0ZIxJ9ERvxWrjDZgZfLOPF/fahOaRvB DQ8T1JMn5x0yRp/rlHfqS9NzsIqT/trIzTbEIueCQJro6kIVU0TsR/rfM4TO1Wbl Ja7uQbRiRsYEeWSbgE3S3XHpvnG0vZdEndPcbliyAF0m9FARTdjljDkFwjzyqU7V tN7LscDen6Pl7Qe3coacLvuHwJjpXSW0WGBnK0F2HZC/Yv74QD8CDzRLJRC7jdk= =r3rz -----END PGP SIGNATURE----- --n8884J15jRwcBTvu-- From owner-svn-src-head@freebsd.org Sun Jan 10 00:28:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55E6DA6AE62; Sun, 10 Jan 2016 00:28:45 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E9961D92; Sun, 10 Jan 2016 00:28:45 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0A0Si4o085647; Sun, 10 Jan 2016 00:28:44 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0A0SiL6085646; Sun, 10 Jan 2016 00:28:44 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601100028.u0A0SiL6085646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 10 Jan 2016 00:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293625 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 00:28:45 -0000 Author: melifaro Date: Sun Jan 10 00:28:44 2016 New Revision: 293625 URL: https://svnweb.freebsd.org/changeset/base/293625 Log: Use already pre-calculated number of entries instead of tc->count. Modified: head/sys/netpfil/ipfw/ip_fw_table.c Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Sun Jan 10 00:01:03 2016 (r293624) +++ head/sys/netpfil/ipfw/ip_fw_table.c Sun Jan 10 00:28:44 2016 (r293625) @@ -2097,7 +2097,7 @@ export_table_info(struct ip_fw_chain *ch i->count = table_get_count(ch, tc); i->limit = tc->limit; i->flags |= (tc->locked != 0) ? IPFW_TGFLAGS_LOCKED : 0; - i->size = tc->count * sizeof(ipfw_obj_tentry); + i->size = i->count * sizeof(ipfw_obj_tentry); i->size += sizeof(ipfw_obj_header) + sizeof(ipfw_xtable_info); strlcpy(i->tablename, tc->tablename, sizeof(i->tablename)); ti = KIDX_TO_TI(ch, tc->no.kidx); From owner-svn-src-head@freebsd.org Sun Jan 10 06:43:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40990A69048; Sun, 10 Jan 2016 06:43:45 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E898C1E7C; Sun, 10 Jan 2016 06:43:44 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0A6hiuM095710; Sun, 10 Jan 2016 06:43:44 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0A6hire095709; Sun, 10 Jan 2016 06:43:44 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601100643.u0A6hire095709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 10 Jan 2016 06:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293626 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 06:43:45 -0000 Author: melifaro Date: Sun Jan 10 06:43:43 2016 New Revision: 293626 URL: https://svnweb.freebsd.org/changeset/base/293626 Log: Make ipfw addr:kfib lookup algo use new routing KPI. Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table_algo.c Sun Jan 10 00:28:44 2016 (r293625) +++ head/sys/netpfil/ipfw/ip_fw_table_algo.c Sun Jan 10 06:43:43 2016 (r293626) @@ -53,8 +53,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include /* struct ipfw_rule_ref */ #include +#include #include #include @@ -3778,7 +3780,6 @@ struct table_algo flow_hash = { * */ -static struct rtentry *lookup_kfib(void *key, int keylen, int fib); static int ta_lookup_kfib(struct table_info *ti, void *key, uint32_t keylen, uint32_t *val); static int kfib_parse_opts(int *pfib, char *data); @@ -3792,46 +3793,44 @@ static void ta_dump_kfib_tinfo(void *ta_ static int contigmask(uint8_t *p, int len); static int ta_dump_kfib_tentry(void *ta_state, struct table_info *ti, void *e, ipfw_obj_tentry *tent); +static int ta_dump_kfib_tentry_int(struct sockaddr *paddr, + struct sockaddr *pmask, ipfw_obj_tentry *tent); static int ta_find_kfib_tentry(void *ta_state, struct table_info *ti, ipfw_obj_tentry *tent); static void ta_foreach_kfib(void *ta_state, struct table_info *ti, ta_foreach_f *f, void *arg); -static struct rtentry * -lookup_kfib(void *key, int keylen, int fib) -{ - struct sockaddr *s; - - if (keylen == 4) { - struct sockaddr_in sin; - bzero(&sin, sizeof(sin)); - sin.sin_len = sizeof(struct sockaddr_in); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = *(in_addr_t *)key; - s = (struct sockaddr *)&sin; - } else { - struct sockaddr_in6 sin6; - bzero(&sin6, sizeof(sin6)); - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_family = AF_INET6; - sin6.sin6_addr = *(struct in6_addr *)key; - s = (struct sockaddr *)&sin6; - } - - return (rtalloc1_fib(s, 0, 0, fib)); -} static int ta_lookup_kfib(struct table_info *ti, void *key, uint32_t keylen, uint32_t *val) { - struct rtentry *rte; +#ifdef INET + struct nhop4_basic nh4; + struct in_addr in; +#endif +#ifdef INET6 + struct nhop6_basic nh6; +#endif + int error; - if ((rte = lookup_kfib(key, keylen, ti->data)) == NULL) +#ifdef INET + if (keylen == 4) { + in.s_addr = *(in_addr_t *)key; + error = fib4_lookup_nh_basic(ti->data, + in, 0, 0, &nh4); + } +#endif +#ifdef INET6 + if (keylen == 6) + error = fib6_lookup_nh_basic(ti->data, + (struct in6_addr *)key, 0, 0, 0, &nh6); +#endif + + if (error != 0) return (0); *val = 0; - RTFREE_LOCKED(rte); return (1); } @@ -3940,6 +3939,16 @@ ta_dump_kfib_tentry(void *ta_state, stru ipfw_obj_tentry *tent) { struct rtentry *rte; + + rte = (struct rtentry *)e; + + return ta_dump_kfib_tentry_int(rt_key(rte), rt_mask(rte), tent); +} + +static int +ta_dump_kfib_tentry_int(struct sockaddr *paddr, struct sockaddr *pmask, + ipfw_obj_tentry *tent) +{ #ifdef INET struct sockaddr_in *addr, *mask; #endif @@ -3948,14 +3957,13 @@ ta_dump_kfib_tentry(void *ta_state, stru #endif int len; - rte = (struct rtentry *)e; - addr = (struct sockaddr_in *)rt_key(rte); - mask = (struct sockaddr_in *)rt_mask(rte); len = 0; /* Guess IPv4/IPv6 radix by sockaddr family */ #ifdef INET - if (addr->sin_family == AF_INET) { + if (paddr->sa_family == AF_INET) { + addr = (struct sockaddr_in *)paddr; + mask = (struct sockaddr_in *)pmask; tent->k.addr.s_addr = addr->sin_addr.s_addr; len = 32; if (mask != NULL) @@ -3968,9 +3976,9 @@ ta_dump_kfib_tentry(void *ta_state, stru } #endif #ifdef INET6 - if (addr->sin_family == AF_INET6) { - addr6 = (struct sockaddr_in6 *)addr; - mask6 = (struct sockaddr_in6 *)mask; + if (paddr->sa_family == AF_INET6) { + addr6 = (struct sockaddr_in6 *)paddr; + mask6 = (struct sockaddr_in6 *)pmask; memcpy(&tent->k, &addr6->sin6_addr, sizeof(struct in6_addr)); len = 128; if (mask6 != NULL) @@ -3990,28 +3998,43 @@ static int ta_find_kfib_tentry(void *ta_state, struct table_info *ti, ipfw_obj_tentry *tent) { - struct rtentry *rte; - void *key; - int keylen; + struct rt_addrinfo info; + struct sockaddr_in6 key6, dst6, mask6; + struct sockaddr *dst, *key, *mask; + + /* Prepare sockaddr for prefix/mask and info */ + bzero(&dst6, sizeof(dst6)); + dst6.sin6_len = sizeof(dst6); + dst = (struct sockaddr *)&dst6; + bzero(&mask6, sizeof(mask6)); + mask6.sin6_len = sizeof(mask6); + mask = (struct sockaddr *)&mask6; + + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = dst; + info.rti_info[RTAX_NETMASK] = mask; + + /* Prepare the lookup key */ + bzero(&key6, sizeof(key6)); + key6.sin6_family = tent->subtype; + key = (struct sockaddr *)&key6; if (tent->subtype == AF_INET) { - key = &tent->k.addr; - keylen = sizeof(struct in_addr); + ((struct sockaddr_in *)&key6)->sin_addr = tent->k.addr; + key6.sin6_len = sizeof(struct sockaddr_in); } else { - key = &tent->k.addr6; - keylen = sizeof(struct in6_addr); + key6.sin6_addr = tent->k.addr6; + key6.sin6_len = sizeof(struct sockaddr_in6); } - if ((rte = lookup_kfib(key, keylen, ti->data)) == NULL) - return (0); + if (rib_lookup_info(ti->data, key, 0, 0, &info) != 0) + return (ENOENT); + if ((info.rti_addrs & RTA_NETMASK) == 0) + mask = NULL; - if (rte != NULL) { - ta_dump_kfib_tentry(ta_state, ti, rte, tent); - RTFREE_LOCKED(rte); - return (0); - } + ta_dump_kfib_tentry_int(dst, mask, tent); - return (ENOENT); + return (0); } static void From owner-svn-src-head@freebsd.org Sun Jan 10 07:36:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81E0FA69FB8; Sun, 10 Jan 2016 07:36:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5504B153F; Sun, 10 Jan 2016 07:36:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0A7ahNI011168; Sun, 10 Jan 2016 07:36:43 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0A7ahHt011167; Sun, 10 Jan 2016 07:36:43 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601100736.u0A7ahHt011167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 10 Jan 2016 07:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293627 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 07:36:44 -0000 Author: dchagin Date: Sun Jan 10 07:36:43 2016 New Revision: 293627 URL: https://svnweb.freebsd.org/changeset/base/293627 Log: Unlock process lock when return error from getrobustlist call and add an forgotten dtrace probe when return the same error. MFC after: 3 days XMFC with: r292743 Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Sun Jan 10 06:43:43 2016 (r293626) +++ head/sys/compat/linux/linux_futex.c Sun Jan 10 07:36:43 2016 (r293627) @@ -1099,8 +1099,12 @@ linux_get_robust_list(struct thread *td, ESRCH); return (ESRCH); } - if (SV_PROC_ABI(td2->td_proc) != SV_ABI_LINUX) + if (SV_PROC_ABI(td2->td_proc) != SV_ABI_LINUX) { + LIN_SDT_PROBE1(futex, linux_get_robust_list, return, + EPERM); + PROC_UNLOCK(td2->td_proc); return (EPERM); + } em = em_find(td2); KASSERT(em != NULL, ("get_robust_list: emuldata notfound.\n")); From owner-svn-src-head@freebsd.org Sun Jan 10 07:50:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1027A6A696; Sun, 10 Jan 2016 07:50:36 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 788661CA6; Sun, 10 Jan 2016 07:50:36 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0A7oZOV014045; Sun, 10 Jan 2016 07:50:35 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0A7oZUr014044; Sun, 10 Jan 2016 07:50:35 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601100750.u0A7oZUr014044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 10 Jan 2016 07:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293628 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 07:50:36 -0000 Author: melifaro Date: Sun Jan 10 07:50:35 2016 New Revision: 293628 URL: https://svnweb.freebsd.org/changeset/base/293628 Log: Convert ipfilter to the new routing KPI. Differential Revision: D4764 Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Jan 10 07:36:43 2016 (r293627) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Jan 10 07:50:35 2016 (r293628) @@ -50,6 +50,7 @@ static const char rcsid[] = "@(#)$Id$"; # include #include #include +#include #include #include #include @@ -712,17 +713,16 @@ ipf_fastroute(m0, mpp, fin, fdp) { register struct ip *ip, *mhip; register struct mbuf *m = *mpp; - register struct route *ro; int len, off, error = 0, hlen, code; struct ifnet *ifp, *sifp; - struct sockaddr_in *dst; - struct route iproute; + struct sockaddr_in dst; + struct nhop4_extended nh4; + int has_nhop = 0; + u_long fibnum = 0; u_short ip_off; frdest_t node; frentry_t *fr; - ro = NULL; - #ifdef M_WRITABLE /* * HOT FIX/KLUDGE: @@ -766,11 +766,10 @@ ipf_fastroute(m0, mpp, fin, fdp) /* * Route packet. */ - ro = &iproute; - bzero(ro, sizeof (*ro)); - dst = (struct sockaddr_in *)&ro->ro_dst; - dst->sin_family = AF_INET; - dst->sin_addr = ip->ip_dst; + bzero(&dst, sizeof (dst)); + dst.sin_family = AF_INET; + dst.sin_addr = ip->ip_dst; + dst.sin_len = sizeof(dst); fr = fin->fin_fr; if ((fr != NULL) && !(fr->fr_flags & FR_KEEPSTATE) && (fdp != NULL) && @@ -790,25 +789,22 @@ ipf_fastroute(m0, mpp, fin, fdp) } if ((fdp != NULL) && (fdp->fd_ip.s_addr != 0)) - dst->sin_addr = fdp->fd_ip; - - dst->sin_len = sizeof(*dst); - in_rtalloc(ro, M_GETFIB(m0)); + dst.sin_addr = fdp->fd_ip; - if ((ifp == NULL) && (ro->ro_rt != NULL)) - ifp = ro->ro_rt->rt_ifp; - - if ((ro->ro_rt == NULL) || (ifp == NULL)) { + fibnum = M_GETFIB(m0); + if (fib4_lookup_nh_ext(fibnum, dst.sin_addr, NHR_REF, 0, &nh4) != 0) { if (in_localaddr(ip->ip_dst)) error = EHOSTUNREACH; else error = ENETUNREACH; goto bad; } - if (ro->ro_rt->rt_flags & RTF_GATEWAY) - dst = (struct sockaddr_in *)ro->ro_rt->rt_gateway; - if (ro->ro_rt) - counter_u64_add(ro->ro_rt->rt_pksent, 1); + + has_nhop = 1; + if (ifp == NULL) + ifp = nh4.nh_ifp; + if (nh4.nh_flags & NHF_GATEWAY) + dst.sin_addr = nh4.nh_addr; /* * For input packets which are being "fastrouted", they won't @@ -852,8 +848,8 @@ ipf_fastroute(m0, mpp, fin, fdp) if (ntohs(ip->ip_len) <= ifp->if_mtu) { if (!ip->ip_sum) ip->ip_sum = in_cksum(m, hlen); - error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, - ro + error = (*ifp->if_output)(ifp, m, (struct sockaddr *)&dst, + NULL ); goto done; } @@ -935,8 +931,8 @@ sendorfree: m->m_act = 0; if (error == 0) error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, - ro + (struct sockaddr *)&dst, + NULL ); else FREE_MB_T(m); @@ -948,9 +944,9 @@ done: else ipfmain.ipf_frouteok[1]++; - if ((ro != NULL) && (ro->ro_rt != NULL)) { - RTFREE(ro->ro_rt); - } + if (has_nhop) + fib4_free_nh_ext(fibnum, &nh4); + return 0; bad: if (error == EMSGSIZE) { @@ -971,18 +967,11 @@ int ipf_verifysrc(fin) fr_info_t *fin; { - struct sockaddr_in *dst; - struct route iproute; + struct nhop4_basic nh4; - bzero((char *)&iproute, sizeof(iproute)); - dst = (struct sockaddr_in *)&iproute.ro_dst; - dst->sin_len = sizeof(*dst); - dst->sin_family = AF_INET; - dst->sin_addr = fin->fin_src; - in_rtalloc(&iproute, 0); - if (iproute.ro_rt == NULL) - return 0; - return (fin->fin_ifp == iproute.ro_rt->rt_ifp); + if (fib4_lookup_nh_basic(0, fin->fin_src, 0, 0, &nh4) != 0) + return (0); + return (fin->fin_ifp == nh4.nh_ifp); } From owner-svn-src-head@freebsd.org Sun Jan 10 08:14:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17DD6A6AE90; Sun, 10 Jan 2016 08:14:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D37B2178A; Sun, 10 Jan 2016 08:14:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0A8EQZ3022554; Sun, 10 Jan 2016 08:14:26 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0A8EQXw022553; Sun, 10 Jan 2016 08:14:26 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201601100814.u0A8EQXw022553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 10 Jan 2016 08:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293629 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 08:14:27 -0000 Author: bz Date: Sun Jan 10 08:14:25 2016 New Revision: 293629 URL: https://svnweb.freebsd.org/changeset/base/293629 Log: Initialize error after r293626 in case neither INET nor INET6 is compiled into the kernel. Ideally lots more code would just not be called (or compiled in) in that case but that requires a lot more surgery. For now try to make IP-less kernels compile again. Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table_algo.c Sun Jan 10 07:50:35 2016 (r293628) +++ head/sys/netpfil/ipfw/ip_fw_table_algo.c Sun Jan 10 08:14:25 2016 (r293629) @@ -3826,6 +3826,9 @@ ta_lookup_kfib(struct table_info *ti, vo error = fib6_lookup_nh_basic(ti->data, (struct in6_addr *)key, 0, 0, 0, &nh6); #endif +#if !defined(INET6) && !defined(INET) + error = ENOENT; +#endif if (error != 0) return (0); From owner-svn-src-head@freebsd.org Sun Jan 10 08:30:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4416AA69357; Sun, 10 Jan 2016 08:30:28 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward17j.cmail.yandex.net (forward17j.cmail.yandex.net [5.255.227.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F33341D76; Sun, 10 Jan 2016 08:30:27 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web1j.yandex.ru (web1j.yandex.ru [5.45.198.42]) by forward17j.cmail.yandex.net (Yandex) with ESMTP id A135620EC2; Sun, 10 Jan 2016 11:30:22 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web1j.yandex.ru (Yandex) with ESMTP id 816242181AE8; Sun, 10 Jan 2016 11:30:21 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1452414622; bh=UHYEb5/WKnWJJwP+bjtFiLHHC6L5WlLycUu/fnu0LDM=; h=From:To:In-Reply-To:References:Subject:Date; b=gvs+fh9s+vAlQNePNPjE9XSam+iAIlRn3yDJg3lgxESV8XdJo0yzE6lBoXkHtIBFG NdW++XCfEubE6NHFrG987BQMDSXnbLdd0h0cNHv2VSe4Z3ch9GDok/RX3G0cMwWtl7 F0bx5H8exu/odeZlDU/DMfxgcz4Gp/Spl4IaUaV4= Received: by web1j.yandex.ru with HTTP; Sun, 10 Jan 2016 11:30:21 +0300 From: Alexander V. Chernikov To: Bjoern A. Zeeb , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <201601100814.u0A8EQXw022553@repo.freebsd.org> References: null <201601100814.u0A8EQXw022553@repo.freebsd.org> Subject: Re: svn commit: r293629 - head/sys/netpfil/ipfw MIME-Version: 1.0 Message-Id: <274801452414621@web1j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 10 Jan 2016 11:30:21 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 08:30:28 -0000 I thought IP-less kernels have no reason to compile ipfw at all, am I wrong? 10.01.2016, 11:14, "Bjoern A. Zeeb" : > Author: bz > Date: Sun Jan 10 08:14:25 2016 > New Revision: 293629 > URL: https://svnweb.freebsd.org/changeset/base/293629 > > Log: > ššInitialize error after r293626 in case neither INET nor INET6 is > ššcompiled into the kernel. Ideally lots more code would just not > ššbe called (or compiled in) in that case but that requires a lot > ššmore surgery. For now try to make IP-less kernels compile again. > > Modified: > ššhead/sys/netpfil/ipfw/ip_fw_table_algo.c > > Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c > ============================================================================== > --- head/sys/netpfil/ipfw/ip_fw_table_algo.c Sun Jan 10 07:50:35 2016 (r293628) > +++ head/sys/netpfil/ipfw/ip_fw_table_algo.c Sun Jan 10 08:14:25 2016 (r293629) > @@ -3826,6 +3826,9 @@ ta_lookup_kfib(struct table_info *ti, vo > šššššššššššššššššerror = fib6_lookup_nh_basic(ti->data, > ššššššššššššššššššššš(struct in6_addr *)key, 0, 0, 0, &nh6); > š#endif > +#if !defined(INET6) && !defined(INET) > + error = ENOENT; > +#endif > > šššššššššif (error != 0) > šššššššššššššššššreturn (0); From owner-svn-src-head@freebsd.org Sun Jan 10 08:37:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82B75A69703; Sun, 10 Jan 2016 08:37:01 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 562D81518; Sun, 10 Jan 2016 08:37:01 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0A8b0p3028306; Sun, 10 Jan 2016 08:37:00 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0A8b0dg028305; Sun, 10 Jan 2016 08:37:00 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601100837.u0A8b0dg028305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 10 Jan 2016 08:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293630 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 08:37:01 -0000 Author: melifaro Date: Sun Jan 10 08:37:00 2016 New Revision: 293630 URL: https://svnweb.freebsd.org/changeset/base/293630 Log: Initialize error value ta_lookup_kfib() by default to please compiler. Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table_algo.c Sun Jan 10 08:14:25 2016 (r293629) +++ head/sys/netpfil/ipfw/ip_fw_table_algo.c Sun Jan 10 08:37:00 2016 (r293630) @@ -3814,6 +3814,7 @@ ta_lookup_kfib(struct table_info *ti, vo #endif int error; + error = ENOENT; #ifdef INET if (keylen == 4) { in.s_addr = *(in_addr_t *)key; @@ -3826,9 +3827,6 @@ ta_lookup_kfib(struct table_info *ti, vo error = fib6_lookup_nh_basic(ti->data, (struct in6_addr *)key, 0, 0, 0, &nh6); #endif -#if !defined(INET6) && !defined(INET) - error = ENOENT; -#endif if (error != 0) return (0); From owner-svn-src-head@freebsd.org Sun Jan 10 08:41:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41422A697FC; Sun, 10 Jan 2016 08:41:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A91017E6; Sun, 10 Jan 2016 08:41:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0A8f2Gh028492; Sun, 10 Jan 2016 08:41:02 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0A8f2MQ028491; Sun, 10 Jan 2016 08:41:02 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601100841.u0A8f2MQ028491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Sun, 10 Jan 2016 08:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293631 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 08:41:03 -0000 Author: sephe Date: Sun Jan 10 08:41:01 2016 New Revision: 293631 URL: https://svnweb.freebsd.org/changeset/base/293631 Log: committer-src.dot: Add {adrian,delphij}->me Approved by: adrian (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Jan 10 08:37:00 2016 (r293630) +++ head/share/misc/committers-src.dot Sun Jan 10 08:41:01 2016 (r293631) @@ -344,6 +344,7 @@ adrian -> loos adrian -> monthadar adrian -> ray adrian -> rmh +adrian -> sephe ae -> melifaro @@ -404,6 +405,7 @@ das -> rodrigc delphij -> gabor delphij -> rafan +delphij -> sephe des -> anholt des -> hmp From owner-svn-src-head@freebsd.org Sun Jan 10 09:03:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D57DA6A3A3; Sun, 10 Jan 2016 09:03:05 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BC2A125F; Sun, 10 Jan 2016 09:03:04 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 496BA25D37D1; Sun, 10 Jan 2016 09:02:55 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 693C1C76FDD; Sun, 10 Jan 2016 09:02:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id d26VfvamOTVW; Sun, 10 Jan 2016 09:02:53 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 49A49C76FDB; Sun, 10 Jan 2016 09:02:53 +0000 (UTC) Date: Sun, 10 Jan 2016 09:02:52 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Alexander V. Chernikov" cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r293629 - head/sys/netpfil/ipfw In-Reply-To: <274801452414621@web1j.yandex.ru> Message-ID: References: null <201601100814.u0A8EQXw022553@repo.freebsd.org> <274801452414621@web1j.yandex.ru> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 09:03:05 -0000 On Sun, 10 Jan 2016, Alexander V. Chernikov wrote: > I thought IP-less kernels have no reason to compile ipfw at all, am I wrong? You can still filter on L2 or other L3 protocols. The latter is probably not very common anymore these days, the former might be. /bz From owner-svn-src-head@freebsd.org Sun Jan 10 11:59:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BA74A6BA8A; Sun, 10 Jan 2016 11:59:57 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E03951D74; Sun, 10 Jan 2016 11:59:56 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ABxuuu088031; Sun, 10 Jan 2016 11:59:56 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ABxuGp088030; Sun, 10 Jan 2016 11:59:56 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601101159.u0ABxuGp088030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 10 Jan 2016 11:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293632 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 11:59:57 -0000 Author: melifaro Date: Sun Jan 10 11:59:55 2016 New Revision: 293632 URL: https://svnweb.freebsd.org/changeset/base/293632 Log: Do not hold ifaddr reference for the whole icmp6_reflect() exec time. Copy source address, calculate hlim and release refcount instead. Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Sun Jan 10 08:41:01 2016 (r293631) +++ head/sys/netinet6/icmp6.c Sun Jan 10 11:59:55 2016 (r293632) @@ -2114,13 +2114,13 @@ icmp6_rip6_input(struct mbuf **mp, int o void icmp6_reflect(struct mbuf *m, size_t off) { - struct in6_addr src, *srcp = NULL; + struct in6_addr src6, *srcp; struct ip6_hdr *ip6; struct icmp6_hdr *icmp6; struct in6_ifaddr *ia = NULL; struct ifnet *outif = NULL; int plen; - int type, code; + int type, code, hlim; /* too short to reflect */ if (off < sizeof(struct ip6_hdr)) { @@ -2166,6 +2166,8 @@ icmp6_reflect(struct mbuf *m, size_t off icmp6 = (struct icmp6_hdr *)(ip6 + 1); type = icmp6->icmp6_type; /* keep type for statistics */ code = icmp6->icmp6_code; /* ditto. */ + hlim = 0; + srcp = NULL; /* * If the incoming packet was addressed directly to us (i.e. unicast), @@ -2177,8 +2179,18 @@ icmp6_reflect(struct mbuf *m, size_t off if (!IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { ia = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); if (ia != NULL && !(ia->ia6_flags & - (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY))) - srcp = &ia->ia_addr.sin6_addr; + (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY))) { + src6 = ia->ia_addr.sin6_addr; + srcp = &src6; + + if (m->m_pkthdr.rcvif != NULL) { + /* XXX: This may not be the outgoing interface */ + hlim = ND_IFINFO(m->m_pkthdr.rcvif)->chlim; + } else + hlim = V_ip6_defhlim; + } + if (ia != NULL) + ifa_free(&ia->ia_ifa); } if (srcp == NULL) { @@ -2195,16 +2207,16 @@ icmp6_reflect(struct mbuf *m, size_t off sin6.sin6_len = sizeof(sin6); sin6.sin6_addr = ip6->ip6_dst; /* zone ID should be embedded */ - e = in6_selectsrc(&sin6, NULL, NULL, NULL, &outif, &src); + e = in6_selectsrc(&sin6, NULL, NULL, NULL, &outif, &src6); if (e) { char ip6buf[INET6_ADDRSTRLEN]; nd6log((LOG_DEBUG, "icmp6_reflect: source can't be determined: " "dst=%s, error=%d\n", - ip6_sprintf(ip6buf, &sin6.sin6_addr), e)); + ip6_sprintf(ip6buf, &ip6->ip6_dst), e)); goto bad; } - srcp = &src; + srcp = &src6; } /* * ip6_input() drops a packet if its src is multicast. @@ -2218,11 +2230,8 @@ icmp6_reflect(struct mbuf *m, size_t off ip6->ip6_nxt = IPPROTO_ICMPV6; if (outif) ip6->ip6_hlim = ND_IFINFO(outif)->chlim; - else if (m->m_pkthdr.rcvif) { - /* XXX: This may not be the outgoing interface */ - ip6->ip6_hlim = ND_IFINFO(m->m_pkthdr.rcvif)->chlim; - } else - ip6->ip6_hlim = V_ip6_defhlim; + else + ip6->ip6_hlim = hlim; icmp6->icmp6_cksum = 0; icmp6->icmp6_cksum = in6_cksum(m, IPPROTO_ICMPV6, @@ -2238,13 +2247,9 @@ icmp6_reflect(struct mbuf *m, size_t off if (outif) icmp6_ifoutstat_inc(outif, type, code); - if (ia != NULL) - ifa_free(&ia->ia_ifa); return; bad: - if (ia != NULL) - ifa_free(&ia->ia_ifa); m_freem(m); return; } From owner-svn-src-head@freebsd.org Sun Jan 10 13:08:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EEC8A5FBBC for ; Sun, 10 Jan 2016 13:08:43 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED9081DDF for ; Sun, 10 Jan 2016 13:08:42 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x235.google.com with SMTP id f206so231962246wmf.0 for ; Sun, 10 Jan 2016 05:08:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ccu58JuLzIJH4QsFKzL80q1Y1YucXwZi83FyBU7Ol7Q=; b=WKFE2jQ7KaaAxSsVQQ/HgQxflAVu0kqImYFNnVH8kBfbY6GxppU0srQUq14fji0liB u+1NkSUIETaCm4w+GZBIxhJLe44Hx6IME21nnEQRv7+uIPtYONC6s5caBCT0x/p9fbH9 taEMsF5QBF7XrdHfdz+b+vwZKji3PSOsZ7A2J5T0OI6rk7FdBKCfwqN5FKZsU+kdCH/h bJTOabuK0uJpYSMnDrBi9Jlvd+40Y7XGp1VZ8TEhuD9rjm2Roamyy5NVNIMw/iolcTyR TLJe9E+2/3saNTlrvNO3C9oKgZN1wg25gktANOBzZgYm06b45EjHgWpFlHz49l3+KaLt rF2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ccu58JuLzIJH4QsFKzL80q1Y1YucXwZi83FyBU7Ol7Q=; b=Zwh/iNnnpo5KlSwz0xlGDjeu9JJegayz+2I5qd+8hTIrLxCkls+kPf//yZecDiTnYO +4AxtSSm+9FZr5oZz7osqJvZQ9d3Ju9Wxtl9SqzpIRNGxgiGazOgpvuj8eSXRJpylvnb MGQE4sG2BxHwF1Q+0PvYlNgzvrqc4GadyVTok70AJxzIlXzkm0HpYpOZzk+QiWJKihCJ wO9GeHIeehUSqrD6zNuzoeW6Aeia5EGUkhUlMObWFGYzg1vw13N5Z3iEzDinUc64tzEz hZ9XAK+FeRKu0V3C9UkkYHcqKGfWI1bF+MWCHaJWofOy6CC57lyB9fpL0Bnttq/ZxUo9 OAjA== X-Gm-Message-State: ALoCoQmT2fOImcT3k1evUP6e+HJEdOerYtxl9T/l1B5JsSE1Bo59P07S8ukIhPzdzZ6hSFWurAXp46ha01wbXwJg0Av3gBEcNzI5DZ7+b7iJ/X9x/fn3Qhg= MIME-Version: 1.0 X-Received: by 10.194.171.66 with SMTP id as2mr28129264wjc.73.1452431321337; Sun, 10 Jan 2016 05:08:41 -0800 (PST) Received: by 10.194.85.167 with HTTP; Sun, 10 Jan 2016 05:08:41 -0800 (PST) In-Reply-To: <201511122200.tACM0xtq091540@repo.freebsd.org> References: <201511122200.tACM0xtq091540@repo.freebsd.org> Date: Sun, 10 Jan 2016 14:08:41 +0100 Message-ID: Subject: Re: svn commit: r290728 - in head/sys: amd64/include i386/include kern vm From: Oliver Pinter To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 13:08:43 -0000 On 11/12/15, John Baldwin wrote: > Author: jhb > Date: Thu Nov 12 22:00:59 2015 > New Revision: 290728 > URL: https://svnweb.freebsd.org/changeset/base/290728 > > Log: > Export various helper variables describing the layout and size of > certain kernel structures for use by debuggers. This mostly aids > in examining cores from a kernel without debug symbols as a debugger > can infer these values if debug symbols are available. > > One set of variables describes the layout of 'struct linker_file' to > walk the list of loaded kernel modules. > > A second set of variables describes the layout of 'struct proc' and > 'struct thread' to walk the list of processes in the kernel and the > threads in each process. > > The 'pcb_size' variable is used to index into the stoppcbs[] array. > > The 'vm_maxuser_address' is used to distinguish kernel virtual addresses > from user addresses. This doesn't have to be perfect, and > 'vm_maxuser_address' is a cheap and simple way to differentiate kernel > pointers from simple values like TIDs and PIDs. > > While here, annotate the fields in struct pcb used by kgdb on amd64 > and i386 to note that their ABI should be preserved. Annotations for > other platforms will be added in the future. > > Reviewed by: kib > MFC after: 2 weeks Hi John! Are you still plan to MFC back to 10-STABLE this commit? > Differential Revision: https://reviews.freebsd.org/D3773 > > Modified: > head/sys/amd64/include/pcb.h > head/sys/i386/include/pcb.h > head/sys/kern/kern_linker.c > head/sys/kern/kern_mib.c > head/sys/kern/kern_proc.c > head/sys/vm/vm_kern.c > [...] > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sun Jan 10 13:40:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC439A6975F; Sun, 10 Jan 2016 13:40:31 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CCE81ADA; Sun, 10 Jan 2016 13:40:31 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ADeUIE017598; Sun, 10 Jan 2016 13:40:30 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ADeUwH017591; Sun, 10 Jan 2016 13:40:30 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601101340.u0ADeUwH017591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 10 Jan 2016 13:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293633 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 13:40:31 -0000 Author: melifaro Date: Sun Jan 10 13:40:29 2016 New Revision: 293633 URL: https://svnweb.freebsd.org/changeset/base/293633 Log: Split in6_selectsrc() into in6_selectsrc_addr() and in6_selectsrc_socket(). in6_selectsrc() has 2 class of users: socket-based one (raw/udp/pcb/etc) and socket-less (ND code). The main reason for that change is inability to specify non-default FIB for callers w/o socket since (internally) inpcb is used to determine fib. As as result, add 2 wrappers for in6_selectsrc() (making in6_selectsrc() static): 1) in6_selectsrc_socket() for the former class. Embed scope_ambiguous check along with returning hop limit when needed. 2) in6_selectsrc_addr() for the latter case. Add 'fibnum' argument and pass IPv6 address w/ explicitly specified scope as separate argument. Reviewed by: ae (previous version) Modified: head/sys/netinet6/icmp6.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_var.h head/sys/netinet6/nd6_nbr.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Sun Jan 10 11:59:55 2016 (r293632) +++ head/sys/netinet6/icmp6.c Sun Jan 10 13:40:29 2016 (r293633) @@ -2194,26 +2194,25 @@ icmp6_reflect(struct mbuf *m, size_t off } if (srcp == NULL) { - int e; - struct sockaddr_in6 sin6; + int error; + struct in6_addr dst6; + uint32_t scopeid; /* * This case matches to multicasts, our anycast, or unicasts * that we do not own. Select a source address based on the * source address of the erroneous packet. */ - bzero(&sin6, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(sin6); - sin6.sin6_addr = ip6->ip6_dst; /* zone ID should be embedded */ + in6_splitscope(&ip6->ip6_dst, &dst6, &scopeid); + error = in6_selectsrc_addr(RT_DEFAULT_FIB, &dst6, + scopeid, NULL, &src6, &hlim); - e = in6_selectsrc(&sin6, NULL, NULL, NULL, &outif, &src6); - if (e) { + if (error) { char ip6buf[INET6_ADDRSTRLEN]; nd6log((LOG_DEBUG, "icmp6_reflect: source can't be determined: " "dst=%s, error=%d\n", - ip6_sprintf(ip6buf, &ip6->ip6_dst), e)); + ip6_sprintf(ip6buf, &ip6->ip6_dst), error)); goto bad; } srcp = &src6; @@ -2228,10 +2227,7 @@ icmp6_reflect(struct mbuf *m, size_t off ip6->ip6_vfc &= ~IPV6_VERSION_MASK; ip6->ip6_vfc |= IPV6_VERSION; ip6->ip6_nxt = IPPROTO_ICMPV6; - if (outif) - ip6->ip6_hlim = ND_IFINFO(outif)->chlim; - else - ip6->ip6_hlim = hlim; + ip6->ip6_hlim = hlim; icmp6->icmp6_cksum = 0; icmp6->icmp6_cksum = in6_cksum(m, IPPROTO_ICMPV6, Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Sun Jan 10 11:59:55 2016 (r293632) +++ head/sys/netinet6/in6_pcb.c Sun Jan 10 13:40:29 2016 (r293633) @@ -328,7 +328,6 @@ in6_pcbladdr(register struct inpcb *inp, { register struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam; int error = 0; - struct ifnet *ifp = NULL; int scope_ambiguous = 0; struct in6_addr in6a; @@ -358,20 +357,15 @@ in6_pcbladdr(register struct inpcb *inp, if ((error = prison_remote_ip6(inp->inp_cred, &sin6->sin6_addr)) != 0) return (error); - error = in6_selectsrc(sin6, inp->in6p_outputopts, - inp, inp->inp_cred, &ifp, &in6a); + error = in6_selectsrc_socket(sin6, inp->in6p_outputopts, + inp, inp->inp_cred, scope_ambiguous, &in6a, NULL); if (error) return (error); - if (ifp && scope_ambiguous && - (error = in6_setscope(&sin6->sin6_addr, ifp, NULL)) != 0) { - return(error); - } - /* * Do not update this earlier, in case we return with an error. * - * XXX: this in6_selectsrc result might replace the bound local + * XXX: this in6_selectsrc_socket result might replace the bound local * address with the address specified by setsockopt(IPV6_PKTINFO). * Is it the intended behavior? */ Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Sun Jan 10 11:59:55 2016 (r293632) +++ head/sys/netinet6/in6_src.c Sun Jan 10 13:40:29 2016 (r293633) @@ -136,6 +136,9 @@ static int selectroute(struct sockaddr_i static int in6_selectif(struct sockaddr_in6 *, struct ip6_pktopts *, struct ip6_moptions *, struct ifnet **, struct ifnet *, u_int); +static int in6_selectsrc(uint32_t, struct sockaddr_in6 *, + struct ip6_pktopts *, struct inpcb *, struct ucred *, + struct ifnet **, struct in6_addr *); static struct in6_addrpolicy *lookup_addrsel_policy(struct sockaddr_in6 *); @@ -175,9 +178,9 @@ static struct in6_addrpolicy *match_addr goto out; /* XXX: we can't use 'break' here */ \ } while(0) -int -in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, - struct inpcb *inp, struct ucred *cred, +static int +in6_selectsrc(uint32_t fibnum, struct sockaddr_in6 *dstsock, + struct ip6_pktopts *opts, struct inpcb *inp, struct ucred *cred, struct ifnet **ifpp, struct in6_addr *srcp) { struct rm_priotracker in6_ifa_tracker; @@ -228,7 +231,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso /* get the outgoing interface */ if ((error = in6_selectif(dstsock, opts, mopts, &ifp, oifp, - (inp != NULL) ? inp->inp_inc.inc_fibnum : RT_DEFAULT_FIB)) + fibnum)) != 0) return (error); @@ -545,6 +548,79 @@ in6_selectsrc(struct sockaddr_in6 *dstso } /* + * Select source address based on @inp, @dstsock and @opts. + * Stores selected address to @srcp. If @scope_ambiguous is set, + * embed scope from selected outgoing interface. If @hlim pointer + * is provided, stores calculated hop limit there. + * Returns 0 on success. + */ +int +in6_selectsrc_socket(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, + struct inpcb *inp, struct ucred *cred, int scope_ambiguous, + struct in6_addr *srcp, int *hlim) +{ + struct ifnet *retifp; + uint32_t fibnum; + int error; + + fibnum = (inp != NULL) ? inp->inp_inc.inc_fibnum : RT_DEFAULT_FIB; + retifp = NULL; + + error = in6_selectsrc(fibnum, dstsock, opts, inp, cred, &retifp, srcp); + if (error != 0) + return (error); + + if (hlim != NULL) + *hlim = in6_selecthlim(inp, retifp); + + if (retifp == NULL || scope_ambiguous == 0) + return (0); + + /* + * Application should provide a proper zone ID or the use of + * default zone IDs should be enabled. Unfortunately, some + * applications do not behave as it should, so we need a + * workaround. Even if an appropriate ID is not determined + * (when it's required), if we can determine the outgoing + * interface. determine the zone ID based on the interface. + */ + error = in6_setscope(&dstsock->sin6_addr, retifp, NULL); + + return (error); +} + +/* + * Select source address based on @fibnum, @dst and @scopeid. + * Stores selected address to @srcp. + * Returns 0 on success. + * + * Used by non-socket based consumers (ND code mostly) + */ +int +in6_selectsrc_addr(uint32_t fibnum, const struct in6_addr *dst, + uint32_t scopeid, struct ifnet *ifp, struct in6_addr *srcp, + int *hlim) +{ + struct ifnet *retifp; + struct sockaddr_in6 dst_sa; + int error; + + retifp = ifp; + bzero(&dst_sa, sizeof(dst_sa)); + dst_sa.sin6_family = AF_INET6; + dst_sa.sin6_len = sizeof(dst_sa); + dst_sa.sin6_addr = *dst; + dst_sa.sin6_scope_id = scopeid; + sa6_embedscope(&dst_sa, 0); + + error = in6_selectsrc(fibnum, &dst_sa, NULL, NULL, NULL, &retifp, srcp); + if (hlim != NULL) + *hlim = in6_selecthlim(NULL, retifp); + + return (error); +} + +/* * clone - meaningful only for bsdi and freebsd */ static int Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Sun Jan 10 11:59:55 2016 (r293632) +++ head/sys/netinet6/ip6_var.h Sun Jan 10 13:40:29 2016 (r293633) @@ -418,9 +418,10 @@ int rip6_usrreq(struct socket *, int dest6_input(struct mbuf **, int *, int); int none_input(struct mbuf **, int *, int); -int in6_selectsrc(struct sockaddr_in6 *, struct ip6_pktopts *, - struct inpcb *inp, struct ucred *cred, - struct ifnet **, struct in6_addr *); +int in6_selectsrc_socket(struct sockaddr_in6 *, struct ip6_pktopts *, + struct inpcb *, struct ucred *, int, struct in6_addr *, int *); +int in6_selectsrc_addr(uint32_t, const struct in6_addr *, + uint32_t, struct ifnet *, struct in6_addr *, int *); int in6_selectroute(struct sockaddr_in6 *, struct ip6_pktopts *, struct ip6_moptions *, struct route_in6 *, struct ifnet **, struct rtentry **); Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Sun Jan 10 11:59:55 2016 (r293632) +++ head/sys/netinet6/nd6_nbr.c Sun Jan 10 13:40:29 2016 (r293633) @@ -481,27 +481,21 @@ nd6_ns_output_fib(struct ifnet *ifp, con ifa_free(ifa); } else { int error; - struct sockaddr_in6 dst_sa; - struct in6_addr src_in; - struct ifnet *oifp; - - bzero(&dst_sa, sizeof(dst_sa)); - dst_sa.sin6_family = AF_INET6; - dst_sa.sin6_len = sizeof(dst_sa); - dst_sa.sin6_addr = ip6->ip6_dst; - - oifp = ifp; - error = in6_selectsrc(&dst_sa, NULL, - NULL, NULL, &oifp, &src_in); + struct in6_addr dst6, src6; + uint32_t scopeid; + + in6_splitscope(&ip6->ip6_dst, &dst6, &scopeid); + error = in6_selectsrc_addr(RT_DEFAULT_FIB, &dst6, + scopeid, ifp, &src6, NULL); if (error) { char ip6buf[INET6_ADDRSTRLEN]; nd6log((LOG_DEBUG, "%s: source can't be " "determined: dst=%s, error=%d\n", __func__, - ip6_sprintf(ip6buf, &dst_sa.sin6_addr), + ip6_sprintf(ip6buf, &dst6), error)); goto bad; } - ip6->ip6_src = src_in; + ip6->ip6_src = src6; } } else { /* @@ -941,12 +935,12 @@ nd6_na_output_fib(struct ifnet *ifp, con { struct mbuf *m; struct m_tag *mtag; - struct ifnet *oifp; struct ip6_hdr *ip6; struct nd_neighbor_advert *nd_na; struct ip6_moptions im6o; - struct in6_addr src, daddr6; - struct sockaddr_in6 dst_sa; + struct in6_addr daddr6, dst6, src6; + uint32_t scopeid; + int icmp6len, maxlen, error; caddr_t mac = NULL; @@ -998,24 +992,21 @@ nd6_na_output_fib(struct ifnet *ifp, con flags &= ~ND_NA_FLAG_SOLICITED; } ip6->ip6_dst = daddr6; - bzero(&dst_sa, sizeof(struct sockaddr_in6)); - dst_sa.sin6_family = AF_INET6; - dst_sa.sin6_len = sizeof(struct sockaddr_in6); - dst_sa.sin6_addr = daddr6; /* * Select a source whose scope is the same as that of the dest. */ - oifp = ifp; - error = in6_selectsrc(&dst_sa, NULL, NULL, NULL, &oifp, &src); + in6_splitscope(&daddr6, &dst6, &scopeid); + error = in6_selectsrc_addr(RT_DEFAULT_FIB, &dst6, + scopeid, ifp, &src6, NULL); if (error) { char ip6buf[INET6_ADDRSTRLEN]; nd6log((LOG_DEBUG, "nd6_na_output: source can't be " "determined: dst=%s, error=%d\n", - ip6_sprintf(ip6buf, &dst_sa.sin6_addr), error)); + ip6_sprintf(ip6buf, &daddr6), error)); goto bad; } - ip6->ip6_src = src; + ip6->ip6_src = src6; nd_na = (struct nd_neighbor_advert *)(ip6 + 1); nd_na->nd_na_type = ND_NEIGHBOR_ADVERT; nd_na->nd_na_code = 0; Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Sun Jan 10 11:59:55 2016 (r293632) +++ head/sys/netinet6/raw_ip6.c Sun Jan 10 13:40:29 2016 (r293633) @@ -397,6 +397,7 @@ rip6_output(struct mbuf *m, struct socke int type = 0, code = 0; /* for ICMPv6 output statistics only */ int scope_ambiguous = 0; int use_defzone = 0; + int hlim = 0; struct in6_addr in6a; va_list ap; @@ -460,8 +461,9 @@ rip6_output(struct mbuf *m, struct socke /* * Source address selection. */ - error = in6_selectsrc(dstsock, optp, in6p, so->so_cred, - &oifp, &in6a); + error = in6_selectsrc_socket(dstsock, optp, in6p, so->so_cred, + scope_ambiguous, &in6a, &hlim); + if (error) goto bad; error = prison_check_ip6(in6p->inp_cred, &in6a); @@ -469,19 +471,6 @@ rip6_output(struct mbuf *m, struct socke goto bad; ip6->ip6_src = in6a; - if (oifp && scope_ambiguous) { - /* - * Application should provide a proper zone ID or the use of - * default zone IDs should be enabled. Unfortunately, some - * applications do not behave as it should, so we need a - * workaround. Even if an appropriate ID is not determined - * (when it's required), if we can determine the outgoing - * interface. determine the zone ID based on the interface. - */ - error = in6_setscope(&dstsock->sin6_addr, oifp, NULL); - if (error != 0) - goto bad; - } ip6->ip6_dst = dstsock->sin6_addr; /* @@ -496,7 +485,7 @@ rip6_output(struct mbuf *m, struct socke * ip6_plen will be filled in ip6_output, so not fill it here. */ ip6->ip6_nxt = in6p->inp_ip_p; - ip6->ip6_hlim = in6_selecthlim(in6p, oifp); + ip6->ip6_hlim = hlim; if (so->so_proto->pr_protocol == IPPROTO_ICMPV6 || in6p->in6p_cksum != -1) { @@ -784,7 +773,6 @@ rip6_connect(struct socket *so, struct s struct inpcb *inp; struct sockaddr_in6 *addr = (struct sockaddr_in6 *)nam; struct in6_addr in6a; - struct ifnet *ifp = NULL; int error = 0, scope_ambiguous = 0; inp = sotoinpcb(so); @@ -813,21 +801,14 @@ rip6_connect(struct socket *so, struct s INP_INFO_WLOCK(&V_ripcbinfo); INP_WLOCK(inp); /* Source address selection. XXX: need pcblookup? */ - error = in6_selectsrc(addr, inp->in6p_outputopts, - inp, so->so_cred, &ifp, &in6a); + error = in6_selectsrc_socket(addr, inp->in6p_outputopts, + inp, so->so_cred, scope_ambiguous, &in6a, NULL); if (error) { INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_ripcbinfo); return (error); } - /* XXX: see above */ - if (ifp && scope_ambiguous && - (error = in6_setscope(&addr->sin6_addr, ifp, NULL)) != 0) { - INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_ripcbinfo); - return (error); - } inp->in6p_faddr = addr->sin6_addr; inp->in6p_laddr = in6a; soisconnected(so); Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Sun Jan 10 11:59:55 2016 (r293632) +++ head/sys/netinet6/udp6_usrreq.c Sun Jan 10 13:40:29 2016 (r293633) @@ -631,7 +631,6 @@ udp6_output(struct inpcb *inp, struct mb struct udphdr *udp6; struct in6_addr *laddr, *faddr, in6a; struct sockaddr_in6 *sin6 = NULL; - struct ifnet *oifp = NULL; int cscov_partial = 0; int scope_ambiguous = 0; u_short fport; @@ -731,15 +730,10 @@ udp6_output(struct inpcb *inp, struct mb } if (!IN6_IS_ADDR_V4MAPPED(faddr)) { - error = in6_selectsrc(sin6, optp, inp, - td->td_ucred, &oifp, &in6a); + error = in6_selectsrc_socket(sin6, optp, inp, + td->td_ucred, scope_ambiguous, &in6a, NULL); if (error) goto release; - if (oifp && scope_ambiguous && - (error = in6_setscope(&sin6->sin6_addr, - oifp, NULL))) { - goto release; - } laddr = &in6a; } else laddr = &inp->in6p_laddr; /* XXX */ From owner-svn-src-head@freebsd.org Sun Jan 10 16:31:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 175BDA6A1AE; Sun, 10 Jan 2016 16:31:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C920013D5; Sun, 10 Jan 2016 16:31:29 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0AGVSlA071331; Sun, 10 Jan 2016 16:31:28 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0AGVSbu071327; Sun, 10 Jan 2016 16:31:28 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601101631.u0AGVSbu071327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 10 Jan 2016 16:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293635 - in head/bin/sh: . tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 16:31:30 -0000 Author: jilles Date: Sun Jan 10 16:31:28 2016 New Revision: 293635 URL: https://svnweb.freebsd.org/changeset/base/293635 Log: sh: Update associated state when restoring locals while leaving a function. Some variables like PATH call a function when modified. Make sure to call this also when leaving a function where such a variable was made local. Make sure to restore local variables before shellparam, so getopts state is not clobbered. Added: head/bin/sh/tests/builtins/local5.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/tests/builtins/Makefile head/bin/sh/var.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Jan 10 13:53:57 2016 (r293634) +++ head/bin/sh/eval.c Sun Jan 10 16:31:28 2016 (r293635) @@ -1039,12 +1039,12 @@ evalcommand(union node *cmd, int flags, reffunc(cmdentry.u.func); savehandler = handler; if (setjmp(jmploc.loc)) { - freeparam(&shellparam); - shellparam = saveparam; popredir(); unreffunc(cmdentry.u.func); poplocalvars(); localvars = savelocalvars; + freeparam(&shellparam); + shellparam = saveparam; funcnest--; handler = savehandler; longjmp(handler->loc, 1); Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sun Jan 10 13:53:57 2016 (r293634) +++ head/bin/sh/tests/builtins/Makefile Sun Jan 10 16:31:28 2016 (r293635) @@ -111,6 +111,7 @@ FILES+= local1.0 FILES+= local2.0 FILES+= local3.0 FILES+= local4.0 +FILES+= local5.0 .if ${MK_NLS} != "no" FILES+= locale1.0 .endif Added: head/bin/sh/tests/builtins/local5.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/local5.0 Sun Jan 10 16:31:28 2016 (r293635) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +f() { + local PATH IFS elem + IFS=: + for elem in ''$PATH''; do + PATH=/var/empty/$elem:$PATH + done + ls -d / >/dev/null +} + +p1=$(command -v ls) +f +p2=$(command -v ls) +[ "$p1" = "$p2" ] Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Sun Jan 10 13:53:57 2016 (r293634) +++ head/bin/sh/var.c Sun Jan 10 16:31:28 2016 (r293635) @@ -791,6 +791,7 @@ poplocalvars(void) { struct localvar *lvp; struct var *vp; + int islocalevar; INTOFF; while ((lvp = localvars) != NULL) { @@ -803,10 +804,20 @@ poplocalvars(void) } else if ((lvp->flags & (VUNSET|VSTRFIXED)) == VUNSET) { (void)unsetvar(vp->text); } else { + islocalevar = (vp->flags | lvp->flags) & VEXPORT && + localevar(lvp->text); if ((vp->flags & VTEXTFIXED) == 0) ckfree(vp->text); vp->flags = lvp->flags; vp->text = lvp->text; + if (vp->func) + (*vp->func)(vp->text + vp->name_len + 1); + if (islocalevar) { + change_env(vp->text, vp->flags & VEXPORT && + (vp->flags & VUNSET) == 0); + setlocale(LC_ALL, ""); + updatecharset(); + } } ckfree(lvp); } From owner-svn-src-head@freebsd.org Sun Jan 10 16:42:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C10A6A632; Sun, 10 Jan 2016 16:42:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD5E41BAF; Sun, 10 Jan 2016 16:42:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0AGgF60077047; Sun, 10 Jan 2016 16:42:15 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0AGgEV3077040; Sun, 10 Jan 2016 16:42:14 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201601101642.u0AGgEV3077040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 10 Jan 2016 16:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293636 - in head/sys/powerpc: include ofw powermac powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 16:42:16 -0000 Author: nwhitehorn Date: Sun Jan 10 16:42:14 2016 New Revision: 293636 URL: https://svnweb.freebsd.org/changeset/base/293636 Log: Use setjmp() instead of the identical-except-for-having-a-wrong-prototype setfault() when testing for faults. This should also help the compiler do the right thing with this complicated-to-optimize function. Modified: head/sys/powerpc/include/pcb.h head/sys/powerpc/include/setjmp.h head/sys/powerpc/ofw/rtas.c head/sys/powerpc/powermac/grackle.c head/sys/powerpc/powerpc/copyinout.c head/sys/powerpc/powerpc/mp_machdep.c head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/include/pcb.h ============================================================================== --- head/sys/powerpc/include/pcb.h Sun Jan 10 16:31:28 2016 (r293635) +++ head/sys/powerpc/include/pcb.h Sun Jan 10 16:42:14 2016 (r293636) @@ -35,7 +35,7 @@ #ifndef _MACHINE_PCB_H_ #define _MACHINE_PCB_H_ -typedef register_t faultbuf[25]; +#include struct pcb { register_t pcb_context[20]; /* non-volatile r14-r31 */ @@ -44,7 +44,7 @@ struct pcb { register_t pcb_toc; /* toc pointer */ register_t pcb_lr; /* link register */ struct pmap *pcb_pm; /* pmap of our vmspace */ - faultbuf *pcb_onfault; /* For use during + jmp_buf *pcb_onfault; /* For use during copyin/copyout */ int pcb_flags; #define PCB_FPU 1 /* Process uses FPU */ Modified: head/sys/powerpc/include/setjmp.h ============================================================================== --- head/sys/powerpc/include/setjmp.h Sun Jan 10 16:31:28 2016 (r293635) +++ head/sys/powerpc/include/setjmp.h Sun Jan 10 16:42:14 2016 (r293636) @@ -8,7 +8,11 @@ #include +#ifdef _KERNEL +#define _JBLEN 25 /* Kernel doesn't save FP and Altivec regs */ +#else #define _JBLEN 100 +#endif /* * jmp_buf and sigjmp_buf are encapsulated in different structs to force Modified: head/sys/powerpc/ofw/rtas.c ============================================================================== --- head/sys/powerpc/ofw/rtas.c Sun Jan 10 16:31:28 2016 (r293635) +++ head/sys/powerpc/ofw/rtas.c Sun Jan 10 16:42:14 2016 (r293636) @@ -62,8 +62,6 @@ int rtascall(vm_offset_t callbuffer, uin extern uintptr_t rtas_entry; extern register_t rtasmsr; -int setfault(faultbuf); /* defined in locore.S */ - /* * After the VM is up, allocate RTAS memory and instantiate it */ @@ -203,7 +201,7 @@ int rtas_call_method(cell_t token, int nargs, int nreturns, ...) { vm_offset_t argsptr; - faultbuf env, *oldfaultbuf; + jmp_buf env, *oldfaultbuf; va_list ap; struct { cell_t token; @@ -233,7 +231,8 @@ rtas_call_method(cell_t token, int nargs /* Get rid of any stale machine checks that have been waiting. */ __asm __volatile ("sync; isync"); oldfaultbuf = curthread->td_pcb->pcb_onfault; - if (!setfault(env)) { + curthread->td_pcb->pcb_onfault = &env; + if (!setjmp(env)) { __asm __volatile ("sync"); result = rtascall(argsptr, rtas_private_data); __asm __volatile ("sync; isync"); Modified: head/sys/powerpc/powermac/grackle.c ============================================================================== --- head/sys/powerpc/powermac/grackle.c Sun Jan 10 16:31:28 2016 (r293635) +++ head/sys/powerpc/powermac/grackle.c Sun Jan 10 16:42:14 2016 (r293636) @@ -82,8 +82,6 @@ static int grackle_enable_config(struct static void grackle_disable_config(struct grackle_softc *); static int badaddr(void *, size_t); -int setfault(faultbuf); /* defined in locore.S */ - /* * Driver methods. */ @@ -244,7 +242,7 @@ static int badaddr(void *addr, size_t size) { struct thread *td; - faultbuf env, *oldfaultbuf; + jmp_buf env, *oldfaultbuf; int x; /* Get rid of any stale machine checks that have been waiting. */ @@ -253,7 +251,8 @@ badaddr(void *addr, size_t size) td = curthread; oldfaultbuf = td->td_pcb->pcb_onfault; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = oldfaultbuf; __asm __volatile ("sync"); return 1; Modified: head/sys/powerpc/powerpc/copyinout.c ============================================================================== --- head/sys/powerpc/powerpc/copyinout.c Sun Jan 10 16:31:28 2016 (r293635) +++ head/sys/powerpc/powerpc/copyinout.c Sun Jan 10 16:42:14 2016 (r293636) @@ -71,8 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include -int setfault(faultbuf); /* defined in locore.S */ - #ifdef AIM /* * Makes sure that the right segment of userspace is mapped in. @@ -176,7 +174,7 @@ copyout(const void *kaddr, void *udaddr, { struct thread *td; pmap_t pm; - faultbuf env; + jmp_buf env; const char *kp; char *up, *p; size_t l; @@ -184,7 +182,8 @@ copyout(const void *kaddr, void *udaddr, td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = NULL; return (EFAULT); } @@ -214,7 +213,7 @@ copyin(const void *udaddr, void *kaddr, { struct thread *td; pmap_t pm; - faultbuf env; + jmp_buf env; const char *up; char *kp, *p; size_t l; @@ -222,7 +221,8 @@ copyin(const void *udaddr, void *kaddr, td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = NULL; return (EFAULT); } @@ -285,13 +285,14 @@ subyte(volatile void *addr, int byte) { struct thread *td; pmap_t pm; - faultbuf env; + jmp_buf env; char *p; td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -313,13 +314,14 @@ suword32(volatile void *addr, int word) { struct thread *td; pmap_t pm; - faultbuf env; + jmp_buf env; int *p; td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -341,13 +343,14 @@ suword(volatile void *addr, long word) { struct thread *td; pmap_t pm; - faultbuf env; + jmp_buf env; long *p; td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -382,14 +385,15 @@ fubyte(volatile const void *addr) { struct thread *td; pmap_t pm; - faultbuf env; + jmp_buf env; u_char *p; int val; td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -410,13 +414,14 @@ fuword16(volatile const void *addr) { struct thread *td; pmap_t pm; - faultbuf env; + jmp_buf env; uint16_t *p, val; td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -437,13 +442,14 @@ fueword32(volatile const void *addr, int { struct thread *td; pmap_t pm; - faultbuf env; + jmp_buf env; int32_t *p; td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -465,13 +471,14 @@ fueword64(volatile const void *addr, int { struct thread *td; pmap_t pm; - faultbuf env; + jmp_buf env; int64_t *p; td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -493,13 +500,14 @@ fueword(volatile const void *addr, long { struct thread *td; pmap_t pm; - faultbuf env; + jmp_buf env; long *p; td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -521,13 +529,14 @@ casueword32(volatile uint32_t *addr, uin { struct thread *td; pmap_t pm; - faultbuf env; + jmp_buf env; uint32_t *p, val; td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -572,13 +581,14 @@ casueword(volatile u_long *addr, u_long { struct thread *td; pmap_t pm; - faultbuf env; + jmp_buf env; u_long *p, val; td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = NULL; return (-1); } Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Sun Jan 10 16:31:28 2016 (r293635) +++ head/sys/powerpc/powerpc/mp_machdep.c Sun Jan 10 16:42:14 2016 (r293636) @@ -67,7 +67,6 @@ volatile static u_quad_t ap_timebase; static u_int ipi_msg_cnt[32]; static struct mtx ap_boot_mtx; struct pcb stoppcbs[MAXCPU]; -int longfault(faultbuf, int); void machdep_ap_bootstrap(void) Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Sun Jan 10 16:31:28 2016 (r293635) +++ head/sys/powerpc/powerpc/trap.c Sun Jan 10 16:42:14 2016 (r293636) @@ -74,11 +74,12 @@ __FBSDID("$FreeBSD$"); #include #include -#define FAULTBUF_LR 0 +/* Below matches setjmp.S */ +#define FAULTBUF_LR 21 #define FAULTBUF_R1 1 #define FAULTBUF_R2 2 -#define FAULTBUF_CR 3 -#define FAULTBUF_R13 4 +#define FAULTBUF_CR 22 +#define FAULTBUF_R14 3 static void trap_fatal(struct trapframe *frame); static void printtrap(u_int vector, struct trapframe *frame, int isfatal, @@ -462,18 +463,19 @@ static int handle_onfault(struct trapframe *frame) { struct thread *td; - faultbuf *fb; + jmp_buf *fb; td = curthread; fb = td->td_pcb->pcb_onfault; if (fb != NULL) { - frame->srr0 = (*fb)[FAULTBUF_LR]; - frame->fixreg[1] = (*fb)[FAULTBUF_R1]; - frame->fixreg[2] = (*fb)[FAULTBUF_R2]; + frame->srr0 = (*fb)->_jb[FAULTBUF_LR]; + frame->fixreg[1] = (*fb)->_jb[FAULTBUF_R1]; + frame->fixreg[2] = (*fb)->_jb[FAULTBUF_R2]; frame->fixreg[3] = 1; - frame->cr = (*fb)[FAULTBUF_CR]; - bcopy(&(*fb)[FAULTBUF_R13], &frame->fixreg[13], - 19 * sizeof(register_t)); + frame->cr = (*fb)->_jb[FAULTBUF_CR]; + bcopy(&(*fb)->_jb[FAULTBUF_R14], &frame->fixreg[14], + 18 * sizeof(register_t)); + td->td_pcb->pcb_onfault = NULL; /* Returns twice, not thrice */ return (1); } return (0); From owner-svn-src-head@freebsd.org Sun Jan 10 17:27:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81C7DA6BB5A; Sun, 10 Jan 2016 17:27:29 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 555291D1D; Sun, 10 Jan 2016 17:27:29 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-oi0-x231.google.com with SMTP id o124so30336441oia.3; Sun, 10 Jan 2016 09:27:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=5QT4oUkw5cM4YAqnp7pFffOtHHBctSTC/n6BTmFpfPs=; b=CynRe6PfcIpf7M6qdcXt9j/CQdVPZBVJkg4OWrdR3jbZexqMTINHzk4Q2cZOGK03r+ 1oKjzev/C2+U/tCNpeHhRn/YMkZgYRUk8EYaJF/xdgW++L14gKmI/zsJXQ9iUjPksUT6 KiBHlG+hmGJboZW45OCASynZI1sSGXRHmdjwqSYJCrbz301mDFuzBLNA/5XHzH+mP7bW 4WlFmfIGK6RR/xco6wt8kqwv2sl+e6JwO/I5p+FxaJvhOYzic7Rvt1Y+qN6KQJdqGcXA k99hA+wA+wMjqmbxX/7JSYBDqVlKhAuIQ/OIUOhEjhZ07C2su+Y8R8k8OJI4BArsMRWT 8cAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni-cwru-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=5QT4oUkw5cM4YAqnp7pFffOtHHBctSTC/n6BTmFpfPs=; b=ytUmI1fcyaGyWY7ZP5/wk2M4tdJ+Lu7u3Uqk5M5ximJqBkj/K8X9dSlDxS7YlSuSvb xpR/FusYLQAn4a/7lyhQscTJUBbSQosKMQbJOMs1QAxv7v9U9a0V1bnEZ0FQUvfTNXyM wEqRPvdHCCCElMiOYDbqzyXltd/ViEz0sr5JPgl/k7/r2aeGzapIVyLO+OpVCwfjt8ep CuPYB3KwHbZSr42EXFMOysAHYCDUHjbXeqtQkvS9Rq3aFjz/fejtYLNd2eCfpGiFpHUc swGyi5E9NoAWm/ygn1tVBNzJM0m9O9uHc718k78i4WtRWA0rggREG+hJrkVp9N9WJIyL Y24A== MIME-Version: 1.0 X-Received: by 10.202.98.84 with SMTP id w81mr85361909oib.3.1452446848516; Sun, 10 Jan 2016 09:27:28 -0800 (PST) Sender: chmeeedalf@gmail.com Received: by 10.182.184.84 with HTTP; Sun, 10 Jan 2016 09:27:28 -0800 (PST) In-Reply-To: <201601101642.u0AGgEV3077040@repo.freebsd.org> References: <201601101642.u0AGgEV3077040@repo.freebsd.org> Date: Sun, 10 Jan 2016 11:27:28 -0600 X-Google-Sender-Auth: utOTyfdHErwsVouTpas5f3i5teo Message-ID: Subject: Re: svn commit: r293636 - in head/sys/powerpc: include ofw powermac powerpc From: Justin Hibbits To: Nathan Whitehorn Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 17:27:29 -0000 On Sun, Jan 10, 2016 at 10:42 AM, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sun Jan 10 16:42:14 2016 > New Revision: 293636 > URL: https://svnweb.freebsd.org/changeset/base/293636 > > Log: > Use setjmp() instead of the identical-except-for-having-a-wrong-prototype > setfault() when testing for faults. This should also help the compiler > do the right thing with this complicated-to-optimize function. > > Modified: > head/sys/powerpc/include/pcb.h > head/sys/powerpc/include/setjmp.h > head/sys/powerpc/ofw/rtas.c > head/sys/powerpc/powermac/grackle.c > head/sys/powerpc/powerpc/copyinout.c > head/sys/powerpc/powerpc/mp_machdep.c > head/sys/powerpc/powerpc/trap.c > Does this mean the assembly function can be removed now from locore*.S? From owner-svn-src-head@freebsd.org Sun Jan 10 17:50:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26786A69323; Sun, 10 Jan 2016 17:50:11 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 140F21BA8; Sun, 10 Jan 2016 17:50:10 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u0AHo74X005625 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 10 Jan 2016 09:50:08 -0800 Subject: Re: svn commit: r293636 - in head/sys/powerpc: include ofw powermac powerpc To: Justin Hibbits References: <201601101642.u0AGgEV3077040@repo.freebsd.org> Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: <569299CF.4030604@freebsd.org> Date: Sun, 10 Jan 2016 09:50:07 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZkcx4bYvy/eHbuOCQDua8ZSEYHG6XE1WFtTomKhgPC452dJyCSKdKQxyZxKNES0dyKrHBdHV+4WQ66oi+JrpBL5uaAz84Kp9w= X-Sonic-ID: C;lDtMlsK35RG5hPA4AoajKQ== M;NsahlsK35RG5hPA4AoajKQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 17:50:11 -0000 On 01/10/16 09:27, Justin Hibbits wrote: > On Sun, Jan 10, 2016 at 10:42 AM, Nathan Whitehorn > wrote: >> Author: nwhitehorn >> Date: Sun Jan 10 16:42:14 2016 >> New Revision: 293636 >> URL: https://svnweb.freebsd.org/changeset/base/293636 >> >> Log: >> Use setjmp() instead of the identical-except-for-having-a-wrong-prototype >> setfault() when testing for faults. This should also help the compiler >> do the right thing with this complicated-to-optimize function. >> >> Modified: >> head/sys/powerpc/include/pcb.h >> head/sys/powerpc/include/setjmp.h >> head/sys/powerpc/ofw/rtas.c >> head/sys/powerpc/powermac/grackle.c >> head/sys/powerpc/powerpc/copyinout.c >> head/sys/powerpc/powerpc/mp_machdep.c >> head/sys/powerpc/powerpc/trap.c >> > Does this mean the assembly function can be removed now from locore*.S? > Yes, that will be a follow-up commit in a few minutes along with some other dead code removal. -Nathan From owner-svn-src-head@freebsd.org Sun Jan 10 17:53:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FCBCA6951D; Sun, 10 Jan 2016 17:53:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D97F1F71; Sun, 10 Jan 2016 17:53:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0AHrh6C099997; Sun, 10 Jan 2016 17:53:43 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0AHrhSJ099996; Sun, 10 Jan 2016 17:53:43 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201601101753.u0AHrhSJ099996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 10 Jan 2016 17:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293640 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 17:53:44 -0000 Author: adrian Date: Sun Jan 10 17:53:43 2016 New Revision: 293640 URL: https://svnweb.freebsd.org/changeset/base/293640 Log: Fix the domain iterator to not try the first-touch / fixed domain more than once when doing round-robin. This lead to a panic because the iterator was trying the same domain twice and not trying one of the other domains. Reported by: pho Tested by: pho Modified: head/sys/vm/vm_domain.c Modified: head/sys/vm/vm_domain.c ============================================================================== --- head/sys/vm/vm_domain.c Sun Jan 10 17:47:57 2016 (r293639) +++ head/sys/vm/vm_domain.c Sun Jan 10 17:53:43 2016 (r293640) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #include static __inline int -vm_domain_rr_selectdomain(void) +vm_domain_rr_selectdomain(int skip_domain) { #if MAXMEMDOM > 1 struct thread *td; @@ -71,6 +71,16 @@ vm_domain_rr_selectdomain(void) td->td_dom_rr_idx++; td->td_dom_rr_idx %= vm_ndomains; + + /* + * If skip_domain is provided then skip over that + * domain. This is intended for round robin variants + * which first try a fixed domain. + */ + if ((skip_domain > -1) && (td->td_dom_rr_idx == skip_domain)) { + td->td_dom_rr_idx++; + td->td_dom_rr_idx %= vm_ndomains; + } return (td->td_dom_rr_idx); #else return (0); @@ -339,12 +349,12 @@ vm_domain_iterator_run(struct vm_domain_ if (vi->n == vm_ndomains) *domain = vi->domain; else - *domain = vm_domain_rr_selectdomain(); + *domain = vm_domain_rr_selectdomain(vi->domain); vi->n--; break; case VM_POLICY_ROUND_ROBIN: default: - *domain = vm_domain_rr_selectdomain(); + *domain = vm_domain_rr_selectdomain(-1); vi->n--; break; } From owner-svn-src-head@freebsd.org Sun Jan 10 18:00:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 188F5A6975C; Sun, 10 Jan 2016 18:00:03 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9EE61594; Sun, 10 Jan 2016 18:00:02 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0AI02kG000513; Sun, 10 Jan 2016 18:00:02 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0AI017v000507; Sun, 10 Jan 2016 18:00:01 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201601101800.u0AI017v000507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 10 Jan 2016 18:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293641 - in head/sys/powerpc: aim booke powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 18:00:03 -0000 Author: nwhitehorn Date: Sun Jan 10 18:00:01 2016 New Revision: 293641 URL: https://svnweb.freebsd.org/changeset/base/293641 Log: Remove dead code and dead comments, most notably the implemenation of the now-obsolete setfault(). No NetBSD code exists in the AIM locore files, so update the copyrights there. Modified: head/sys/powerpc/aim/locore32.S head/sys/powerpc/aim/locore64.S head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/booke/booke_machdep.c head/sys/powerpc/booke/locore.S head/sys/powerpc/powerpc/setjmp.S Modified: head/sys/powerpc/aim/locore32.S ============================================================================== --- head/sys/powerpc/aim/locore32.S Sun Jan 10 17:53:43 2016 (r293640) +++ head/sys/powerpc/aim/locore32.S Sun Jan 10 18:00:01 2016 (r293641) @@ -1,8 +1,7 @@ /* $FreeBSD$ */ -/* $NetBSD: locore.S,v 1.24 2000/05/31 05:09:17 thorpej Exp $ */ /*- - * Copyright (C) 2001 Benno Rice + * Copyright (C) 2010-2016 Nathan Whitehorn * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -14,37 +13,7 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/*- - * Copyright (C) 1995, 1996 Wolfgang Solfrank. - * Copyright (C) 1995, 1996 TooLs GmbH. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by TooLs GmbH. - * 4. The name of TooLs GmbH may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, @@ -95,15 +64,7 @@ GLOBAL(tmpstk) btext: /* - * This symbol is here for the benefit of kvm_mkdb, and is supposed to - * mark the start of kernel text. - */ - .globl kernel_text -kernel_text: - -/* - * Startup entry. Note, this must be the first thing in the text - * segment! + * Main kernel entry point. */ .text .globl __start @@ -148,29 +109,7 @@ __start: stw %r3, 0(%r1) bl mi_startup - /* If mi_startup somehow returns, exit. This would be bad. */ - b OF_exit - -/* - * int setfault() - * - * Similar to setjmp to setup for handling faults on accesses to user memory. - * Any routine using this may only call bcopy, either the form below, - * or the (currently used) C code optimized, so it doesn't use any non-volatile - * registers. - */ - .globl setfault -setfault: - mflr 0 - mfcr 12 - mfsprg 4,0 - lwz 4,TD_PCB(2) /* curthread = r2 */ - stw 3,PCB_ONFAULT(4) - stw 0,0(3) - stw 1,4(3) - stw 2,8(3) - stmw 12,12(3) - xor 3,3,3 - blr + /* mi_startup() does not return */ + b . #include Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Sun Jan 10 17:53:43 2016 (r293640) +++ head/sys/powerpc/aim/locore64.S Sun Jan 10 18:00:01 2016 (r293641) @@ -1,8 +1,7 @@ /* $FreeBSD$ */ -/* $NetBSD: locore.S,v 1.24 2000/05/31 05:09:17 thorpej Exp $ */ /*- - * Copyright (C) 2001 Benno Rice + * Copyright (C) 2010-2016 Nathan Whitehorn * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -14,7 +13,7 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, @@ -24,36 +23,8 @@ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/*- - * Copyright (C) 1995, 1996 Wolfgang Solfrank. - * Copyright (C) 1995, 1996 TooLs GmbH. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by TooLs GmbH. - * 4. The name of TooLs GmbH may not be used to endorse or promote products - * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * $FreeBSD$ */ #include "assym.s" @@ -69,13 +40,6 @@ .abiversion _CALL_ELF #endif -/* Locate the per-CPU data structure */ -#define GET_CPUINFO(r) \ - mfsprg0 r -#define GET_TOCBASE(r) \ - li r,TRAP_TOCBASE; /* Magic address for TOC */ \ - ld r,0(r) - /* Glue for linker script */ .globl kernbase .set kernbase, KERNBASE @@ -102,15 +66,7 @@ TOC_ENTRY(tmpstk) btext: /* - * This symbol is here for the benefit of kvm_mkdb, and is supposed to - * mark the start of kernel text. - */ - .globl kernel_text -kernel_text: - -/* - * Startup entry. Note, this must be the first thing in the text - * segment! + * Main kernel entry point. * * Calling convention: * r3: Flattened Device Tree pointer (or zero) @@ -169,50 +125,7 @@ ASENTRY_NOPROF(__start) bl mi_startup nop - /* If this returns (it won't), go back to firmware */ - b OF_exit - nop - -/* - * int setfault() - * - * Similar to setjmp to setup for handling faults on accesses to user memory. - * Any routine using this may only call bcopy, either the form below, - * or the (currently used) C code optimized, so it doesn't use any non-volatile - * registers. - */ -ASENTRY_NOPROF(setfault) - mflr 0 - mfcr 12 - mfsprg 4,0 - ld 4,TD_PCB(13) /* curthread = r13 */ - std 3,PCB_ONFAULT(4) - std 0,0(3) - std 1,8(3) - std 2,16(3) - - std %r12,24(%r3) /* Save the non-volatile GP regs. */ - std %r13,24+1*8(%r3) - std %r14,24+2*8(%r3) - std %r15,24+3*8(%r3) - std %r16,24+4*8(%r3) - std %r17,24+5*8(%r3) - std %r18,24+6*8(%r3) - std %r19,24+7*8(%r3) - std %r20,24+8*8(%r3) - std %r21,24+9*8(%r3) - std %r22,24+10*8(%r3) - std %r23,24+11*8(%r3) - std %r24,24+12*8(%r3) - std %r25,24+13*8(%r3) - std %r26,24+14*8(%r3) - std %r27,24+15*8(%r3) - std %r28,24+16*8(%r3) - std %r29,24+17*8(%r3) - std %r30,24+18*8(%r3) - std %r31,24+19*8(%r3) - - xor 3,3,3 - blr + /* Unreachable */ + b . #include Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sun Jan 10 17:53:43 2016 (r293640) +++ head/sys/powerpc/aim/trap_subr64.S Sun Jan 10 18:00:01 2016 (r293641) @@ -39,9 +39,12 @@ * #include */ -/* - * Save/restore segment registers - */ +/* Locate the per-CPU data structure */ +#define GET_CPUINFO(r) \ + mfsprg0 r +#define GET_TOCBASE(r) \ + li r,TRAP_TOCBASE; /* Magic address for TOC */ \ + ld r,0(r) /* * Restore SRs for a pmap Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Sun Jan 10 17:53:43 2016 (r293640) +++ head/sys/powerpc/booke/booke_machdep.c Sun Jan 10 18:00:01 2016 (r293641) @@ -156,7 +156,6 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif -extern unsigned char kernel_text[]; extern unsigned char _etext[]; extern unsigned char _edata[]; extern unsigned char __bss_start[]; @@ -311,7 +310,7 @@ booke_init(u_long arg1, u_long arg2) end += fdt_totalsize((void *)dtbp); __endkernel = end; mdp = NULL; - } else if (arg1 > (uintptr_t)kernel_text) /* FreeBSD loader */ + } else if (arg1 > (uintptr_t)btext) /* FreeBSD loader */ mdp = (void *)arg1; else /* U-Boot */ mdp = NULL; Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Sun Jan 10 17:53:43 2016 (r293640) +++ head/sys/powerpc/booke/locore.S Sun Jan 10 18:00:01 2016 (r293641) @@ -837,29 +837,6 @@ ENTRY(dataloss_erratum_access) blr -/* - * int setfault() - * - * Similar to setjmp to setup for handling faults on accesses to user memory. - * Any routine using this may only call bcopy, either the form below, - * or the (currently used) C code optimized, so it doesn't use any non-volatile - * registers. - */ - .globl setfault -setfault: - mflr %r0 - mfsprg0 %r4 - lwz %r4, TD_PCB(%r2) - stw %r3, PCB_ONFAULT(%r4) - mfcr %r4 - stw %r0, 0(%r3) - stw %r1, 4(%r3) - stw %r2, 8(%r3) - stw %r4, 12(%r3) - stmw %r13, 16(%r3) /* store CR, CTR, XER, [r13 .. r31] */ - li %r3, 0 /* return FALSE */ - blr - /************************************************************************/ /* Data section */ /************************************************************************/ Modified: head/sys/powerpc/powerpc/setjmp.S ============================================================================== --- head/sys/powerpc/powerpc/setjmp.S Sun Jan 10 17:53:43 2016 (r293640) +++ head/sys/powerpc/powerpc/setjmp.S Sun Jan 10 18:00:01 2016 (r293641) @@ -40,7 +40,6 @@ #define JMP_cr 22*REGWIDTH #define JMP_ctr 23*REGWIDTH #define JMP_xer 24*REGWIDTH -#define JMP_sig 25*REGWIDTH ASENTRY_NOPROF(setjmp) ST_REG 31, JMP_r31(3) From owner-svn-src-head@freebsd.org Sun Jan 10 18:11:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 222FBA69D0B; Sun, 10 Jan 2016 18:11:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D85F61E1B; Sun, 10 Jan 2016 18:11:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0AIBOHw004030; Sun, 10 Jan 2016 18:11:24 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0AIBNSv004028; Sun, 10 Jan 2016 18:11:23 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201601101811.u0AIBNSv004028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 10 Jan 2016 18:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293642 - in head/sys/dev: ic puc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 18:11:25 -0000 Author: marius Date: Sun Jan 10 18:11:23 2016 New Revision: 293642 URL: https://svnweb.freebsd.org/changeset/base/293642 Log: - Add support for Advantech PCI-1602 Rev. B1 and PCI-1603 cards. [1] - Add a description of Advantech PCI-1602 Rev. A boards. [1] - Properly set up REG_ACR also for PCI-1602 Rev. A based on what the Advantech-supplied Linux driver does. - Additionally use the macros of to replace existing magic values and get rid of trivial comments. - Fix the style of some comments. PR: 205359 [1] Submitted by: Jan Mikkelsen (original patch) [1] Modified: head/sys/dev/ic/ns16550.h head/sys/dev/puc/pucdata.c Modified: head/sys/dev/ic/ns16550.h ============================================================================== --- head/sys/dev/ic/ns16550.h Sun Jan 10 18:00:01 2016 (r293641) +++ head/sys/dev/ic/ns16550.h Sun Jan 10 18:11:23 2016 (r293642) @@ -205,6 +205,7 @@ * requires ACR[6]. */ #define com_icr 5 /* index control register (R/W) */ +#define REG_ICR com_icr /* * 16950 register #7. It is the same as com_scr except it has a different @@ -220,6 +221,7 @@ */ #define com_acr 0 /* additional control register (R/W) */ +#define REG_ACR com_acr #define ACR_ASE 0x80 /* ASR/RFL/TFL enable */ #define ACR_ICRE 0x40 /* ICR enable */ #define ACR_TLE 0x20 /* TTL/RTL enable */ Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Sun Jan 10 18:00:01 2016 (r293641) +++ head/sys/dev/puc/pucdata.c Sun Jan 10 18:11:23 2016 (r293642) @@ -42,12 +42,16 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include #include #include #include #include +static puc_config_f puc_config_advantech; static puc_config_f puc_config_amc; static puc_config_f puc_config_diva; static puc_config_f puc_config_exar; @@ -691,10 +695,25 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_exar_pcie }, + /* + * The Advantech PCI-1602 Rev. A use the first two ports of an Oxford + * Semiconductor OXuPCI954. Note these boards have a hardware bug in + * that they drive the RS-422/485 transmitters after power-on until a + * driver initalizes the UARTs. + */ { 0x13fe, 0x1600, 0x1602, 0x0002, - "Advantech PCI-1602", + "Advantech PCI-1602 Rev. A", DEFAULT_RCLK * 8, PUC_PORT_2S, 0x10, 0, 8, + .config_function = puc_config_advantech + }, + + /* Advantech PCI-1602 Rev. B1/PCI-1603 are also based on OXuPCI952. */ + { 0x13fe, 0xa102, 0x13fe, 0xa102, + "Advantech 2-port PCI (PCI-1602 Rev. B1/PCI-1603)", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 4, 0, + .config_function = puc_config_advantech }, { 0x1407, 0x0100, 0xffff, 0, @@ -1256,6 +1275,92 @@ const struct puc_cfg puc_pci_devices[] = }; static int +puc_config_advantech(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, + intptr_t *res __unused) +{ + const struct puc_cfg *cfg; + struct resource *cres; + struct puc_bar *bar; + device_t cdev, dev; + bus_size_t off; + int base, crtype, fixed, high, i, oxpcie; + uint8_t acr, func, mask; + + if (cmd != PUC_CFG_SETUP) + return (ENXIO); + + base = fixed = oxpcie = 0; + crtype = SYS_RES_IOPORT; + acr = mask = 0x0; + func = high = 1; + off = 0x60; + + cfg = sc->sc_cfg; + switch (cfg->subvendor) { + case 0x13fe: + switch (cfg->device) { + case 0xa102: + high = 0; + break; + default: + break; + } + default: + break; + } + if (fixed == 1) + goto setup; + + dev = sc->sc_dev; + cdev = pci_find_dbsf(pci_get_domain(dev), pci_get_bus(dev), + pci_get_slot(dev), func); + if (cdev == NULL) { + device_printf(dev, "could not find config function\n"); + return (ENXIO); + } + + i = PCIR_BAR(0); + cres = bus_alloc_resource_any(cdev, crtype, &i, RF_ACTIVE); + if (cres == NULL) { + device_printf(dev, "could not allocate config resource\n"); + return (ENXIO); + } + + if (oxpcie == 0) { + mask = bus_read_1(cres, off); + if (pci_get_function(dev) == 1) + base = 4; + } + + setup: + for (i = 0; i < sc->sc_nports; ++i) { + device_printf(dev, "port %d: ", i); + bar = puc_get_bar(sc, cfg->rid + i * cfg->d_rid); + if (bar == NULL) { + printf("could not get BAR\n"); + continue; + } + + if (fixed == 0) { + if ((mask & (1 << (base + i))) == 0) { + acr = 0; + printf("RS-232\n"); + } else { + acr = (high == 1 ? 0x18 : 0x10); + printf("RS-422/RS-485, active-%s auto-DTR\n", + high == 1 ? "high" : "low"); + } + } + + bus_write_1(bar->b_res, REG_SPR, REG_ACR); + bus_write_1(bar->b_res, REG_ICR, acr); + } + + bus_release_resource(cdev, crtype, rman_get_rid(cres), cres); + return (0); +} + +static int puc_config_amc(struct puc_softc *sc __unused, enum puc_cfg_cmd cmd, int port, intptr_t *res) { @@ -1360,24 +1465,17 @@ puc_config_quatech(struct puc_softc *sc, bar = puc_get_bar(sc, cfg->rid); if (bar == NULL) return (ENXIO); - /* Set DLAB in the LCR register of UART 0. */ - bus_write_1(bar->b_res, 3, 0x80); - /* Write 0 to the SPR register of UART 0. */ - bus_write_1(bar->b_res, 7, 0); - /* Read back the contents of the SPR register of UART 0. */ - v0 = bus_read_1(bar->b_res, 7); - /* Write a specific value to the SPR register of UART 0. */ - bus_write_1(bar->b_res, 7, 0x80 + -cfg->clock); - /* Read back the contents of the SPR register of UART 0. */ - v1 = bus_read_1(bar->b_res, 7); - /* Clear DLAB in the LCR register of UART 0. */ - bus_write_1(bar->b_res, 3, 0); - /* Save the two values read-back from the SPR register. */ + bus_write_1(bar->b_res, REG_LCR, LCR_DLAB); + bus_write_1(bar->b_res, REG_SPR, 0); + v0 = bus_read_1(bar->b_res, REG_SPR); + bus_write_1(bar->b_res, REG_SPR, 0x80 + -cfg->clock); + v1 = bus_read_1(bar->b_res, REG_SPR); + bus_write_1(bar->b_res, REG_LCR, 0); sc->sc_cfg_data = (v0 << 8) | v1; if (v0 == 0 && v1 == 0x80 + -cfg->clock) { /* * The SPR register echoed the two values written - * by us. This means that the SPAD jumper is set. + * by us. This means that the SPAD jumper is set. */ device_printf(sc->sc_dev, "warning: extra features " "not usable -- SPAD compatibility enabled\n"); @@ -1385,7 +1483,7 @@ puc_config_quatech(struct puc_softc *sc, } if (v0 != 0) { /* - * The first value doesn't match. This can only mean + * The first value doesn't match. This can only mean * that the SPAD jumper is not set and that a non- * standard fixed clock multiplier jumper is set. */ @@ -1399,8 +1497,8 @@ puc_config_quatech(struct puc_softc *sc, return (0); } /* - * The first value matched, but the second didn't. We know - * that the SPAD jumper is not set. We also know that the + * The first value matched, but the second didn't. We know + * that the SPAD jumper is not set. We also know that the * clock rate multiplier is software controlled *and* that * we just programmed it to the maximum allowed. */ @@ -1415,8 +1513,8 @@ puc_config_quatech(struct puc_softc *sc, /* * XXX With the SPAD jumper applied, there's no * easy way of knowing if there's also a clock - * rate multiplier jumper installed. Let's hope - * not... + * rate multiplier jumper installed. Let's hope + * not ... */ *res = DEFAULT_RCLK; } else if (v0 == 0) { @@ -1678,15 +1776,15 @@ puc_config_oxford_pcie(struct puc_softc case PUC_CFG_GET_NPORTS: /* * Check if we are being called from puc_bfe_attach() - * or puc_bfe_probe(). If puc_bfe_probe(), we cannot - * puc_get_bar(), so we return a value of 16. This has cosmetic - * side-effects at worst; in PUC_CFG_GET_DESC, - * (int)sc->sc_cfg_data will not contain the true number of - * ports in PUC_CFG_GET_DESC, but we are not implementing that - * call for this device family anyway. + * or puc_bfe_probe(). If puc_bfe_probe(), we cannot + * puc_get_bar(), so we return a value of 16. This has + * cosmetic side-effects at worst; in PUC_CFG_GET_DESC, + * sc->sc_cfg_data will not contain the true number of + * ports in PUC_CFG_GET_DESC, but we are not implementing + * that call for this device family anyway. * - * The check is for initialisation of sc->sc_bar[idx], which is - * only done in puc_bfe_attach(). + * The check is for initialization of sc->sc_bar[idx], + * which is only done in puc_bfe_attach(). */ idx = 0; do { From owner-svn-src-head@freebsd.org Sun Jan 10 20:10:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4C31A6A8DA; Sun, 10 Jan 2016 20:10:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71D8C1CE0; Sun, 10 Jan 2016 20:10:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0AKAY49039706; Sun, 10 Jan 2016 20:10:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0AKAYTe039705; Sun, 10 Jan 2016 20:10:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601102010.u0AKAYTe039705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 10 Jan 2016 20:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293643 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 20:10:35 -0000 Author: glebius Date: Sun Jan 10 20:10:34 2016 New Revision: 293643 URL: https://svnweb.freebsd.org/changeset/base/293643 Log: Fix bhyve(1) operation on vmnet devices, broken in r293459. Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Sun Jan 10 18:11:23 2016 (r293642) +++ head/usr.sbin/bhyve/pci_virtio_net.c Sun Jan 10 20:10:34 2016 (r293643) @@ -850,7 +850,8 @@ pci_vtnet_init(struct vmctx *ctx, struct if (strncmp(devname, "vale", 4) == 0) pci_vtnet_netmap_setup(sc, devname); - if (strncmp(devname, "tap", 3) == 0) + if (strncmp(devname, "tap", 3) == 0 || + strncmp(devname, "vmnet", 5) == 0) pci_vtnet_tap_setup(sc, devname); free(devname); From owner-svn-src-head@freebsd.org Sun Jan 10 23:11:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 430E9A6A456; Sun, 10 Jan 2016 23:11:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0745B1A6D; Sun, 10 Jan 2016 23:11:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 7D99F25D3A47; Sun, 10 Jan 2016 23:11:30 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 3935EC76FDA; Sun, 10 Jan 2016 23:11:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id d-Oc-r_vjO1A; Sun, 10 Jan 2016 23:11:28 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id E0C1BC76FCE; Sun, 10 Jan 2016 23:11:27 +0000 (UTC) Date: Sun, 10 Jan 2016 23:11:26 +0000 (UTC) From: "Bjoern A. Zeeb" To: Ed Maste cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r293450 - in head: gnu/lib/libgcc share/mk tools/build/options In-Reply-To: Message-ID: References: <201601090042.u090g7dX048643@repo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 23:11:35 -0000 On Sat, 9 Jan 2016, Ed Maste wrote: > On 9 January 2016 at 00:42, Ed Maste wrote: >> >> Author: emaste >> Date: Sat Jan 9 00:42:07 2016 >> New Revision: 293450 >> URL: https://svnweb.freebsd.org/changeset/base/293450 >> >> Log: >> Support use of LLVM's libunwind for exception unwinding > > As reported by bz@, an incremental build on arm64 across this change > can fail due to an old unwind.h being left behind. I hope to sort it > out soon; in the interim deleting the generated unwind.h files from > the objdir should be a usable workaround. Either you sorted it out or the next full build fixed it. Thanks! /bz From owner-svn-src-head@freebsd.org Sun Jan 10 23:41:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE423A6B02F; Sun, 10 Jan 2016 23:41:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 883CE18EA; Sun, 10 Jan 2016 23:41:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ANfVVs011572; Sun, 10 Jan 2016 23:41:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ANfVO2011571; Sun, 10 Jan 2016 23:41:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601102341.u0ANfVO2011571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 10 Jan 2016 23:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293648 - head/lib/csu/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 23:41:32 -0000 Author: andrew Date: Sun Jan 10 23:41:31 2016 New Revision: 293648 URL: https://svnweb.freebsd.org/changeset/base/293648 Log: Use -mlong-calls to build crt1.o and gcrt1.o. This tells the compiler to generate code to branch based on an address in a register. This allows us to have binaries larger than the 32MiB limit of a branch instruction. The main use of this is with clang. Clang 3.8.0 has been shown to be larger than the above limit. Modified: head/lib/csu/arm/Makefile Modified: head/lib/csu/arm/Makefile ============================================================================== --- head/lib/csu/arm/Makefile Sun Jan 10 22:31:39 2016 (r293647) +++ head/lib/csu/arm/Makefile Sun Jan 10 23:41:31 2016 (r293648) @@ -7,6 +7,7 @@ OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= Scrt1.o gcrt1.o CFLAGS+= -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include +STATIC_CFLAGS+= -mlong-calls FILES= ${OBJS} FILESMODE= ${LIBMODE} @@ -23,14 +24,14 @@ CLEANFILES+= crt1.s gcrt1.s Scrt1.s # directly compiled to .o files. crt1.s: crt1.c - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c + ${CC} ${CFLAGS} ${STATIC_CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c - ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c + ${CC} ${CFLAGS} ${STATIC_CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s From owner-svn-src-head@freebsd.org Mon Jan 11 03:30:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85563A6ACE0; Mon, 11 Jan 2016 03:30:17 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52FBA164E; Mon, 11 Jan 2016 03:30:17 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0B3UGni078207; Mon, 11 Jan 2016 03:30:16 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0B3UGWR078206; Mon, 11 Jan 2016 03:30:16 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601110330.u0B3UGWR078206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 11 Jan 2016 03:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293653 - head/contrib/hyperv/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 03:30:17 -0000 Author: sephe Date: Mon Jan 11 03:30:16 2016 New Revision: 293653 URL: https://svnweb.freebsd.org/changeset/base/293653 Log: hyperv/kvp_daemon: Make poll(2) block indefinitely Submitted by: Jun Su Reviewed by: Dexuan Cui , me, adrain Approved by: adrian Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4762 Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c ============================================================================== --- head/contrib/hyperv/tools/hv_kvp_daemon.c Mon Jan 11 01:48:16 2016 (r293652) +++ head/contrib/hyperv/tools/hv_kvp_daemon.c Mon Jan 11 03:30:16 2016 (r293653) @@ -1437,7 +1437,7 @@ main(int argc, char *argv[]) for (;;) { - r = poll (hv_kvp_poll_fd, 1, 100); + r = poll (hv_kvp_poll_fd, 1, INFTIM); KVP_LOG(LOG_DEBUG, "poll returned r = %d, revent = 0x%x\n", r, hv_kvp_poll_fd[0].revents); From owner-svn-src-head@freebsd.org Mon Jan 11 04:54:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FF8FA6B59B; Mon, 11 Jan 2016 04:54:56 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp001.me.com (mr11p00im-asmtp001.me.com [17.110.69.252]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CE5B1951; Mon, 11 Jan 2016 04:54:56 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from [192.168.1.4] (c-24-6-178-251.hsd1.ca.comcast.net [24.6.178.251]) by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O0R00FW1UZB6Z30@mr11p00im-asmtp001.me.com>; Mon, 11 Jan 2016 04:54:50 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-01-11_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=17 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1601110095 User-Agent: Microsoft-MacOutlook/0.0.0.151217 Date: Sun, 10 Jan 2016 20:54:46 -0800 Subject: Re: svn commit: r292788 - in head/sys: geom/part sys From: Ravi Pokala Sender: "Pokala, Ravi" To: Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <1F9E33A5-A9D7-44A9-9519-2A1593BFF990@panasas.com> Thread-topic: svn commit: r292788 - in head/sys: geom/part sys References: <201512271812.tBRICD3A044563@repo.freebsd.org> In-reply-to: <201512271812.tBRICD3A044563@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 04:54:56 -0000 Hi folks, I have a Panasas-proprietary GPT UUID that I'd like to commit upstream. There's ~zero chance anyone outside of Panasas or our customers would ever see it, but we're trying to reduce gratuitous differences against upstream, and this is a good candidate. When I mentioned this at the November 2015 DevSummit, no one there objected. There was a recent change in this area, which brought up some questions. See below: -----Original Message----- From: on behalf of Allan Jude Date: 2015-12-27, Sunday at 10:12 To: , , Subject: svn commit: r292788 - in head/sys: geom/part sys >Author: allanjude >Date: Sun Dec 27 18:12:13 2015 >New Revision: 292788 >URL: https://svnweb.freebsd.org/changeset/base/292788 > >Log: > Add some additional GPT partition types > >... > > Differential Revision: https://reviews.freebsd.org/D3841 > >... > In that review, there was discussion about the sorting of aliases in (enum g_part_alias). It was originally thought that the aliases needed to be sorted, due to binary searching in g_part_alias_name(). It turned out that g_part_alias_name() did a linear search, so the list didn't strictly need to be sorted. But, there was talk of potentially switching to a binary search later, so Allan went with the sorted version. ae@ and kib@ voiced some concerns: From: on behalf of "Andrey V. Elsukov" Date: 2015-12-28, Monday at 00:32 To: Allan Jude , , , Subject: Re: svn commit: r292788 - in head/sys: geom/part sys > This enum could be used by third-party kernel module and in general it > is not good to change the order of elements here. This can break `gpart > show` output for such modules. Just for the future. :) From: on behalf of Konstantin Belousov Date: 2015-12-28, Monday at 02:49 To: "Andrey V. Elsukov" Cc: Allan Jude , , , Subject: Re: svn commit: r292788 - in head/sys: geom/part sys > If the enum values are considered part of KBI, then explicit assignment > of the enum values is much preferred. As best as I can tell, nothing in base/head or ports/head looks at the GPT UUIDs or aliases (outside of GEOM_PART itself, of course), so ae@ and kib@'s concerns are not an issue at this time. Therefore, my plan is to insert the new alias and UUID entries into the various enums and lists in-order, rather than just appending. Any objections? Thanks, Ravi (rpokala@) From owner-svn-src-head@freebsd.org Mon Jan 11 05:19:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2BD5A6BE1C; Mon, 11 Jan 2016 05:19:35 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-ob0-x234.google.com (mail-ob0-x234.google.com [IPv6:2607:f8b0:4003:c01::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A5D0141A; Mon, 11 Jan 2016 05:19:35 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-ob0-x234.google.com with SMTP id py5so22653354obc.2; Sun, 10 Jan 2016 21:19:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=nJbcoehgebAgWBRohuRUPWMtUiwrVbId66Mj0jww1gY=; b=Rcq5m2Yr1gg1KCrYgbpmYVxiJAZbWrW5rETekyW6reENIQGHCbplrx2WIsYmTxE9yA Zin7XuA5kPB1WBgbT4I2HUt/XlqdxHozGaxSSHilnE4xG/MKCwwVn+KcBnswKtzeJwoq IBszOKVRfJ/N1mZNUR4BEJQp9c1Dyu2voYYKUA8ELd+biXQOQ3Fr6pKdOSiY5HDv4fy2 j6trvEoUWVtuBRLIQSLQ0CTEPJzMG5bLto2qOGl9LgDf/JJlw3eOGfeFVtTtkCylUJvI 9VLiEn7Rbjp7LG86UiijarL2Nt0X6ieEh8uaEF/hz4wV0Vam6bZpWsTg2q7vm6WtBO/7 YNqw== MIME-Version: 1.0 X-Received: by 10.182.49.170 with SMTP id v10mr90146126obn.64.1452489574798; Sun, 10 Jan 2016 21:19:34 -0800 (PST) Received: by 10.182.40.194 with HTTP; Sun, 10 Jan 2016 21:19:34 -0800 (PST) Reply-To: araujo@FreeBSD.org In-Reply-To: <1F9E33A5-A9D7-44A9-9519-2A1593BFF990@panasas.com> References: <201512271812.tBRICD3A044563@repo.freebsd.org> <1F9E33A5-A9D7-44A9-9519-2A1593BFF990@panasas.com> Date: Mon, 11 Jan 2016 13:19:34 +0800 Message-ID: Subject: Re: svn commit: r292788 - in head/sys: geom/part sys From: Marcelo Araujo To: Ravi Pokala Cc: Allan Jude , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 05:19:35 -0000 IMHO, if it can't be something generic that other people can use it, it is a NO GO! -1 2016-01-11 12:54 GMT+08:00 Ravi Pokala : > Hi folks, > > I have a Panasas-proprietary GPT UUID that I'd like to commit upstream. > There's ~zero chance anyone outside of Panasas or our customers would ever > see it, but we're trying to reduce gratuitous differences against upstream, > and this is a good candidate. When I mentioned this at the November 2015 > DevSummit, no one there objected. > > There was a recent change in this area, which brought up some questions. > See below: > > -----Original Message----- > > > From: on behalf of Allan Jude > > Date: 2015-12-27, Sunday at 10:12 > To: , , < > svn-src-head@freebsd.org> > Subject: svn commit: r292788 - in head/sys: geom/part sys > > >Author: allanjude > >Date: Sun Dec 27 18:12:13 2015 > >New Revision: 292788 > >URL: https://svnweb.freebsd.org/changeset/base/292788 > > > >Log: > > Add some additional GPT partition types > > > >... > > > > Differential Revision: https://reviews.freebsd.org/D3841 > > > >... > > > > In that review, there was discussion about the sorting of aliases in (enum > g_part_alias). It was originally thought that the aliases needed to be > sorted, due to binary searching in g_part_alias_name(). It turned out that > g_part_alias_name() did a linear search, so the list didn't strictly need > to be sorted. But, there was talk of potentially switching to a binary > search later, so Allan went with the sorted version. > > ae@ and kib@ voiced some concerns: > > From: on behalf of "Andrey V. Elsukov" > > Date: 2015-12-28, Monday at 00:32 > To: Allan Jude , , < > svn-src-all@freebsd.org>, > Subject: Re: svn commit: r292788 - in head/sys: geom/part sys > > > > This enum could be used by third-party kernel module and in general it > > is not good to change the order of elements here. This can break `gpart > > show` output for such modules. Just for the future. :) > > > From: on behalf of Konstantin Belousov > > Date: 2015-12-28, Monday at 02:49 > To: "Andrey V. Elsukov" > Cc: Allan Jude , , < > svn-src-all@freebsd.org>, > Subject: Re: svn commit: r292788 - in head/sys: geom/part sys > > > > If the enum values are considered part of KBI, then explicit assignment > > of the enum values is much preferred. > > > As best as I can tell, nothing in base/head or ports/head looks at the GPT > UUIDs or aliases (outside of GEOM_PART itself, of course), so ae@ and kib@'s > concerns are not an issue at this time. Therefore, my plan is to insert the > new alias and UUID entries into the various enums and lists in-order, > rather than just appending. Any objections? > > Thanks, > > Ravi (rpokala@) > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Mon Jan 11 06:13:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36C80A6CB22; Mon, 11 Jan 2016 06:13:26 +0000 (UTC) (envelope-from ike@michaeleichorn.com) Received: from mx1.eichornenterprises.com (mx1.eichornenterprises.com [104.236.13.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.eichornenterprises.com", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 875041CAA; Mon, 11 Jan 2016 06:13:25 +0000 (UTC) (envelope-from ike@michaeleichorn.com) Received: from smtp.eichornenterprises.com (cpe-184-59-147-149.neo.res.rr.com [184.59.147.149]) by mx1.eichornenterprises.com (OpenSMTPD) with ESMTP id a6093a90; Mon, 11 Jan 2016 01:13:15 -0500 (EST) Received: by smtp.eichornenterprises.com (OpenSMTPD) with ESMTPSA id 90ccbd8e TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO; Mon, 11 Jan 2016 01:13:14 -0500 (EST) User-Agent: K-9 Mail for Android In-Reply-To: References: <201512271812.tBRICD3A044563@repo.freebsd.org> <1F9E33A5-A9D7-44A9-9519-2A1593BFF990@panasas.com> MIME-Version: 1.0 Subject: Re: svn commit: r292788 - in head/sys: geom/part sys From: "Michael B. Eichorn" Date: Mon, 11 Jan 2016 01:13:11 -0500 To: araujo@FreeBSD.org, Marcelo Araujo , Ravi Pokala CC: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Allan Jude Message-ID: <860F7549-231D-4175-AD21-3419E8F9AF92@michaeleichorn.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 06:13:26 -0000 GUID partition types *are* of use to all. I see no problem keeping track of additional proprietary ids that are in the wild. These are the type codes we use when partioning and examining partition tables, it is useful to know what a partition is even if we cannot read it. The referenced commit by Allan included ids for Microsoft proprietary partitions. This request seems in line with that to me. On January 11, 2016 12:19:34 AM EST, Marcelo Araujo wrote: >IMHO, if it can't be something generic that other people can use it, it >is >a NO GO! > >-1 > > >2016-01-11 12:54 GMT+08:00 Ravi Pokala : > >> Hi folks, >> >> I have a Panasas-proprietary GPT UUID that I'd like to commit >upstream. >> There's ~zero chance anyone outside of Panasas or our customers would >ever >> see it, but we're trying to reduce gratuitous differences against >upstream, >> and this is a good candidate. When I mentioned this at the November >2015 >> DevSummit, no one there objected. >> >> There was a recent change in this area, which brought up some >questions. >> See below: >> >> -----Original Message----- >> >> >> From: on behalf of Allan Jude >> >> Date: 2015-12-27, Sunday at 10:12 >> To: , , < >> svn-src-head@freebsd.org> >> Subject: svn commit: r292788 - in head/sys: geom/part sys >> >> >Author: allanjude >> >Date: Sun Dec 27 18:12:13 2015 >> >New Revision: 292788 >> >URL: https://svnweb.freebsd.org/changeset/base/292788 >> > >> >Log: >> > Add some additional GPT partition types >> > >> >... >> > >> > Differential Revision: https://reviews.freebsd.org/D3841 >> > >> >... >> > >> >> In that review, there was discussion about the sorting of aliases in >(enum >> g_part_alias). It was originally thought that the aliases needed to >be >> sorted, due to binary searching in g_part_alias_name(). It turned out >that >> g_part_alias_name() did a linear search, so the list didn't strictly >need >> to be sorted. But, there was talk of potentially switching to a >binary >> search later, so Allan went with the sorted version. >> >> ae@ and kib@ voiced some concerns: >> >> From: on behalf of "Andrey V. >Elsukov" >> >> Date: 2015-12-28, Monday at 00:32 >> To: Allan Jude , , >< >> svn-src-all@freebsd.org>, >> Subject: Re: svn commit: r292788 - in head/sys: geom/part sys >> >> >> > This enum could be used by third-party kernel module and in general >it >> > is not good to change the order of elements here. This can break >`gpart >> > show` output for such modules. Just for the future. :) >> >> >> From: on behalf of Konstantin >Belousov >> >> Date: 2015-12-28, Monday at 02:49 >> To: "Andrey V. Elsukov" >> Cc: Allan Jude , , >< >> svn-src-all@freebsd.org>, >> Subject: Re: svn commit: r292788 - in head/sys: geom/part sys >> >> >> > If the enum values are considered part of KBI, then explicit >assignment >> > of the enum values is much preferred. >> >> >> As best as I can tell, nothing in base/head or ports/head looks at >the GPT >> UUIDs or aliases (outside of GEOM_PART itself, of course), so ae@ and >kib@'s >> concerns are not an issue at this time. Therefore, my plan is to >insert the >> new alias and UUID entries into the various enums and lists in-order, >> rather than just appending. Any objections? >> >> Thanks, >> >> Ravi (rpokala@) >> >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to >"svn-src-head-unsubscribe@freebsd.org" >> > > > >-- > >-- >Marcelo Araujo (__)araujo@FreeBSD.org >\\\'',)http://www.FreeBSD.org \/ \ ^ >Power To Server. .\. /_) >_______________________________________________ >svn-src-head@freebsd.org mailing list >https://lists.freebsd.org/mailman/listinfo/svn-src-head >To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From owner-svn-src-head@freebsd.org Mon Jan 11 08:00:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16F27A6B3BC; Mon, 11 Jan 2016 08:00:15 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D99231A5E; Mon, 11 Jan 2016 08:00:14 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0B80DsH059829; Mon, 11 Jan 2016 08:00:13 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0B80Dgn059828; Mon, 11 Jan 2016 08:00:13 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601110800.u0B80Dgn059828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 11 Jan 2016 08:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293656 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 08:00:15 -0000 Author: melifaro Date: Mon Jan 11 08:00:13 2016 New Revision: 293656 URL: https://svnweb.freebsd.org/changeset/base/293656 Log: Do not rewrite all ro_flags. Modified: head/sys/net/route.h Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Mon Jan 11 07:44:49 2016 (r293655) +++ head/sys/net/route.h Mon Jan 11 08:00:13 2016 (r293656) @@ -228,7 +228,7 @@ rt_update_ro_flags(struct route *ro) ro->ro_flags &= ~ (RT_REJECT|RT_BLACKHOLE|RT_HAS_GW); - ro->ro_flags = (rt_flags & RTF_REJECT) ? RT_REJECT : 0; + ro->ro_flags |= (rt_flags & RTF_REJECT) ? RT_REJECT : 0; ro->ro_flags |= (rt_flags & RTF_BLACKHOLE) ? RT_BLACKHOLE : 0; ro->ro_flags |= (rt_flags & RTF_GATEWAY) ? RT_HAS_GW : 0; } From owner-svn-src-head@freebsd.org Mon Jan 11 08:36:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE81FA6C0E0; Mon, 11 Jan 2016 08:36:59 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward14j.cmail.yandex.net (forward14j.cmail.yandex.net [IPv6:2a02:6b8:0:1630::b4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97E0F1BA3; Mon, 11 Jan 2016 08:36:59 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp13.mail.yandex.net (smtp13.mail.yandex.net [95.108.130.68]) by forward14j.cmail.yandex.net (Yandex) with ESMTP id 4AF692109E; Mon, 11 Jan 2016 11:36:46 +0300 (MSK) Received: from smtp13.mail.yandex.net (localhost [127.0.0.1]) by smtp13.mail.yandex.net (Yandex) with ESMTP id 31B74E404E5; Mon, 11 Jan 2016 11:36:45 +0300 (MSK) Received: by smtp13.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id vaWl9ZuTsg-aic4iQCK; Mon, 11 Jan 2016 11:36:44 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1452501404; bh=7ibKSs3KzkgPXg+rQ4FoZcPu33zvRQWXswhzelUuv3k=; h=Subject:To:References:From:X-Enigmail-Draft-Status:Message-ID: Date:User-Agent:MIME-Version:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=UyzwBIuCvzj0etpBGKJu2gyDm4JPyWQbw+JF7+t31o5si0iPOi+Psu5/Pa6TfPzJp vShuLkUqwfHRPPju0N9Oqt4sEyPxr31qD7zW5rEw5kQ6xUCvej++pJ3JhatJBSEzpC 5mifN0rvhb6ZyeJ6zJ1UbnoH61OBLrS2ebDCgGX4= Authentication-Results: smtp13.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-ForeignMX: US Subject: Re: svn commit: r292788 - in head/sys: geom/part sys To: Ravi Pokala , Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512271812.tBRICD3A044563@repo.freebsd.org> <1F9E33A5-A9D7-44A9-9519-2A1593BFF990@panasas.com> From: "Andrey V. Elsukov" X-Enigmail-Draft-Status: N1110 Message-ID: <56936975.9000202@yandex.ru> Date: Mon, 11 Jan 2016 11:36:05 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1F9E33A5-A9D7-44A9-9519-2A1593BFF990@panasas.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 08:37:00 -0000 On 11.01.16 07:54, Ravi Pokala wrote: > In that review, there was discussion about the sorting of aliases in (enum g_part_alias). It was originally thought that the aliases needed to be sorted, due to binary searching in g_part_alias_name(). It turned out that g_part_alias_name() did a linear search, so the list didn't strictly need to be sorted. But, there was talk of potentially switching to a binary search later, so Allan went with the sorted version. Hi, no, my note was relate to the following possible problem: you have some stable/10 and some geom_part_panasas module installed from the ports in the /boot/modules. When you rebuild the kernel after merging r292788 your module will use old values of g_part_alias and thus it will get not the same aliases. You will need rebuild your module to fix this. -- WBR, Andrey V. Elsukov From owner-svn-src-head@freebsd.org Mon Jan 11 08:45:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CDE8A6C386; Mon, 11 Jan 2016 08:45:30 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45E751FF8; Mon, 11 Jan 2016 08:45:30 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0B8jTwW073957; Mon, 11 Jan 2016 08:45:29 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0B8jTE8073953; Mon, 11 Jan 2016 08:45:29 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601110845.u0B8jTE8073953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 11 Jan 2016 08:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293657 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 08:45:30 -0000 Author: melifaro Date: Mon Jan 11 08:45:28 2016 New Revision: 293657 URL: https://svnweb.freebsd.org/changeset/base/293657 Log: Bring RADIX_MPATH support to new routing KPI to ease migration. Move actual rte selection process from rtalloc_mpath_fib() to the rt_path_selectrte() function. Add public rt_mpath_select() to use in fibX_lookup_ functions. Modified: head/sys/net/radix_mpath.c head/sys/net/radix_mpath.h head/sys/netinet/in_fib.c head/sys/netinet6/in6_fib.c Modified: head/sys/net/radix_mpath.c ============================================================================== --- head/sys/net/radix_mpath.c Mon Jan 11 08:00:13 2016 (r293656) +++ head/sys/net/radix_mpath.c Mon Jan 11 08:45:28 2016 (r293657) @@ -197,14 +197,49 @@ rt_mpath_conflict(struct radix_node_head return (0); } -void -rtalloc_mpath_fib(struct route *ro, uint32_t hash, u_int fibnum) +static struct rtentry * +rt_mpath_selectrte(struct rtentry *rte, uint32_t hash) { struct radix_node *rn0, *rn; u_int32_t n; struct rtentry *rt; int64_t weight; + /* beyond here, we use rn as the master copy */ + rn0 = rn = (struct radix_node *)rte; + n = rn_mpath_count(rn0); + + /* gw selection by Modulo-N Hash (RFC2991) XXX need improvement? */ + hash += hashjitter; + hash %= n; + for (weight = abs((int32_t)hash), rt = rte; + weight >= rt->rt_weight && rn; + weight -= rt->rt_weight) { + + /* stay within the multipath routes */ + if (rn->rn_dupedkey && rn->rn_mask != rn->rn_dupedkey->rn_mask) + break; + rn = rn->rn_dupedkey; + rt = (struct rtentry *)rn; + } + + return (rt); +} + +struct rtentry * +rt_mpath_select(struct rtentry *rte, uint32_t hash) +{ + if (rn_mpath_next((struct radix_node *)rte) == NULL) + return (rte); + + return (rt_mpath_selectrte(rte, hash)); +} + +void +rtalloc_mpath_fib(struct route *ro, uint32_t hash, u_int fibnum) +{ + struct rtentry *rt; + /* * XXX we don't attempt to lookup cached route again; what should * be done for sendto(3) case? @@ -222,34 +257,18 @@ rtalloc_mpath_fib(struct route *ro, uint return; } - /* beyond here, we use rn as the master copy */ - rn0 = rn = (struct radix_node *)ro->ro_rt; - n = rn_mpath_count(rn0); - - /* gw selection by Modulo-N Hash (RFC2991) XXX need improvement? */ - hash += hashjitter; - hash %= n; - for (weight = abs((int32_t)hash), rt = ro->ro_rt; - weight >= rt->rt_weight && rn; - weight -= rt->rt_weight) { - - /* stay within the multipath routes */ - if (rn->rn_dupedkey && rn->rn_mask != rn->rn_dupedkey->rn_mask) - break; - rn = rn->rn_dupedkey; - rt = (struct rtentry *)rn; - } + rt = rt_mpath_selectrte(ro->ro_rt, hash); /* XXX try filling rt_gwroute and avoid unreachable gw */ /* gw selection has failed - there must be only zero weight routes */ - if (!rn) { + if (!rt) { RT_UNLOCK(ro->ro_rt); ro->ro_rt = NULL; return; } if (ro->ro_rt != rt) { RTFREE_LOCKED(ro->ro_rt); - ro->ro_rt = (struct rtentry *)rn; + ro->ro_rt = rt; RT_LOCK(ro->ro_rt); RT_ADDREF(ro->ro_rt); Modified: head/sys/net/radix_mpath.h ============================================================================== --- head/sys/net/radix_mpath.h Mon Jan 11 08:00:13 2016 (r293656) +++ head/sys/net/radix_mpath.h Mon Jan 11 08:45:28 2016 (r293657) @@ -52,6 +52,7 @@ int rt_mpath_conflict(struct radix_node_ struct sockaddr *); void rtalloc_mpath_fib(struct route *, u_int32_t, u_int); #define rtalloc_mpath(_route, _hash) rtalloc_mpath_fib((_route), (_hash), 0) +struct rtentry *rt_mpath_select(struct rtentry *, uint32_t); struct radix_node *rn_mpath_lookup(void *, void *, struct radix_node_head *); int rt_mpath_deldup(struct rtentry *, struct rtentry *); Modified: head/sys/netinet/in_fib.c ============================================================================== --- head/sys/netinet/in_fib.c Mon Jan 11 08:00:13 2016 (r293656) +++ head/sys/netinet/in_fib.c Mon Jan 11 08:45:28 2016 (r293657) @@ -200,6 +200,13 @@ fib4_lookup_nh_ext(uint32_t fibnum, stru rn = rh->rnh_matchaddr((void *)&sin, rh); if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) { rte = RNTORT(rn); +#ifdef RADIX_MPATH + rte = rt_mpath_select(rte, flowid); + if (rte == NULL) { + RADIX_NODE_HEAD_RUNLOCK(rh); + return (ENOENT); + } +#endif /* Ensure route & ifp is UP */ if (RT_LINK_IS_UP(rte->rt_ifp)) { fib4_rte_to_nh_extended(rte, dst, flags, pnh4); Modified: head/sys/netinet6/in6_fib.c ============================================================================== --- head/sys/netinet6/in6_fib.c Mon Jan 11 08:00:13 2016 (r293656) +++ head/sys/netinet6/in6_fib.c Mon Jan 11 08:45:28 2016 (r293657) @@ -241,6 +241,13 @@ fib6_lookup_nh_ext(uint32_t fibnum, cons rn = rh->rnh_matchaddr((void *)&sin6, rh); if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) { rte = RNTORT(rn); +#ifdef RADIX_MPATH + rte = rt_mpath_select(rte, flowid); + if (rte == NULL) { + RADIX_NODE_HEAD_RUNLOCK(rh); + return (ENOENT); + } +#endif /* Ensure route & ifp is UP */ if (RT_LINK_IS_UP(rte->rt_ifp)) { fib6_rte_to_nh_extended(rte, &sin6.sin6_addr, flags, From owner-svn-src-head@freebsd.org Mon Jan 11 09:15:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51DF3A6CE36; Mon, 11 Jan 2016 09:15:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2185C1ED0; Mon, 11 Jan 2016 09:15:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0B9FPxN083498; Mon, 11 Jan 2016 09:15:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0B9FPpF083497; Mon, 11 Jan 2016 09:15:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601110915.u0B9FPpF083497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 11 Jan 2016 09:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293658 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 09:15:26 -0000 Author: arybchik Date: Mon Jan 11 09:15:25 2016 New Revision: 293658 URL: https://svnweb.freebsd.org/changeset/base/293658 Log: sfxge: add Medford build option disabled by default Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efsys.h Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Mon Jan 11 08:45:28 2016 (r293657) +++ head/sys/dev/sfxge/common/efsys.h Mon Jan 11 09:15:25 2016 (r293658) @@ -238,6 +238,7 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE 0 #define EFSYS_OPT_SIENA 1 #define EFSYS_OPT_HUNTINGTON 1 +#define EFSYS_OPT_MEDFORD 0 #ifdef DEBUG #define EFSYS_OPT_CHECK_REG 1 #else From owner-svn-src-head@freebsd.org Mon Jan 11 10:24:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E8ACA6C628; Mon, 11 Jan 2016 10:24:31 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 773DC1E25; Mon, 11 Jan 2016 10:24:31 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BAOUbg005813; Mon, 11 Jan 2016 10:24:30 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BAOUe3005811; Mon, 11 Jan 2016 10:24:30 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601111024.u0BAOUe3005811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 11 Jan 2016 10:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293659 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 10:24:31 -0000 Author: smh Date: Mon Jan 11 10:24:30 2016 New Revision: 293659 URL: https://svnweb.freebsd.org/changeset/base/293659 Log: Close iSCSI sessions on shutdown Ensure that all iSCSI sessions are correctly terminated during shutdown. * Enhances the changes done by r286226 (D3052). * Add shutdown post sync event to run after filesystem shutdown (SHUTDOWN_PRI_FIRST) but before CAM shutdown (SHUTDOWN_PRI_DEFAULT). * Changes iscsi_maintenance_thread to processes terminate in preference to reconnect. Reviewed by: trasz MFC after: 2 weeks Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4429 Modified: head/sys/dev/iscsi/iscsi.c head/sys/dev/iscsi/iscsi.h Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Mon Jan 11 09:15:25 2016 (r293658) +++ head/sys/dev/iscsi/iscsi.c Mon Jan 11 10:24:30 2016 (r293659) @@ -98,6 +98,9 @@ SYSCTL_INT(_kern_iscsi, OID_AUTO, maxtag static int fail_on_disconnection = 0; SYSCTL_INT(_kern_iscsi, OID_AUTO, fail_on_disconnection, CTLFLAG_RWTUN, &fail_on_disconnection, 0, "Destroy CAM SIM on connection failure"); +static int fail_on_shutdown = 1; +SYSCTL_INT(_kern_iscsi, OID_AUTO, fail_on_shutdown, CTLFLAG_RWTUN, + &fail_on_shutdown, 0, "Fail disconnected sessions on shutdown"); static MALLOC_DEFINE(M_ISCSI, "iSCSI", "iSCSI initiator"); static uma_zone_t iscsi_outstanding_zone; @@ -417,8 +420,6 @@ iscsi_maintenance_thread_terminate(struc sc = is->is_softc; sx_xlock(&sc->sc_lock); - TAILQ_REMOVE(&sc->sc_sessions, is, is_next); - sx_xunlock(&sc->sc_lock); icl_conn_close(is->is_conn); callout_drain(&is->is_callout); @@ -450,6 +451,9 @@ iscsi_maintenance_thread_terminate(struc #ifdef ICL_KERNEL_PROXY cv_destroy(&is->is_login_cv); #endif + TAILQ_REMOVE(&sc->sc_sessions, is, is_next); + sx_xunlock(&sc->sc_lock); + ISCSI_SESSION_DEBUG(is, "terminated"); free(is, M_ISCSI); @@ -473,12 +477,7 @@ iscsi_maintenance_thread(void *arg) STAILQ_EMPTY(&is->is_postponed)) cv_wait(&is->is_maintenance_cv, &is->is_lock); - if (is->is_reconnecting) { - ISCSI_SESSION_UNLOCK(is); - iscsi_maintenance_thread_reconnect(is); - continue; - } - + /* Terminate supersedes reconnect. */ if (is->is_terminating) { ISCSI_SESSION_UNLOCK(is); iscsi_maintenance_thread_terminate(is); @@ -486,6 +485,12 @@ iscsi_maintenance_thread(void *arg) return; } + if (is->is_reconnecting) { + ISCSI_SESSION_UNLOCK(is); + iscsi_maintenance_thread_reconnect(is); + continue; + } + iscsi_session_send_postponed(is); ISCSI_SESSION_UNLOCK(is); } @@ -605,6 +610,11 @@ iscsi_callout(void *context) return; out: + if (is->is_terminating) { + ISCSI_SESSION_UNLOCK(is); + return; + } + ISCSI_SESSION_UNLOCK(is); if (reconnect_needed) @@ -2326,30 +2336,62 @@ iscsi_poll(struct cam_sim *sim) } static void -iscsi_shutdown(struct iscsi_softc *sc) +iscsi_terminate_sessions(struct iscsi_softc *sc) { struct iscsi_session *is; - /* - * Trying to reconnect during system shutdown would lead to hang. - */ - fail_on_disconnection = 1; + sx_slock(&sc->sc_lock); + TAILQ_FOREACH(is, &sc->sc_sessions, is_next) + iscsi_session_terminate(is); + while(!TAILQ_EMPTY(&sc->sc_sessions)) { + ISCSI_DEBUG("waiting for sessions to terminate"); + cv_wait(&sc->sc_cv, &sc->sc_lock); + } + ISCSI_DEBUG("all sessions terminated"); + sx_sunlock(&sc->sc_lock); +} + +static void +iscsi_shutdown_pre(struct iscsi_softc *sc) +{ + struct iscsi_session *is; + + if (!fail_on_shutdown) + return; /* * If we have any sessions waiting for reconnection, request * maintenance thread to fail them immediately instead of waiting * for reconnect timeout. + * + * This prevents LUNs with mounted filesystems that are supported + * by disconnected iSCSI sessions from hanging, however it will + * fail all queued BIOs. */ + ISCSI_DEBUG("forcing failing all disconnected sessions due to shutdown"); + + fail_on_disconnection = 1; + sx_slock(&sc->sc_lock); TAILQ_FOREACH(is, &sc->sc_sessions, is_next) { ISCSI_SESSION_LOCK(is); - if (is->is_waiting_for_iscsid) + if (!is->is_connected) { + ISCSI_SESSION_DEBUG(is, "force failing disconnected session early"); iscsi_session_reconnect(is); + } ISCSI_SESSION_UNLOCK(is); } sx_sunlock(&sc->sc_lock); } +static void +iscsi_shutdown_post(struct iscsi_softc *sc) +{ + + ISCSI_DEBUG("removing all sessions due to shutdown"); + iscsi_terminate_sessions(sc); +} + static int iscsi_load(void) { @@ -2372,8 +2414,16 @@ iscsi_load(void) } sc->sc_cdev->si_drv1 = sc; - sc->sc_shutdown_eh = EVENTHANDLER_REGISTER(shutdown_pre_sync, - iscsi_shutdown, sc, SHUTDOWN_PRI_DEFAULT-1); + sc->sc_shutdown_pre_eh = EVENTHANDLER_REGISTER(shutdown_pre_sync, + iscsi_shutdown_pre, sc, SHUTDOWN_PRI_FIRST); + /* + * shutdown_post_sync needs to run after filesystem shutdown and before + * CAM shutdown - otherwise when rebooting with an iSCSI session that is + * disconnected but has outstanding requests, dashutdown() will hang on + * cam_periph_runccb(). + */ + sc->sc_shutdown_post_eh = EVENTHANDLER_REGISTER(shutdown_post_sync, + iscsi_shutdown_post, sc, SHUTDOWN_PRI_DEFAULT - 1); return (0); } @@ -2381,7 +2431,6 @@ iscsi_load(void) static int iscsi_unload(void) { - struct iscsi_session *is, *tmp; if (sc->sc_cdev != NULL) { ISCSI_DEBUG("removing device node"); @@ -2389,18 +2438,12 @@ iscsi_unload(void) ISCSI_DEBUG("device node removed"); } - if (sc->sc_shutdown_eh != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, sc->sc_shutdown_eh); + if (sc->sc_shutdown_pre_eh != NULL) + EVENTHANDLER_DEREGISTER(shutdown_pre_sync, sc->sc_shutdown_pre_eh); + if (sc->sc_shutdown_post_eh != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, sc->sc_shutdown_post_eh); - sx_slock(&sc->sc_lock); - TAILQ_FOREACH_SAFE(is, &sc->sc_sessions, is_next, tmp) - iscsi_session_terminate(is); - while(!TAILQ_EMPTY(&sc->sc_sessions)) { - ISCSI_DEBUG("waiting for sessions to terminate"); - cv_wait(&sc->sc_cv, &sc->sc_lock); - } - ISCSI_DEBUG("all sessions terminated"); - sx_sunlock(&sc->sc_lock); + iscsi_terminate_sessions(sc); uma_zdestroy(iscsi_outstanding_zone); sx_destroy(&sc->sc_lock); Modified: head/sys/dev/iscsi/iscsi.h ============================================================================== --- head/sys/dev/iscsi/iscsi.h Mon Jan 11 09:15:25 2016 (r293658) +++ head/sys/dev/iscsi/iscsi.h Mon Jan 11 10:24:30 2016 (r293659) @@ -131,7 +131,8 @@ struct iscsi_softc { TAILQ_HEAD(, iscsi_session) sc_sessions; struct cv sc_cv; unsigned int sc_last_session_id; - eventhandler_tag sc_shutdown_eh; + eventhandler_tag sc_shutdown_pre_eh; + eventhandler_tag sc_shutdown_post_eh; }; #endif /* !ISCSI_H */ From owner-svn-src-head@freebsd.org Mon Jan 11 15:03:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3937BA6A03F; Mon, 11 Jan 2016 15:03:35 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 245AA1BBF; Mon, 11 Jan 2016 15:03:35 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from [192.168.1.4] (c-24-6-178-251.hsd1.ca.comcast.net [24.6.178.251]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O0S00I2UN5XWW20@mr11p00im-asmtp003.me.com>; Mon, 11 Jan 2016 15:03:34 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-01-11_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=18 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1601110267 User-Agent: Microsoft-MacOutlook/0.0.0.151217 Date: Mon, 11 Jan 2016 07:03:32 -0800 Subject: Re: svn commit: r292788 - in head/sys: geom/part sys From: Ravi Pokala Sender: "Pokala, Ravi" To: "Andrey V. Elsukov" , Ravi Pokala , Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <12E970B9-E993-4071-B334-021AB155D0B4@panasas.com> Thread-topic: svn commit: r292788 - in head/sys: geom/part sys References: <201512271812.tBRICD3A044563@repo.freebsd.org> <1F9E33A5-A9D7-44A9-9519-2A1593BFF990@panasas.com> <56936975.9000202@yandex.ru> In-reply-to: <56936975.9000202@yandex.ru> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 15:03:35 -0000 -----Original Message----- From: on behalf of "Andrey V. Elsukov" <= bu7cher@yandex.ru> Date: 2016-01-11, Monday at 00:36 To: Ravi Pokala , Allan Jude , , , Subject: Re: svn commit: r292788 - in head/sys: geom/part sys >On 11.01.16 07:54, Ravi Pokala wrote: >> In that review, there was discussion about the sorting of aliases in >(enum g_part_alias). It was originally thought that the aliases needed >to be sorted, due to binary searching in g_part_alias_name(). It turned >out that g_part_alias_name() did a linear search, so the list didn't >strictly need to be sorted. But, there was talk of potentially switching >to a binary search later, so Allan went with the sorted version. > >Hi, > >no, my note was relate to the following possible problem: >you have some stable/10 and some geom_part_panasas module installed from >the ports in the /boot/modules. When you rebuild the kernel after >merging r292788 your module will use old values of g_part_alias and thus >it will get not the same aliases. You will need rebuild your module to >fix this. Right, I explained your concerns later down in the email. However, I don't = think they're applicable, because it doesn=E2=80=99t look like anything is actuall= y using the enum outside of GEOM_PART driver. Thanks, Ravi (rpokala@) From owner-svn-src-head@freebsd.org Mon Jan 11 15:35:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19FE7A6AB77; Mon, 11 Jan 2016 15:35:31 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD7511DD3; Mon, 11 Jan 2016 15:35:30 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BFZUYC096871; Mon, 11 Jan 2016 15:35:30 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BFZUEf096870; Mon, 11 Jan 2016 15:35:30 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201601111535.u0BFZUEf096870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 11 Jan 2016 15:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293661 - head/sys/boot/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 15:35:31 -0000 Author: allanjude Date: Mon Jan 11 15:35:29 2016 New Revision: 293661 URL: https://svnweb.freebsd.org/changeset/base/293661 Log: DIOCGSECTORSIZE expects to write to a u_int, but struct zfs_probe_args member secsz was a uint16_t sys/boot/zfs/zfs.c has a probe args structure member, secsz, that is a uint16_t for media sector size; it is used as an argument for ioctl() at line 484. however, this ioctl writes 32 bits of data (u_int *) and therefore this ioctl will overwrite and corrupt 16 bits of memory. other use cases seem to use correct u_int type for secsz. PR: 204358 Submitted by: Toomas Soome Reviewed by: asomers, delphij, smh MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D4811 Modified: head/sys/boot/zfs/zfs.c Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Mon Jan 11 15:30:19 2016 (r293660) +++ head/sys/boot/zfs/zfs.c Mon Jan 11 15:35:29 2016 (r293661) @@ -413,7 +413,7 @@ struct zfs_probe_args { int fd; const char *devname; uint64_t *pool_guid; - uint16_t secsz; + u_int secsz; }; static int From owner-svn-src-head@freebsd.org Mon Jan 11 17:29:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B754A65A9B; Mon, 11 Jan 2016 17:29:27 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFC87151A; Mon, 11 Jan 2016 17:29:26 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id f206so222271054wmf.0; Mon, 11 Jan 2016 09:29:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=ihopZ0yG/vU0x6L0hNO4bDiGZu55SolWqYbs9KSxWWU=; b=gUj4nKg7WQA0PycZVeCxHD72H905BUu+VxUcwC0oWLcUTjUY71EvK8Firo8Dv0vuts FPlZPJPgJI/EOcvydxgHpLJ+FcHHu32SWzI+XjA2e+xZ1FeO8OBI8FRewhukpTHFbf7L M2bCQSTsnaUw77Fkjy8XUxjv9ILAJkbOCZl5lMBOiY+zXHLjoQeoQgL94/0oj/h05jCK hy2PzyOEpQlpxAyOVki4ahl+wVRny4VgdkVqtBG6UqrGdL0Y5oEP8qapzoNLtQRlQf5T yQTk+2WLHZanZDm1I55f+zxuObQK6xmY5W6zAWtJX8yI2ow9W4x62iR8FkI+yzS4JqXu cSyA== X-Received: by 10.28.11.77 with SMTP id 74mr15839907wml.36.1452533365205; Mon, 11 Jan 2016 09:29:25 -0800 (PST) Received: from [172.16.1.30] (178.Red-79-152-19.dynamicIP.rima-tde.net. [79.152.19.178]) by smtp.gmail.com with ESMTPSA id id1sm119929755wjb.19.2016.01.11.09.29.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jan 2016 09:29:24 -0800 (PST) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Subject: Re: svn commit: r291716 - in head: share/man/man4 sys/cam sys/cam/ata sys/cam/scsi sys/dev/md sys/geom sys/kern sys/pc98/include sys/sys usr.sbin usr.sbin/camdd To: "Kenneth D. Merry" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512032054.tB3KsuUw037541@repo.freebsd.org> From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= X-Enigmail-Draft-Status: N1110 Message-ID: <5693E672.7080100@FreeBSD.org> Date: Mon, 11 Jan 2016 18:29:22 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201512032054.tB3KsuUw037541@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 17:29:27 -0000 El 03/12/15 a les 21.54, Kenneth D. Merry ha escrit: > Author: ken > Date: Thu Dec 3 20:54:55 2015 > New Revision: 291716 > URL: https://svnweb.freebsd.org/changeset/base/291716 > > Log: > Add asynchronous command support to the pass(4) driver, and the new > camdd(8) utility. > > CCBs may be queued to the driver via the new CAMIOQUEUE ioctl, and > completed CCBs may be retrieved via the CAMIOGET ioctl. User > processes can use poll(2) or kevent(2) to get notification when > I/O has completed. > > While the existing CAMIOCOMMAND blocking ioctl interface only > supports user virtual data pointers in a CCB (generally only > one per CCB), the new CAMIOQUEUE ioctl supports user virtual and > physical address pointers, as well as user virtual and physical > scatter/gather lists. This allows user applications to have more > flexibility in their data handling operations. > > Kernel memory for data transferred via the queued interface is > allocated from the zone allocator in MAXPHYS sized chunks, and user > data is copied in and out. This is likely faster than the > vmapbuf()/vunmapbuf() method used by the CAMIOCOMMAND ioctl in > configurations with many processors (there are more TLB shootdowns > caused by the mapping/unmapping operation) but may not be as fast > as running with unmapped I/O. > > The new memory handling model for user requests also allows > applications to send CCBs with request sizes that are larger than > MAXPHYS. The pass(4) driver now limits queued requests to the I/O > size listed by the SIM driver in the maxio field in the Path > Inquiry (XPT_PATH_INQ) CCB. > > There are some things things would be good to add: > > 1. Come up with a way to do unmapped I/O on multiple buffers. > Currently the unmapped I/O interface operates on a struct bio, > which includes only one address and length. It would be nice > to be able to send an unmapped scatter/gather list down to > busdma. This would allow eliminating the copy we currently do > for data. > > 2. Add an ioctl to list currently outstanding CCBs in the various > queues. > > 3. Add an ioctl to cancel a request, or use the XPT_ABORT CCB to do > that. > > 4. Test physical address support. Virtual pointers and scatter > gather lists have been tested, but I have not yet tested > physical addresses or scatter/gather lists. > > 5. Investigate multiple queue support. At the moment there is one > queue of commands per pass(4) device. If multiple processes > open the device, they will submit I/O into the same queue and > get events for the same completions. This is probably the right > model for most applications, but it is something that could be > changed later on. > > Also, add a new utility, camdd(8) that uses the asynchronous pass(4) > driver interface. > > This utility is intended to be a basic data transfer/copy utility, > a simple benchmark utility, and an example of how to use the > asynchronous pass(4) interface. > > It can copy data to and from pass(4) devices using any target queue > depth, starting offset and blocksize for the input and ouptut devices. > It currently only supports SCSI devices, but could be easily extended > to support ATA devices. > > It can also copy data to and from regular files, block devices, tape > devices, pipes, stdin, and stdout. It does not support queueing > multiple commands to any of those targets, since it uses the standard > read(2)/write(2)/writev(2)/readv(2) system calls. > > The I/O is done by two threads, one for the reader and one for the > writer. The reader thread sends completed read requests to the > writer thread in strictly sequential order, even if they complete > out of order. That could be modified later on for random I/O patterns > or slightly out of order I/O. > > camdd(8) uses kqueue(2)/kevent(2) to get I/O completion events from > the pass(4) driver and also to send request notifications internally. > > For pass(4) devcies, camdd(8) uses a single buffer (CAM_DATA_VADDR) > per CAM CCB on the reading side, and a scatter/gather list > (CAM_DATA_SG) on the writing side. In addition to testing both > interfaces, this makes any potential reblocking of I/O easier. No > data is copied between the reader and the writer, but rather the > reader's buffers are split into multiple I/O requests or combined > into a single I/O request depending on the input and output blocksize. > > For the file I/O path, camdd(8) also uses a single buffer (read(2), > write(2), pread(2) or pwrite(2)) on reads, and a scatter/gather list > (readv(2), writev(2), preadv(2), pwritev(2)) on writes. > > Things that would be nice to do for camdd(8) eventually: > > 1. Add support for I/O pattern generation. Patterns like all > zeros, all ones, LBA-based patterns, random patterns, etc. Right > Now you can always use /dev/zero, /dev/random, etc. > > 2. Add support for a "sink" mode, so we do only reads with no > writes. Right now, you can use /dev/null. > > 3. Add support for automatic queue depth probing, so that we can > figure out the right queue depth on the input and output side > for maximum throughput. At the moment it defaults to 6. > > 4. Add support for SATA device passthrough I/O. > > 5. Add support for random LBAs and/or lengths on the input and > output sides. > > 6. Track average per-I/O latency and busy time. The busy time > and latency could also feed in to the automatic queue depth > determination. > > sys/cam/scsi/scsi_pass.h: > Define two new ioctls, CAMIOQUEUE and CAMIOGET, that queue > and fetch asynchronous CAM CCBs respectively. > > Although these ioctls do not have a declared argument, they > both take a union ccb pointer. If we declare a size here, > the ioctl code in sys/kern/sys_generic.c will malloc and free > a buffer for either the CCB or the CCB pointer (depending on > how it is declared). Since we have to keep a copy of the > CCB (which is fairly large) anyway, having the ioctl malloc > and free a CCB for each call is wasteful. > > sys/cam/scsi/scsi_pass.c: > Add asynchronous CCB support. > > Add two new ioctls, CAMIOQUEUE and CAMIOGET. > > CAMIOQUEUE adds a CCB to the incoming queue. The CCB is > executed immediately (and moved to the active queue) if it > is an immediate CCB, but otherwise it will be executed > in passstart() when a CCB is available from the transport layer. > > When CCBs are completed (because they are immediate or > passdone() if they are queued), they are put on the done > queue. > > If we get the final close on the device before all pending > I/O is complete, all active I/O is moved to the abandoned > queue and we increment the peripheral reference count so > that the peripheral driver instance doesn't go away before > all pending I/O is done. > > The new passcreatezone() function is called on the first > call to the CAMIOQUEUE ioctl on a given device to allocate > the UMA zones for I/O requests and S/G list buffers. This > may be good to move off to a taskqueue at some point. > The new passmemsetup() function allocates memory and > scatter/gather lists to hold the user's data, and copies > in any data that needs to be written. For virtual pointers > (CAM_DATA_VADDR), the kernel buffer is malloced from the > new pass(4) driver malloc bucket. For virtual > scatter/gather lists (CAM_DATA_SG), buffers are allocated > from a new per-pass(9) UMA zone in MAXPHYS-sized chunks. > Physical pointers are passed in unchanged. We have support > for up to 16 scatter/gather segments (for the user and > kernel S/G lists) in the default struct pass_io_req, so > requests with longer S/G lists require an extra kernel malloc. > > The new passcopysglist() function copies a user scatter/gather > list to a kernel scatter/gather list. The number of elements > in each list may be different, but (obviously) the amount of data > stored has to be identical. > > The new passmemdone() function copies data out for the > CAM_DATA_VADDR and CAM_DATA_SG cases. > > The new passiocleanup() function restores data pointers in > user CCBs and frees memory. > > Add new functions to support kqueue(2)/kevent(2): > > passreadfilt() tells kevent whether or not the done > queue is empty. > > passkqfilter() adds a knote to our list. > > passreadfiltdetach() removes a knote from our list. > > Add a new function, passpoll(), for poll(2)/select(2) > to use. > > Add devstat(9) support for the queued CCB path. > > sys/cam/ata/ata_da.c: > Add support for the BIO_VLIST bio type. > > sys/cam/cam_ccb.h: > Add a new enumeration for the xflags field in the CCB header. > (This doesn't change the CCB header, just adds an enumeration to > use.) > > sys/cam/cam_xpt.c: > Add a new function, xpt_setup_ccb_flags(), that allows specifying > CCB flags. > > sys/cam/cam_xpt.h: > Add a prototype for xpt_setup_ccb_flags(). > > sys/cam/scsi/scsi_da.c: > Add support for BIO_VLIST. > > sys/dev/md/md.c: > Add BIO_VLIST support to md(4). > > sys/geom/geom_disk.c: > Add BIO_VLIST support to the GEOM disk class. Re-factor the I/O size > limiting code in g_disk_start() a bit. > > sys/kern/subr_bus_dma.c: > Change _bus_dmamap_load_vlist() to take a starting offset and > length. > > Add a new function, _bus_dmamap_load_pages(), that will load a list > of physical pages starting at an offset. (cannot comment inline because the diff is truncated, sorry). This is bogus, and defeats the purpose of _bus_dmamap_load_ma by reintroducing the mechanics already found in bus_dmamap_load_ma_triv. See r290610, which was the commit that introduced a proper implementation of bus_dmamap_load_ma in x86. The problem with the approach taken both in _bus_dmamap_load_pages and bus_dmamap_load_ma_triv is that they split the request buffer into arbitrary chunks based on page boundaries, creating segments that no longer have a size that's a multiple of the sector size. This breaks drivers like blkfront (and probably other stuff). The following patch solves the problem AFAICT, and I would like to commit it ASAP: Roger. --- diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c index ae30276..cdf176b 100644 --- a/sys/kern/subr_bus_dma.c +++ b/sys/kern/subr_bus_dma.c @@ -131,28 +131,6 @@ _bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, } /* - * Load tlen data starting at offset within a region specified by a list of - * physical pages. - */ -static int -_bus_dmamap_load_pages(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_page_t *pages, bus_size_t tlen, int offset, int *nsegs, int flags) -{ - vm_paddr_t paddr; - bus_size_t len; - int error, i; - - for (i = 0, error = 0; error == 0 && tlen > 0; i++, tlen -= len) { - len = min(PAGE_SIZE - offset, tlen); - paddr = VM_PAGE_TO_PHYS(pages[i]) + offset; - error = _bus_dmamap_load_phys(dmat, map, paddr, len, - flags, NULL, nsegs); - offset = 0; - } - return (error); -} - -/* * Load from block io. */ static int @@ -168,8 +146,8 @@ _bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio *bio, } if ((bio->bio_flags & BIO_UNMAPPED) != 0) - return (_bus_dmamap_load_pages(dmat, map, bio->bio_ma, - bio->bio_bcount, bio->bio_ma_offset, nsegs, flags)); + return (_bus_dmamap_load_ma(dmat, map, bio->bio_ma, + bio->bio_bcount, bio->bio_ma_offset, flags, NULL, nsegs)); return (_bus_dmamap_load_buffer(dmat, map, bio->bio_data, bio->bio_bcount, kernel_pmap, flags, NULL, nsegs)); From owner-svn-src-head@freebsd.org Mon Jan 11 17:52:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9DFFA6B243; Mon, 11 Jan 2016 17:52:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC5001AE9; Mon, 11 Jan 2016 17:52:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BHqgcj038959; Mon, 11 Jan 2016 17:52:42 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BHqgCE038958; Mon, 11 Jan 2016 17:52:42 GMT (envelope-from np@FreeBSD.org) Message-Id: <201601111752.u0BHqgCE038958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 11 Jan 2016 17:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293674 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 17:52:43 -0000 Author: np Date: Mon Jan 11 17:52:42 2016 New Revision: 293674 URL: https://svnweb.freebsd.org/changeset/base/293674 Log: cxgbe: bind the ithreads that handle NIC rx to the correct CPU if the kernel is built with option RSS. Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jan 11 17:33:51 2016 (r293673) +++ head/sys/dev/cxgbe/t4_main.c Mon Jan 11 17:52:42 2016 (r293674) @@ -3642,6 +3642,9 @@ setup_intr_handlers(struct adapter *sc) #ifdef DEV_NETMAP struct sge_nm_rxq *nm_rxq; #endif +#ifdef RSS + int nbuckets = rss_getnumbuckets(); +#endif /* * Setup interrupts. @@ -3700,6 +3703,10 @@ setup_intr_handlers(struct adapter *sc) t4_intr, rxq, s); if (rc != 0) return (rc); +#ifdef RSS + bus_bind_intr(sc->dev, irq->res, + rss_getcpu(q % nbuckets)); +#endif irq++; rid++; vi->nintr++; From owner-svn-src-head@freebsd.org Mon Jan 11 17:57:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AB22A6B444; Mon, 11 Jan 2016 17:57:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D90B710C2; Mon, 11 Jan 2016 17:57:27 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BHvQuj039286; Mon, 11 Jan 2016 17:57:26 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BHvQ8x039285; Mon, 11 Jan 2016 17:57:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201601111757.u0BHvQ8x039285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 11 Jan 2016 17:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293677 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 17:57:28 -0000 Author: asomers Date: Mon Jan 11 17:57:26 2016 New Revision: 293677 URL: https://svnweb.freebsd.org/changeset/base/293677 Log: Record physical path information in ZFS Vdevs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c: If available, record the physical path of a vdev in ZFS meta-data. Do this both when opening the vdev, and when receiving an attribute change notification from GEOM. Make vdev_geom_close() synchronous instead of deferring its work to a GEOM event handler. There is no benefit to deferring the work and this prevents a future open call from referencing a consumer that is scheduled for destruction. The close followed by an immediate open will occur during a vdev reprobe triggered by any type of I/O error. Consolidate vdev_geom_close() and vdev_geom_detach() into vdev_geom_close() and vdev_geom_close_locked(). This also moves the cross linking operations between vdev and GEOM consumer into a single place (linking in vdev_geom_attach() and unlinking in vdev_geom_close_locked()). Submitted by: gibbs, asomers MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4524 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Jan 11 17:54:23 2016 (r293676) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Jan 11 17:57:26 2016 (r293677) @@ -78,6 +78,9 @@ static void vdev_geom_attrchanged(struct g_consumer *cp, const char *attr) { vdev_t *vd; + spa_t *spa; + char *physpath; + int error, physpath_len; vd = cp->private; if (vd == NULL) @@ -87,6 +90,47 @@ vdev_geom_attrchanged(struct g_consumer vdev_geom_set_rotation_rate(vd, cp); return; } + + if (strcmp(attr, "GEOM::physpath") != 0) + return; + + if (g_access(cp, 1, 0, 0) != 0) + return; + + /* + * Record/Update physical path information for this device. + */ + spa = vd->vdev_spa; + physpath_len = MAXPATHLEN; + physpath = g_malloc(physpath_len, M_WAITOK|M_ZERO); + error = g_io_getattr("GEOM::physpath", cp, &physpath_len, physpath); + g_access(cp, -1, 0, 0); + if (error == 0) { + char *old_physpath; + + old_physpath = vd->vdev_physpath; + vd->vdev_physpath = spa_strdup(physpath); + spa_async_request(spa, SPA_ASYNC_CONFIG_UPDATE); + + if (old_physpath != NULL) { + int held_lock; + + held_lock = spa_config_held(spa, SCL_STATE, RW_WRITER); + if (held_lock == 0) { + g_topology_unlock(); + spa_config_enter(spa, SCL_STATE, FTAG, + RW_WRITER); + } + + spa_strfree(old_physpath); + + if (held_lock == 0) { + spa_config_exit(spa, SCL_STATE, FTAG); + g_topology_lock(); + } + } + } + g_free(physpath); } static void @@ -97,8 +141,10 @@ vdev_geom_orphan(struct g_consumer *cp) g_topology_assert(); vd = cp->private; - if (vd == NULL) + if (vd == NULL) { + /* Vdev close in progress. Ignore the event. */ return; + } /* * Orphan callbacks occur from the GEOM event thread. @@ -120,7 +166,7 @@ vdev_geom_orphan(struct g_consumer *cp) } static struct g_consumer * -vdev_geom_attach(struct g_provider *pp) +vdev_geom_attach(struct g_provider *pp, vdev_t *vd) { struct g_geom *gp; struct g_consumer *cp; @@ -139,6 +185,7 @@ vdev_geom_attach(struct g_provider *pp) if (gp == NULL) { gp = g_new_geomf(&zfs_vdev_class, "zfs::vdev"); gp->orphan = vdev_geom_orphan; + gp->attrchanged = vdev_geom_attrchanged; cp = g_new_consumer(gp); if (g_attach(cp, pp) != 0) { g_wither_geom(gp, ENXIO); @@ -175,28 +222,56 @@ vdev_geom_attach(struct g_provider *pp) ZFS_LOG(1, "Used existing consumer for %s.", pp->name); } } + + /* + * BUG: cp may already belong to a vdev. This could happen if: + * 1) That vdev is a shared spare, or + * 2) We are trying to reopen a missing vdev and we are scanning by + * guid. In that case, we'll ultimately fail to open this consumer, + * but not until after setting the private field. + * The solution is to: + * 1) Don't set the private field until after the open succeeds, and + * 2) Set it to a linked list of vdevs, not just a single vdev + */ + cp->private = vd; + vd->vdev_tsd = cp; + + /* Fetch initial physical path information for this device. */ + vdev_geom_attrchanged(cp, "GEOM::physpath"); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; return (cp); } static void -vdev_geom_detach(void *arg, int flag __unused) +vdev_geom_close_locked(vdev_t *vd) { struct g_geom *gp; struct g_consumer *cp; g_topology_assert(); - cp = arg; - gp = cp->geom; + + cp = vd->vdev_tsd; + if (cp == NULL) + return; ZFS_LOG(1, "Closing access to %s.", cp->provider->name); + KASSERT(vd->vdev_tsd == cp, ("%s: vdev_tsd is not cp", __func__)); + vd->vdev_tsd = NULL; + vd->vdev_delayed_close = B_FALSE; + cp->private = NULL; + + gp = cp->geom; g_access(cp, -1, 0, -1); /* Destroy consumer on last close. */ if (cp->acr == 0 && cp->ace == 0) { - ZFS_LOG(1, "Destroyed consumer to %s.", cp->provider->name); if (cp->acw > 0) g_access(cp, 0, -cp->acw, 0); - g_detach(cp); + if (cp->provider != NULL) { + ZFS_LOG(1, "Destroyed consumer to %s.", + cp->provider->name); + g_detach(cp); + } g_destroy_consumer(cp); } /* Destroy geom if there are no consumers left. */ @@ -490,7 +565,7 @@ vdev_geom_read_guids(struct g_consumer * } static struct g_consumer * -vdev_geom_attach_by_guids(uint64_t pool_guid, uint64_t vdev_guid) +vdev_geom_attach_by_guids(vdev_t *vd) { struct g_class *mp; struct g_geom *gp, *zgp; @@ -519,9 +594,10 @@ vdev_geom_attach_by_guids(uint64_t pool_ vdev_geom_read_guids(zcp, &pguid, &vguid); g_topology_lock(); vdev_geom_detach_taster(zcp); - if (pguid != pool_guid || vguid != vdev_guid) + if (pguid != spa_guid(vd->vdev_spa) || + vguid != vd->vdev_guid) continue; - cp = vdev_geom_attach(pp); + cp = vdev_geom_attach(pp, vd); if (cp == NULL) { printf("ZFS WARNING: Unable to " "attach to %s.\n", pp->name); @@ -551,7 +627,7 @@ vdev_geom_open_by_guids(vdev_t *vd) g_topology_assert(); ZFS_LOG(1, "Searching by guid [%ju].", (uintmax_t)vd->vdev_guid); - cp = vdev_geom_attach_by_guids(spa_guid(vd->vdev_spa), vd->vdev_guid); + cp = vdev_geom_attach_by_guids(vd); if (cp != NULL) { len = strlen(cp->provider->name) + strlen("/dev/") + 1; buf = kmem_alloc(len, KM_SLEEP); @@ -585,7 +661,7 @@ vdev_geom_open_by_path(vdev_t *vd, int c pp = g_provider_by_name(vd->vdev_path + sizeof("/dev/") - 1); if (pp != NULL) { ZFS_LOG(1, "Found provider by name %s.", vd->vdev_path); - cp = vdev_geom_attach(pp); + cp = vdev_geom_attach(pp, vd); if (cp != NULL && check_guid && ISP2(pp->sectorsize) && pp->sectorsize <= VDEV_PAD_SIZE) { g_topology_unlock(); @@ -593,7 +669,7 @@ vdev_geom_open_by_path(vdev_t *vd, int c g_topology_lock(); if (pguid != spa_guid(vd->vdev_spa) || vguid != vd->vdev_guid) { - vdev_geom_detach(cp, 0); + vdev_geom_close_locked(vd); cp = NULL; ZFS_LOG(1, "guid mismatch for provider %s: " "%ju:%ju != %ju:%ju.", vd->vdev_path, @@ -675,7 +751,8 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi !ISP2(cp->provider->sectorsize)) { ZFS_LOG(1, "Provider %s has unsupported sectorsize.", vd->vdev_path); - vdev_geom_detach(cp, 0); + + vdev_geom_close_locked(vd); error = EINVAL; cp = NULL; } else if (cp->acw == 0 && (spa_mode(vd->vdev_spa) & FWRITE) != 0) { @@ -692,19 +769,17 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi if (error != 0) { printf("ZFS WARNING: Unable to open %s for writing (error=%d).\n", vd->vdev_path, error); - vdev_geom_detach(cp, 0); + vdev_geom_close_locked(vd); cp = NULL; } } + g_topology_unlock(); PICKUP_GIANT(); if (cp == NULL) { vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; return (error); } - - cp->private = vd; - vd->vdev_tsd = cp; pp = cp->provider; /* @@ -727,12 +802,6 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi */ vd->vdev_nowritecache = B_FALSE; - if (vd->vdev_physpath != NULL) - spa_strfree(vd->vdev_physpath); - bufsize = sizeof("/dev/") + strlen(pp->name); - vd->vdev_physpath = kmem_alloc(bufsize, KM_SLEEP); - snprintf(vd->vdev_physpath, bufsize, "/dev/%s", pp->name); - /* * Determine the device's rotation rate. */ @@ -744,15 +813,12 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi static void vdev_geom_close(vdev_t *vd) { - struct g_consumer *cp; - cp = vd->vdev_tsd; - if (cp == NULL) - return; - vd->vdev_tsd = NULL; - vd->vdev_delayed_close = B_FALSE; - cp->private = NULL; /* XXX locking */ - g_post_event(vdev_geom_detach, cp, M_WAITOK, NULL); + DROP_GIANT(); + g_topology_lock(); + vdev_geom_close_locked(vd); + g_topology_unlock(); + PICKUP_GIANT(); } static void From owner-svn-src-head@freebsd.org Mon Jan 11 17:57:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B856A6B4A6; Mon, 11 Jan 2016 17:57:50 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6894212AE; Mon, 11 Jan 2016 17:57:50 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BHvnpF039342; Mon, 11 Jan 2016 17:57:49 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BHvntJ039341; Mon, 11 Jan 2016 17:57:49 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601111757.u0BHvntJ039341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Mon, 11 Jan 2016 17:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293678 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 17:57:50 -0000 Author: jimharris Date: Mon Jan 11 17:57:49 2016 New Revision: 293678 URL: https://svnweb.freebsd.org/changeset/base/293678 Log: Update ismt(4) man page to reflect inclusion in upcoming 10.3 release. MFC after: 3 days Sponsored by: Intel Modified: head/share/man/man4/ismt.4 Modified: head/share/man/man4/ismt.4 ============================================================================== --- head/share/man/man4/ismt.4 Mon Jan 11 17:57:26 2016 (r293677) +++ head/share/man/man4/ismt.4 Mon Jan 11 17:57:49 2016 (r293678) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2014 +.Dd January 11, 2016 .Dt ISMT 4 .Os .Sh NAME @@ -54,6 +54,6 @@ in the Intel Atom S1200 and C2000 CPUs. The .Nm driver first appeared in -.Fx 11.0 . +.Fx 10.3 . .Sh AUTHORS .An Jim Harris Aq Mt jimharris@FreeBSD.org From owner-svn-src-head@freebsd.org Mon Jan 11 18:11:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EB4AA6B729; Mon, 11 Jan 2016 18:11:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B7CA1B2B; Mon, 11 Jan 2016 18:11:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BIB74u042941; Mon, 11 Jan 2016 18:11:07 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BIB7pC042938; Mon, 11 Jan 2016 18:11:07 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201601111811.u0BIB7pC042938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 11 Jan 2016 18:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293679 - head/sys/fs/smbfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 18:11:08 -0000 Author: ae Date: Mon Jan 11 18:11:06 2016 New Revision: 293679 URL: https://svnweb.freebsd.org/changeset/base/293679 Log: Change the type of newsize argument in the smbfs_smb_setfsize() function from int to int64. MSDN says that SMB_SET_FILE_END_OF_FILE_INFO uses signed 64-bit integer to specify offset, but since smbfs_smb_setfsize() has used plain int, a value was truncated in case when offset was larger than 2G. https://msdn.microsoft.com/en-us/library/ff469975.aspx In particular, now `truncate -s 10G` will work correctly on the mounted SMB share. Reported and tested by: Eugene Grosbein MFC after: 1 week Modified: head/sys/fs/smbfs/smbfs_smb.c head/sys/fs/smbfs/smbfs_subr.h head/sys/fs/smbfs/smbfs_vnops.c Modified: head/sys/fs/smbfs/smbfs_smb.c ============================================================================== --- head/sys/fs/smbfs/smbfs_smb.c Mon Jan 11 17:57:49 2016 (r293678) +++ head/sys/fs/smbfs/smbfs_smb.c Mon Jan 11 18:11:06 2016 (r293679) @@ -333,18 +333,18 @@ smbfs_smb_flush(struct smbnode *np, stru } int -smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred) +smbfs_smb_setfsize(struct smbnode *np, int64_t newsize, struct smb_cred *scred) { struct smb_share *ssp = np->n_mount->sm_share; struct smb_rq *rqp; struct mbchain *mbp; int error; - if (!smbfs_smb_seteof(np, (int64_t) newsize, scred)) { + if (!smbfs_smb_seteof(np, newsize, scred)) { np->n_flag |= NFLUSHWIRE; return (0); } - + /* XXX: We should use SMB_COM_WRITE_ANDX to support large offsets */ error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_WRITE, scred, &rqp); if (error) return (error); @@ -352,7 +352,7 @@ smbfs_smb_setfsize(struct smbnode *np, i smb_rq_wstart(rqp); mb_put_mem(mbp, (caddr_t)&np->n_fid, 2, MB_MSYSTEM); mb_put_uint16le(mbp, 0); - mb_put_uint32le(mbp, newsize); + mb_put_uint32le(mbp, (uint32_t)newsize); mb_put_uint16le(mbp, 0); smb_rq_wend(rqp); smb_rq_bstart(rqp); Modified: head/sys/fs/smbfs/smbfs_subr.h ============================================================================== --- head/sys/fs/smbfs/smbfs_subr.h Mon Jan 11 17:57:49 2016 (r293678) +++ head/sys/fs/smbfs/smbfs_subr.h Mon Jan 11 18:11:06 2016 (r293679) @@ -128,7 +128,8 @@ int smbfs_smb_lock(struct smbnode *np, off_t start, off_t end, struct smb_cred *scred); int smbfs_smb_statfs(struct smb_share *ssp, struct statfs *sbp, struct smb_cred *scred); -int smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred); +int smbfs_smb_setfsize(struct smbnode *np, int64_t newsize, + struct smb_cred *scred); int smbfs_smb_query_info(struct smbnode *np, const char *name, int len, struct smbfattr *fap, struct smb_cred *scred); Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Mon Jan 11 17:57:49 2016 (r293678) +++ head/sys/fs/smbfs/smbfs_vnops.c Mon Jan 11 18:11:06 2016 (r293679) @@ -358,7 +358,8 @@ smbfs_setattr(ap) doclose = 1; } if (error == 0) - error = smbfs_smb_setfsize(np, vap->va_size, scred); + error = smbfs_smb_setfsize(np, + (int64_t)vap->va_size, scred); if (doclose) smbfs_smb_close(ssp, np->n_fid, NULL, scred); if (error) { From owner-svn-src-head@freebsd.org Mon Jan 11 18:12:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F909A6B879; Mon, 11 Jan 2016 18:12:50 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f169.google.com (mail-yk0-f169.google.com [209.85.160.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B8AB1DA1; Mon, 11 Jan 2016 18:12:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yk0-f169.google.com with SMTP id k129so417748175yke.0; Mon, 11 Jan 2016 10:12:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=b0rQwzjETlNI5VtrvBaOoqyVfWW7/cfF0nseX29zCtY=; b=ZTRIDn7OB/mlGsUC3+nMF4vhcKWuRy9Ax3Ha8EI4amkofTbmkAfeKmrxW3gFGqkKNV 1LDRh+/qDvN7rlKS8uAsvd1wvC+8SMsigFYWAbvq70i1mGm9X4IUkXilk7WgJkmV1EJE 5H85QpRXHMQzEJUUE3XdocZtVD9NfLxlW0/HPb/9cf/FQsUNOoif/68HghLWdtLtLOFi rLlWYYXc1DGp+/N+lmm3OZ52Kr7IG1W5i8OoOlwdm1DQHfWviYlHnRvm9mj6/8dxLuHl rIRchYRfxLV6qIFBopom3VLDPLLApYHq9Og5Cq1ZykQZ42pwAJvlOqTs5sDfmqB844vo RCMg== X-Received: by 10.129.92.132 with SMTP id q126mr105501089ywb.46.1452535963508; Mon, 11 Jan 2016 10:12:43 -0800 (PST) Received: from mail-yk0-f169.google.com (mail-yk0-f169.google.com. [209.85.160.169]) by smtp.gmail.com with ESMTPSA id w82sm45604277ywc.29.2016.01.11.10.12.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jan 2016 10:12:43 -0800 (PST) Received: by mail-yk0-f169.google.com with SMTP id k129so417747832yke.0; Mon, 11 Jan 2016 10:12:42 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.40.77 with SMTP id o74mr106179363ywo.9.1452535962926; Mon, 11 Jan 2016 10:12:42 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.4.69 with HTTP; Mon, 11 Jan 2016 10:12:42 -0800 (PST) In-Reply-To: <201601101753.u0AHrhSJ099996@repo.freebsd.org> References: <201601101753.u0AHrhSJ099996@repo.freebsd.org> Date: Mon, 11 Jan 2016 10:12:42 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r293640 - head/sys/vm From: Conrad Meyer To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 18:12:50 -0000 Does this fix https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204121 ? Thanks, Conrad On Sun, Jan 10, 2016 at 9:53 AM, Adrian Chadd wrote: > Author: adrian > Date: Sun Jan 10 17:53:43 2016 > New Revision: 293640 > URL: https://svnweb.freebsd.org/changeset/base/293640 > > Log: > Fix the domain iterator to not try the first-touch / fixed domain > more than once when doing round-robin. > > This lead to a panic because the iterator was trying the same domain > twice and not trying one of the other domains. > > Reported by: pho > Tested by: pho > > Modified: > head/sys/vm/vm_domain.c > > Modified: head/sys/vm/vm_domain.c > ============================================================================== > --- head/sys/vm/vm_domain.c Sun Jan 10 17:47:57 2016 (r293639) > +++ head/sys/vm/vm_domain.c Sun Jan 10 17:53:43 2016 (r293640) > @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); > #include > > static __inline int > -vm_domain_rr_selectdomain(void) > +vm_domain_rr_selectdomain(int skip_domain) > { > #if MAXMEMDOM > 1 > struct thread *td; > @@ -71,6 +71,16 @@ vm_domain_rr_selectdomain(void) > > td->td_dom_rr_idx++; > td->td_dom_rr_idx %= vm_ndomains; > + > + /* > + * If skip_domain is provided then skip over that > + * domain. This is intended for round robin variants > + * which first try a fixed domain. > + */ > + if ((skip_domain > -1) && (td->td_dom_rr_idx == skip_domain)) { > + td->td_dom_rr_idx++; > + td->td_dom_rr_idx %= vm_ndomains; > + } > return (td->td_dom_rr_idx); > #else > return (0); > @@ -339,12 +349,12 @@ vm_domain_iterator_run(struct vm_domain_ > if (vi->n == vm_ndomains) > *domain = vi->domain; > else > - *domain = vm_domain_rr_selectdomain(); > + *domain = vm_domain_rr_selectdomain(vi->domain); > vi->n--; > break; > case VM_POLICY_ROUND_ROBIN: > default: > - *domain = vm_domain_rr_selectdomain(); > + *domain = vm_domain_rr_selectdomain(-1); > vi->n--; > break; > } > From owner-svn-src-head@freebsd.org Mon Jan 11 19:08:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3BA1A6C595; Mon, 11 Jan 2016 19:08:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A522D1C01; Mon, 11 Jan 2016 19:08:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22b.google.com with SMTP id h5so77088126igh.0; Mon, 11 Jan 2016 11:08:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=oCB3A9oIM6QS8sii5MSA+A+e1kZj/6uBIy6RcY+WJ8A=; b=FG2VUgXBYAeZNTdQWrtHRLewXS3jgRTIsJ45kZxt7AK+TVnmkXj9lW0nZ5hXGZPx4z p2DMkjLM7bDDJfnTyDLR7XOpnrIIuh/rIC92Cs/1Da5EsL55AUiHBlgzVxBH17p89GM1 tAsxdOXkGOX4u5EOv+SOfTZrtS9VB2r+8AOasRMvqbBX/5Rt4o3X4vnoUKeB5I1OSVek voKQ6SapZLVN7AYcP6ydv9jyp33CZi+iwTC2Gkk7afPYgLPRbQpF1JGC3Qn3ytUMjQyb PTv0pnofY0llojtXgESsfRxvYaw8SqCjd9DjuSTwSyTSx2NLM7IQv2dIGz/utX3VBLDO goIQ== MIME-Version: 1.0 X-Received: by 10.50.136.226 with SMTP id qd2mr13810764igb.37.1452539333011; Mon, 11 Jan 2016 11:08:53 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.121.202 with HTTP; Mon, 11 Jan 2016 11:08:52 -0800 (PST) In-Reply-To: References: <201601101753.u0AHrhSJ099996@repo.freebsd.org> Date: Mon, 11 Jan 2016 11:08:52 -0800 X-Google-Sender-Auth: 7lExSHi4hO-5AQuVaj5YENZwFTs Message-ID: Subject: Re: svn commit: r293640 - head/sys/vm From: Adrian Chadd To: cem@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 19:08:54 -0000 yes sorry, I forgot about the PR! -a On 11 January 2016 at 10:12, Conrad Meyer wrote: > Does this fix https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204121 ? > > Thanks, > Conrad > > On Sun, Jan 10, 2016 at 9:53 AM, Adrian Chadd wrote: >> Author: adrian >> Date: Sun Jan 10 17:53:43 2016 >> New Revision: 293640 >> URL: https://svnweb.freebsd.org/changeset/base/293640 >> >> Log: >> Fix the domain iterator to not try the first-touch / fixed domain >> more than once when doing round-robin. >> >> This lead to a panic because the iterator was trying the same domain >> twice and not trying one of the other domains. >> >> Reported by: pho >> Tested by: pho >> >> Modified: >> head/sys/vm/vm_domain.c >> >> Modified: head/sys/vm/vm_domain.c >> ============================================================================== >> --- head/sys/vm/vm_domain.c Sun Jan 10 17:47:57 2016 (r293639) >> +++ head/sys/vm/vm_domain.c Sun Jan 10 17:53:43 2016 (r293640) >> @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); >> #include >> >> static __inline int >> -vm_domain_rr_selectdomain(void) >> +vm_domain_rr_selectdomain(int skip_domain) >> { >> #if MAXMEMDOM > 1 >> struct thread *td; >> @@ -71,6 +71,16 @@ vm_domain_rr_selectdomain(void) >> >> td->td_dom_rr_idx++; >> td->td_dom_rr_idx %= vm_ndomains; >> + >> + /* >> + * If skip_domain is provided then skip over that >> + * domain. This is intended for round robin variants >> + * which first try a fixed domain. >> + */ >> + if ((skip_domain > -1) && (td->td_dom_rr_idx == skip_domain)) { >> + td->td_dom_rr_idx++; >> + td->td_dom_rr_idx %= vm_ndomains; >> + } >> return (td->td_dom_rr_idx); >> #else >> return (0); >> @@ -339,12 +349,12 @@ vm_domain_iterator_run(struct vm_domain_ >> if (vi->n == vm_ndomains) >> *domain = vi->domain; >> else >> - *domain = vm_domain_rr_selectdomain(); >> + *domain = vm_domain_rr_selectdomain(vi->domain); >> vi->n--; >> break; >> case VM_POLICY_ROUND_ROBIN: >> default: >> - *domain = vm_domain_rr_selectdomain(); >> + *domain = vm_domain_rr_selectdomain(-1); >> vi->n--; >> break; >> } >> From owner-svn-src-head@freebsd.org Mon Jan 11 19:09:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B455DA6C5D7; Mon, 11 Jan 2016 19:09:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x236.google.com (mail-ig0-x236.google.com [IPv6:2607:f8b0:4001:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 853691D7E; Mon, 11 Jan 2016 19:09:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x236.google.com with SMTP id mw1so116945745igb.1; Mon, 11 Jan 2016 11:09:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=+AD/xWH5Qu5aBat6RzxnmMqWFrGUBlCcIgq5CeG6mCI=; b=AqMRS4Y70n6R6R2QMzKKavW1bcBfbSw3qHGXfpKbJ9wPT+zWcFtLUqU5Ake3VG7jU1 zB3VmR9A0UpZS2gYSHZJxpk1T3x/om78in+O857vGrKnx8y/uslUbMEWPhuXlYF0ymen Qvqd87PXHQ3Nld9J689n7abDA7PdF4TZsgtuqVu3dd0WBX4vHvw6L+Z5xKbxWnBkrI0N hdeBS4A/DF9YGbMpzeVtbKJrZVlwOa5vs3hw0u+ljEI6YWe32GrM4zLyx5WtCrVjTRgL GtYNtf4MSIhO+TTacUuDcuhDgA8jMq24680F+xCpQpcfGNEmITNx/0RkxNK40xAoguy8 Sa7A== MIME-Version: 1.0 X-Received: by 10.50.122.100 with SMTP id lr4mr2001049igb.37.1452539377970; Mon, 11 Jan 2016 11:09:37 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.121.202 with HTTP; Mon, 11 Jan 2016 11:09:37 -0800 (PST) In-Reply-To: References: <201601101753.u0AHrhSJ099996@repo.freebsd.org> Date: Mon, 11 Jan 2016 11:09:37 -0800 X-Google-Sender-Auth: GUoiJbyc9rVmBxDhDtRgiebOIeo Message-ID: Subject: Re: svn commit: r293640 - head/sys/vm From: Adrian Chadd To: cem@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 19:09:38 -0000 Sorry, to be clear - it fixes one of the things that lead to that panic. There are other issues (eg highly memory unbalanced workloads) that may trigger this, but the initial issue from peter was fixed. -a From owner-svn-src-head@freebsd.org Mon Jan 11 19:14:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90E5EA6C7ED; Mon, 11 Jan 2016 19:14:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6905A129D; Mon, 11 Jan 2016 19:14:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BJEu5A063072; Mon, 11 Jan 2016 19:14:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BJEuTc063068; Mon, 11 Jan 2016 19:14:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601111914.u0BJEuTc063068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 11 Jan 2016 19:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293680 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 19:14:57 -0000 Author: pfg Date: Mon Jan 11 19:14:55 2016 New Revision: 293680 URL: https://svnweb.freebsd.org/changeset/base/293680 Log: ext4: add support for reading sparse files Add support for sparse files in ext4. Also implement read-ahead, which greatly increases the performance when transferring files from ext4. Both features implemented by Damjan Jovanovic. PR: 205816 MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_extents.h head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Mon Jan 11 18:11:06 2016 (r293679) +++ head/sys/fs/ext2fs/ext2_bmap.c Mon Jan 11 19:14:55 2016 (r293680) @@ -102,9 +102,6 @@ ext4_bmapext(struct vnode *vp, int32_t b fs = ip->i_e2fs; lbn = bn; - /* - * TODO: need to implement read ahead to improve the performance. - */ if (runp != NULL) *runp = 0; @@ -112,15 +109,25 @@ ext4_bmapext(struct vnode *vp, int32_t b *runb = 0; ext4_ext_find_extent(fs, ip, lbn, &path); - ep = path.ep_ext; - if (ep == NULL) - ret = EIO; - else { - *bnp = fsbtodb(fs, lbn - ep->e_blk + - (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); + if (path.ep_is_sparse) { + *bnp = -1; + if (runp != NULL) + *runp = path.ep_sparse_ext.e_len - + (lbn - path.ep_sparse_ext.e_blk) - 1; + } else { + ep = path.ep_ext; + if (ep == NULL) + ret = EIO; + else { + *bnp = fsbtodb(fs, lbn - ep->e_blk + + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); - if (*bnp == 0) - *bnp = -1; + if (*bnp == 0) + *bnp = -1; + + if (runp != NULL) + *runp = ep->e_len - (lbn - ep->e_blk) - 1; + } } if (path.ep_bp != NULL) { Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Mon Jan 11 18:11:06 2016 (r293679) +++ head/sys/fs/ext2fs/ext2_extents.c Mon Jan 11 19:14:55 2016 (r293680) @@ -66,13 +66,14 @@ static void ext4_ext_binsearch(struct inode *ip, struct ext4_extent_path *path, daddr_t lbn) { struct ext4_extent_header *ehp = path->ep_header; - struct ext4_extent *l, *r, *m; + struct ext4_extent *first, *l, *r, *m; if (ehp->eh_ecount == 0) return; - l = (struct ext4_extent *)(char *)(ehp + 1); - r = (struct ext4_extent *)(char *)(ehp + 1) + ehp->eh_ecount - 1; + first = (struct ext4_extent *)(char *)(ehp + 1); + l = first; + r = first + ehp->eh_ecount - 1; while (l <= r) { m = l + (r - l) / 2; if (lbn < m->e_blk) @@ -81,7 +82,25 @@ ext4_ext_binsearch(struct inode *ip, str l = m + 1; } + if (l == first) { + path->ep_sparse_ext.e_blk = lbn; + path->ep_sparse_ext.e_len = first->e_blk - lbn; + path->ep_sparse_ext.e_start_hi = 0; + path->ep_sparse_ext.e_start_lo = 0; + path->ep_is_sparse = 1; + return; + } path->ep_ext = l - 1; + if (path->ep_ext->e_blk + path->ep_ext->e_len <= lbn) { + path->ep_sparse_ext.e_blk = lbn; + if (l <= (first + ehp->eh_ecount - 1)) + path->ep_sparse_ext.e_len = l->e_blk - lbn; + else // XXX: where does it end? + path->ep_sparse_ext.e_len = 1; + path->ep_sparse_ext.e_start_hi = 0; + path->ep_sparse_ext.e_start_lo = 0; + path->ep_is_sparse = 1; + } } /* @@ -169,6 +188,7 @@ ext4_ext_find_extent(struct m_ext2fs *fs path->ep_depth = i; path->ep_ext = NULL; path->ep_index = NULL; + path->ep_is_sparse = 0; ext4_ext_binsearch(ip, path, lbn); return (path); Modified: head/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.h Mon Jan 11 18:11:06 2016 (r293679) +++ head/sys/fs/ext2fs/ext2_extents.h Mon Jan 11 19:14:55 2016 (r293680) @@ -84,7 +84,11 @@ struct ext4_extent_cache { struct ext4_extent_path { uint16_t ep_depth; struct buf *ep_bp; - struct ext4_extent *ep_ext; + int ep_is_sparse; + union { + struct ext4_extent ep_sparse_ext; + struct ext4_extent *ep_ext; + }; struct ext4_extent_index *ep_index; struct ext4_extent_header *ep_header; }; Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Mon Jan 11 18:11:06 2016 (r293679) +++ head/sys/fs/ext2fs/ext2_vnops.c Mon Jan 11 19:14:55 2016 (r293680) @@ -1787,6 +1787,7 @@ ext2_ioctl(struct vop_ioctl_args *ap) static int ext4_ext_read(struct vop_read_args *ap) { + static unsigned char zeroes[EXT2_MAX_BLOCK_SIZE]; struct vnode *vp; struct inode *ip; struct uio *uio; @@ -1831,11 +1832,15 @@ ext4_ext_read(struct vop_read_args *ap) switch (cache_type) { case EXT4_EXT_CACHE_NO: ext4_ext_find_extent(fs, ip, lbn, &path); - ep = path.ep_ext; + if (path.ep_is_sparse) + ep = &path.ep_sparse_ext; + else + ep = path.ep_ext; if (ep == NULL) return (EIO); - ext4_ext_put_cache(ip, ep, EXT4_EXT_CACHE_IN); + ext4_ext_put_cache(ip, ep, + path.ep_is_sparse ? EXT4_EXT_CACHE_GAP : EXT4_EXT_CACHE_IN); newblk = lbn - ep->e_blk + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32); @@ -1848,7 +1853,7 @@ ext4_ext_read(struct vop_read_args *ap) case EXT4_EXT_CACHE_GAP: /* block has not been allocated yet */ - return (0); + break; case EXT4_EXT_CACHE_IN: newblk = lbn - nex.e_blk + (nex.e_start_lo | @@ -1859,24 +1864,34 @@ ext4_ext_read(struct vop_read_args *ap) panic("%s: invalid cache type", __func__); } - error = bread(ip->i_devvp, fsbtodb(fs, newblk), size, NOCRED, &bp); - if (error) { - brelse(bp); - return (error); - } + if (cache_type == EXT4_EXT_CACHE_GAP || + (cache_type == EXT4_EXT_CACHE_NO && path.ep_is_sparse)) { + if (xfersize > sizeof(zeroes)) + xfersize = sizeof(zeroes); + error = uiomove(zeroes, xfersize, uio); + if (error) + return (error); + } else { + error = bread(ip->i_devvp, fsbtodb(fs, newblk), size, + NOCRED, &bp); + if (error) { + brelse(bp); + return (error); + } - size -= bp->b_resid; - if (size < xfersize) { - if (size == 0) { - bqrelse(bp); - break; + size -= bp->b_resid; + if (size < xfersize) { + if (size == 0) { + bqrelse(bp); + break; + } + xfersize = size; } - xfersize = size; + error = uiomove(bp->b_data + blkoffset, xfersize, uio); + bqrelse(bp); + if (error) + return (error); } - error = uiomove(bp->b_data + blkoffset, (int)xfersize, uio); - bqrelse(bp); - if (error) - return (error); } return (0); From owner-svn-src-head@freebsd.org Mon Jan 11 19:19:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB5FFA6CA2D; Mon, 11 Jan 2016 19:19:31 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B67C1952; Mon, 11 Jan 2016 19:19:31 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x229.google.com with SMTP id g73so163210199ioe.3; Mon, 11 Jan 2016 11:19:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Nfcaxg4bS3Ks7SFLSXARnT3FnunK2D/rJhmEWX4xXtc=; b=ccsN1Yn2YC2MuUw/k4GC5OkfVNCNxeI9HZbWRZMGOsWJPSTcFkMagYBiywb03iTJI9 gaIxuI+RxvBdp94Md0rSNlMxLgm6C/JzzwLLk7jLXcNNTgk4yY1K2HHQhixEGZHYyA8B 379kYEBTQV3jvUWe77DQ6C1WopgbdjIQZCNme8mwr5SBXPlQMRbWQ0qvPCEAG9k/gEzU PpypuropdMJOyRXSwFkn9CCpm6F67Brr62DRzwsppeC53R/V8G3Olve/9CU+gSLE6I5V lXBmEAhLW8AfFllkMZbNMC2oVz87TYJaI6LTvC8byg4PcLYW5i8bXoUlO4BflXP/D5Dn 0Xyg== MIME-Version: 1.0 X-Received: by 10.107.11.162 with SMTP id 34mr110321401iol.165.1452539971008; Mon, 11 Jan 2016 11:19:31 -0800 (PST) Received: by 10.36.121.202 with HTTP; Mon, 11 Jan 2016 11:19:30 -0800 (PST) In-Reply-To: <201601111752.u0BHqgCE038958@repo.freebsd.org> References: <201601111752.u0BHqgCE038958@repo.freebsd.org> Date: Mon, 11 Jan 2016 11:19:30 -0800 Message-ID: Subject: Re: svn commit: r293674 - head/sys/dev/cxgbe From: Adrian Chadd To: Navdeep Parhar Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 19:19:31 -0000 wooo, thanks! -a On 11 January 2016 at 09:52, Navdeep Parhar wrote: > Author: np > Date: Mon Jan 11 17:52:42 2016 > New Revision: 293674 > URL: https://svnweb.freebsd.org/changeset/base/293674 > > Log: > cxgbe: bind the ithreads that handle NIC rx to the correct CPU if the kernel > is built with option RSS. > > Modified: > head/sys/dev/cxgbe/t4_main.c > > Modified: head/sys/dev/cxgbe/t4_main.c > ============================================================================== > --- head/sys/dev/cxgbe/t4_main.c Mon Jan 11 17:33:51 2016 (r293673) > +++ head/sys/dev/cxgbe/t4_main.c Mon Jan 11 17:52:42 2016 (r293674) > @@ -3642,6 +3642,9 @@ setup_intr_handlers(struct adapter *sc) > #ifdef DEV_NETMAP > struct sge_nm_rxq *nm_rxq; > #endif > +#ifdef RSS > + int nbuckets = rss_getnumbuckets(); > +#endif > > /* > * Setup interrupts. > @@ -3700,6 +3703,10 @@ setup_intr_handlers(struct adapter *sc) > t4_intr, rxq, s); > if (rc != 0) > return (rc); > +#ifdef RSS > + bus_bind_intr(sc->dev, irq->res, > + rss_getcpu(q % nbuckets)); > +#endif > irq++; > rid++; > vi->nintr++; > From owner-svn-src-head@freebsd.org Mon Jan 11 19:25:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55DC4A6CD0B; Mon, 11 Jan 2016 19:25:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 236AC127A; Mon, 11 Jan 2016 19:25:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BJPiOu066683; Mon, 11 Jan 2016 19:25:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BJPiDu066682; Mon, 11 Jan 2016 19:25:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601111925.u0BJPiDu066682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 11 Jan 2016 19:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293683 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 19:25:45 -0000 Author: pfg Date: Mon Jan 11 19:25:43 2016 New Revision: 293683 URL: https://svnweb.freebsd.org/changeset/base/293683 Log: ext4: mount panic from freeing invalid pointers Initialize the struct with those fields to zeroes on allocation, preventing the panic. Patch by: Damjan Jovanovic. PR: 206056 MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Mon Jan 11 19:22:58 2016 (r293682) +++ head/sys/fs/ext2fs/ext2_vfsops.c Mon Jan 11 19:25:43 2016 (r293683) @@ -590,7 +590,7 @@ ext2_mountfs(struct vnode *devvp, struct * while Linux keeps the super block in a locked buffer. */ ump->um_e2fs = malloc(sizeof(struct m_ext2fs), - M_EXT2MNT, M_WAITOK); + M_EXT2MNT, M_WAITOK | M_ZERO); ump->um_e2fs->e2fs = malloc(sizeof(struct ext2fs), M_EXT2MNT, M_WAITOK); mtx_init(EXT2_MTX(ump), "EXT2FS", "EXT2FS Lock", MTX_DEF); From owner-svn-src-head@freebsd.org Mon Jan 11 19:52:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3DA3A6B595; Mon, 11 Jan 2016 19:52:41 +0000 (UTC) (envelope-from ken@kdm.org) Received: from mithlond.kdm.org (mithlond.kdm.org [96.89.93.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "A1-33714", Issuer "A1-33714" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C6CF19D1; Mon, 11 Jan 2016 19:52:41 +0000 (UTC) (envelope-from ken@kdm.org) Received: from mithlond.kdm.org (localhost [127.0.0.1]) by mithlond.kdm.org (8.15.2/8.14.9) with ESMTPS id u0BJqWUY057393 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 11 Jan 2016 14:52:32 -0500 (EST) (envelope-from ken@mithlond.kdm.org) Received: (from ken@localhost) by mithlond.kdm.org (8.15.2/8.14.9/Submit) id u0BJqWRl057392; Mon, 11 Jan 2016 14:52:32 -0500 (EST) (envelope-from ken) Date: Mon, 11 Jan 2016 14:52:32 -0500 From: "Kenneth D. Merry" To: Roger Pau Monn?? Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, gibbs@freebsd.org Subject: Re: svn commit: r291716 - in head: share/man/man4 sys/cam sys/cam/ata sys/cam/scsi sys/dev/md sys/geom sys/kern sys/pc98/include sys/sys usr.sbin usr.sbin/camdd Message-ID: <20160111195231.GA57278@mithlond.kdm.org> References: <201512032054.tB3KsuUw037541@repo.freebsd.org> <5693E672.7080100@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5693E672.7080100@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mithlond.kdm.org [127.0.0.1]); Mon, 11 Jan 2016 14:52:32 -0500 (EST) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mithlond.kdm.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 19:52:41 -0000 On Mon, Jan 11, 2016 at 18:29:22 +0100, Roger Pau Monn?? wrote: > El 03/12/15 a les 21.54, Kenneth D. Merry ha escrit: > > Author: ken > > Date: Thu Dec 3 20:54:55 2015 > > New Revision: 291716 > > URL: https://svnweb.freebsd.org/changeset/base/291716 > > > > Log: > > Add asynchronous command support to the pass(4) driver, and the new > > camdd(8) utility. > > > > CCBs may be queued to the driver via the new CAMIOQUEUE ioctl, and > > completed CCBs may be retrieved via the CAMIOGET ioctl. User > > processes can use poll(2) or kevent(2) to get notification when > > I/O has completed. > > > > While the existing CAMIOCOMMAND blocking ioctl interface only > > supports user virtual data pointers in a CCB (generally only > > one per CCB), the new CAMIOQUEUE ioctl supports user virtual and > > physical address pointers, as well as user virtual and physical > > scatter/gather lists. This allows user applications to have more > > flexibility in their data handling operations. > > > > Kernel memory for data transferred via the queued interface is > > allocated from the zone allocator in MAXPHYS sized chunks, and user > > data is copied in and out. This is likely faster than the > > vmapbuf()/vunmapbuf() method used by the CAMIOCOMMAND ioctl in > > configurations with many processors (there are more TLB shootdowns > > caused by the mapping/unmapping operation) but may not be as fast > > as running with unmapped I/O. > > > > The new memory handling model for user requests also allows > > applications to send CCBs with request sizes that are larger than > > MAXPHYS. The pass(4) driver now limits queued requests to the I/O > > size listed by the SIM driver in the maxio field in the Path > > Inquiry (XPT_PATH_INQ) CCB. > > > > There are some things things would be good to add: > > > > 1. Come up with a way to do unmapped I/O on multiple buffers. > > Currently the unmapped I/O interface operates on a struct bio, > > which includes only one address and length. It would be nice > > to be able to send an unmapped scatter/gather list down to > > busdma. This would allow eliminating the copy we currently do > > for data. > > > > 2. Add an ioctl to list currently outstanding CCBs in the various > > queues. > > > > 3. Add an ioctl to cancel a request, or use the XPT_ABORT CCB to do > > that. > > > > 4. Test physical address support. Virtual pointers and scatter > > gather lists have been tested, but I have not yet tested > > physical addresses or scatter/gather lists. > > > > 5. Investigate multiple queue support. At the moment there is one > > queue of commands per pass(4) device. If multiple processes > > open the device, they will submit I/O into the same queue and > > get events for the same completions. This is probably the right > > model for most applications, but it is something that could be > > changed later on. > > > > Also, add a new utility, camdd(8) that uses the asynchronous pass(4) > > driver interface. > > > > This utility is intended to be a basic data transfer/copy utility, > > a simple benchmark utility, and an example of how to use the > > asynchronous pass(4) interface. > > > > It can copy data to and from pass(4) devices using any target queue > > depth, starting offset and blocksize for the input and ouptut devices. > > It currently only supports SCSI devices, but could be easily extended > > to support ATA devices. > > > > It can also copy data to and from regular files, block devices, tape > > devices, pipes, stdin, and stdout. It does not support queueing > > multiple commands to any of those targets, since it uses the standard > > read(2)/write(2)/writev(2)/readv(2) system calls. > > > > The I/O is done by two threads, one for the reader and one for the > > writer. The reader thread sends completed read requests to the > > writer thread in strictly sequential order, even if they complete > > out of order. That could be modified later on for random I/O patterns > > or slightly out of order I/O. > > > > camdd(8) uses kqueue(2)/kevent(2) to get I/O completion events from > > the pass(4) driver and also to send request notifications internally. > > > > For pass(4) devcies, camdd(8) uses a single buffer (CAM_DATA_VADDR) > > per CAM CCB on the reading side, and a scatter/gather list > > (CAM_DATA_SG) on the writing side. In addition to testing both > > interfaces, this makes any potential reblocking of I/O easier. No > > data is copied between the reader and the writer, but rather the > > reader's buffers are split into multiple I/O requests or combined > > into a single I/O request depending on the input and output blocksize. > > > > For the file I/O path, camdd(8) also uses a single buffer (read(2), > > write(2), pread(2) or pwrite(2)) on reads, and a scatter/gather list > > (readv(2), writev(2), preadv(2), pwritev(2)) on writes. > > > > Things that would be nice to do for camdd(8) eventually: > > > > 1. Add support for I/O pattern generation. Patterns like all > > zeros, all ones, LBA-based patterns, random patterns, etc. Right > > Now you can always use /dev/zero, /dev/random, etc. > > > > 2. Add support for a "sink" mode, so we do only reads with no > > writes. Right now, you can use /dev/null. > > > > 3. Add support for automatic queue depth probing, so that we can > > figure out the right queue depth on the input and output side > > for maximum throughput. At the moment it defaults to 6. > > > > 4. Add support for SATA device passthrough I/O. > > > > 5. Add support for random LBAs and/or lengths on the input and > > output sides. > > > > 6. Track average per-I/O latency and busy time. The busy time > > and latency could also feed in to the automatic queue depth > > determination. > > > > sys/cam/scsi/scsi_pass.h: > > Define two new ioctls, CAMIOQUEUE and CAMIOGET, that queue > > and fetch asynchronous CAM CCBs respectively. > > > > Although these ioctls do not have a declared argument, they > > both take a union ccb pointer. If we declare a size here, > > the ioctl code in sys/kern/sys_generic.c will malloc and free > > a buffer for either the CCB or the CCB pointer (depending on > > how it is declared). Since we have to keep a copy of the > > CCB (which is fairly large) anyway, having the ioctl malloc > > and free a CCB for each call is wasteful. > > > > sys/cam/scsi/scsi_pass.c: > > Add asynchronous CCB support. > > > > Add two new ioctls, CAMIOQUEUE and CAMIOGET. > > > > CAMIOQUEUE adds a CCB to the incoming queue. The CCB is > > executed immediately (and moved to the active queue) if it > > is an immediate CCB, but otherwise it will be executed > > in passstart() when a CCB is available from the transport layer. > > > > When CCBs are completed (because they are immediate or > > passdone() if they are queued), they are put on the done > > queue. > > > > If we get the final close on the device before all pending > > I/O is complete, all active I/O is moved to the abandoned > > queue and we increment the peripheral reference count so > > that the peripheral driver instance doesn't go away before > > all pending I/O is done. > > > > The new passcreatezone() function is called on the first > > call to the CAMIOQUEUE ioctl on a given device to allocate > > the UMA zones for I/O requests and S/G list buffers. This > > may be good to move off to a taskqueue at some point. > > The new passmemsetup() function allocates memory and > > scatter/gather lists to hold the user's data, and copies > > in any data that needs to be written. For virtual pointers > > (CAM_DATA_VADDR), the kernel buffer is malloced from the > > new pass(4) driver malloc bucket. For virtual > > scatter/gather lists (CAM_DATA_SG), buffers are allocated > > from a new per-pass(9) UMA zone in MAXPHYS-sized chunks. > > Physical pointers are passed in unchanged. We have support > > for up to 16 scatter/gather segments (for the user and > > kernel S/G lists) in the default struct pass_io_req, so > > requests with longer S/G lists require an extra kernel malloc. > > > > The new passcopysglist() function copies a user scatter/gather > > list to a kernel scatter/gather list. The number of elements > > in each list may be different, but (obviously) the amount of data > > stored has to be identical. > > > > The new passmemdone() function copies data out for the > > CAM_DATA_VADDR and CAM_DATA_SG cases. > > > > The new passiocleanup() function restores data pointers in > > user CCBs and frees memory. > > > > Add new functions to support kqueue(2)/kevent(2): > > > > passreadfilt() tells kevent whether or not the done > > queue is empty. > > > > passkqfilter() adds a knote to our list. > > > > passreadfiltdetach() removes a knote from our list. > > > > Add a new function, passpoll(), for poll(2)/select(2) > > to use. > > > > Add devstat(9) support for the queued CCB path. > > > > sys/cam/ata/ata_da.c: > > Add support for the BIO_VLIST bio type. > > > > sys/cam/cam_ccb.h: > > Add a new enumeration for the xflags field in the CCB header. > > (This doesn't change the CCB header, just adds an enumeration to > > use.) > > > > sys/cam/cam_xpt.c: > > Add a new function, xpt_setup_ccb_flags(), that allows specifying > > CCB flags. > > > > sys/cam/cam_xpt.h: > > Add a prototype for xpt_setup_ccb_flags(). > > > > sys/cam/scsi/scsi_da.c: > > Add support for BIO_VLIST. > > > > sys/dev/md/md.c: > > Add BIO_VLIST support to md(4). > > > > sys/geom/geom_disk.c: > > Add BIO_VLIST support to the GEOM disk class. Re-factor the I/O size > > limiting code in g_disk_start() a bit. > > > > sys/kern/subr_bus_dma.c: > > Change _bus_dmamap_load_vlist() to take a starting offset and > > length. > > > > Add a new function, _bus_dmamap_load_pages(), that will load a list > > of physical pages starting at an offset. > > (cannot comment inline because the diff is truncated, sorry). > > This is bogus, and defeats the purpose of _bus_dmamap_load_ma by > reintroducing the mechanics already found in bus_dmamap_load_ma_triv. > See r290610, which was the commit that introduced a proper > implementation of bus_dmamap_load_ma in x86. > > The problem with the approach taken both in _bus_dmamap_load_pages and > bus_dmamap_load_ma_triv is that they split the request buffer into > arbitrary chunks based on page boundaries, creating segments that no > longer have a size that's a multiple of the sector size. This breaks > drivers like blkfront (and probably other stuff). Sorry, the breakage was an oversight. As for the history here, gibbs@ originally introduced the load_pages() function into the Spectra tree in October 2014. But he was doing development on a tree that did not yet have _bus_dmamap_load_ma(). He did something similar to that, and just chose a different name -- _bus_dmamap_load_pages(). I obviously didn't pay enough attention when putting into the tree. > The following patch solves the problem AFAICT, and I would like to > commit it ASAP: I think this should be fine. > Roger. > --- > diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > index ae30276..cdf176b 100644 > --- a/sys/kern/subr_bus_dma.c > +++ b/sys/kern/subr_bus_dma.c > @@ -131,28 +131,6 @@ _bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, > } > > /* > - * Load tlen data starting at offset within a region specified by a list of > - * physical pages. > - */ > -static int > -_bus_dmamap_load_pages(bus_dma_tag_t dmat, bus_dmamap_t map, > - vm_page_t *pages, bus_size_t tlen, int offset, int *nsegs, int flags) > -{ > - vm_paddr_t paddr; > - bus_size_t len; > - int error, i; > - > - for (i = 0, error = 0; error == 0 && tlen > 0; i++, tlen -= len) { > - len = min(PAGE_SIZE - offset, tlen); > - paddr = VM_PAGE_TO_PHYS(pages[i]) + offset; > - error = _bus_dmamap_load_phys(dmat, map, paddr, len, > - flags, NULL, nsegs); > - offset = 0; > - } > - return (error); > -} > - > -/* > * Load from block io. > */ > static int > @@ -168,8 +146,8 @@ _bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio *bio, > } > > if ((bio->bio_flags & BIO_UNMAPPED) != 0) > - return (_bus_dmamap_load_pages(dmat, map, bio->bio_ma, > - bio->bio_bcount, bio->bio_ma_offset, nsegs, flags)); > + return (_bus_dmamap_load_ma(dmat, map, bio->bio_ma, > + bio->bio_bcount, bio->bio_ma_offset, flags, NULL, nsegs)); > > return (_bus_dmamap_load_buffer(dmat, map, bio->bio_data, > bio->bio_bcount, kernel_pmap, flags, NULL, nsegs)); > > > > Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-head@freebsd.org Mon Jan 11 20:27:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77215A6C1C8; Mon, 11 Jan 2016 20:27:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47DC1180C; Mon, 11 Jan 2016 20:27:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BKR51N085403; Mon, 11 Jan 2016 20:27:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BKR54F085402; Mon, 11 Jan 2016 20:27:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601112027.u0BKR54F085402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 11 Jan 2016 20:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293697 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 20:27:06 -0000 Author: bdrewery Date: Mon Jan 11 20:27:05 2016 New Revision: 293697 URL: https://svnweb.freebsd.org/changeset/base/293697 Log: Correct a comment. Submitted by: jhb Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jan 11 20:25:41 2016 (r293696) +++ head/Makefile.inc1 Mon Jan 11 20:27:05 2016 (r293697) @@ -569,7 +569,7 @@ _worldtmp: .PHONY .endif .else rm -rf ${WORLDTMP}/legacy/usr/include -# XXX - These three can depend on any header file. +# XXX - These can depend on any header file. rm -f ${OBJTREE}${.CURDIR}/lib/libsysdecode/ioctl.c rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c .endif From owner-svn-src-head@freebsd.org Mon Jan 11 20:38:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BD66A6C5A4; Mon, 11 Jan 2016 20:38:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35AB31DEA; Mon, 11 Jan 2016 20:38:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BKcdUM088421; Mon, 11 Jan 2016 20:38:39 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BKcdhW088420; Mon, 11 Jan 2016 20:38:39 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201601112038.u0BKcdhW088420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Mon, 11 Jan 2016 20:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293698 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 20:38:40 -0000 Author: cperciva Date: Mon Jan 11 20:38:39 2016 New Revision: 293698 URL: https://svnweb.freebsd.org/changeset/base/293698 Log: Fix a bug introduced in r291716: "The problem with the approach taken both in _bus_dmamap_load_pages and bus_dmamap_load_ma_triv is that they split the request buffer into arbitrary chunks based on page boundaries, creating segments that no longer have a size that's a multiple of the sector size. This breaks drivers like blkfront (and probably other stuff)." [1] This was most easily triggered by running `fsck /` on a system running in Xen (e.g. Amazon EC2) but also showed up via growfs(8) and probably many other userland tools which access the disk directly. Patch by: royger [1] "Thinks this should be fine" by: ken Modified: head/sys/kern/subr_bus_dma.c Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Mon Jan 11 20:27:05 2016 (r293697) +++ head/sys/kern/subr_bus_dma.c Mon Jan 11 20:38:39 2016 (r293698) @@ -131,28 +131,6 @@ _bus_dmamap_load_mbuf_sg(bus_dma_tag_t d } /* - * Load tlen data starting at offset within a region specified by a list of - * physical pages. - */ -static int -_bus_dmamap_load_pages(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_page_t *pages, bus_size_t tlen, int offset, int *nsegs, int flags) -{ - vm_paddr_t paddr; - bus_size_t len; - int error, i; - - for (i = 0, error = 0; error == 0 && tlen > 0; i++, tlen -= len) { - len = min(PAGE_SIZE - offset, tlen); - paddr = VM_PAGE_TO_PHYS(pages[i]) + offset; - error = _bus_dmamap_load_phys(dmat, map, paddr, len, - flags, NULL, nsegs); - offset = 0; - } - return (error); -} - -/* * Load from block io. */ static int @@ -168,8 +146,8 @@ _bus_dmamap_load_bio(bus_dma_tag_t dmat, } if ((bio->bio_flags & BIO_UNMAPPED) != 0) - return (_bus_dmamap_load_pages(dmat, map, bio->bio_ma, - bio->bio_bcount, bio->bio_ma_offset, nsegs, flags)); + return (_bus_dmamap_load_ma(dmat, map, bio->bio_ma, + bio->bio_bcount, bio->bio_ma_offset, flags, NULL, nsegs)); return (_bus_dmamap_load_buffer(dmat, map, bio->bio_data, bio->bio_bcount, kernel_pmap, flags, NULL, nsegs)); From owner-svn-src-head@freebsd.org Mon Jan 11 20:41:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49515A6C829 for ; Mon, 11 Jan 2016 20:41:50 +0000 (UTC) (envelope-from bounces+73574-9504-svn-src-head=freebsd.org@sendgrid.net) Received: from o1.l99.sendgrid.net (o1.l99.sendgrid.net [198.37.153.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D41AA1132 for ; Mon, 11 Jan 2016 20:41:49 +0000 (UTC) (envelope-from bounces+73574-9504-svn-src-head=freebsd.org@sendgrid.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=subject:to:references:cc:from:mime-version:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=e8OMU17vIPqgu96U+T2jR5ScGGo=; b=PCh+Lk66WWHM0v311E lxwoFetuOYXi+AxtW5H/AEXpxxyyuN+5mo8U536ks9yeJCc4RdmyFaeyDzSC84I/ nZ7wMlpW9GIMY6ou2Y6+pWzjhR+1JSWXycDKgAaBCOSdp5eacr7DSblElHDkoUtK j4HDcRWSk5aw15KS8y4Fra1FA= Received: by filter0478p1mdw1.sendgrid.net with SMTP id filter0478p1mdw1.30897.5694138731 2016-01-11 20:41:43.524039636 +0000 UTC Received: from mail.tarsnap.com (ec2-54-86-246-204.compute-1.amazonaws.com [54.86.246.204]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id Fib0tL2IQOaI7LP1Ex1NVg for ; Mon, 11 Jan 2016 20:41:43.673 +0000 (UTC) Received: (qmail 19167 invoked from network); 11 Jan 2016 20:39:21 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 11 Jan 2016 20:39:21 -0000 Received: (qmail 78906 invoked from network); 11 Jan 2016 20:40:47 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 11 Jan 2016 20:40:47 -0000 Subject: Re: svn commit: r291716 - in head: share/man/man4 sys/cam sys/cam/ata sys/cam/scsi sys/dev/md sys/geom sys/kern sys/pc98/include sys/sys usr.sbin usr.sbin/camdd To: "Kenneth D. Merry" , Roger Pau Monn?? References: <201512032054.tB3KsuUw037541@repo.freebsd.org> <5693E672.7080100@FreeBSD.org> <20160111195231.GA57278@mithlond.kdm.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, gibbs@freebsd.org From: Colin Percival Message-ID: <5694134F.6070201@freebsd.org> Date: Mon, 11 Jan 2016 12:40:47 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20160111195231.GA57278@mithlond.kdm.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SG-EID: EvYvoie/qnEezyq2t4eRKjDm9X7ZKbCMt75WvXA+XNHW8m7n/0njMHTwfEXAMzwsZ0Ui4LkItG8Lv1 dHbEL1bHgXtC6Ke0yr3/RYaNZER6b0rSJy0uB9rxy6OoWJvuw6oUfc43uZ+HA0mWhoKc+ci0jQGKE2 XhpHh3vso11KCe+tGdpqQxCoYyilPQJE9XQGij3eAjwRoUy9WLLICSwtt9cRaJ+RUxSN6IybLmtEke M= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 20:41:50 -0000 On 01/11/16 11:52, Kenneth D. Merry wrote: > On Mon, Jan 11, 2016 at 18:29:22 +0100, Roger Pau Monn?? wrote: >> The following patch solves the problem AFAICT, and I would like to >> commit it ASAP: > > I think this should be fine. In light of the "ASAP" and the hour in Roger's part of the world (and the fact that this was obstructing other work I want to do today) I committed this fix as r293698 after experimental confirmation that it fixes what I was seeing. Thank you both for the quick investigation! -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Mon Jan 11 21:02:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51798A6B1E2; Mon, 11 Jan 2016 21:02:32 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2072F1F28; Mon, 11 Jan 2016 21:02:32 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BL2ViE096797; Mon, 11 Jan 2016 21:02:31 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BL2VZA096796; Mon, 11 Jan 2016 21:02:31 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201601112102.u0BL2VZA096796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Mon, 11 Jan 2016 21:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293700 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 21:02:32 -0000 Author: cperciva Date: Mon Jan 11 21:02:30 2016 New Revision: 293700 URL: https://svnweb.freebsd.org/changeset/base/293700 Log: Add two more assertions to catch busdma problems. Each segment provided by busdma to the blkfront driver must be an integer number of sectors, and must be aligned in memory on a "sector" boundary. Having these assertions yesterday would have made finding the bug fixed in r293698 somewhat easier. Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Mon Jan 11 20:55:52 2016 (r293699) +++ head/sys/dev/xen/blkfront/blkfront.c Mon Jan 11 21:02:30 2016 (r293700) @@ -170,6 +170,11 @@ xbd_mksegarray(bus_dma_segment_t *segs, int ref; while (sg < last_block_sg) { + KASSERT(segs->ds_addr % (1 << XBD_SECTOR_SHFT) == 0, + ("XEN disk driver I/O must be sector aligned")); + KASSERT(segs->ds_len % (1 << XBD_SECTOR_SHFT) == 0, + ("XEN disk driver I/Os must be a multiple of " + "the sector length")); buffer_ma = segs->ds_addr; fsect = (buffer_ma & PAGE_MASK) >> XBD_SECTOR_SHFT; lsect = fsect + (segs->ds_len >> XBD_SECTOR_SHFT) - 1; From owner-svn-src-head@freebsd.org Mon Jan 11 21:56:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24DB6A6C706; Mon, 11 Jan 2016 21:56:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC64D10CC; Mon, 11 Jan 2016 21:56:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BLusbf012835; Mon, 11 Jan 2016 21:56:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BLus2L012834; Mon, 11 Jan 2016 21:56:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601112156.u0BLus2L012834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 11 Jan 2016 21:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293704 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 21:56:55 -0000 Author: ngie Date: Mon Jan 11 21:56:53 2016 New Revision: 293704 URL: https://svnweb.freebsd.org/changeset/base/293704 Log: Fix theoretical leak of netconfig(3) resources in svcunix_create(..) In the event that the getconfig(3) call in svcunix_create is partly successful, some of the netconfig(3) resources allocated might be leaked if the call returns NULL as endnetconfig(3) wasn't called explicitly in that case. Ensure that the resources are fully cleaned up by going to the `done` label, which will call endnetconfig(3) for us. MFC after: 1 week Reported by: Coverity Submitted by: Miles Ohlrich Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/rpc/rpc_soc.c Modified: head/lib/libc/rpc/rpc_soc.c ============================================================================== --- head/lib/libc/rpc/rpc_soc.c Mon Jan 11 21:46:37 2016 (r293703) +++ head/lib/libc/rpc/rpc_soc.c Mon Jan 11 21:56:53 2016 (r293704) @@ -483,7 +483,7 @@ svcunix_create(int sock, u_int sendsize, break; } if (nconf == NULL) - return(xprt); + goto done; if ((sock = __rpc_nconf2fd(nconf)) < 0) goto done; From owner-svn-src-head@freebsd.org Mon Jan 11 22:01:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3DDBA6C968; Mon, 11 Jan 2016 22:01:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A59A413A0; Mon, 11 Jan 2016 22:01:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BM1XE0013047; Mon, 11 Jan 2016 22:01:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BM1XNf013046; Mon, 11 Jan 2016 22:01:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601112201.u0BM1XNf013046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 11 Jan 2016 22:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293705 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 22:01:34 -0000 Author: ngie Date: Mon Jan 11 22:01:33 2016 New Revision: 293705 URL: https://svnweb.freebsd.org/changeset/base/293705 Log: Similar to r293704, fix theoretical leak of netconfig(3) resources in __rpcbind_is_up(..) if getnetconfig(3) is partly successful in allocating resources, but not completely successful by moving the endnetconfig(3) call up before we return from the function if nconf == NULL. MFC after: 1 week Reported by: Coverity Submitted by: Miles Ohlrich Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/rpc/rpcb_clnt.c Modified: head/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- head/lib/libc/rpc/rpcb_clnt.c Mon Jan 11 21:56:53 2016 (r293704) +++ head/lib/libc/rpc/rpcb_clnt.c Mon Jan 11 22:01:33 2016 (r293705) @@ -661,11 +661,11 @@ __rpcbind_is_up(void) strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0) break; } + endnetconfig(localhandle); + if (nconf == NULL) return (FALSE); - endnetconfig(localhandle); - memset(&sun, 0, sizeof sun); sock = _socket(AF_LOCAL, SOCK_STREAM, 0); if (sock < 0) From owner-svn-src-head@freebsd.org Mon Jan 11 22:15:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0DE8A6CDCD; Mon, 11 Jan 2016 22:15:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A22491E3A; Mon, 11 Jan 2016 22:15:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BMFk4a018700; Mon, 11 Jan 2016 22:15:46 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BMFkhq018699; Mon, 11 Jan 2016 22:15:46 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201601112215.u0BMFkhq018699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 11 Jan 2016 22:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293708 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 22:15:47 -0000 Author: asomers Date: Mon Jan 11 22:15:46 2016 New Revision: 293708 URL: https://svnweb.freebsd.org/changeset/base/293708 Log: Fix importing l2arc device by guid After r292066, vdev_geom verifies both the vdev and pool guids of device labels during open. However, spare and l2arc devices don't have pool guids, so opening them by guid will fail (opening by path, when the pathname is known, still succeeds). This change allows a vdev to be opened by guid if the label contains no pool_guid, which is the case for inactive spares and l2arc devices. PR: 292066 Reported by: delphij Reviewed by: delphij, smh MFC after: 2 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4861 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Jan 11 22:11:20 2016 (r293707) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Jan 11 22:15:46 2016 (r293708) @@ -594,7 +594,15 @@ vdev_geom_attach_by_guids(vdev_t *vd) vdev_geom_read_guids(zcp, &pguid, &vguid); g_topology_lock(); vdev_geom_detach_taster(zcp); - if (pguid != spa_guid(vd->vdev_spa) || + /* + * Check that the label's vdev guid matches the + * desired guid. If the label has a pool guid, + * check that it matches too. (Inactive spares + * and L2ARCs do not have any pool guid in the + * label.) + */ + if ((pguid != 0 && + pguid != spa_guid(vd->vdev_spa)) || vguid != vd->vdev_guid) continue; cp = vdev_geom_attach(pp, vd); From owner-svn-src-head@freebsd.org Mon Jan 11 22:16:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F38DA6CE17; Mon, 11 Jan 2016 22:16:16 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E6821FB1; Mon, 11 Jan 2016 22:16:16 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id ADE115A9F13; Mon, 11 Jan 2016 22:16:14 +0000 (UTC) Date: Mon, 11 Jan 2016 22:16:14 +0000 From: Brooks Davis To: Dimitry Andric Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293068 - in head/etc: . mtree Message-ID: <20160111221614.GC79262@spindle.one-eyed-alien.net> References: <201601030432.u034W6en043633@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TRYliJ5NKNqkz5bu" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 22:16:16 -0000 --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 03, 2016 at 06:41:33PM +0100, Dimitry Andric wrote: > On 03 Jan 2016, at 05:32, Warner Losh wrote: > >=20 > > Author: imp > > Date: Sun Jan 3 04:32:05 2016 > > New Revision: 293068 > > URL: https://svnweb.freebsd.org/changeset/base/293068 > >=20 > > Log: > > Add libsoft to the tree, just like lib32. >=20 > Hmm, are there going to be more of these "multilib" things? :) We'll want to do something about supporting hard float on MIPS. Over there it may be more of a TARGET_ARCH thing, but libsoft might be useful. We've also got a libcheri in CheriBSD and will eventually need to do a lib64 as we explore the switch from CHERI-when-requested to CHERI-by-default. -- Brooks --TRYliJ5NKNqkz5bu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWlCmuAAoJEKzQXbSebgfA2IMH/joLQQauDo5M0vl9EEI2Fy7T 5yg2Y59oqnzbOGEi5WsswXiHb5ee6aU35IEx+O9VHCagylEzgkL6infqlDA3XfDk FnWPJgFywcJQBmz2MQ2kQ03UnpetdQrfpKUyZ0DbdaOrC3WU36pGOKd77Kl1HDKy /aTqFSRL/DsWdgqhfITd3vMvY16zW9bRyuXVwUEgOdoeqX2X041Oe5lA0LinVN+7 6WqHbmv5gdm0d9sGTttznEJMH0fBRXOFhP/pHJz4F1kh6LohXGyQsKw5T4ua/j6o JPc8gFPKu1UUO/QFNGhz2o/H5PoM1b15cx4K6ELZOput4+Aw/VXsDRLj5Z7yMMc= =xF3n -----END PGP SIGNATURE----- --TRYliJ5NKNqkz5bu-- From owner-svn-src-head@freebsd.org Mon Jan 11 23:14:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9290A6C674 for ; Mon, 11 Jan 2016 23:14:40 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x236.google.com (mail-oi0-x236.google.com [IPv6:2607:f8b0:4003:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 752C410F7 for ; Mon, 11 Jan 2016 23:14:40 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x236.google.com with SMTP id k206so61529809oia.1 for ; Mon, 11 Jan 2016 15:14:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:cc:content-type; bh=HquYO11oSDYd5Nc7TMUPgIosx0SFZwoFKYBy5sKwNc4=; b=U34MFw/WPjo2S4LNzYmve7tUDVm9D3cbJ9ZQTyitcX7FMhu6SpeYzABlY6IjTnDhY/ hgqNxsXgrQgQwk+bhhUyPVf8qteZmAePNOZKigE24UzD71dDNQ9zQ2Vig9/3yyx5nXJY Geb3larWIOsUdMBJMuZQU2F3MLlGA6IWtwKbnIr5sCwXxNla/DSUQc4E/o8ZRLNCBHNS WFDYmuEgBPWlb+aViCkCZIcfDtzKE95xYzbY8r2V6uFXUkEIOb1eIaE12M9Zs23Y9i9h Tk7inMUfJ9dOH/TzXdPl7L2G1s/LP5UuFbjvuK3kTrodm5YdRx1yMWgs1jritWvgHEFP US7g== MIME-Version: 1.0 X-Received: by 10.202.208.65 with SMTP id h62mt102398258oig.57.1452554079895; Mon, 11 Jan 2016 15:14:39 -0800 (PST) Sender: asomers@gmail.com Received: by 10.202.69.84 with HTTP; Mon, 11 Jan 2016 15:14:39 -0800 (PST) In-Reply-To: <201601112215.u0BMFkhq018699@repo.freebsd.org> References: <201601112215.u0BMFkhq018699@repo.freebsd.org> Date: Mon, 11 Jan 2016 16:14:39 -0700 X-Google-Sender-Auth: G_3LELhmOwmk_dXo2zaU00aiFjc Message-ID: Subject: Re: svn commit: r293708 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Alan Somers Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 23:14:40 -0000 I referenced the wrong PR. The correct PR is 205882. On Mon, Jan 11, 2016 at 3:15 PM, Alan Somers wrote: > Author: asomers > Date: Mon Jan 11 22:15:46 2016 > New Revision: 293708 > URL: https://svnweb.freebsd.org/changeset/base/293708 > > Log: > Fix importing l2arc device by guid > > After r292066, vdev_geom verifies both the vdev and pool guids of device > labels during open. However, spare and l2arc devices don't have pool guids, > so opening them by guid will fail (opening by path, when the pathname is > known, still succeeds). This change allows a vdev to be opened by guid if > the label contains no pool_guid, which is the case for inactive spares and > l2arc devices. > > PR: 292066 > Reported by: delphij > Reviewed by: delphij, smh > MFC after: 2 weeks > Sponsored by: Spectra Logic Corp > Differential Revision: https://reviews.freebsd.org/D4861 > From owner-svn-src-head@freebsd.org Tue Jan 12 00:12:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F17B4A6CD97; Tue, 12 Jan 2016 00:12:19 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1B56136A; Tue, 12 Jan 2016 00:12:19 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C0CIrd053925; Tue, 12 Jan 2016 00:12:18 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C0CIbS053924; Tue, 12 Jan 2016 00:12:18 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601120012.u0C0CIbS053924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 12 Jan 2016 00:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293714 - head/sys/dev/rtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 00:12:20 -0000 Author: avos Date: Tue Jan 12 00:12:18 2016 New Revision: 293714 URL: https://svnweb.freebsd.org/changeset/base/293714 Log: rtwn: import r290022 (do not filter out control frames in the RX path) Tested by: kevlo Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4838 Modified: head/sys/dev/rtwn/if_rtwn.c Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Tue Jan 12 00:07:26 2016 (r293713) +++ head/sys/dev/rtwn/if_rtwn.c Tue Jan 12 00:12:18 2016 (r293714) @@ -1438,7 +1438,7 @@ rtwn_rx_frame(struct rtwn_softc *sc, str struct rtwn_rx_data *rx_data, int desc_idx) { struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211_frame *wh; + struct ieee80211_frame_min *wh; struct ieee80211_node *ni; struct r92c_rx_phystat *phy = NULL; uint32_t rxdw0, rxdw3; @@ -1462,7 +1462,8 @@ rtwn_rx_frame(struct rtwn_softc *sc, str } pktlen = MS(rxdw0, R92C_RXDW0_PKTLEN); - if (__predict_false(pktlen < sizeof(*wh) || pktlen > MCLBYTES)) { + if (__predict_false(pktlen < sizeof(struct ieee80211_frame_ack) || + pktlen > MCLBYTES)) { counter_u64_add(ic->ic_ierrors, 1); return; } @@ -1554,10 +1555,13 @@ rtwn_rx_frame(struct rtwn_softc *sc, str } RTWN_UNLOCK(sc); - wh = mtod(m, struct ieee80211_frame *); + wh = mtod(m, struct ieee80211_frame_min *); + if (m->m_len >= sizeof(*wh)) + ni = ieee80211_find_rxnode(ic, wh); + else + ni = NULL; /* Send the frame to the 802.11 layer. */ - ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); if (ni != NULL) { (void)ieee80211_input(ni, m, rssi - nf, nf); /* Node is no longer needed. */ From owner-svn-src-head@freebsd.org Tue Jan 12 00:20:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EBB4A6B2BF; Tue, 12 Jan 2016 00:20:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D48E1A83; Tue, 12 Jan 2016 00:20:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C0Kvbt054249; Tue, 12 Jan 2016 00:20:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C0KvlA054248; Tue, 12 Jan 2016 00:20:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601120020.u0C0KvlA054248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 12 Jan 2016 00:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293715 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 00:20:58 -0000 Author: ngie Date: Tue Jan 12 00:20:57 2016 New Revision: 293715 URL: https://svnweb.freebsd.org/changeset/base/293715 Log: Fix a mismerge from NetBSD in r162194 with `xdr_rpcb_entry_list_ptr(..)` This fixes the potential NULL pointer dereference properly, and also fixes memory leaks encountered in the process of iterating through `*rp`. MFC after: 1 week Found by: Valgrind Reported by: Dan Roberts Submitted by: Miles Ohlrich Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/rpc/rpcb_prot.c Modified: head/lib/libc/rpc/rpcb_prot.c ============================================================================== --- head/lib/libc/rpc/rpcb_prot.c Tue Jan 12 00:12:18 2016 (r293714) +++ head/lib/libc/rpc/rpcb_prot.c Tue Jan 12 00:20:57 2016 (r293715) @@ -207,14 +207,14 @@ xdr_rpcb_entry_list_ptr(XDR *xdrs, rpcb_ * the case of freeing we must remember the next object * before we free the current object ... */ - if (freeing) + if (freeing && *rp) next = (*rp)->rpcb_entry_next; if (! xdr_reference(xdrs, (caddr_t *)rp, (u_int)sizeof (rpcb_entry_list), (xdrproc_t)xdr_rpcb_entry)) { return (FALSE); } - if (freeing && *rp) { + if (freeing) { next_copy = next; rp = &next_copy; /* From owner-svn-src-head@freebsd.org Tue Jan 12 00:24:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD27BA6B52D; Tue, 12 Jan 2016 00:24:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A80621DF5; Tue, 12 Jan 2016 00:24:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C0OeHC056977; Tue, 12 Jan 2016 00:24:40 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C0Oe6Z056975; Tue, 12 Jan 2016 00:24:40 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601120024.u0C0Oe6Z056975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 12 Jan 2016 00:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293716 - in head/sys/dev: iwn wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 00:24:42 -0000 Author: avos Date: Tue Jan 12 00:24:40 2016 New Revision: 293716 URL: https://svnweb.freebsd.org/changeset/base/293716 Log: wpi, iwn: implement ic_getradiocaps method This will allow to restore channel list after switching interface to more restrictive regdomain. Tested with Intel 3945BG (wpi) only. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4863 Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Tue Jan 12 00:20:57 2016 (r293715) +++ head/sys/dev/iwn/if_iwn.c Tue Jan 12 00:24:40 2016 (r293716) @@ -177,11 +177,15 @@ static void iwn4965_print_power_group(st #endif static void iwn5000_read_eeprom(struct iwn_softc *); static uint32_t iwn_eeprom_channel_flags(struct iwn_eeprom_chan *); -static void iwn_read_eeprom_band(struct iwn_softc *, int); -static void iwn_read_eeprom_ht40(struct iwn_softc *, int); +static void iwn_read_eeprom_band(struct iwn_softc *, int, int, int *, + struct ieee80211_channel[]); +static void iwn_read_eeprom_ht40(struct iwn_softc *, int, int, int *, + struct ieee80211_channel[]); static void iwn_read_eeprom_channels(struct iwn_softc *, int, uint32_t); static struct iwn_eeprom_chan *iwn_find_eeprom_channel(struct iwn_softc *, struct ieee80211_channel *); +static void iwn_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static int iwn_setregdomain(struct ieee80211com *, struct ieee80211_regdomain *, int, struct ieee80211_channel[]); @@ -666,6 +670,7 @@ iwn_attach(device_t dev) ic->ic_set_channel = iwn_set_channel; ic->ic_scan_curchan = iwn_scan_curchan; ic->ic_scan_mindwell = iwn_scan_mindwell; + ic->ic_getradiocaps = iwn_getradiocaps; ic->ic_setregdomain = iwn_setregdomain; iwn_radiotap_attach(sc); @@ -2371,9 +2376,9 @@ iwn_eeprom_channel_flags(struct iwn_eepr } static void -iwn_read_eeprom_band(struct iwn_softc *sc, int n) +iwn_read_eeprom_band(struct iwn_softc *sc, int n, int maxchans, int *nchans, + struct ieee80211_channel chans[]) { - struct ieee80211com *ic = &sc->sc_ic; struct iwn_eeprom_chan *channels = sc->eeprom_channels[n]; const struct iwn_chan_band *band = &iwn_bands[n]; struct ieee80211_channel *c; @@ -2390,10 +2395,14 @@ iwn_read_eeprom_band(struct iwn_softc *s channels[i].maxpwr); continue; } + + if (*nchans >= maxchans) + break; + chan = band->chan[i]; nflags = iwn_eeprom_channel_flags(&channels[i]); - c = &ic->ic_channels[ic->ic_nchans++]; + c = &chans[(*nchans)++]; c->ic_ieee = chan; c->ic_maxregpower = channels[i].maxpwr; c->ic_maxpower = 2*c->ic_maxregpower; @@ -2402,7 +2411,11 @@ iwn_read_eeprom_band(struct iwn_softc *s c->ic_freq = ieee80211_ieee2mhz(chan, IEEE80211_CHAN_G); /* G =>'s B is supported */ c->ic_flags = IEEE80211_CHAN_B | nflags; - c = &ic->ic_channels[ic->ic_nchans++]; + + if (*nchans >= maxchans) + break; + + c = &chans[(*nchans)++]; c[0] = c[-1]; c->ic_flags = IEEE80211_CHAN_G | nflags; } else { /* 5GHz band */ @@ -2418,8 +2431,11 @@ iwn_read_eeprom_band(struct iwn_softc *s channels[i].flags, channels[i].maxpwr); if (sc->sc_flags & IWN_FLAG_HAS_11N) { + if (*nchans >= maxchans) + break; + /* add HT20, HT40 added separately */ - c = &ic->ic_channels[ic->ic_nchans++]; + c = &chans[(*nchans)++]; c[0] = c[-1]; c->ic_flags |= IEEE80211_CHAN_HT20; } @@ -2430,7 +2446,8 @@ iwn_read_eeprom_band(struct iwn_softc *s } static void -iwn_read_eeprom_ht40(struct iwn_softc *sc, int n) +iwn_read_eeprom_ht40(struct iwn_softc *sc, int n, int maxchans, int *nchans, + struct ieee80211_channel chans[]) { struct ieee80211com *ic = &sc->sc_ic; struct iwn_eeprom_chan *channels = sc->eeprom_channels[n]; @@ -2454,6 +2471,10 @@ iwn_read_eeprom_ht40(struct iwn_softc *s channels[i].maxpwr); continue; } + + if (*nchans + 1 >= maxchans) + break; + chan = band->chan[i]; nflags = iwn_eeprom_channel_flags(&channels[i]); @@ -2481,12 +2502,12 @@ iwn_read_eeprom_ht40(struct iwn_softc *s "add ht40 chan %d flags 0x%x maxpwr %d\n", chan, channels[i].flags, channels[i].maxpwr); - c = &ic->ic_channels[ic->ic_nchans++]; + c = &chans[(*nchans)++]; c[0] = cent[0]; c->ic_extieee = extc->ic_ieee; c->ic_flags &= ~IEEE80211_CHAN_HT; c->ic_flags |= IEEE80211_CHAN_HT40U | nflags; - c = &ic->ic_channels[ic->ic_nchans++]; + c = &chans[(*nchans)++]; c[0] = extc[0]; c->ic_extieee = cent->ic_ieee; c->ic_flags &= ~IEEE80211_CHAN_HT; @@ -2505,10 +2526,13 @@ iwn_read_eeprom_channels(struct iwn_soft iwn_read_prom_data(sc, addr, &sc->eeprom_channels[n], iwn_bands[n].nchan * sizeof (struct iwn_eeprom_chan)); - if (n < 5) - iwn_read_eeprom_band(sc, n); - else - iwn_read_eeprom_ht40(sc, n); + if (n < 5) { + iwn_read_eeprom_band(sc, n, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); + } else { + iwn_read_eeprom_ht40(sc, n, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); + } ieee80211_sort_channels(ic->ic_channels, ic->ic_nchans); } @@ -2538,6 +2562,20 @@ iwn_find_eeprom_channel(struct iwn_softc return NULL; } +static void +iwn_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + struct iwn_softc *sc = ic->ic_softc; + int i; + + /* Parse the list of authorized channels. */ + for (i = 0; i < 5 && *nchans < maxchans; i++) + iwn_read_eeprom_band(sc, i, maxchans, nchans, chans); + for (i = 5; i < IWN_NBANDS - 1 && *nchans < maxchans; i++) + iwn_read_eeprom_ht40(sc, i, maxchans, nchans, chans); +} + /* * Enforce flags read from EEPROM. */ Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Tue Jan 12 00:20:57 2016 (r293715) +++ head/sys/dev/wpi/if_wpi.c Tue Jan 12 00:24:40 2016 (r293716) @@ -166,10 +166,13 @@ static void wpi_free_tx_ring(struct wpi_ static int wpi_read_eeprom(struct wpi_softc *, uint8_t macaddr[IEEE80211_ADDR_LEN]); static uint32_t wpi_eeprom_channel_flags(struct wpi_eeprom_chan *); -static void wpi_read_eeprom_band(struct wpi_softc *, uint8_t); +static void wpi_read_eeprom_band(struct wpi_softc *, uint8_t, int, int *, + struct ieee80211_channel[]); static int wpi_read_eeprom_channels(struct wpi_softc *, uint8_t); static struct wpi_eeprom_chan *wpi_find_eeprom_channel(struct wpi_softc *, struct ieee80211_channel *); +static void wpi_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static int wpi_setregdomain(struct ieee80211com *, struct ieee80211_regdomain *, int, struct ieee80211_channel[]); @@ -516,6 +519,7 @@ wpi_attach(device_t dev) ic->ic_set_channel = wpi_set_channel; ic->ic_scan_curchan = wpi_scan_curchan; ic->ic_scan_mindwell = wpi_scan_mindwell; + ic->ic_getradiocaps = wpi_getradiocaps; ic->ic_setregdomain = wpi_setregdomain; sc->sc_update_rx_ring = wpi_update_rx_ring; @@ -1417,9 +1421,9 @@ wpi_eeprom_channel_flags(struct wpi_eepr } static void -wpi_read_eeprom_band(struct wpi_softc *sc, uint8_t n) +wpi_read_eeprom_band(struct wpi_softc *sc, uint8_t n, int maxchans, + int *nchans, struct ieee80211_channel chans[]) { - struct ieee80211com *ic = &sc->sc_ic; struct wpi_eeprom_chan *channels = sc->eeprom_channels[n]; const struct wpi_chan_band *band = &wpi_bands[n]; struct ieee80211_channel *c; @@ -1434,10 +1438,13 @@ wpi_read_eeprom_band(struct wpi_softc *s continue; } + if (*nchans >= maxchans) + break; + chan = band->chan[i]; nflags = wpi_eeprom_channel_flags(&channels[i]); - c = &ic->ic_channels[ic->ic_nchans++]; + c = &chans[(*nchans)++]; c->ic_ieee = chan; c->ic_maxregpower = channels[i].maxpwr; c->ic_maxpower = 2*c->ic_maxregpower; @@ -1448,7 +1455,11 @@ wpi_read_eeprom_band(struct wpi_softc *s /* G =>'s B is supported */ c->ic_flags = IEEE80211_CHAN_B | nflags; - c = &ic->ic_channels[ic->ic_nchans++]; + + if (*nchans >= maxchans) + break; + + c = &chans[(*nchans)++]; c[0] = c[-1]; c->ic_flags = IEEE80211_CHAN_G | nflags; } else { /* 5GHz band */ @@ -1465,7 +1476,7 @@ wpi_read_eeprom_band(struct wpi_softc *s "adding chan %d (%dMHz) flags=0x%x maxpwr=%d passive=%d," " offset %d\n", chan, c->ic_freq, channels[i].flags, sc->maxpwr[chan], - IEEE80211_IS_CHAN_PASSIVE(c), ic->ic_nchans); + IEEE80211_IS_CHAN_PASSIVE(c), *nchans); } } @@ -1489,7 +1500,8 @@ wpi_read_eeprom_channels(struct wpi_soft return error; } - wpi_read_eeprom_band(sc, n); + wpi_read_eeprom_band(sc, n, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ieee80211_sort_channels(ic->ic_channels, ic->ic_nchans); @@ -1511,6 +1523,18 @@ wpi_find_eeprom_channel(struct wpi_softc return NULL; } +static void +wpi_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + struct wpi_softc *sc = ic->ic_softc; + int i; + + /* Parse the list of authorized channels. */ + for (i = 0; i < WPI_CHAN_BANDS_COUNT && *nchans < maxchans; i++) + wpi_read_eeprom_band(sc, i, maxchans, nchans, chans); +} + /* * Enforce flags read from EEPROM. */ From owner-svn-src-head@freebsd.org Tue Jan 12 01:30:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C979A6CB14; Tue, 12 Jan 2016 01:30:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4949E1ABE; Tue, 12 Jan 2016 01:30:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C1UqLK074727; Tue, 12 Jan 2016 01:30:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C1UpvA074721; Tue, 12 Jan 2016 01:30:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601120130.u0C1UpvA074721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 12 Jan 2016 01:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293719 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 01:30:53 -0000 Author: sephe Date: Tue Jan 12 01:30:51 2016 New Revision: 293719 URL: https://svnweb.freebsd.org/changeset/base/293719 Log: hyperv/hn: Implement LRO - Implement the LRO using tcp_lro APIs, and LRO is enabled by default. - Add several stats sysctl nodes. - Check IP/TCP length before sending the packet to tcp_lro_rx(), if host does not provide RX csum information (*); and add an option through sysctl to always trust host TCP segment csum checks (default is off). - Add sysctl to control the LRO entry depth; it is disabled by default. It is used to avoid holding too much TCP segments in driver. Limiting the LRO entry depth helps a lot in a one/two streams RX test. This one 3x the RX performance on my local test (3Gbps -> 10Gbps), and ~2x the RX performance over a directly connected 40Ge network (5Gbps -> 9Gbps). (*) It seems the host stops supplying csum information, once the network load is high. This still needs investigation... Reviewed by: Hongjiang Zhang , Dexuan Cui , Jun Su , delphij Tested by: me (local), Hongjiang Zhang (directly connected 40Ge) Approved by: delphij (mentor), adrian (mentor, no objection) With feedback from: delphij, Hongjiang Zhang Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4824 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Jan 12 01:23:45 2016 (r293718) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Jan 12 01:30:51 2016 (r293719) @@ -919,6 +919,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st */ hv_nv_on_receive_completion(device, vm_xfer_page_pkt->d.transaction_id, status); + hv_rf_receive_rollup(net_dev); } /* Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Jan 12 01:23:45 2016 (r293718) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Jan 12 01:30:51 2016 (r293719) @@ -43,6 +43,8 @@ #include #include #include +#include +#include #include @@ -993,6 +995,17 @@ typedef struct hn_softc { int temp_unusable; struct hv_device *hn_dev_obj; netvsc_dev *net_dev; + + struct lro_ctrl hn_lro; + int hn_lro_hiwat; + + /* Trust tcp segments verification on host side */ + int hn_trust_hosttcp; + + u_long hn_csum_ip; + u_long hn_csum_tcp; + u_long hn_csum_trusted; + u_long hn_lro_tried; } hn_softc_t; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jan 12 01:23:45 2016 (r293718) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jan 12 01:30:51 2016 (r293719) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -138,6 +139,15 @@ __FBSDID("$FreeBSD$"); CSUM_IP_ISCSI|CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP| \ CSUM_IP6_TSO|CSUM_IP6_ISCSI) +/* XXX move to netinet/tcp_lro.h */ +#define HN_LRO_HIWAT_MAX 65535 +#define HN_LRO_HIWAT_DEF HN_LRO_HIWAT_MAX +/* YYY 2*MTU is a bit rough, but should be good enough. */ +#define HN_LRO_HIWAT_MTULIM(ifp) (2 * (ifp)->if_mtu) +#define HN_LRO_HIWAT_ISVALID(sc, hiwat) \ + ((hiwat) >= HN_LRO_HIWAT_MTULIM((sc)->hn_ifp) || \ + (hiwat) <= HN_LRO_HIWAT_MAX) + /* * Data types */ @@ -171,6 +181,9 @@ int hv_promisc_mode = 0; /* normal mo /* The one and only one */ static struct hv_netvsc_driver_context g_netvsc_drv; +/* Trust tcp segements verification on host side. */ +static int hn_trust_hosttcp = 0; +TUNABLE_INT("dev.hn.trust_hosttcp", &hn_trust_hosttcp); /* * Forward declarations @@ -181,6 +194,19 @@ static void hn_ifinit(void *xsc); static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); static int hn_start_locked(struct ifnet *ifp); static void hn_start(struct ifnet *ifp); +#ifdef HN_LRO_HIWAT +static int hn_lro_hiwat_sysctl(SYSCTL_HANDLER_ARGS); +#endif +static int hn_check_iplen(const struct mbuf *, int); + +static __inline void +hn_set_lro_hiwat(struct hn_softc *sc, int hiwat) +{ + sc->hn_lro_hiwat = hiwat; +#ifdef HN_LRO_HIWAT + sc->hn_lro.lro_hiwat = sc->hn_lro_hiwat; +#endif +} /* * NetVsc get message transport protocol type @@ -310,6 +336,8 @@ netvsc_attach(device_t dev) hn_softc_t *sc; int unit = device_get_unit(dev); struct ifnet *ifp; + struct sysctl_oid_list *child; + struct sysctl_ctx_list *ctx; int ret; netvsc_init(); @@ -322,6 +350,8 @@ netvsc_attach(device_t dev) bzero(sc, sizeof(hn_softc_t)); sc->hn_unit = unit; sc->hn_dev = dev; + sc->hn_lro_hiwat = HN_LRO_HIWAT_DEF; + sc->hn_trust_hosttcp = hn_trust_hosttcp; NV_LOCK_INIT(sc, "NetVSCLock"); @@ -349,9 +379,11 @@ netvsc_attach(device_t dev) */ ifp->if_hdrlen = sizeof(struct ether_vlan_header); ifp->if_capabilities |= - IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO; + IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO | + IFCAP_LRO; ifp->if_capenable |= - IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO; + IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO | + IFCAP_LRO; /* * Only enable UDP checksum offloading when it is on 2012R2 or * later. UDP checksum offloading doesn't work on earlier @@ -372,8 +404,59 @@ netvsc_attach(device_t dev) sc->hn_carrier = 1; } + tcp_lro_init(&sc->hn_lro); + /* Driver private LRO settings */ + sc->hn_lro.ifp = ifp; +#ifdef HN_LRO_HIWAT + sc->hn_lro.lro_hiwat = sc->hn_lro_hiwat; +#endif + ether_ifattach(ifp, device_info.mac_addr); + ctx = device_get_sysctl_ctx(dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "lro_queued", + CTLFLAG_RW, &sc->hn_lro.lro_queued, 0, "LRO queued"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "lro_flushed", + CTLFLAG_RW, &sc->hn_lro.lro_flushed, 0, "LRO flushed"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "lro_tried", + CTLFLAG_RW, &sc->hn_lro_tried, "# of LRO tries"); +#ifdef HN_LRO_HIWAT + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_hiwat", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_lro_hiwat_sysctl, + "I", "LRO high watermark"); +#endif + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "trust_hosttcp", + CTLFLAG_RW, &sc->hn_trust_hosttcp, 0, + "Trust tcp segement verification on host side, " + "when csum info is missing"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_ip", + CTLFLAG_RW, &sc->hn_csum_ip, "RXCSUM IP"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_tcp", + CTLFLAG_RW, &sc->hn_csum_tcp, "RXCSUM TCP"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_trusted", + CTLFLAG_RW, &sc->hn_csum_trusted, + "# of TCP segements that we trust host's csum verification"); + + if (unit == 0) { + struct sysctl_ctx_list *dc_ctx; + struct sysctl_oid_list *dc_child; + devclass_t dc; + + /* + * Add sysctl nodes for devclass + */ + dc = device_get_devclass(dev); + dc_ctx = devclass_get_sysctl_ctx(dc); + dc_child = SYSCTL_CHILDREN(devclass_get_sysctl_tree(dc)); + + SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "trust_hosttcp", + CTLFLAG_RD, &hn_trust_hosttcp, 0, + "Trust tcp segement verification on host side, " + "when csum info is missing (global setting)"); + } + return (0); } @@ -383,6 +466,7 @@ netvsc_attach(device_t dev) static int netvsc_detach(device_t dev) { + struct hn_softc *sc = device_get_softc(dev); struct hv_device *hv_device = vmbus_get_devctx(dev); if (bootverbose) @@ -401,6 +485,8 @@ netvsc_detach(device_t dev) hv_rf_on_device_remove(hv_device, HV_RF_NV_DESTROY_CHANNEL); + tcp_lro_free(&sc->hn_lro); + return (0); } @@ -887,7 +973,7 @@ netvsc_recv(struct hv_device *device_ctx struct mbuf *m_new; struct ifnet *ifp; device_t dev = device_ctx->device; - int size; + int size, do_lro = 0; if (sc == NULL) { return (0); /* TODO: KYS how can this be! */ @@ -938,6 +1024,7 @@ netvsc_recv(struct hv_device *device_ctx if (csum_info->receive.ip_csum_succeeded) { m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); + sc->hn_csum_ip++; } /* TCP csum offload */ @@ -945,9 +1032,50 @@ netvsc_recv(struct hv_device *device_ctx m_new->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; + sc->hn_csum_tcp++; } - } + if (csum_info->receive.ip_csum_succeeded && + csum_info->receive.tcp_csum_succeeded) + do_lro = 1; + } else { + const struct ether_header *eh; + uint16_t etype; + int hoff; + + hoff = sizeof(*eh); + if (m_new->m_len < hoff) + goto skip; + eh = mtod(m_new, struct ether_header *); + etype = ntohs(eh->ether_type); + if (etype == ETHERTYPE_VLAN) { + const struct ether_vlan_header *evl; + + hoff = sizeof(*evl); + if (m_new->m_len < hoff) + goto skip; + evl = mtod(m_new, struct ether_vlan_header *); + etype = ntohs(evl->evl_proto); + } + + if (etype == ETHERTYPE_IP) { + int pr; + + pr = hn_check_iplen(m_new, hoff); + if (pr == IPPROTO_TCP) { + if (sc->hn_trust_hosttcp) { + sc->hn_csum_trusted++; + m_new->m_pkthdr.csum_flags |= + (CSUM_IP_CHECKED | CSUM_IP_VALID | + CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + m_new->m_pkthdr.csum_data = 0xffff; + } + /* Rely on SW csum verification though... */ + do_lro = 1; + } + } + } +skip: if ((packet->vlan_tci != 0) && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { m_new->m_pkthdr.ether_vtag = packet->vlan_tci; @@ -961,12 +1089,37 @@ netvsc_recv(struct hv_device *device_ctx if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + if ((ifp->if_capenable & IFCAP_LRO) && do_lro) { + struct lro_ctrl *lro = &sc->hn_lro; + + if (lro->lro_cnt) { + sc->hn_lro_tried++; + if (tcp_lro_rx(lro, m_new, 0) == 0) { + /* DONE! */ + return 0; + } + } + } + /* We're not holding the lock here, so don't release it */ (*ifp->if_input)(ifp, m_new); return (0); } +void +netvsc_recv_rollup(struct hv_device *device_ctx) +{ + hn_softc_t *sc = device_get_softc(device_ctx->device); + struct lro_ctrl *lro = &sc->hn_lro; + struct lro_entry *queued; + + while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { + SLIST_REMOVE_HEAD(&lro->lro_active, next); + tcp_lro_flush(lro, queued); + } +} + /* * Rules for using sc->temp_unusable: * 1. sc->temp_unusable can only be read or written while holding NV_LOCK() @@ -1022,7 +1175,13 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, /* Obtain and record requested MTU */ ifp->if_mtu = ifr->ifr_mtu; - + /* + * Make sure that LRO high watermark is still valid, + * after MTU change (the 2*MTU limit). + */ + if (!HN_LRO_HIWAT_ISVALID(sc, sc->hn_lro_hiwat)) + hn_set_lro_hiwat(sc, HN_LRO_HIWAT_MTULIM(ifp)); + do { NV_LOCK(sc); if (!sc->temp_unusable) { @@ -1147,6 +1306,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, ifp->if_capenable |= IFCAP_RXCSUM; } } + if (mask & IFCAP_LRO) + ifp->if_capenable ^= IFCAP_LRO; if (mask & IFCAP_TSO4) { ifp->if_capenable ^= IFCAP_TSO4; @@ -1292,6 +1453,102 @@ hn_watchdog(struct ifnet *ifp) } #endif +#ifdef HN_LRO_HIWAT +static int +hn_lro_hiwat_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int hiwat, error; + + hiwat = sc->hn_lro_hiwat; + error = sysctl_handle_int(oidp, &hiwat, 0, req); + if (error || req->newptr == NULL) + return error; + + if (!HN_LRO_HIWAT_ISVALID(sc, hiwat)) + return EINVAL; + + if (sc->hn_lro_hiwat != hiwat) + hn_set_lro_hiwat(sc, hiwat); + return 0; +} +#endif /* HN_LRO_HIWAT */ + +static int +hn_check_iplen(const struct mbuf *m, int hoff) +{ + const struct ip *ip; + int len, iphlen, iplen; + const struct tcphdr *th; + int thoff; /* TCP data offset */ + + len = hoff + sizeof(struct ip); + + /* The packet must be at least the size of an IP header. */ + if (m->m_pkthdr.len < len) + return IPPROTO_DONE; + + /* The fixed IP header must reside completely in the first mbuf. */ + if (m->m_len < len) + return IPPROTO_DONE; + + ip = mtodo(m, hoff); + + /* Bound check the packet's stated IP header length. */ + iphlen = ip->ip_hl << 2; + if (iphlen < sizeof(struct ip)) /* minimum header length */ + return IPPROTO_DONE; + + /* The full IP header must reside completely in the one mbuf. */ + if (m->m_len < hoff + iphlen) + return IPPROTO_DONE; + + iplen = ntohs(ip->ip_len); + + /* + * Check that the amount of data in the buffers is as + * at least much as the IP header would have us expect. + */ + if (m->m_pkthdr.len < hoff + iplen) + return IPPROTO_DONE; + + /* + * Ignore IP fragments. + */ + if (ntohs(ip->ip_off) & (IP_OFFMASK | IP_MF)) + return IPPROTO_DONE; + + /* + * The TCP/IP or UDP/IP header must be entirely contained within + * the first fragment of a packet. + */ + switch (ip->ip_p) { + case IPPROTO_TCP: + if (iplen < iphlen + sizeof(struct tcphdr)) + return IPPROTO_DONE; + if (m->m_len < hoff + iphlen + sizeof(struct tcphdr)) + return IPPROTO_DONE; + th = (const struct tcphdr *)((const uint8_t *)ip + iphlen); + thoff = th->th_off << 2; + if (thoff < sizeof(struct tcphdr) || thoff + iphlen > iplen) + return IPPROTO_DONE; + if (m->m_len < hoff + iphlen + thoff) + return IPPROTO_DONE; + break; + case IPPROTO_UDP: + if (iplen < iphlen + sizeof(struct udphdr)) + return IPPROTO_DONE; + if (m->m_len < hoff + iphlen + sizeof(struct udphdr)) + return IPPROTO_DONE; + break; + default: + if (iplen < iphlen) + return IPPROTO_DONE; + break; + } + return ip->ip_p; +} + static device_method_t netvsc_methods[] = { /* Device interface */ DEVMETHOD(device_probe, netvsc_probe), Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Tue Jan 12 01:23:45 2016 (r293718) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Tue Jan 12 01:30:51 2016 (r293719) @@ -1049,6 +1049,7 @@ typedef struct rndismp_rx_bufs_info_ { int netvsc_recv(struct hv_device *device_ctx, netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info); +void netvsc_recv_rollup(struct hv_device *device_ctx); void* hv_set_rppi_data(rndis_msg *rndis_mesg, uint32_t rppi_size, Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Jan 12 01:23:45 2016 (r293718) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Jan 12 01:30:51 2016 (r293719) @@ -963,3 +963,14 @@ hv_rf_on_send_request_halt_completion(vo request->halt_complete_flag = 1; } +/* + * RNDIS filter when "all" reception is done + */ +void +hv_rf_receive_rollup(netvsc_dev *net_dev) +{ + rndis_device *rndis_dev; + + rndis_dev = (rndis_device *)net_dev->extension; + netvsc_recv_rollup(rndis_dev->net_dev->dev); +} Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Tue Jan 12 01:23:45 2016 (r293718) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Tue Jan 12 01:30:51 2016 (r293719) @@ -98,6 +98,7 @@ typedef struct rndis_device_ { int hv_rf_on_receive(netvsc_dev *net_dev, struct hv_device *device, netvsc_packet *pkt); +void hv_rf_receive_rollup(netvsc_dev *net_dev); int hv_rf_on_device_add(struct hv_device *device, void *additl_info); int hv_rf_on_device_remove(struct hv_device *device, boolean_t destroy_channel); int hv_rf_on_open(struct hv_device *device); From owner-svn-src-head@freebsd.org Tue Jan 12 01:41:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C55DA6CE77; Tue, 12 Jan 2016 01:41:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13E8B101C; Tue, 12 Jan 2016 01:41:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C1fZIa080239; Tue, 12 Jan 2016 01:41:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C1fYbC080237; Tue, 12 Jan 2016 01:41:34 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601120141.u0C1fYbC080237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 12 Jan 2016 01:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293720 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 01:41:36 -0000 Author: sephe Date: Tue Jan 12 01:41:34 2016 New Revision: 293720 URL: https://svnweb.freebsd.org/changeset/base/293720 Log: hyperv/hn: Implement SIOC[SG]IFMEDIA support Many applications and kernel modules (e.g. bridge) rely on the ifmedia status report; give them what they want. Submitted by: Dexuan Cui Reviewed by: Jun Su , me, adrian Modified by: me (minor) Original differential: https://reviews.freebsd.org/D4611 Differential Revision: https://reviews.freebsd.org/D4852 Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Jan 12 01:30:51 2016 (r293719) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Jan 12 01:41:34 2016 (r293720) @@ -43,9 +43,13 @@ #include #include #include + #include #include +#include +#include + #include MALLOC_DECLARE(M_NETVSC); @@ -985,6 +989,7 @@ typedef struct { */ typedef struct hn_softc { struct ifnet *hn_ifp; + struct ifmedia hn_media; device_t hn_dev; uint8_t hn_unit; int hn_carrier; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jan 12 01:30:51 2016 (r293719) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jan 12 01:41:34 2016 (r293720) @@ -194,6 +194,8 @@ static void hn_ifinit(void *xsc); static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); static int hn_start_locked(struct ifnet *ifp); static void hn_start(struct ifnet *ifp); +static int hn_ifmedia_upd(struct ifnet *ifp); +static void hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); #ifdef HN_LRO_HIWAT static int hn_lro_hiwat_sysctl(SYSCTL_HANDLER_ARGS); #endif @@ -264,6 +266,29 @@ static uint32_t get_transport_proto_type return (ret_val); } +static int +hn_ifmedia_upd(struct ifnet *ifp __unused) +{ + + return EOPNOTSUPP; +} + +static void +hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct hn_softc *sc = ifp->if_softc; + + ifmr->ifm_status = IFM_AVALID; + ifmr->ifm_active = IFM_ETHER; + + if (!sc->hn_carrier) { + ifmr->ifm_active |= IFM_NONE; + return; + } + ifmr->ifm_status |= IFM_ACTIVE; + ifmr->ifm_active |= IFM_10G_T | IFM_FDX; +} + /* * NetVsc driver initialization * Note: Filter init is no longer required @@ -374,6 +399,12 @@ netvsc_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = 511; IFQ_SET_READY(&ifp->if_snd); + ifmedia_init(&sc->hn_media, 0, hn_ifmedia_upd, hn_ifmedia_sts); + ifmedia_add(&sc->hn_media, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(&sc->hn_media, IFM_ETHER | IFM_AUTO); + /* XXX ifmedia_set really should do this for us */ + sc->hn_media.ifm_media = sc->hn_media.ifm_cur->ifm_media; + /* * Tell upper layers that we support full VLAN capability. */ @@ -485,6 +516,7 @@ netvsc_detach(device_t dev) hv_rf_on_device_remove(hv_device, HV_RF_NV_DESTROY_CHANNEL); + ifmedia_removeall(&sc->hn_media); tcp_lro_free(&sc->hn_lro); return (0); @@ -1332,10 +1364,11 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, error = 0; } #endif - /* FALLTHROUGH */ + error = EINVAL; + break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: - error = EINVAL; + error = ifmedia_ioctl(ifp, ifr, &sc->hn_media, cmd); break; default: error = ether_ioctl(ifp, cmd, data); From owner-svn-src-head@freebsd.org Tue Jan 12 01:50:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E48A1A6D3DD; Tue, 12 Jan 2016 01:50:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1D5717B6; Tue, 12 Jan 2016 01:50:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C1ouX3081394; Tue, 12 Jan 2016 01:50:56 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C1ouKM081392; Tue, 12 Jan 2016 01:50:56 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601120150.u0C1ouKM081392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 12 Jan 2016 01:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293721 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 01:50:58 -0000 Author: sephe Date: Tue Jan 12 01:50:56 2016 New Revision: 293721 URL: https://svnweb.freebsd.org/changeset/base/293721 Log: hyperv/hn: Avoid mbuf cluster allocation, if the packet is small. This one mainly avoids mbuf cluster allocation for TCP ACKs during TCP sending tests. And it gives me ~200Mbps improvement (4.7Gbps -> 4.9Gbps), when running iperf3 TCP sending test w/ 16 connections. While I'm here, nuke the unnecessary zeroing out pkthdr.csum_flags. Reviewed by: adrain Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4853 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Jan 12 01:41:34 2016 (r293720) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Jan 12 01:50:56 2016 (r293721) @@ -1011,6 +1011,7 @@ typedef struct hn_softc { u_long hn_csum_tcp; u_long hn_csum_trusted; u_long hn_lro_tried; + u_long hn_small_pkts; } hn_softc_t; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jan 12 01:41:34 2016 (r293720) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jan 12 01:50:56 2016 (r293721) @@ -469,6 +469,8 @@ netvsc_attach(device_t dev) SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_trusted", CTLFLAG_RW, &sc->hn_csum_trusted, "# of TCP segements that we trust host's csum verification"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "small_pkts", + CTLFLAG_RW, &sc->hn_small_pkts, "# of small packets received"); if (unit == 0) { struct sysctl_ctx_list *dc_ctx; @@ -1022,35 +1024,38 @@ netvsc_recv(struct hv_device *device_ctx */ if (packet->tot_data_buf_len > (ifp->if_mtu + ETHER_HDR_LEN)) { return (0); - } - - /* - * Get an mbuf with a cluster. For packets 2K or less, - * get a standard 2K cluster. For anything larger, get a - * 4K cluster. Any buffers larger than 4K can cause problems - * if looped around to the Hyper-V TX channel, so avoid them. - */ - size = MCLBYTES; - - if (packet->tot_data_buf_len > MCLBYTES) { - /* 4096 */ - size = MJUMPAGESIZE; - } + } else if (packet->tot_data_buf_len <= MHLEN) { + m_new = m_gethdr(M_NOWAIT, MT_DATA); + if (m_new == NULL) + return (0); + memcpy(mtod(m_new, void *), packet->data, + packet->tot_data_buf_len); + m_new->m_pkthdr.len = m_new->m_len = packet->tot_data_buf_len; + sc->hn_small_pkts++; + } else { + /* + * Get an mbuf with a cluster. For packets 2K or less, + * get a standard 2K cluster. For anything larger, get a + * 4K cluster. Any buffers larger than 4K can cause problems + * if looped around to the Hyper-V TX channel, so avoid them. + */ + size = MCLBYTES; + if (packet->tot_data_buf_len > MCLBYTES) { + /* 4096 */ + size = MJUMPAGESIZE; + } - m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, size); + m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, size); + if (m_new == NULL) { + device_printf(dev, "alloc mbuf failed.\n"); + return (0); + } - if (m_new == NULL) { - device_printf(dev, "alloc mbuf failed.\n"); - return (0); + hv_m_append(m_new, packet->tot_data_buf_len, packet->data); } - - hv_m_append(m_new, packet->tot_data_buf_len, - packet->data); - m_new->m_pkthdr.rcvif = ifp; /* receive side checksum offload */ - m_new->m_pkthdr.csum_flags = 0; if (NULL != csum_info) { /* IP csum offload */ if (csum_info->receive.ip_csum_succeeded) { From owner-svn-src-head@freebsd.org Tue Jan 12 01:55:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E922FA6D613; Tue, 12 Jan 2016 01:55:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A183C1AF4; Tue, 12 Jan 2016 01:55:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C1tvRr083541; Tue, 12 Jan 2016 01:55:57 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C1tvU9083540; Tue, 12 Jan 2016 01:55:57 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601120155.u0C1tvU9083540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 12 Jan 2016 01:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293722 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 01:55:59 -0000 Author: sephe Date: Tue Jan 12 01:55:57 2016 New Revision: 293722 URL: https://svnweb.freebsd.org/changeset/base/293722 Log: hyperv/hn: Removed unused netvsc_init() Submitted by: Dexuan Cui Reviewed by: me, adrian, royger, Hongjiang Zhang Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4594 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jan 12 01:50:56 2016 (r293721) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jan 12 01:55:57 2016 (r293722) @@ -149,14 +149,6 @@ __FBSDID("$FreeBSD$"); (hiwat) <= HN_LRO_HIWAT_MAX) /* - * Data types - */ - -struct hv_netvsc_driver_context { - uint32_t drv_inited; -}; - -/* * Be aware that this sleepable mutex will exhibit WITNESS errors when * certain TCP and ARP code paths are taken. This appears to be a * well-known condition, as all other drivers checked use a sleeping @@ -178,9 +170,6 @@ struct hv_netvsc_driver_context { int hv_promisc_mode = 0; /* normal mode by default */ -/* The one and only one */ -static struct hv_netvsc_driver_context g_netvsc_drv; - /* Trust tcp segements verification on host side. */ static int hn_trust_hosttcp = 0; TUNABLE_INT("dev.hn.trust_hosttcp", &hn_trust_hosttcp); @@ -289,37 +278,6 @@ hn_ifmedia_sts(struct ifnet *ifp, struct ifmr->ifm_active |= IFM_10G_T | IFM_FDX; } -/* - * NetVsc driver initialization - * Note: Filter init is no longer required - */ -static int -netvsc_drv_init(void) -{ - return (0); -} - -/* - * NetVsc global initialization entry point - */ -static void -netvsc_init(void) -{ - if (bootverbose) - printf("Netvsc initializing... "); - - /* - * XXXKYS: cleanup initialization - */ - if (!cold && !g_netvsc_drv.drv_inited) { - g_netvsc_drv.drv_inited = 1; - netvsc_drv_init(); - if (bootverbose) - printf("done!\n"); - } else if (bootverbose) - printf("Already initialized!\n"); -} - /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ static const hv_guid g_net_vsc_device_type = { .data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, @@ -365,8 +323,6 @@ netvsc_attach(device_t dev) struct sysctl_ctx_list *ctx; int ret; - netvsc_init(); - sc = device_get_softc(dev); if (sc == NULL) { return (ENOMEM); @@ -1608,6 +1564,3 @@ static devclass_t netvsc_devclass; DRIVER_MODULE(hn, vmbus, netvsc_driver, netvsc_devclass, 0, 0); MODULE_VERSION(hn, 1); MODULE_DEPEND(hn, vmbus, 1, 1, 1); -SYSINIT(netvsc_initx, SI_SUB_KTHREAD_IDLE, SI_ORDER_MIDDLE + 1, netvsc_init, - NULL); - From owner-svn-src-head@freebsd.org Tue Jan 12 02:17:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CAE9A6DC6C; Tue, 12 Jan 2016 02:17:45 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 280E015B5; Tue, 12 Jan 2016 02:17:45 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C2HiWE089730; Tue, 12 Jan 2016 02:17:44 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C2HdBC089684; Tue, 12 Jan 2016 02:17:39 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601120217.u0C2HdBC089684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Tue, 12 Jan 2016 02:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293724 - in head/sys/boot: arm64/libarm64 common efi/boot1 efi/fdt efi/include efi/include/arm64 efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 i... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 02:17:45 -0000 Author: smh Date: Tue Jan 12 02:17:39 2016 New Revision: 293724 URL: https://svnweb.freebsd.org/changeset/base/293724 Log: Enable warnings in EFI boot code Set WARNS if not set for EFI boot code and fix the issues highlighted by setting it. Most components are set to WARNS level 6 with few being left at lower levels due to the amount of changes needed to fix at higher levels. Error types fixed: * Missing / invalid casts * Missing inner structs * Unused vars * Missing static for internal only funcs * Missing prototypes * Alignment changes * Use of uninitialised vars * Unknown pragma (intrinsic) * Missing types etc due to missing includes * printf formatting types Reviewed by: emaste (in part) MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4839 Modified: head/sys/boot/arm64/libarm64/cache.c head/sys/boot/common/load_elf.c head/sys/boot/common/load_elf_obj.c head/sys/boot/common/misc.c head/sys/boot/common/module.c head/sys/boot/common/part.c head/sys/boot/common/self_reloc.c head/sys/boot/common/ufsread.c head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/fdt/Makefile head/sys/boot/efi/fdt/efi_fdt.c head/sys/boot/efi/include/arm64/efibind.h head/sys/boot/efi/include/efi_nii.h head/sys/boot/efi/include/efiapi.h head/sys/boot/efi/include/eficon.h head/sys/boot/efi/include/eficonsctl.h head/sys/boot/efi/include/efidevp.h head/sys/boot/efi/include/efierr.h head/sys/boot/efi/include/efifpswa.h head/sys/boot/efi/include/efigop.h head/sys/boot/efi/include/efilib.h head/sys/boot/efi/include/efinet.h head/sys/boot/efi/include/efipciio.h head/sys/boot/efi/include/efiprot.h head/sys/boot/efi/include/efipxebc.h head/sys/boot/efi/include/efiser.h head/sys/boot/efi/include/efiuga.h head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/libefi/efi_console.c head/sys/boot/efi/libefi/efipart.c head/sys/boot/efi/libefi/libefi.c head/sys/boot/efi/loader/Makefile head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c head/sys/boot/efi/loader/arch/amd64/framebuffer.c head/sys/boot/efi/loader/arch/arm/exec.c head/sys/boot/efi/loader/arch/arm64/exec.c head/sys/boot/efi/loader/autoload.c head/sys/boot/efi/loader/bootinfo.c head/sys/boot/efi/loader/copy.c head/sys/boot/efi/loader/devicename.c head/sys/boot/efi/loader/loader_efi.h head/sys/boot/efi/loader/main.c head/sys/boot/i386/libi386/smbios.c Modified: head/sys/boot/arm64/libarm64/cache.c ============================================================================== --- head/sys/boot/arm64/libarm64/cache.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/arm64/libarm64/cache.c Tue Jan 12 02:17:39 2016 (r293724) @@ -67,7 +67,7 @@ cpu_flush_dcache(const void *ptr, size_t cl_size = get_dcache_line_size(); /* Calculate end address to clean */ - end = (vm_offset_t)(ptr + len); + end = (vm_offset_t)ptr + (vm_offset_t)len; /* Align start address to cache line */ addr = (vm_offset_t)ptr; addr = rounddown2(addr, cl_size); Modified: head/sys/boot/common/load_elf.c ============================================================================== --- head/sys/boot/common/load_elf.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/common/load_elf.c Tue Jan 12 02:17:39 2016 (r293724) @@ -886,7 +886,7 @@ __elfN(parse_modmetadata)(struct preload error = __elfN(reloc_ptr)(fp, ef, v, &md, sizeof(md)); if (error == EOPNOTSUPP) { md.md_cval += ef->off; - md.md_data += ef->off; + md.md_data = (void *)((uintptr_t)md.md_data + ef->off); } else if (error != 0) return (error); #endif Modified: head/sys/boot/common/load_elf_obj.c ============================================================================== --- head/sys/boot/common/load_elf_obj.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/common/load_elf_obj.c Tue Jan 12 02:17:39 2016 (r293724) @@ -520,10 +520,8 @@ __elfN(obj_symaddr)(struct elf_file *ef, { Elf_Sym sym; Elf_Addr base; - int symcnt; - symcnt = ef->e_shdr[ef->symtabindex].sh_size / sizeof(Elf_Sym); - if (symidx >= symcnt) + if (symidx >= ef->e_shdr[ef->symtabindex].sh_size / sizeof(Elf_Sym)) return (0); COPYOUT(ef->e_shdr[ef->symtabindex].sh_addr + symidx * sizeof(Elf_Sym), &sym, sizeof(sym)); Modified: head/sys/boot/common/misc.c ============================================================================== --- head/sys/boot/common/misc.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/common/misc.c Tue Jan 12 02:17:39 2016 (r293724) @@ -118,7 +118,6 @@ kern_bzero(vm_offset_t dest, size_t len) int kern_pread(int fd, vm_offset_t dest, size_t len, off_t off) { - ssize_t nread; if (lseek(fd, off, SEEK_SET) == -1) { #ifdef DEBUG @@ -126,8 +125,7 @@ kern_pread(int fd, vm_offset_t dest, siz #endif return (-1); } - nread = archsw.arch_readin(fd, dest, len); - if (nread != len) { + if ((size_t)archsw.arch_readin(fd, dest, len) != len) { #ifdef DEBUG printf("\nreadin failed\n"); #endif @@ -144,7 +142,6 @@ void * alloc_pread(int fd, off_t off, size_t len) { void *buf; - ssize_t nread; buf = malloc(len); if (buf == NULL) { @@ -160,8 +157,7 @@ alloc_pread(int fd, off_t off, size_t le free(buf); return (NULL); } - nread = read(fd, buf, len); - if (nread != len) { + if ((size_t)read(fd, buf, len) != len) { #ifdef DEBUG printf("\nread failed\n"); #endif Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/common/module.c Tue Jan 12 02:17:39 2016 (r293724) @@ -983,7 +983,7 @@ moduledir_rebuild(void) { struct moduledir *mdp, *mtmp; const char *path, *cp, *ep; - int cplen; + size_t cplen; path = getenv("module_path"); if (path == NULL) Modified: head/sys/boot/common/part.c ============================================================================== --- head/sys/boot/common/part.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/common/part.c Tue Jan 12 02:17:39 2016 (r293724) @@ -102,7 +102,7 @@ static struct parttypes { const char * parttype2str(enum partition_type type) { - int i; + size_t i; for (i = 0; i < sizeof(ptypes) / sizeof(ptypes[0]); i++) if (ptypes[i].type == type) @@ -203,7 +203,7 @@ gpt_checktbl(const struct gpt_hdr *hdr, uint64_t lba_last) { struct gpt_ent *ent; - int i, cnt; + uint32_t i, cnt; cnt = size / hdr->hdr_entsz; if (hdr->hdr_entries <= cnt) { @@ -234,8 +234,8 @@ ptable_gptread(struct ptable *table, voi struct gpt_ent *ent; u_char *buf, *tbl; uint64_t offset; - int pri, sec, i; - size_t size; + int pri, sec; + size_t size, i; buf = malloc(table->sectorsize); if (buf == NULL) @@ -358,7 +358,7 @@ mbr_parttype(uint8_t type) return (PART_UNKNOWN); } -struct ptable* +static struct ptable* ptable_ebrread(struct ptable *table, void *dev, diskread_t dread) { struct dos_partition *dp; @@ -436,7 +436,7 @@ bsd_parttype(uint8_t type) return (PART_UNKNOWN); } -struct ptable* +static struct ptable* ptable_bsdread(struct ptable *table, void *dev, diskread_t dread) { struct disklabel *dl; Modified: head/sys/boot/common/self_reloc.c ============================================================================== --- head/sys/boot/common/self_reloc.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/common/self_reloc.c Tue Jan 12 02:17:39 2016 (r293724) @@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$"); #define RELOC_TYPE_RELATIVE R_386_RELATIVE #endif +void self_reloc(Elf_Addr baseaddr, ElfW_Dyn *dynamic); + /* * A simple elf relocator. */ @@ -118,6 +120,6 @@ self_reloc(Elf_Addr baseaddr, ElfW_Dyn * /* XXX: do we need other relocations ? */ break; } - rel = (ElfW_Rel *) ((caddr_t) rel + relent); + rel = (ElfW_Rel *)(void *)((caddr_t) rel + relent); } } Modified: head/sys/boot/common/ufsread.c ============================================================================== --- head/sys/boot/common/ufsread.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/common/ufsread.c Tue Jan 12 02:17:39 2016 (r293724) @@ -207,7 +207,7 @@ fsread(ufs_ino_t inode, void *buf, size_ #endif ) && fs.fs_bsize <= MAXBSIZE && - fs.fs_bsize >= sizeof(struct fs)) + fs.fs_bsize >= (int32_t)sizeof(struct fs)) break; } if (sblock_try[n] == -1) { @@ -231,10 +231,10 @@ fsread(ufs_ino_t inode, void *buf, size_ sizeof(struct ufs2_dinode)); #else if (fs.fs_magic == FS_UFS1_MAGIC) - memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n, sizeof(struct ufs1_dinode)); else - memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n, sizeof(struct ufs2_dinode)); #endif inomap = inode; @@ -283,7 +283,7 @@ fsread(ufs_ino_t inode, void *buf, size_ return -1; vbaddr = fsbtodb(&fs, addr2) + (off >> VBLKSHIFT) * DBPERVBLK; vboff = off & VBLKMASK; - n = sblksize(&fs, size, lbn) - (off & ~VBLKMASK); + n = sblksize(&fs, (off_t)size, lbn) - (off & ~VBLKMASK); if (n > VBLKSIZE) n = VBLKSIZE; if (blkmap != vbaddr) { Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/boot1/Makefile Tue Jan 12 02:17:39 2016 (r293724) @@ -11,6 +11,7 @@ MK_SSP= no PROG= boot1.sym INTERNALPROG= +WARNS?= 6 # architecture-specific loader code SRCS= boot1.c self_reloc.c start.S Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/boot1/boot1.c Tue Jan 12 02:17:39 2016 (r293724) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); void panic(const char *fmt, ...) __dead2; void putchar(int c); +EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); static int domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet); static void load(const char *fname); @@ -62,7 +63,7 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E EFI_BOOT_SERVICES *BS; EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; - char *path = _PATH_LOADER; + const char *path = _PATH_LOADER; systab = Xsystab; image = Ximage; @@ -157,7 +158,6 @@ fsstat(ufs_ino_t inode) { #ifndef UFS2_ONLY static struct ufs1_dinode dp1; - ufs1_daddr_t addr1; #endif #ifndef UFS1_ONLY static struct ufs2_dinode dp2; @@ -166,11 +166,8 @@ fsstat(ufs_ino_t inode) static ufs_ino_t inomap; char *blkbuf; void *indbuf; - size_t n, nb, size, off, vboff; - ufs_lbn_t lbn; - ufs2_daddr_t addr2, vbaddr; + size_t n, size; static ufs2_daddr_t blkmap, indmap; - u_int u; blkbuf = dmadat->blkbuf; indbuf = dmadat->indbuf; @@ -194,7 +191,7 @@ fsstat(ufs_ino_t inode) #endif ) && fs.fs_bsize <= MAXBSIZE && - fs.fs_bsize >= sizeof(struct fs)) + fs.fs_bsize >= (int32_t)sizeof(struct fs)) break; } if (sblock_try[n] == -1) { @@ -218,10 +215,10 @@ fsstat(ufs_ino_t inode) sizeof(struct ufs2_dinode)); #else if (fs.fs_magic == FS_UFS1_MAGIC) - memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n, sizeof(struct ufs1_dinode)); else - memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n, sizeof(struct ufs2_dinode)); #endif inomap = inode; Modified: head/sys/boot/efi/fdt/Makefile ============================================================================== --- head/sys/boot/efi/fdt/Makefile Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/fdt/Makefile Tue Jan 12 02:17:39 2016 (r293724) @@ -6,6 +6,7 @@ LIB= efi_fdt INTERNALLIB= +WARNS?= 6 SRCS= efi_fdt.c Modified: head/sys/boot/efi/fdt/efi_fdt.c ============================================================================== --- head/sys/boot/efi/fdt/efi_fdt.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/fdt/efi_fdt.c Tue Jan 12 02:17:39 2016 (r293724) @@ -44,7 +44,6 @@ int fdt_platform_load_dtb(void) { struct fdt_header *hdr; - int err; hdr = efi_get_table(&fdtdtb); if (hdr != NULL) { @@ -54,7 +53,7 @@ fdt_platform_load_dtb(void) } } - return (err); + return (1); } void Modified: head/sys/boot/efi/include/arm64/efibind.h ============================================================================== --- head/sys/boot/efi/include/arm64/efibind.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/arm64/efibind.h Tue Jan 12 02:17:39 2016 (r293724) @@ -127,7 +127,6 @@ typedef uint64_t UINTN; #define BAD_POINTER 0xFBFBFBFBFBFBFBFB #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF -#pragma intrinsic (__break) #define BREAKPOINT() __break(0) // @@ -180,7 +179,6 @@ typedef uint64_t UINTN; // BugBug: Need to find out if this is portable accross compliers. // void __mfa (void); -#pragma intrinsic (__mfa) #define MEMORY_FENCE() __mfa() #ifdef EFI_NO_INTERFACE_DECL Modified: head/sys/boot/efi/include/efi_nii.h ============================================================================== --- head/sys/boot/efi/include/efi_nii.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/efi_nii.h Tue Jan 12 02:17:39 2016 (r293724) @@ -26,9 +26,9 @@ Revision history: --*/ #define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL \ - { 0xE18541CD, 0xF755, 0x4f73, 0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29 } + { 0xE18541CD, 0xF755, 0x4f73, {0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29} } #define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_31 \ - { 0x1ACED566, 0x76ED, 0x4218, 0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89 } + { 0x1ACED566, 0x76ED, 0x4218, {0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89} } #define EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE_REVISION 0x00010000 #define EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE_REVISION_31 0x00010001 Modified: head/sys/boot/efi/include/efiapi.h ============================================================================== --- head/sys/boot/efi/include/efiapi.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/efiapi.h Tue Jan 12 02:17:39 2016 (r293724) @@ -214,8 +214,8 @@ VOID // EFI platform varibles // -#define EFI_GLOBAL_VARIABLE \ - { 0x8BE4DF61, 0x93CA, 0x11d2, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C } +#define EFI_GLOBAL_VARIABLE \ + { 0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C} } // Variable attributes #define EFI_VARIABLE_NON_VOLATILE 0x00000001 @@ -363,8 +363,8 @@ EFI_STATUS // Image handle -#define LOADED_IMAGE_PROTOCOL \ - { 0x5B1B31A1, 0x9562, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } +#define LOADED_IMAGE_PROTOCOL \ + { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} } #define EFI_LOADED_IMAGE_INFORMATION_REVISION 0x1000 typedef struct { @@ -827,35 +827,35 @@ typedef struct { // EFI Configuration Table and GUID definitions // -#define MPS_TABLE_GUID \ - { 0xeb9d2d2f, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } +#define MPS_TABLE_GUID \ + { 0xeb9d2d2f, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } -#define ACPI_TABLE_GUID \ - { 0xeb9d2d30, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } +#define ACPI_TABLE_GUID \ + { 0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } -#define ACPI_20_TABLE_GUID \ - { 0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } +#define ACPI_20_TABLE_GUID \ + { 0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} } -#define SMBIOS_TABLE_GUID \ - { 0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } +#define SMBIOS_TABLE_GUID \ + { 0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } -#define SAL_SYSTEM_TABLE_GUID \ - { 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } +#define SAL_SYSTEM_TABLE_GUID \ + { 0xeb9d2d32, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } -#define FDT_TABLE_GUID \ - { 0xb1b621d5, 0xf19c, 0x41a5, 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } +#define FDT_TABLE_GUID \ + { 0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0} } -#define DXE_SERVICES_TABLE_GUID \ - { 0x5ad34ba, 0x6f02, 0x4214, 0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9 } +#define DXE_SERVICES_TABLE_GUID \ + { 0x5ad34ba, 0x6f02, 0x4214, {0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9} } -#define HOB_LIST_TABLE_GUID \ - { 0x7739f24c, 0x93d7, 0x11d4, 0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } +#define HOB_LIST_TABLE_GUID \ + { 0x7739f24c, 0x93d7, 0x11d4, {0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } #define MEMORY_TYPE_INFORMATION_TABLE_GUID \ - { 0x4c19049f, 0x4137, 0x4dd3, 0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa } + { 0x4c19049f, 0x4137, 0x4dd3, {0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa} } #define DEBUG_IMAGE_INFO_TABLE_GUID \ - { 0x49152e77, 0x1ada, 0x4764, 0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b } + { 0x49152e77, 0x1ada, 0x4764, {0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b} } typedef struct _EFI_CONFIGURATION_TABLE { EFI_GUID VendorGuid; Modified: head/sys/boot/efi/include/eficon.h ============================================================================== --- head/sys/boot/efi/include/eficon.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/eficon.h Tue Jan 12 02:17:39 2016 (r293724) @@ -32,7 +32,7 @@ Revision History // #define SIMPLE_TEXT_OUTPUT_PROTOCOL \ - { 0x387477c2, 0x69c7, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + { 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } INTERFACE_DECL(_SIMPLE_TEXT_OUTPUT_INTERFACE); @@ -239,8 +239,8 @@ typedef struct _SIMPLE_TEXT_OUTPUT_INTER // Text input protocol // -#define SIMPLE_TEXT_INPUT_PROTOCOL \ - { 0x387477c1, 0x69c7, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } +#define SIMPLE_TEXT_INPUT_PROTOCOL \ + { 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } INTERFACE_DECL(_SIMPLE_INPUT_INTERFACE); Modified: head/sys/boot/efi/include/eficonsctl.h ============================================================================== --- head/sys/boot/efi/include/eficonsctl.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/eficonsctl.h Tue Jan 12 02:17:39 2016 (r293724) @@ -35,7 +35,7 @@ #define _EFI_CONS_CTL_H #define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \ - { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} } + { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} } typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL; Modified: head/sys/boot/efi/include/efidevp.h ============================================================================== --- head/sys/boot/efi/include/efidevp.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/efidevp.h Tue Jan 12 02:17:39 2016 (r293724) @@ -110,7 +110,7 @@ typedef struct _VENDOR_DEVICE_PATH { } VENDOR_DEVICE_PATH; #define UNKNOWN_DEVICE_GUID \ - { 0xcf31fac5, 0xc24e, 0x11d2, 0x85, 0xf3, 0x0, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b } + { 0xcf31fac5, 0xc24e, 0x11d2, {0x85, 0xf3, 0x0, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b} } typedef struct _UKNOWN_DEVICE_VENDOR_DP { VENDOR_DEVICE_PATH DevicePath; @@ -274,16 +274,16 @@ typedef struct _UART_DEVICE_PATH { /* Use VENDOR_DEVICE_PATH struct */ #define DEVICE_PATH_MESSAGING_PC_ANSI \ - { 0xe0c14753, 0xf9be, 0x11d2, 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } + { 0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } #define DEVICE_PATH_MESSAGING_VT_100 \ - { 0xdfa66065, 0xb419, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } + { 0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } #define DEVICE_PATH_MESSAGING_VT_100_PLUS \ - { 0x7baec70b, 0x57e0, 0x4c76, 0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } + { 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43} } #define DEVICE_PATH_MESSAGING_VT_UTF8 \ - { 0xad15a0d6, 0x8bec, 0x4acf, 0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } + { 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88} } #define MEDIA_DEVICE_PATH 0x04 Modified: head/sys/boot/efi/include/efierr.h ============================================================================== --- head/sys/boot/efi/include/efierr.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/efierr.h Tue Jan 12 02:17:39 2016 (r293724) @@ -31,7 +31,7 @@ Revision History #define EFIWARN(a) (a) #define EFI_ERROR(a) (((INTN) a) < 0) -#define EFI_ERROR_CODE(a) (a & ~EFI_ERROR_MASK) +#define EFI_ERROR_CODE(a) (unsigned long)(a & ~EFI_ERROR_MASK) #define EFI_SUCCESS 0 Modified: head/sys/boot/efi/include/efifpswa.h ============================================================================== --- head/sys/boot/efi/include/efifpswa.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/efifpswa.h Tue Jan 12 02:17:39 2016 (r293724) @@ -7,7 +7,7 @@ */ #define EFI_INTEL_FPSWA \ - { 0xc41b6531, 0x97b9, 0x11d3, 0x9a, 0x29, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } + { 0xc41b6531, 0x97b9, 0x11d3, {0x9a, 0x29, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } INTERFACE_DECL(_FPSWA_INTERFACE); Modified: head/sys/boot/efi/include/efigop.h ============================================================================== --- head/sys/boot/efi/include/efigop.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/efigop.h Tue Jan 12 02:17:39 2016 (r293724) @@ -27,9 +27,8 @@ Revision History #ifndef _EFIGOP_H #define _EFIGOP_H -#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ - { 0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, \ - 0x51, 0x6a } +#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ + { 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a} } INTERFACE_DECL(_EFI_GRAPHICS_OUTPUT); Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/efilib.h Tue Jan 12 02:17:39 2016 (r293724) @@ -50,3 +50,4 @@ time_t efi_time(EFI_TIME *); EFI_STATUS main(int argc, CHAR16 *argv[]); void exit(EFI_STATUS status); +void delay(int usecs); Modified: head/sys/boot/efi/include/efinet.h ============================================================================== --- head/sys/boot/efi/include/efinet.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/efinet.h Tue Jan 12 02:17:39 2016 (r293724) @@ -29,7 +29,7 @@ Revision History // #define EFI_SIMPLE_NETWORK_PROTOCOL \ - { 0xA19832B9, 0xAC25, 0x11D3, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } + { 0xA19832B9, 0xAC25, 0x11D3, {0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} } INTERFACE_DECL(_EFI_SIMPLE_NETWORK); Modified: head/sys/boot/efi/include/efipciio.h ============================================================================== --- head/sys/boot/efi/include/efipciio.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/efipciio.h Tue Jan 12 02:17:39 2016 (r293724) @@ -21,9 +21,7 @@ /// Global ID for the PCI I/O Protocol /// #define EFI_PCI_IO_PROTOCOL_GUID \ - { \ - 0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a } \ - } + { 0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a} } typedef struct _EFI_PCI_IO_PROTOCOL EFI_PCI_IO_PROTOCOL; Modified: head/sys/boot/efi/include/efiprot.h ============================================================================== --- head/sys/boot/efi/include/efiprot.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/efiprot.h Tue Jan 12 02:17:39 2016 (r293724) @@ -31,8 +31,8 @@ Revision History // Device Path protocol // -#define DEVICE_PATH_PROTOCOL \ - { 0x9576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } +#define DEVICE_PATH_PROTOCOL \ + { 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } // @@ -40,7 +40,7 @@ Revision History // #define BLOCK_IO_PROTOCOL \ - { 0x964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + { 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } #define EFI_BLOCK_IO_INTERFACE_REVISION 0x00010000 INTERFACE_DECL(_EFI_BLOCK_IO); @@ -116,7 +116,7 @@ typedef struct _EFI_BLOCK_IO { // #define DISK_IO_PROTOCOL \ - { 0xce345171, 0xba0b, 0x11d2, 0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + { 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } #define EFI_DISK_IO_INTERFACE_REVISION 0x00010000 INTERFACE_DECL(_EFI_DISK_IO); @@ -155,7 +155,7 @@ typedef struct _EFI_DISK_IO { // #define SIMPLE_FILE_SYSTEM_PROTOCOL \ - { 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } INTERFACE_DECL(_EFI_FILE_IO_INTERFACE); INTERFACE_DECL(_EFI_FILE_HANDLE); @@ -290,8 +290,8 @@ typedef struct _EFI_FILE_HANDLE { // File information types // -#define EFI_FILE_INFO_ID \ - { 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } +#define EFI_FILE_INFO_ID \ + { 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } typedef struct { UINT64 Size; @@ -314,8 +314,8 @@ typedef struct { #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName) -#define EFI_FILE_SYSTEM_INFO_ID \ - { 0x9576e93, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } +#define EFI_FILE_SYSTEM_INFO_ID \ + { 0x9576e93, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } typedef struct { UINT64 Size; @@ -336,8 +336,8 @@ typedef struct { #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel) -#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \ - { 0xDB47D7D3,0xFE81, 0x11d3, 0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } +#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \ + { 0xDB47D7D3,0xFE81, 0x11d3, {0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} } typedef struct { CHAR16 VolumeLabel[1]; @@ -351,7 +351,7 @@ typedef struct { #define LOAD_FILE_PROTOCOL \ - { 0x56EC3091, 0x954C, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } + { 0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} } INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE); @@ -375,7 +375,7 @@ typedef struct _EFI_LOAD_FILE_INTERFACE // #define DEVICE_IO_PROTOCOL \ - { 0xaf6ac311, 0x84c3, 0x11d2, 0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + { 0xaf6ac311, 0x84c3, 0x11d2, {0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE); @@ -485,7 +485,7 @@ typedef struct _EFI_DEVICE_IO_INTERFACE // #define UNICODE_COLLATION_PROTOCOL \ - { 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } + { 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } #define UNICODE_BYTE_ORDER_MARK (CHAR16)(0xfeff) Modified: head/sys/boot/efi/include/efipxebc.h ============================================================================== --- head/sys/boot/efi/include/efipxebc.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/efipxebc.h Tue Jan 12 02:17:39 2016 (r293724) @@ -32,7 +32,7 @@ Revision History // #define EFI_PXE_BASE_CODE_PROTOCOL \ - { 0x03c4e603, 0xac28, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } + { 0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } INTERFACE_DECL(_EFI_PXE_BASE_CODE); @@ -425,7 +425,7 @@ typedef struct _EFI_PXE_BASE_CODE { // #define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL \ - { 0x245dca21, 0xfb7b, 0x11d3, 0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + { 0x245dca21, 0xfb7b, 0x11d3, {0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } // // Revision Number Modified: head/sys/boot/efi/include/efiser.h ============================================================================== --- head/sys/boot/efi/include/efiser.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/efiser.h Tue Jan 12 02:17:39 2016 (r293724) @@ -30,7 +30,7 @@ Revision History // #define SERIAL_IO_PROTOCOL \ - { 0xBB25CF6F, 0xF1D4, 0x11D2, 0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD } + { 0xBB25CF6F, 0xF1D4, 0x11D2, {0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD} } INTERFACE_DECL(_SERIAL_IO_INTERFACE); Modified: head/sys/boot/efi/include/efiuga.h ============================================================================== --- head/sys/boot/efi/include/efiuga.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/include/efiuga.h Tue Jan 12 02:17:39 2016 (r293724) @@ -22,9 +22,7 @@ #define __UGA_DRAW_H__ #define EFI_UGA_DRAW_PROTOCOL_GUID \ - { \ - 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \ - } + { 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39} } typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL; Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/libefi/Makefile Tue Jan 12 02:17:39 2016 (r293724) @@ -2,6 +2,7 @@ LIB= efi INTERNALLIB= +WARNS?= 2 SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c Modified: head/sys/boot/efi/libefi/efi_console.c ============================================================================== --- head/sys/boot/efi/libefi/efi_console.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/libefi/efi_console.c Tue Jan 12 02:17:39 2016 (r293724) @@ -47,6 +47,8 @@ static int esc; void get_pos(int *x, int *y); void curs_move(int *_x, int *_y, int x, int y); static void CL(int); +void HO(void); +void end_term(void); #endif static void efi_cons_probe(struct console *); Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/libefi/efipart.c Tue Jan 12 02:17:39 2016 (r293724) @@ -67,7 +67,6 @@ efipart_init(void) EFI_HANDLE *hin, *hout, *aliases, handle; EFI_STATUS status; UINTN sz; - CHAR16 *path; u_int n, nin, nout; int err; size_t devpathlen; Modified: head/sys/boot/efi/libefi/libefi.c ============================================================================== --- head/sys/boot/efi/libefi/libefi.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/libefi/libefi.c Tue Jan 12 02:17:39 2016 (r293724) @@ -179,7 +179,7 @@ efi_main(EFI_HANDLE image_handle, EFI_SY argv = malloc((argc + 1) * sizeof(CHAR16*)); argc = 0; if (addprog) - argv[argc++] = L"loader.efi"; + argv[argc++] = (CHAR16 *)"loader.efi"; argp = args; while (argp != NULL && *argp != 0) { argp = arg_skipsep(argp); Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/loader/Makefile Tue Jan 12 02:17:39 2016 (r293724) @@ -11,6 +11,7 @@ MK_SSP= no PROG= loader.sym INTERNALPROG= +WARNS?= 3 # architecture-specific loader code SRCS= autoload.c \ Modified: head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Tue Jan 12 02:17:39 2016 (r293724) @@ -100,7 +100,6 @@ elf64_exec(struct preloaded_file *fp) ACPI_TABLE_RSDP *rsdp; char buf[24]; int revision; - EFI_STATUS status; rsdp = efi_get_table(&acpi20_guid); if (rsdp == NULL) { Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/framebuffer.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/loader/arch/amd64/framebuffer.c Tue Jan 12 02:17:39 2016 (r293724) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "framebuffer.h" + static EFI_GUID gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; static EFI_GUID pciio_guid = EFI_PCI_IO_PROTOCOL_GUID; static EFI_GUID uga_guid = EFI_UGA_DRAW_PROTOCOL_GUID; @@ -270,7 +272,7 @@ efifb_from_uga(struct efi_fb *efifb, EFI char *ev, *p; EFI_STATUS status; ssize_t offset; - uint64_t fbaddr, fbsize; + uint64_t fbaddr; uint32_t horiz, vert, stride; uint32_t np, depth, refresh; Modified: head/sys/boot/efi/loader/arch/arm/exec.c ============================================================================== --- head/sys/boot/efi/loader/arch/arm/exec.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/loader/arch/arm/exec.c Tue Jan 12 02:17:39 2016 (r293724) @@ -44,8 +44,9 @@ __FBSDID("$FreeBSD$"); #include "loader_efi.h" extern vm_offset_t md_load(char *, vm_offset_t *); +extern int bi_load(char *, vm_offset_t *, vm_offset_t *); -int +static int __elfN(arm_load)(char *filename, u_int64_t dest, struct preloaded_file **result) { @@ -58,7 +59,7 @@ __elfN(arm_load)(char *filename, u_int64 return (0); } -int +static int __elfN(arm_exec)(struct preloaded_file *fp) { struct file_metadata *fmp; @@ -66,7 +67,6 @@ __elfN(arm_exec)(struct preloaded_file * Elf_Ehdr *e; int error; void (*entry)(void *); - EFI_STATUS status; if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) return (EFTYPE); Modified: head/sys/boot/efi/loader/arch/arm64/exec.c ============================================================================== --- head/sys/boot/efi/loader/arch/arm64/exec.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/loader/arch/arm64/exec.c Tue Jan 12 02:17:39 2016 (r293724) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include "platform/acfreebsd.h" #include "acconfig.h" #define ACPI_SYSTEM_XFACE +#define ACPI_USE_SYSTEM_INTTYPES #include "actypes.h" #include "actbl.h" @@ -74,8 +75,6 @@ elf64_exec(struct preloaded_file *fp) size_t clean_size; struct file_metadata *md; ACPI_TABLE_RSDP *rsdp; - EFI_STATUS status; - EFI_PHYSICAL_ADDRESS addr; Elf_Ehdr *ehdr; char buf[24]; int err, revision; @@ -119,8 +118,8 @@ elf64_exec(struct preloaded_file *fp) return (err); /* Clean D-cache under kernel area and invalidate whole I-cache */ - clean_addr = efi_translate(fp->f_addr); - clean_size = efi_translate(kernendp) - clean_addr; + clean_addr = (vm_offset_t)efi_translate(fp->f_addr); + clean_size = (vm_offset_t)efi_translate(kernendp) - clean_addr; cpu_flush_dcache((void *)clean_addr, clean_size); cpu_inval_icache(NULL, 0); Modified: head/sys/boot/efi/loader/autoload.c ============================================================================== --- head/sys/boot/efi/loader/autoload.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/loader/autoload.c Tue Jan 12 02:17:39 2016 (r293724) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "loader_efi.h" + int efi_autoload(void) { Modified: head/sys/boot/efi/loader/bootinfo.c ============================================================================== --- head/sys/boot/efi/loader/bootinfo.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/loader/bootinfo.c Tue Jan 12 02:17:39 2016 (r293724) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #endif +int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp); + extern EFI_SYSTEM_TABLE *ST; static const char howto_switches[] = "aCdrgDmphsv"; @@ -122,7 +124,7 @@ bi_copyenv(vm_offset_t start) /* Traverse the environment. */ for (ep = environ; ep != NULL; ep = ep->ev_next) { len = strlen(ep->ev_name); - if (archsw.arch_copyin(ep->ev_name, addr, len) != len) + if ((size_t)archsw.arch_copyin(ep->ev_name, addr, len) != len) break; addr += len; if (archsw.arch_copyin("=", addr, 1) != 1) @@ -130,7 +132,7 @@ bi_copyenv(vm_offset_t start) addr++; if (ep->ev_value != NULL) { len = strlen(ep->ev_value); - if (archsw.arch_copyin(ep->ev_value, addr, len) != len) + if ((size_t)archsw.arch_copyin(ep->ev_value, addr, len) != len) break; addr += len; } @@ -351,7 +353,7 @@ bi_load(char *args, vm_offset_t *modulep #endif #if defined(__arm__) vm_offset_t vaddr; - int i; + size_t i; /* * These metadata addreses must be converted for kernel after * relocation. Modified: head/sys/boot/efi/loader/copy.c ============================================================================== --- head/sys/boot/efi/loader/copy.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/loader/copy.c Tue Jan 12 02:17:39 2016 (r293724) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "loader_efi.h" + #ifndef EFI_STAGING_SIZE #define EFI_STAGING_SIZE 48 #endif Modified: head/sys/boot/efi/loader/devicename.c ============================================================================== --- head/sys/boot/efi/loader/devicename.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/loader/devicename.c Tue Jan 12 02:17:39 2016 (r293724) @@ -31,11 +31,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include "bootstrap.h" +#include #include #include +#include "loader_efi.h" + static int efi_parsedev(struct devdesc **, const char *, const char **); /* Modified: head/sys/boot/efi/loader/loader_efi.h ============================================================================== --- head/sys/boot/efi/loader/loader_efi.h Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/loader/loader_efi.h Tue Jan 12 02:17:39 2016 (r293724) @@ -31,6 +31,8 @@ #ifndef _LOADER_EFI_COPY_H_ #define _LOADER_EFI_COPY_H_ +#include + int efi_autoload(void); int efi_getdev(void **vdev, const char *devspec, const char **path); Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/efi/loader/main.c Tue Jan 12 02:17:39 2016 (r293724) @@ -68,6 +68,7 @@ main(int argc, CHAR16 *argv[]) EFI_LOADED_IMAGE *img; EFI_GUID *guid; int i, j, vargood; + UINTN k; /* * XXX Chicken-and-egg problem; we want to have console output @@ -155,10 +156,10 @@ main(int argc, CHAR16 *argv[]) archsw.arch_copyout = efi_copyout; archsw.arch_readin = efi_readin; - for (i = 0; i < ST->NumberOfTableEntries; i++) { - guid = &ST->ConfigurationTable[i].VendorGuid; + for (k = 0; k < ST->NumberOfTableEntries; k++) { + guid = &ST->ConfigurationTable[k].VendorGuid; if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { - smbios_detect(ST->ConfigurationTable[i].VendorTable); + smbios_detect(ST->ConfigurationTable[k].VendorTable); break; } } @@ -242,8 +243,9 @@ command_memmap(int argc, char *argv[]) for (i = 0, p = map; i < ndesc; i++, p = NextMemoryDescriptor(p, dsz)) { - printf("%23s %012lx %012lx %08lx ", types[p->Type], - p->PhysicalStart, p->VirtualStart, p->NumberOfPages); + printf("%23s %012jx %012jx %08jx ", types[p->Type], + (uintmax_t)p->PhysicalStart, (uintmax_t)p->VirtualStart, + (uintmax_t)p->NumberOfPages); if (p->Attribute & EFI_MEMORY_UC) printf("UC "); if (p->Attribute & EFI_MEMORY_WC) @@ -284,9 +286,10 @@ guid_to_string(EFI_GUID *guid) static int command_configuration(int argc, char *argv[]) { - int i; + UINTN i; - printf("NumberOfTableEntries=%ld\n", ST->NumberOfTableEntries); + printf("NumberOfTableEntries=%lu\n", + (unsigned long)ST->NumberOfTableEntries); for (i = 0; i < ST->NumberOfTableEntries; i++) { EFI_GUID *guid; @@ -382,9 +385,8 @@ command_nvram(int argc, char *argv[]) CHAR16 *data; EFI_STATUS status; EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; - UINTN varsz, datasz; + UINTN varsz, datasz, i; SIMPLE_TEXT_OUTPUT_INTERFACE *conout; - int i; conout = ST->ConOut; Modified: head/sys/boot/i386/libi386/smbios.c ============================================================================== --- head/sys/boot/i386/libi386/smbios.c Tue Jan 12 02:12:40 2016 (r293723) +++ head/sys/boot/i386/libi386/smbios.c Tue Jan 12 02:17:39 2016 (r293724) @@ -332,7 +332,7 @@ static caddr_t smbios_find_struct(int type) { caddr_t dmi; - int i; + size_t i; if (smbios.addr == NULL) return (NULL); @@ -402,7 +402,7 @@ smbios_detect(const caddr_t addr) { char buf[16]; caddr_t dmi; - int i; + size_t i; smbios_probe(addr); if (smbios.addr == NULL) From owner-svn-src-head@freebsd.org Tue Jan 12 03:11:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE8F3A6CFD0 for ; Tue, 12 Jan 2016 03:11:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [IPv6:2607:f8b0:400e:c03::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84F4B178D for ; Tue, 12 Jan 2016 03:11:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by mail-pa0-x22c.google.com with SMTP id cy9so331747257pac.0 for ; Mon, 11 Jan 2016 19:11:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to; bh=RMUKrKk8pz/l8YN/E4hqWv7+cKEycaGSJAIoVAcWjdI=; b=J50NVfHnExrVY6qW6ZZISA4jzRDlIe35+c4PTlj1qx20+DwAX+0fbfNiYHxzywv6hT n49QMuaD3i7ClbvXLdblFbHlzPjHy644TmlI5HSLRULlk7hA76CKMLy0LonpdCDfLagw LkPZbsqauVHfy49WMq6n+17dWcYIxyvyuIZ03DZNJoUAeY+QTAx6E/RwQCSJVHX9mI+p AGYmM73jktgOHwO2lTIN5a6OCb08jjDLmSwe/a3htqsyIMrRPuAGqSoWaVa+82g+DRJN 4NNZBMkQrXKoz0Ipvw8v5+Bgkj/c1XbSaZKhfC7fMhZ+1bjwB8U4laqZusUnE4yiLVT5 rcJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=RMUKrKk8pz/l8YN/E4hqWv7+cKEycaGSJAIoVAcWjdI=; b=hqvaqEA58vaQU/AUeSlx5NOj+KFKE919z4SWsnfcR0XJJAKtXgBHVuFfGtpr9cJU5S aM512UaBFl2+M+YJAbgVdqArAjRklIJoHj/72DXEXnNPJaJaEOt/iDm4jdvY+RMHG651 pIzARSoZkNKkQ9gu3ElhPktEzbKnjbUxj+MkUqyCTQjx+JbYnf98fFUqj/gjTUoleQM4 fzrcyhPnsE+FWCZgc1Ay/is1a0r8ys9X0b75y+Ly/ltldCg8ZpkD5DznTHjAY9JbX76L 3OXglViDmKKp5uKtXengbgh579+UjcpsFvUQbHuv9eP5H5Ipbvm+eNBTiS3o1mhoz7mx T71w== X-Gm-Message-State: ALoCoQlIQJaHuxOOQUBJmFBVa4u1PRLbO1uwuSxtArQ28vwTYmNUeOYzMoEpFqokcETAnPsrfOAJVdjlqgXWIp/aXp2x2+Uktg== X-Received: by 10.66.219.98 with SMTP id pn2mr185060692pac.113.1452568276957; Mon, 11 Jan 2016 19:11:16 -0800 (PST) Received: from [100.127.145.144] ([69.53.245.34]) by smtp.gmail.com with ESMTPSA id 7sm26201078pfc.69.2016.01.11.19.11.15 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 19:11:16 -0800 (PST) Sender: Warner Losh Subject: Re: svn commit: r293068 - in head/etc: . mtree Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/signed; boundary="Apple-Mail=_9B8DBDC1-3FDC-4D4F-BE36-E9DB43DCBA9A"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5.2 From: Warner Losh In-Reply-To: <20160111221614.GC79262@spindle.one-eyed-alien.net> Date: Mon, 11 Jan 2016 20:11:13 -0700 Cc: Dimitry Andric , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201601030432.u034W6en043633@repo.freebsd.org> <20160111221614.GC79262@spindle.one-eyed-alien.net> To: Brooks Davis X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 03:11:17 -0000 --Apple-Mail=_9B8DBDC1-3FDC-4D4F-BE36-E9DB43DCBA9A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 11, 2016, at 3:16 PM, Brooks Davis wrote: >=20 > On Sun, Jan 03, 2016 at 06:41:33PM +0100, Dimitry Andric wrote: >> On 03 Jan 2016, at 05:32, Warner Losh wrote: >>>=20 >>> Author: imp >>> Date: Sun Jan 3 04:32:05 2016 >>> New Revision: 293068 >>> URL: https://svnweb.freebsd.org/changeset/base/293068 >>>=20 >>> Log: >>> Add libsoft to the tree, just like lib32. >>=20 >> Hmm, are there going to be more of these "multilib" things? :) >=20 > We'll want to do something about supporting hard float on MIPS. Over > there it may be more of a TARGET_ARCH thing, but libsoft might be = useful. It isn=E2=80=99t quite a TARGET_ARCH on mips either. I=E2=80=99d love to = work with you to use this stuff MIPS turns out to be a harder nut to crack with this = stuff because it marks the different types of binaries differently and it = looks harder to parse. For amv6 it is more of a transition thing, but I wanted to do it = something approaching =E2=80=9Ccorrect=E2=80=9D so that we could leverage it for = MIPS. > We've also got a libcheri in CheriBSD and will eventually need to do a > lib64 as we explore the switch from CHERI-when-requested to > CHERI-by-default. We should definitely chat about this. There=E2=80=99s some easy ways to = mark the CHERI binaries that are easier than others which would be quite helpful. So we should chat about how this would be helpful on MIPS, and not just CHERI-mips... Warner --Apple-Mail=_9B8DBDC1-3FDC-4D4F-BE36-E9DB43DCBA9A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJWlG7RAAoJEGwc0Sh9sBEAVHYP+QFLWnRRlQWqXrBkX0JT2RuS KdIohcDKTuaLNuPmmU0KUezcDaoOilDctvxtC15hTiNnFZW/32S7MQMcH9Xot4nJ VIqp6iJe12RuBsx/cx/ToHoYTOeUfdgriuzlhuLGFiyOLw9R22H8K3NBMG92EMMY hA/PT2JJnH7bPwqu9m//AMlUHqs5c7mQV6z2RShpk+Jyv392XueL++Plk9prMKTy ukfqe+op93afVCs9/qX7Af+FN03ZaMD14dcdk8aCIHoCRIel/lmZKGweq4zABjpM QvGQEQuw0fUYsne+82nhK4BZtr9WMSvHKu7umEdMtLkK1RNWefXgMryhlJoZFpaP VbYBaLPYJTBmMRSpCXttLXwc3ge+RcbGfd58BG6AA3wLZe/QUUJ3rp3WhWu6mdQE w2iM+oObVcDPCMU233UFYUdsN+LZWD8fAWASkP5ttvUmyJ130ga7Jrgd3djql2H6 /EHiGQwhSAd5v9P0cfDhJR6j3BiqYFr4/c/4UTXVZbZSANclliopBQOn6+iy3Z4h KZsQ3DI2VR0KbGvacXagSImvdah0JdFEmpAme1X1/dllVP2kM8QsqHXA3nvpYyyI NK/pXvinBQx++wZZ4BLmCBBYNPVw8vnyonRu+7+NYwjk33QSb4+oEyEgc6R38tKg w8j5QG6B8AsuBC5UB/W9 =Z9Ne -----END PGP SIGNATURE----- --Apple-Mail=_9B8DBDC1-3FDC-4D4F-BE36-E9DB43DCBA9A-- From owner-svn-src-head@freebsd.org Tue Jan 12 04:14:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27E66A6C719; Tue, 12 Jan 2016 04:14:47 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEBD2144C; Tue, 12 Jan 2016 04:14:46 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u0C4EbSO017313 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 11 Jan 2016 20:14:37 -0800 Subject: Re: svn commit: r293068 - in head/etc: . mtree To: Warner Losh , Brooks Davis References: <201601030432.u034W6en043633@repo.freebsd.org> <20160111221614.GC79262@spindle.one-eyed-alien.net> Cc: Dimitry Andric , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: <56947DAD.80106@freebsd.org> Date: Mon, 11 Jan 2016 20:14:37 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVYNbGltiiGZBZ0uM/hq7g4N6vCWQnOELjJ/U2pAzkcdVIwR4NsYXxX5vrOiP0kJi3jt2C3zdkeL/HE9BgnsrRCCjrEYBX9NsG8= X-Sonic-ID: C;ahlQ/uK45RG2NPA4AoajKQ== M;uACn/uK45RG2NPA4AoajKQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 04:14:47 -0000 On 01/11/16 19:11, Warner Losh wrote: >> On Jan 11, 2016, at 3:16 PM, Brooks Davis wrote: >> >> On Sun, Jan 03, 2016 at 06:41:33PM +0100, Dimitry Andric wrote: >>> On 03 Jan 2016, at 05:32, Warner Losh wrote: >>>> Author: imp >>>> Date: Sun Jan 3 04:32:05 2016 >>>> New Revision: 293068 >>>> URL: https://svnweb.freebsd.org/changeset/base/293068 >>>> >>>> Log: >>>> Add libsoft to the tree, just like lib32. >>> Hmm, are there going to be more of these "multilib" things? :) >> We'll want to do something about supporting hard float on MIPS. Over >> there it may be more of a TARGET_ARCH thing, but libsoft might be useful. > It isn’t quite a TARGET_ARCH on mips either. I’d love to work with you > to use this stuff MIPS turns out to be a harder nut to crack with this stuff > because it marks the different types of binaries differently and it looks harder > to parse. > > For amv6 it is more of a transition thing, but I wanted to do it something > approaching β€œcorrect” so that we could leverage it for MIPS. > >> We've also got a libcheri in CheriBSD and will eventually need to do a >> lib64 as we explore the switch from CHERI-when-requested to >> CHERI-by-default. > We should definitely chat about this. There’s some easy ways to mark the CHERI > binaries that are easier than others which would be quite helpful. > > So we should chat about how this would be helpful on MIPS, and not just > CHERI-mips... > > Warner > For things that are a MACHINE_ARCH, do we want a convention of lib/${MACHINE_ARCH}? That seems like it would make it easily scalable and easier to predict than a lot of lib*. For things that aren't quite a MACHINE_ARCH, it's more complicated of course. -Nathan From owner-svn-src-head@freebsd.org Tue Jan 12 04:42:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62FFAA6D1F6; Tue, 12 Jan 2016 04:42:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F556129B; Tue, 12 Jan 2016 04:42:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u0C4g9aA037234 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 11 Jan 2016 20:42:09 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u0C4g84o037233; Mon, 11 Jan 2016 20:42:08 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 11 Jan 2016 20:42:08 -0800 From: Gleb Smirnoff To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293721 - head/sys/dev/hyperv/netvsc Message-ID: <20160112044208.GF1906@FreeBSD.org> References: <201601120150.u0C1ouKM081392@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601120150.u0C1ouKM081392@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 04:42:10 -0000 On Tue, Jan 12, 2016 at 01:50:56AM +0000, Sepherosa Ziehau wrote: S> Author: sephe S> Date: Tue Jan 12 01:50:56 2016 S> New Revision: 293721 S> URL: https://svnweb.freebsd.org/changeset/base/293721 S> S> Log: S> hyperv/hn: Avoid mbuf cluster allocation, if the packet is small. S> S> This one mainly avoids mbuf cluster allocation for TCP ACKs during S> TCP sending tests. And it gives me ~200Mbps improvement (4.7Gbps S> -> 4.9Gbps), when running iperf3 TCP sending test w/ 16 connections. S> S> While I'm here, nuke the unnecessary zeroing out pkthdr.csum_flags. S> S> Reviewed by: adrain S> Approved by: adrian (mentor) S> Sponsored by: Microsoft OSTC S> Differential Revision: https://reviews.freebsd.org/D4853 Consider using m_get2() instead of implementing it yourself :) -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Tue Jan 12 05:00:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9649A6D701; Tue, 12 Jan 2016 05:00:11 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C1811AD4; Tue, 12 Jan 2016 05:00:11 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id q21so372075363iod.0; Mon, 11 Jan 2016 21:00:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=QTCg/t4ZbHCw73nNeSVwft6ABkOWsWPuc/ICDR59TQg=; b=i7/xv9awQTzYPdsvNapAqE5ZEM94dBD5vT1HuPJiZyYp1XZ3jtfCZ+BHPW/lE0/mh/ pVq6La6T80niGymbY+bh0nVSdCBdobQ+tALQpf1+zjM1YR6+6a6TixssmyAPv/ExaAtw ITh2RemsjY4kNJ7ycs+YEf358KJRIapdTb0HdolKJKP+NmJ3iz9OzMyuTPHzdx0AT+cO VKiZewLfDXBTPnRr6ZjueB6KXk6eIRx3kzufwevfY98dSowio5AnwZainLtn/+T2cFCD T6x/VcaXQHvk/O2k6wX8g7b6TXqRPcgPtYZvSTyIjtcb6KbGcbRtHcWP6BZ4gCgPcFK9 yUHw== MIME-Version: 1.0 X-Received: by 10.107.7.22 with SMTP id 22mr64165090ioh.17.1452574810573; Mon, 11 Jan 2016 21:00:10 -0800 (PST) Sender: sepherosa@gmail.com Received: by 10.107.166.3 with HTTP; Mon, 11 Jan 2016 21:00:10 -0800 (PST) In-Reply-To: <20160112044208.GF1906@FreeBSD.org> References: <201601120150.u0C1ouKM081392@repo.freebsd.org> <20160112044208.GF1906@FreeBSD.org> Date: Tue, 12 Jan 2016 13:00:10 +0800 X-Google-Sender-Auth: L1snILaW5bFUKK0kQVNnR7pDTKY Message-ID: Subject: Re: svn commit: r293721 - head/sys/dev/hyperv/netvsc From: Sepherosa Ziehau To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 05:00:11 -0000 On Tue, Jan 12, 2016 at 12:42 PM, Gleb Smirnoff wrote: > On Tue, Jan 12, 2016 at 01:50:56AM +0000, Sepherosa Ziehau wrote: > S> Author: sephe > S> Date: Tue Jan 12 01:50:56 2016 > S> New Revision: 293721 > S> URL: https://svnweb.freebsd.org/changeset/base/293721 > S> > S> Log: > S> hyperv/hn: Avoid mbuf cluster allocation, if the packet is small. > S> > S> This one mainly avoids mbuf cluster allocation for TCP ACKs during > S> TCP sending tests. And it gives me ~200Mbps improvement (4.7Gbps > S> -> 4.9Gbps), when running iperf3 TCP sending test w/ 16 connections. > S> > S> While I'm here, nuke the unnecessary zeroing out pkthdr.csum_flags. > S> > S> Reviewed by: adrain > S> Approved by: adrian (mentor) > S> Sponsored by: Microsoft OSTC > S> Differential Revision: https://reviews.freebsd.org/D4853 > > Consider using m_get2() instead of implementing it yourself :) Good suggestion, noted :) Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Tue Jan 12 06:29:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A88EA6D1AE; Tue, 12 Jan 2016 06:29:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CDD41031; Tue, 12 Jan 2016 06:29:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C6TI9O064436; Tue, 12 Jan 2016 06:29:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C6TI1O064435; Tue, 12 Jan 2016 06:29:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601120629.u0C6TI1O064435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 06:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293730 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 06:29:19 -0000 Author: arybchik Date: Tue Jan 12 06:29:17 2016 New Revision: 293730 URL: https://svnweb.freebsd.org/changeset/base/293730 Log: sfxge: add sanity checking for EFX_OPT_MEDFORD build option to efx_check.h Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4854 Modified: head/sys/dev/sfxge/common/efx_check.h Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue Jan 12 05:56:49 2016 (r293729) +++ head/sys/dev/sfxge/common/efx_check.h Tue Jan 12 06:29:17 2016 (r293730) @@ -52,16 +52,17 @@ /* Verify chip implements accessed registers */ #if EFSYS_OPT_CHECK_REG -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "CHECK_REG requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "CHECK_REG requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_CHECK_REG */ /* Decode fatal errors */ #if EFSYS_OPT_DECODE_INTR_FATAL # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA) -# if EFSYS_OPT_HUNTINGTON -# error "INTR_FATAL not supported on HUNTINGTON" +# if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "INTR_FATAL not supported on HUNTINGTON or MEDFORD" # endif # error "INTR_FATAL requires FALCON or SIENA" # endif @@ -69,15 +70,17 @@ /* Support diagnostic hardware tests */ #if EFSYS_OPT_DIAG -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "DIAG requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "DIAG requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_DIAG */ /* Support optimized EVQ data access */ #if EFSYS_OPT_EV_PREFETCH -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "EV_PREFETCH requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "EV_PREFETCH requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_EV_PREFETCH */ @@ -90,21 +93,23 @@ /* Support hardware packet filters */ #if EFSYS_OPT_FILTER -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "FILTER requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "FILTER requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_FILTER */ -#if EFSYS_OPT_HUNTINGTON +#if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) # if !EFSYS_OPT_FILTER -# error "HUNTINGTON requires FILTER" +# error "HUNTINGTON or MEDFORD requires FILTER" # endif #endif /* EFSYS_OPT_HUNTINGTON */ /* Support hardware loopback modes */ #if EFSYS_OPT_LOOPBACK -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "LOOPBACK requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "LOOPBACK requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_LOOPBACK */ @@ -124,26 +129,26 @@ /* Support MAC statistics */ #if EFSYS_OPT_MAC_STATS -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "MAC_STATS requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "MAC_STATS requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_MAC_STATS */ /* Support management controller messages */ #if EFSYS_OPT_MCDI -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) # if EFSYS_OPT_FALCON # error "MCDI not supported on FALCON" # endif -# error "MCDI requires SIENA or HUNTINGTON" +# error "MCDI requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_MCDI */ -#if EFSYS_OPT_SIENA && !EFSYS_OPT_MCDI -# error "SIENA requires MCDI" -#endif -#if EFSYS_OPT_HUNTINGTON && !EFSYS_OPT_MCDI -# error "HUNTINGTON requires MCDI" +#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# if !EFSYS_OPT_MCDI +# error "SIENA or HUNTINGTON or MEDFORD requires MCDI" +# endif #endif /* Support MCDI logging */ @@ -193,15 +198,16 @@ /* Support monitor statistics (voltage/temperature) */ #if EFSYS_OPT_MON_STATS -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "MON_STATS requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "MON_STATS requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_MON_STATS */ /* Support Monitor via mcdi */ #if EFSYS_OPT_MON_MCDI -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "MON_MCDI requires SIENA or HUNTINGTON" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "MON_MCDI requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_MON_MCDI*/ @@ -216,8 +222,9 @@ /* Support non volatile configuration */ #if EFSYS_OPT_NVRAM -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "NVRAM requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "NVRAM requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_NVRAM */ @@ -340,29 +347,33 @@ /* Support EVQ/RXQ/TXQ statistics */ #if EFSYS_OPT_QSTATS -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "QSTATS requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "QSTATS requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_QSTATS */ /* Support receive header split */ #if EFSYS_OPT_RX_HDR_SPLIT -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "RX_HDR_SPLIT requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "RX_HDR_SPLIT requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_RX_HDR_SPLIT */ /* Support receive scaling (RSS) */ #if EFSYS_OPT_RX_SCALE -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "RX_SCALE requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "RX_SCALE requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_RX_SCALE */ /* Support receive scatter DMA */ #if EFSYS_OPT_RX_SCATTER -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "RX_SCATTER requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "RX_SCATTER requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_RX_SCATTER */ @@ -373,8 +384,9 @@ /* Support PCI Vital Product Data (VPD) */ #if EFSYS_OPT_VPD -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "VPD requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "VPD requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_VPD */ @@ -387,15 +399,17 @@ /* Support calculating multicast pktfilter in common code */ #if EFSYS_OPT_MCAST_FILTER_LIST -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "MCAST_FILTER_LIST requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "MCAST_FILTER_LIST requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_MCAST_FILTER_LIST */ /* Support BIST */ #if EFSYS_OPT_BIST -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) -# error "BIST requires FALCON or SIENA or HUNTINGTON" +# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ + EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "BIST requires FALCON or SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_BIST */ From owner-svn-src-head@freebsd.org Tue Jan 12 06:32:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62247A6D508; Tue, 12 Jan 2016 06:32:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24E7714BD; Tue, 12 Jan 2016 06:32:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C6Wvr9067166; Tue, 12 Jan 2016 06:32:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C6Wu3b067163; Tue, 12 Jan 2016 06:32:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601120632.u0C6Wu3b067163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 06:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293731 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 06:32:58 -0000 Author: arybchik Date: Tue Jan 12 06:32:56 2016 New Revision: 293731 URL: https://svnweb.freebsd.org/changeset/base/293731 Log: sfxge: add Medford PCI IDs to common code Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4856 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Jan 12 06:29:17 2016 (r293730) +++ head/sys/dev/sfxge/common/efx.h Tue Jan 12 06:32:56 2016 (r293731) @@ -61,6 +61,7 @@ typedef enum efx_family_e { EFX_FAMILY_FALCON, EFX_FAMILY_SIENA, EFX_FAMILY_HUNTINGTON, + EFX_FAMILY_MEDFORD, EFX_FAMILY_NTYPES } efx_family_t; @@ -90,6 +91,9 @@ efx_infer_family( #define EFX_PCI_DEVID_FARMINGDALE_VF 0x1903 /* SFC9120 VF */ #define EFX_PCI_DEVID_GREENPORT_VF 0x1923 /* SFC9140 VF */ +#define EFX_PCI_DEVID_MEDFORD_PF_UNINIT 0x0913 +#define EFX_PCI_DEVID_MEDFORD 0x0A03 /* SFC9240 PF */ +#define EFX_PCI_DEVID_MEDFORD_VF 0x1A03 /* SFC9240 VF */ #define EFX_MEM_BAR 2 @@ -1153,11 +1157,11 @@ typedef struct efx_nic_cfg_s { #if EFSYS_OPT_BIST uint32_t enc_bist_mask; #endif /* EFSYS_OPT_BIST */ -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD uint32_t enc_pf; uint32_t enc_vf; uint32_t enc_privilege_mask; -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ boolean_t enc_bug26807_workaround; boolean_t enc_bug35388_workaround; boolean_t enc_bug41750_workaround; Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue Jan 12 06:29:17 2016 (r293730) +++ head/sys/dev/sfxge/common/efx_impl.h Tue Jan 12 06:32:56 2016 (r293731) @@ -797,6 +797,10 @@ struct efx_txq_s { rev = 'D'; \ break; \ \ + case EFX_FAMILY_MEDFORD: \ + rev = 'E'; \ + break; \ + \ default: \ rev = '?'; \ break; \ Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Tue Jan 12 06:29:17 2016 (r293730) +++ head/sys/dev/sfxge/common/efx_nic.c Tue Jan 12 06:32:56 2016 (r293731) @@ -49,7 +49,8 @@ efx_family( case EFX_PCI_DEVID_FALCON: *efp = EFX_FAMILY_FALCON; return (0); -#endif +#endif /* EFSYS_OPT_FALCON */ + #if EFSYS_OPT_SIENA case EFX_PCI_DEVID_SIENA_F1_UNINIT: /* @@ -63,7 +64,7 @@ efx_family( case EFX_PCI_DEVID_SIENA: *efp = EFX_FAMILY_SIENA; return (0); -#endif +#endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_PCI_DEVID_HUNTINGTON_PF_UNINIT: @@ -83,7 +84,26 @@ efx_family( case EFX_PCI_DEVID_GREENPORT_VF: *efp = EFX_FAMILY_HUNTINGTON; return (0); -#endif +#endif /* EFSYS_OPT_HUNTINGTON */ + +#if EFSYS_OPT_MEDFORD + case EFX_PCI_DEVID_MEDFORD_PF_UNINIT: + /* + * Hardware default for PF0 of uninitialised Medford. + * manftest must be able to cope with this device id. + */ + *efp = EFX_FAMILY_MEDFORD; + return (0); + + case EFX_PCI_DEVID_MEDFORD: + *efp = EFX_FAMILY_MEDFORD; + return (0); + + case EFX_PCI_DEVID_MEDFORD_VF: + *efp = EFX_FAMILY_MEDFORD; + return (0); +#endif /* EFSYS_OPT_MEDFORD */ + default: break; } @@ -110,8 +130,12 @@ efx_infer_family( EFSYS_BAR_READO(esbp, FR_AZ_CS_DEBUG_REG_OFST, &oword, B_TRUE); portnum = EFX_OWORD_FIELD(oword, FRF_CZ_CS_PORT_NUM); - switch (portnum) { - case 0: { + if ((portnum == 1) || (portnum == 2)) { +#if EFSYS_OPT_SIENA + family = EFX_FAMILY_SIENA; + goto out; +#endif + } else if (portnum == 0) { efx_dword_t dword; uint32_t hw_rev; @@ -119,31 +143,25 @@ efx_infer_family( B_TRUE); hw_rev = EFX_DWORD_FIELD(dword, ERF_DZ_HW_REV_ID); if (hw_rev == ER_DZ_BIU_HW_REV_ID_REG_RESET) { -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD + /* + * BIU_HW_REV_ID is the same for Huntington and Medford. + * Assume Huntington, as Medford is very similar. + */ family = EFX_FAMILY_HUNTINGTON; - break; + goto out; #endif } else { #if EFSYS_OPT_FALCON family = EFX_FAMILY_FALCON; - break; + goto out; #endif } - rc = ENOTSUP; - goto fail1; - } - -#if EFSYS_OPT_SIENA - case 1: - case 2: - family = EFX_FAMILY_SIENA; - break; -#endif - default: - rc = ENOTSUP; - goto fail1; } + rc = ENOTSUP; + goto fail1; +out: if (efp != NULL) *efp = family; return (0); From owner-svn-src-head@freebsd.org Tue Jan 12 06:34:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AABB2A6D584; Tue, 12 Jan 2016 06:34:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78C99173F; Tue, 12 Jan 2016 06:34:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C6YjP2067279; Tue, 12 Jan 2016 06:34:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C6Yjwf067278; Tue, 12 Jan 2016 06:34:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601120634.u0C6Yjwf067278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 06:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293732 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 06:34:46 -0000 Author: arybchik Date: Tue Jan 12 06:34:45 2016 New Revision: 293732 URL: https://svnweb.freebsd.org/changeset/base/293732 Log: sfxge: use MCDIv2 on Medford Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4857 Modified: head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Jan 12 06:32:56 2016 (r293731) +++ head/sys/dev/sfxge/common/efx.h Tue Jan 12 06:34:45 2016 (r293732) @@ -191,8 +191,8 @@ efx_nic_destroy( #if EFSYS_OPT_MCDI -#if EFSYS_OPT_HUNTINGTON -/* Huntington requires MCDIv2 commands */ +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +/* Huntington and Medford require MCDIv2 commands */ #define WITH_MCDI_V2 1 #endif From owner-svn-src-head@freebsd.org Tue Jan 12 06:37:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EFA3A6D675; Tue, 12 Jan 2016 06:37:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A668199F; Tue, 12 Jan 2016 06:37:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C6bguk067431; Tue, 12 Jan 2016 06:37:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C6bga6067428; Tue, 12 Jan 2016 06:37:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601120637.u0C6bga6067428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 06:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293733 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 06:37:43 -0000 Author: arybchik Date: Tue Jan 12 06:37:42 2016 New Revision: 293733 URL: https://svnweb.freebsd.org/changeset/base/293733 Log: sfxge: add Medford sensor support Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4858 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mon.c head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Jan 12 06:34:45 2016 (r293732) +++ head/sys/dev/sfxge/common/efx.h Tue Jan 12 06:37:42 2016 (r293733) @@ -594,6 +594,7 @@ typedef enum efx_mon_type_e { EFX_MON_MAX6647, EFX_MON_SFC90X0, EFX_MON_SFC91X0, + EFX_MON_SFC92X0, EFX_MON_NTYPES } efx_mon_type_t; @@ -1148,12 +1149,12 @@ typedef struct efx_nic_cfg_s { uint32_t enc_mcdi_phy_stat_mask; #endif /* EFSYS_OPT_PHY_STATS */ #endif /* EFSYS_OPT_SIENA */ -#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON) +#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) #if EFSYS_OPT_MON_STATS uint32_t *enc_mcdi_sensor_maskp; uint32_t enc_mcdi_sensor_mask_size; #endif /* EFSYS_OPT_MON_STATS */ -#endif /* (EFSYS_OPT_SIENA | EFSYS_OPT_HUNTINGTON) */ +#endif /* (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */ #if EFSYS_OPT_BIST uint32_t enc_bist_mask; #endif /* EFSYS_OPT_BIST */ Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Tue Jan 12 06:34:45 2016 (r293732) +++ head/sys/dev/sfxge/common/efx_mon.c Tue Jan 12 06:37:42 2016 (r293733) @@ -62,6 +62,7 @@ static const char *__efx_mon_name[] = { "max6647", "sfx90x0", "sfx91x0" + "sfx92x0" }; const char * @@ -119,34 +120,6 @@ static efx_mon_ops_t __efx_mon_mcdi_ops }; #endif -static efx_mon_ops_t *__efx_mon_ops[] = { - NULL, -#if EFSYS_OPT_MON_NULL - &__efx_mon_null_ops, -#else - NULL, -#endif -#if EFSYS_OPT_MON_LM87 - &__efx_mon_lm87_ops, -#else - NULL, -#endif -#if EFSYS_OPT_MON_MAX6647 - &__efx_mon_max6647_ops, -#else - NULL, -#endif -#if EFSYS_OPT_MON_MCDI - &__efx_mon_mcdi_ops, -#else - NULL, -#endif -#if EFSYS_OPT_MON_MCDI - &__efx_mon_mcdi_ops -#else - NULL -#endif -}; __checkReturn efx_rc_t efx_mon_init( @@ -170,8 +143,30 @@ efx_mon_init( emp->em_type = encp->enc_mon_type; EFSYS_ASSERT(encp->enc_mon_type != EFX_MON_INVALID); - EFSYS_ASSERT3U(emp->em_type, <, EFX_MON_NTYPES); - if ((emop = (efx_mon_ops_t *)__efx_mon_ops[emp->em_type]) == NULL) { + switch (emp->em_type) { +#if EFSYS_OPT_MON_NULL + case EFX_MON_NULL: + emop = &__efx_mon_null_ops; + break; +#endif +#if EFSYS_OPT_MON_LM87 + case EFX_MON_LM87: + emop = &__efx_mon_lm87_ops; + break; +#endif +#if EFSYS_OPT_MON_MAX6647 + case EFX_MON_MAX6647: + emop = &__efx_mon_max6647_ops; + break; +#endif +#if EFSYS_OPT_MON_MCDI + case EFX_MON_SFC90X0: + case EFX_MON_SFC91X0: + case EFX_MON_SFC92X0: + emop = &__efx_mon_mcdi_ops; + break; +#endif + default: rc = ENOTSUP; goto fail2; } Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Tue Jan 12 06:34:45 2016 (r293732) +++ head/sys/dev/sfxge/common/mcdi_mon.c Tue Jan 12 06:37:42 2016 (r293733) @@ -478,6 +478,11 @@ mcdi_mon_cfg_build( encp->enc_mon_type = EFX_MON_SFC91X0; break; #endif +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + encp->enc_mon_type = EFX_MON_SFC92X0; + break; +#endif default: rc = EINVAL; goto fail1; From owner-svn-src-head@freebsd.org Tue Jan 12 07:55:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 273CFA6D11F; Tue, 12 Jan 2016 07:55:36 +0000 (UTC) (envelope-from joel@vnode.se) Received: from smtp.vnode.se (smtp.vnode.se [IPv6:2001:67c:40c:e3aa::5]) by mx1.freebsd.org (Postfix) with ESMTP id E6D581D8C; Tue, 12 Jan 2016 07:55:35 +0000 (UTC) (envelope-from joel@vnode.se) Received: from ymer.vnode.se (81-234-63-71-no20.tbcn.telia.com [81.234.63.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.vnode.se (Postfix) with ESMTPSA id 02B942952F; Tue, 12 Jan 2016 08:55:26 +0100 (CET) Date: Tue, 12 Jan 2016 08:55:25 +0100 From: Joel Dahl To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293720 - head/sys/dev/hyperv/netvsc Message-ID: <20160112075525.GA38087@ymer.vnode.se> Mail-Followup-To: Sepherosa Ziehau , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601120141.u0C1fYbC080237@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601120141.u0C1fYbC080237@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 07:55:36 -0000 On Tue, Jan 12, 2016 at 01:41:34AM +0000, Sepherosa Ziehau wrote: > Author: sephe > Date: Tue Jan 12 01:41:34 2016 > New Revision: 293720 > URL: https://svnweb.freebsd.org/changeset/base/293720 > > Log: > hyperv/hn: Implement SIOC[SG]IFMEDIA support > > Many applications and kernel modules (e.g. bridge) rely on the ifmedia > status report; give them what they want. > > Submitted by: Dexuan Cui > Reviewed by: Jun Su , me, adrian > Modified by: me (minor) ^^^^^^^^^^^^^^^ Really? % finger me@freebsd.org [freebsd.org] Trying 8.8.178.110... Login: me Name: Michael Elbel Directory: /home/me Shell: /usr/local/bin/bash No Mail. Mail forwarded to: me@consol.de # me No Plan. ;-) -- Joel From owner-svn-src-head@freebsd.org Tue Jan 12 08:32:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 708EAA6B1CC; Tue, 12 Jan 2016 08:32:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F88910AA; Tue, 12 Jan 2016 08:32:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C8WsmP002666; Tue, 12 Jan 2016 08:32:54 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C8WrEO002661; Tue, 12 Jan 2016 08:32:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601120832.u0C8WrEO002661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 08:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293734 - in head/sys: dev/sfxge/common modules/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 08:32:55 -0000 Author: arybchik Date: Tue Jan 12 08:32:53 2016 New Revision: 293734 URL: https://svnweb.freebsd.org/changeset/base/293734 Log: sfxge: add medford_impl.h, medford_nic.c, ef10_impl.h Creating some files together to do the build system changes in one go. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4859 Added: head/sys/dev/sfxge/common/ef10_impl.h (contents, props changed) head/sys/dev/sfxge/common/medford_impl.h (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c (contents, props changed) Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/modules/sfxge/Makefile Added: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/ef10_impl.h Tue Jan 12 08:32:53 2016 (r293734) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2015 Solarflare Communications Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of the FreeBSD Project. + * + * $FreeBSD$ + */ + +#ifndef _SYS_EF10_IMPL_H +#define _SYS_EF10_IMPL_H + +#ifdef __cplusplus +extern "C" { +#endif + + + + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_EF10_IMPL_H */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue Jan 12 06:37:42 2016 (r293733) +++ head/sys/dev/sfxge/common/efx_impl.h Tue Jan 12 08:32:53 2016 (r293734) @@ -58,6 +58,14 @@ #include "hunt_impl.h" #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD +#include "medford_impl.h" +#endif /* EFSYS_OPT_MEDFORD */ + +#if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +#include "ef10_impl.h" +#endif /* (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */ + #ifdef __cplusplus extern "C" { #endif Added: head/sys/dev/sfxge/common/medford_impl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/medford_impl.h Tue Jan 12 08:32:53 2016 (r293734) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2015 Solarflare Communications Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of the FreeBSD Project. + * + * $FreeBSD$ + */ + +#ifndef _SYS_MEDFORD_IMPL_H +#define _SYS_MEDFORD_IMPL_H + +#ifdef __cplusplus +extern "C" { +#endif + + + + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_MEDFORD_IMPL_H */ Added: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/medford_nic.c Tue Jan 12 08:32:53 2016 (r293734) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2015 Solarflare Communications Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of the FreeBSD Project. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "efsys.h" +#include "efx.h" +#include "efx_impl.h" +#include "mcdi_mon.h" + +#if EFSYS_OPT_MEDFORD + +#include "ef10_tlv_layout.h" + + + + +#endif /* EFSYS_OPT_MEDFORD */ Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Tue Jan 12 06:37:42 2016 (r293733) +++ head/sys/modules/sfxge/Makefile Tue Jan 12 08:32:53 2016 (r293734) @@ -29,11 +29,16 @@ SRCS+= siena_mac.c siena_mcdi.c siena_ni SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h +SRCS+= ef10_impl.h + SRCS+= hunt_ev.c hunt_intr.c hunt_mac.c hunt_mcdi.c hunt_nic.c SRCS+= hunt_nvram.c hunt_rx.c hunt_phy.c hunt_sram.c hunt_tx.c hunt_vpd.c SRCS+= hunt_filter.c SRCS+= hunt_impl.h +SRCS+= medford_nic.c +SRCS+= medford_impl.h + # Extra debug checks #CFLAGS += -DDEBUG=1 From owner-svn-src-head@freebsd.org Tue Jan 12 09:32:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F084A6D2B1; Tue, 12 Jan 2016 09:32:47 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D07B81CD5; Tue, 12 Jan 2016 09:32:46 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id f206so309805183wmf.0; Tue, 12 Jan 2016 01:32:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=tznwp1U3vrDfhGaEfSwexiEP0/k7bwemA7Vm6KqFDF8=; b=dHHwP7hBTtwhD+sSMaR0mqxGPSIEu51oM9RnusnuOjOhW8xPwUsytf0luzUEqIpW1v /i3jcLPaIZaHhpDrwCNzd+mlhbG7L871usIvJilWWTr8P2AXKQIPLoU1Seiz6rK9Acte WYi7CqjDTy7uEKTJHWT4ChwK7mIK4YS9sL2c1nghiUbqPXCJBwfJk9uGz9fVwLsaXDht DrYWT+e2OAdRtWhO3Ors0owyfN/kzmHDqjeRfy7f0lnceP91bH+VcAHN68BJbklSd9yv yE7kGhnnXq2FFcffHf503iKSRdBGSDuTu0z+VHwmW1A9DEn4Kdq7kISTAHhDywO33F5X Efbg== X-Received: by 10.28.171.135 with SMTP id u129mr17262472wme.99.1452591165290; Tue, 12 Jan 2016 01:32:45 -0800 (PST) Received: from [172.16.1.30] (178.Red-79-152-19.dynamicIP.rima-tde.net. [79.152.19.178]) by smtp.gmail.com with ESMTPSA id s129sm16580842wmf.18.2016.01.12.01.32.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jan 2016 01:32:44 -0800 (PST) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Subject: Re: svn commit: r291716 - in head: share/man/man4 sys/cam sys/cam/ata sys/cam/scsi sys/dev/md sys/geom sys/kern sys/pc98/include sys/sys usr.sbin usr.sbin/camdd To: Colin Percival , "Kenneth D. Merry" References: <201512032054.tB3KsuUw037541@repo.freebsd.org> <5693E672.7080100@FreeBSD.org> <20160111195231.GA57278@mithlond.kdm.org> <5694134F.6070201@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, gibbs@freebsd.org From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Message-ID: <5694C83A.1040609@FreeBSD.org> Date: Tue, 12 Jan 2016 10:32:42 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <5694134F.6070201@freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 09:32:47 -0000 El 11/01/16 a les 21.40, Colin Percival ha escrit: > On 01/11/16 11:52, Kenneth D. Merry wrote: >> On Mon, Jan 11, 2016 at 18:29:22 +0100, Roger Pau Monn?? wrote: >>> The following patch solves the problem AFAICT, and I would like to >>> commit it ASAP: >> >> I think this should be fine. > > In light of the "ASAP" and the hour in Roger's part of the world (and the > fact that this was obstructing other work I want to do today) I committed > this fix as r293698 after experimental confirmation that it fixes what I > was seeing. > > Thank you both for the quick investigation! Thanks both for the fast response, let's hope that this doesn't introduce any other regressions :). Roger. From owner-svn-src-head@freebsd.org Tue Jan 12 09:42:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DA67A6D6AE; Tue, 12 Jan 2016 09:42:23 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FFE013D9; Tue, 12 Jan 2016 09:42:22 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C9gMs8024302; Tue, 12 Jan 2016 09:42:22 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C9gMHX024301; Tue, 12 Jan 2016 09:42:22 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201601120942.u0C9gMHX024301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 12 Jan 2016 09:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293739 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 09:42:23 -0000 Author: cperciva Date: Tue Jan 12 09:42:21 2016 New Revision: 293739 URL: https://svnweb.freebsd.org/changeset/base/293739 Log: Enable "EC2 Enhanced Networking" (aka. SR-IOV networking) when creating EC2 images. X-MFC after: if/when the driver fixes get MFCed Relnotes: FreeBSD now supports EC2 Enhanced Networking Modified: head/release/Makefile.ec2 Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Tue Jan 12 09:27:01 2016 (r293738) +++ head/release/Makefile.ec2 Tue Jan 12 09:42:21 2016 (r293739) @@ -51,7 +51,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} @echo "--------------------------------------------------------------" @false .endif - /usr/local/bin/bsdec2-image-upload ${PUBLISH} \ + /usr/local/bin/bsdec2-image-upload ${PUBLISH} --sriov \ ${.OBJDIR}/ec2.raw \ "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ "${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \ From owner-svn-src-head@freebsd.org Tue Jan 12 09:52:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA395A6D9EE; Tue, 12 Jan 2016 09:52:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9091B0E; Tue, 12 Jan 2016 09:52:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0C9qcTC027345; Tue, 12 Jan 2016 09:52:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0C9qc1h027343; Tue, 12 Jan 2016 09:52:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601120952.u0C9qc1h027343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 09:52:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293740 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 09:52:39 -0000 Author: arybchik Date: Tue Jan 12 09:52:38 2016 New Revision: 293740 URL: https://svnweb.freebsd.org/changeset/base/293740 Log: sfxge: update autogenerated monitors lists Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mon.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Jan 12 09:42:21 2016 (r293739) +++ head/sys/dev/sfxge/common/efx.h Tue Jan 12 09:52:38 2016 (r293740) @@ -615,7 +615,7 @@ efx_mon_init( #define EFX_MON_STATS_PAGE_SIZE 0x100 #define EFX_MON_MASK_ELEMENT_SIZE 32 -/* START MKCONFIG GENERATED MonitorHeaderStatsBlock c79c86b62a144846 */ +/* START MKCONFIG GENERATED MonitorHeaderStatsBlock c09b13f732431f23 */ typedef enum efx_mon_stat_e { EFX_MON_STAT_2_5V, EFX_MON_STAT_VCCP1, @@ -686,6 +686,12 @@ typedef enum efx_mon_stat_e { EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP, EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT_EXT_ADC, EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP_EXT_ADC, + EFX_MON_STAT_SODIMM_VOUT, + EFX_MON_STAT_SODIMM_0_TEMP, + EFX_MON_STAT_SODIMM_1_TEMP, + EFX_MON_STAT_PHY0_VCC, + EFX_MON_STAT_PHY1_VCC, + EFX_MON_STAT_CONTROLLER_TDIODE_TEMP, EFX_MON_NSTATS } efx_mon_stat_t; Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Tue Jan 12 09:42:21 2016 (r293739) +++ head/sys/dev/sfxge/common/efx_mon.c Tue Jan 12 09:52:38 2016 (r293740) @@ -209,7 +209,7 @@ fail1: #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED MonitorStatNamesBlock b9328f15438c4d01 */ +/* START MKCONFIG GENERATED MonitorStatNamesBlock 01ee3ea01f23a0c4 */ static const char *__mon_stat_name[] = { "value_2_5v", "value_vccp1", @@ -280,6 +280,12 @@ static const char *__mon_stat_name[] = "controller_slave_internal_temp", "controller_slave_vptat_ext_adc", "controller_slave_internal_temp_ext_adc", + "sodimm_vout", + "sodimm_0_temp", + "sodimm_1_temp", + "phy0_vcc", + "phy1_vcc", + "controller_tdiode_temp", }; /* END MKCONFIG GENERATED MonitorStatNamesBlock */ From owner-svn-src-head@freebsd.org Tue Jan 12 10:16:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6388FA6C451; Tue, 12 Jan 2016 10:16:17 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AA451F2D; Tue, 12 Jan 2016 10:16:17 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CAGGN9034047; Tue, 12 Jan 2016 10:16:16 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CAGGZD034045; Tue, 12 Jan 2016 10:16:16 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201601121016.u0CAGGZD034045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Tue, 12 Jan 2016 10:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293745 - head/usr.sbin/bhyvectl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 10:16:17 -0000 Author: brueffer Date: Tue Jan 12 10:16:15 2016 New Revision: 293745 URL: https://svnweb.freebsd.org/changeset/base/293745 Log: Add a basic bhyvectl manpage. Reviewed by: neel MFC after: 2 weeks Added: head/usr.sbin/bhyvectl/bhyvectl.8 (contents, props changed) Modified: head/usr.sbin/bhyvectl/Makefile Modified: head/usr.sbin/bhyvectl/Makefile ============================================================================== --- head/usr.sbin/bhyvectl/Makefile Tue Jan 12 10:14:57 2016 (r293744) +++ head/usr.sbin/bhyvectl/Makefile Tue Jan 12 10:16:15 2016 (r293745) @@ -5,7 +5,7 @@ PROG= bhyvectl SRCS= bhyvectl.c -MAN= +MAN= bhyvectl.8 LIBADD= vmmapi util Added: head/usr.sbin/bhyvectl/bhyvectl.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyvectl/bhyvectl.8 Tue Jan 12 10:16:15 2016 (r293745) @@ -0,0 +1,97 @@ +.\" Copyright (c) 2015 Christian Brueffer +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 12, 2016 +.Dt BHYVECTL 8 +.Os +.Sh NAME +.Nm bhyvectl +.Nd "control utility for bhyve instances" +.Sh SYNOPSIS +.Nm +.Fl -vm= Ns Ar +.Op Fl -create +.Op Fl -destroy +.Op Fl -get-stats +.Op Fl -inject-nmi +.Op Fl -force-reset +.Op Fl -force-poweroff +.Sh DESCRIPTION +The +.Nm +command is a control utility for active +.Xr bhyve 8 +virtual machine instances. +.Pp +.Em Note : +Most +.Nm +flags are intended for querying and setting the state of an active instance. +These commands are intended for development purposes, and are not documented here. +A complete list can be obtained by executing +.Nm +without any arguments. +.Pp +The user-facing options are as follows: +.Bl -tag -width ".Fl d Ar argument" +.It Fl -vm= Ns Ar +Operate on the virtual machine +.Ar . +.It Fl -create +Create the specified VM. +.It Fl -destroy +Destroy the specified VM. +.It Fl -get-state +Retrieve statistics for the specified VM. +.It Fl -inject-nmi +Inject a non-maskable interrupt (NMI) into the VM. +.It Fl -force-reset +Force the VM to reset. +.It Fl -force-poweroff +Force the VM to power off. +.El +.Sh EXIT STATUS +.Ex -std +.Sh EXAMPLES +Destroy the VM called fbsd10: +.Pp +.Dl "bhyvectl --vm=fbsd10 --destroy" +.Sh SEE ALSO +.Xr bhyve 8 , +.Xr bhyveload 8 +.Sh HISTORY +The +.Nm +command first appeared in +.Fx 10.1 . +.Sh AUTHORS +.An -nosplit +The +.Nm +utility was written by +.An Peter Grehan +and +.An Neel Natu . From owner-svn-src-head@freebsd.org Tue Jan 12 10:19:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA932A6C5B9; Tue, 12 Jan 2016 10:19:57 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B805911A6; Tue, 12 Jan 2016 10:19:57 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CAJunN034199; Tue, 12 Jan 2016 10:19:56 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CAJuTx034198; Tue, 12 Jan 2016 10:19:56 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201601121019.u0CAJuTx034198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Tue, 12 Jan 2016 10:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293746 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 10:19:58 -0000 Author: brueffer Date: Tue Jan 12 10:19:56 2016 New Revision: 293746 URL: https://svnweb.freebsd.org/changeset/base/293746 Log: Document etherswitch and drivers using this framework. MFC after: 2 weeks Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Jan 12 10:16:15 2016 (r293745) +++ head/sys/conf/NOTES Tue Jan 12 10:19:56 2016 (r293746) @@ -2586,6 +2586,25 @@ device pps device lpbb device pcfclock +# +# Etherswitch framework and drivers +# +# etherswitch The etherswitch(4) framework +# miiproxy Proxy device for miibus(4) functionality +# +# Switch hardware support: +# arswitch Atheros switches +# ip17x IC+ 17x family switches +# rtl8366r Realtek RTL8366 switches +# ukswitch Multi-PHY switches +# +device etherswitch +device miiproxy +device arswitch +device ip17x +device rtl8366rb +device ukswitch + # Kernel BOOTP support options BOOTP # Use BOOTP to obtain IP address/hostname From owner-svn-src-head@freebsd.org Tue Jan 12 10:31:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34A27A6CB2C; Tue, 12 Jan 2016 10:31:50 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf0-x22e.google.com (mail-pf0-x22e.google.com [IPv6:2607:f8b0:400e:c00::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B1C81B83; Tue, 12 Jan 2016 10:31:50 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf0-x22e.google.com with SMTP id e65so61148367pfe.0; Tue, 12 Jan 2016 02:31:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=1ETpYlAFrzc83qXjm9CeO9hHYe3wcV+ef6WjW32/yvs=; b=itj/d7AseGpZ4uhT7k2/tfet8p9cSKglTWcwbfWWrI/JIqPEuy67lDSXqpQ/oqCNJt CFegD/xtdX4j+scNh8nv0K+WNWAMQ/bBOble9ATBm8QsHxkmCr/iNzfGxipNNjBGVxEj 9bgyf/OZSXcIxrZW3fhsumk4VPmXlevhQEO0JYOTrnrEGzoLMTC8evxUD9fGrN6VaslX axA+AQAcwHZucEyc+cFQit0SMNHEaQzhneRyvXqAaWhC/+somEFqtVb17pHiSDgsNM30 9c8WRtN11+fZeI2BjZwjUl8hvh/ZOatA9Y8jpG/WvxhrCmA8Yf8eNqjPXfMX3FZyg8Bx uVeQ== X-Received: by 10.98.17.199 with SMTP id 68mr33548192pfr.30.1452594709591; Tue, 12 Jan 2016 02:31:49 -0800 (PST) Received: from ?IPv6:2001:44b8:31ae:7b01:88b5:f3c0:af89:ff6a? (2001-44b8-31ae-7b01-88b5-f3c0-af89-ff6a.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:88b5:f3c0:af89:ff6a]) by smtp.gmail.com with ESMTPSA id sy5sm191817012pac.5.2016.01.12.02.31.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jan 2016 02:31:49 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r293739 - head/release References: <201601120942.u0C9gMHX024301@repo.freebsd.org> To: Colin Percival , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kubilay Kocak Message-ID: <5694D60D.5050404@FreeBSD.org> Date: Tue, 12 Jan 2016 21:31:41 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Thunderbird/43.0 MIME-Version: 1.0 In-Reply-To: <201601120942.u0C9gMHX024301@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 10:31:50 -0000 On 12/01/2016 8:42 PM, Colin Percival wrote: > Author: cperciva > Date: Tue Jan 12 09:42:21 2016 > New Revision: 293739 > URL: https://svnweb.freebsd.org/changeset/base/293739 > > Log: > Enable "EC2 Enhanced Networking" (aka. SR-IOV networking) when creating > EC2 images. > > X-MFC after: if/when the driver fixes get MFCed Is there a Bugzilla issue reference for this (or the head changeset)? > Relnotes: FreeBSD now supports EC2 Enhanced Networking > > Modified: > head/release/Makefile.ec2 > > Modified: head/release/Makefile.ec2 > ============================================================================== > --- head/release/Makefile.ec2 Tue Jan 12 09:27:01 2016 (r293738) > +++ head/release/Makefile.ec2 Tue Jan 12 09:42:21 2016 (r293739) > @@ -51,7 +51,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} > @echo "--------------------------------------------------------------" > @false > .endif > - /usr/local/bin/bsdec2-image-upload ${PUBLISH} \ > + /usr/local/bin/bsdec2-image-upload ${PUBLISH} --sriov \ > ${.OBJDIR}/ec2.raw \ > "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ > "${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \ > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Tue Jan 12 13:26:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB69DA6CB7A; Tue, 12 Jan 2016 13:26:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A77418E5; Tue, 12 Jan 2016 13:26:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CDQ4Ul092661; Tue, 12 Jan 2016 13:26:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CDQ4rC092656; Tue, 12 Jan 2016 13:26:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121326.u0CDQ4rC092656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 13:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293748 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 13:26:06 -0000 Author: arybchik Date: Tue Jan 12 13:26:04 2016 New Revision: 293748 URL: https://svnweb.freebsd.org/changeset/base/293748 Log: sfxge: change hunt specific fields of efx_nic_t to ef10 All these fields will be used in shared ef10 code, so put them in an ef10 member of a per-architecture union, rather that in the per-chip union. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4865 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/hunt_vpd.c head/sys/dev/sfxge/common/medford_impl.h Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Tue Jan 12 10:24:08 2016 (r293747) +++ head/sys/dev/sfxge/common/ef10_impl.h Tue Jan 12 13:26:04 2016 (r293748) @@ -37,6 +37,13 @@ extern "C" { #endif +#if (EFSYS_OPT_HUNTINGTON && EFSYS_OPT_MEDFORD) +#define EF10_MAX_PIOBUF_NBUFS MAX(HUNT_PIOBUF_NBUFS, MEDFORD_PIOBUF_NBUFS) +#elif EFSYS_OPT_HUNTINGTON +#define EF10_MAX_PIOBUF_NBUFS HUNT_PIOBUF_NBUFS +#elif EFSYS_OPT_MEDFORD +#define EF10_MAX_PIOBUF_NBUFS MEDFORD_PIOBUF_NBUFS +#endif Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue Jan 12 10:24:08 2016 (r293747) +++ head/sys/dev/sfxge/common/efx_impl.h Tue Jan 12 13:26:04 2016 (r293748) @@ -672,26 +672,29 @@ struct efx_nic_s { int enu_unused; } siena; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON + int enu_unused; + } en_u; +#if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) + union en_arch { struct { - int enu_vi_base; - int enu_vi_count; + int ena_vi_base; + int ena_vi_count; #if EFSYS_OPT_VPD - caddr_t enu_svpd; - size_t enu_svpd_length; + caddr_t ena_svpd; + size_t ena_svpd_length; #endif /* EFSYS_OPT_VPD */ - efx_piobuf_handle_t enu_piobuf_handle[HUNT_PIOBUF_NBUFS]; - uint32_t enu_piobuf_count; - uint32_t enu_pio_alloc_map[HUNT_PIOBUF_NBUFS]; - uint32_t enu_pio_write_vi_base; + efx_piobuf_handle_t ena_piobuf_handle[EF10_MAX_PIOBUF_NBUFS]; + uint32_t ena_piobuf_count; + uint32_t ena_pio_alloc_map[EF10_MAX_PIOBUF_NBUFS]; + uint32_t ena_pio_write_vi_base; /* Memory BAR mapping regions */ - uint32_t enu_uc_mem_map_offset; - size_t enu_uc_mem_map_size; - uint32_t enu_wc_mem_map_offset; - size_t enu_wc_mem_map_size; - } hunt; -#endif /* EFSYS_OPT_HUNTINGTON */ - } en_u; + uint32_t ena_uc_mem_map_offset; + size_t ena_uc_mem_map_size; + uint32_t ena_wc_mem_map_offset; + size_t ena_wc_mem_map_size; + } ef10; + } en_arch; +#endif /* (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */ }; Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Tue Jan 12 10:24:08 2016 (r293747) +++ head/sys/dev/sfxge/common/hunt_nic.c Tue Jan 12 13:26:04 2016 (r293748) @@ -715,30 +715,30 @@ hunt_nic_alloc_piobufs( efx_rc_t rc; EFSYS_ASSERT3U(max_piobuf_count, <=, - EFX_ARRAY_SIZE(enp->en_u.hunt.enu_piobuf_handle)); + EFX_ARRAY_SIZE(enp->en_arch.ef10.ena_piobuf_handle)); - enp->en_u.hunt.enu_piobuf_count = 0; + enp->en_arch.ef10.ena_piobuf_count = 0; for (i = 0; i < max_piobuf_count; i++) { - handlep = &enp->en_u.hunt.enu_piobuf_handle[i]; + handlep = &enp->en_arch.ef10.ena_piobuf_handle[i]; if ((rc = efx_mcdi_alloc_piobuf(enp, handlep)) != 0) goto fail1; - enp->en_u.hunt.enu_pio_alloc_map[i] = 0; - enp->en_u.hunt.enu_piobuf_count++; + enp->en_arch.ef10.ena_pio_alloc_map[i] = 0; + enp->en_arch.ef10.ena_piobuf_count++; } return; fail1: - for (i = 0; i < enp->en_u.hunt.enu_piobuf_count; i++) { - handlep = &enp->en_u.hunt.enu_piobuf_handle[i]; + for (i = 0; i < enp->en_arch.ef10.ena_piobuf_count; i++) { + handlep = &enp->en_arch.ef10.ena_piobuf_handle[i]; efx_mcdi_free_piobuf(enp, *handlep); *handlep = EFX_PIOBUF_HANDLE_INVALID; } - enp->en_u.hunt.enu_piobuf_count = 0; + enp->en_arch.ef10.ena_piobuf_count = 0; } @@ -749,13 +749,13 @@ hunt_nic_free_piobufs( efx_piobuf_handle_t *handlep; unsigned int i; - for (i = 0; i < enp->en_u.hunt.enu_piobuf_count; i++) { - handlep = &enp->en_u.hunt.enu_piobuf_handle[i]; + for (i = 0; i < enp->en_arch.ef10.ena_piobuf_count; i++) { + handlep = &enp->en_arch.ef10.ena_piobuf_handle[i]; efx_mcdi_free_piobuf(enp, *handlep); *handlep = EFX_PIOBUF_HANDLE_INVALID; } - enp->en_u.hunt.enu_piobuf_count = 0; + enp->en_arch.ef10.ena_piobuf_count = 0; } /* Sub-allocate a block from a piobuf */ @@ -781,14 +781,14 @@ hunt_nic_pio_alloc( EFSYS_ASSERT(sizep); if ((edcp->edc_pio_alloc_size == 0) || - (enp->en_u.hunt.enu_piobuf_count == 0)) { + (enp->en_arch.ef10.ena_piobuf_count == 0)) { rc = ENOMEM; goto fail1; } blk_per_buf = HUNT_PIOBUF_SIZE / edcp->edc_pio_alloc_size; - for (buf = 0; buf < enp->en_u.hunt.enu_piobuf_count; buf++) { - uint32_t *map = &enp->en_u.hunt.enu_pio_alloc_map[buf]; + for (buf = 0; buf < enp->en_arch.ef10.ena_piobuf_count; buf++) { + uint32_t *map = &enp->en_arch.ef10.ena_pio_alloc_map[buf]; if (~(*map) == 0) continue; @@ -805,7 +805,7 @@ hunt_nic_pio_alloc( goto fail2; done: - *handlep = enp->en_u.hunt.enu_piobuf_handle[buf]; + *handlep = enp->en_arch.ef10.ena_piobuf_handle[buf]; *bufnump = buf; *blknump = blk; *sizep = edcp->edc_pio_alloc_size; @@ -831,13 +831,13 @@ hunt_nic_pio_free( uint32_t *map; efx_rc_t rc; - if ((bufnum >= enp->en_u.hunt.enu_piobuf_count) || + if ((bufnum >= enp->en_arch.ef10.ena_piobuf_count) || (blknum >= (8 * sizeof (*map)))) { rc = EINVAL; goto fail1; } - map = &enp->en_u.hunt.enu_pio_alloc_map[bufnum]; + map = &enp->en_arch.ef10.ena_pio_alloc_map[bufnum]; if ((*map & (1u << blknum)) == 0) { rc = ENOENT; goto fail2; @@ -1579,7 +1579,8 @@ hunt_nic_init( * each VI that is using a sub-allocated block from the piobuf. */ min_vi_count = edcp->edc_min_vi_count; - max_vi_count = edcp->edc_max_vi_count + enp->en_u.hunt.enu_piobuf_count; + max_vi_count = + edcp->edc_max_vi_count + enp->en_arch.ef10.ena_piobuf_count; /* Ensure that the previously attached driver's VIs are freed */ if ((rc = efx_mcdi_free_vis(enp)) != 0) @@ -1601,44 +1602,44 @@ hunt_nic_init( goto fail4; } - enp->en_u.hunt.enu_vi_base = vi_base; - enp->en_u.hunt.enu_vi_count = vi_count; + enp->en_arch.ef10.ena_vi_base = vi_base; + enp->en_arch.ef10.ena_vi_count = vi_count; - if (vi_count < min_vi_count + enp->en_u.hunt.enu_piobuf_count) { + if (vi_count < min_vi_count + enp->en_arch.ef10.ena_piobuf_count) { /* Not enough extra VIs to map piobufs */ hunt_nic_free_piobufs(enp); } - enp->en_u.hunt.enu_pio_write_vi_base = - vi_count - enp->en_u.hunt.enu_piobuf_count; + enp->en_arch.ef10.ena_pio_write_vi_base = + vi_count - enp->en_arch.ef10.ena_piobuf_count; /* Save UC memory mapping details */ - enp->en_u.hunt.enu_uc_mem_map_offset = 0; - if (enp->en_u.hunt.enu_piobuf_count > 0) { - enp->en_u.hunt.enu_uc_mem_map_size = + enp->en_arch.ef10.ena_uc_mem_map_offset = 0; + if (enp->en_arch.ef10.ena_piobuf_count > 0) { + enp->en_arch.ef10.ena_uc_mem_map_size = (ER_DZ_TX_PIOBUF_STEP * - enp->en_u.hunt.enu_pio_write_vi_base); + enp->en_arch.ef10.ena_pio_write_vi_base); } else { - enp->en_u.hunt.enu_uc_mem_map_size = + enp->en_arch.ef10.ena_uc_mem_map_size = (ER_DZ_TX_PIOBUF_STEP * - enp->en_u.hunt.enu_vi_count); + enp->en_arch.ef10.ena_vi_count); } /* Save WC memory mapping details */ - enp->en_u.hunt.enu_wc_mem_map_offset = - enp->en_u.hunt.enu_uc_mem_map_offset + - enp->en_u.hunt.enu_uc_mem_map_size; + enp->en_arch.ef10.ena_wc_mem_map_offset = + enp->en_arch.ef10.ena_uc_mem_map_offset + + enp->en_arch.ef10.ena_uc_mem_map_size; - enp->en_u.hunt.enu_wc_mem_map_size = + enp->en_arch.ef10.ena_wc_mem_map_size = (ER_DZ_TX_PIOBUF_STEP * - enp->en_u.hunt.enu_piobuf_count); + enp->en_arch.ef10.ena_piobuf_count); /* Link piobufs to extra VIs in WC mapping */ - if (enp->en_u.hunt.enu_piobuf_count > 0) { - for (i = 0; i < enp->en_u.hunt.enu_piobuf_count; i++) { + if (enp->en_arch.ef10.ena_piobuf_count > 0) { + for (i = 0; i < enp->en_arch.ef10.ena_piobuf_count; i++) { rc = efx_mcdi_link_piobuf(enp, - enp->en_u.hunt.enu_pio_write_vi_base + i, - enp->en_u.hunt.enu_piobuf_handle[i]); + enp->en_arch.ef10.ena_pio_write_vi_base + i, + enp->en_arch.ef10.ena_piobuf_handle[i]); if (rc != 0) break; } @@ -1715,7 +1716,7 @@ hunt_nic_get_vi_pool( * Report VIs that the client driver can use. * Do not include VIs used for PIO buffer writes. */ - *vi_countp = enp->en_u.hunt.enu_pio_write_vi_base; + *vi_countp = enp->en_arch.ef10.ena_pio_write_vi_base; return (0); } @@ -1739,14 +1740,14 @@ hunt_nic_get_bar_region( switch (region) { case EFX_REGION_VI: /* UC mapped memory BAR region for VI registers */ - *offsetp = enp->en_u.hunt.enu_uc_mem_map_offset; - *sizep = enp->en_u.hunt.enu_uc_mem_map_size; + *offsetp = enp->en_arch.ef10.ena_uc_mem_map_offset; + *sizep = enp->en_arch.ef10.ena_uc_mem_map_size; break; case EFX_REGION_PIO_WRITE_VI: /* WC mapped memory BAR region for piobuf writes */ - *offsetp = enp->en_u.hunt.enu_wc_mem_map_offset; - *sizep = enp->en_u.hunt.enu_wc_mem_map_size; + *offsetp = enp->en_arch.ef10.ena_wc_mem_map_offset; + *sizep = enp->en_arch.ef10.ena_wc_mem_map_size; break; default: @@ -1773,10 +1774,10 @@ hunt_nic_fini( enp->en_vport_id = 0; /* Unlink piobufs from extra VIs in WC mapping */ - if (enp->en_u.hunt.enu_piobuf_count > 0) { - for (i = 0; i < enp->en_u.hunt.enu_piobuf_count; i++) { + if (enp->en_arch.ef10.ena_piobuf_count > 0) { + for (i = 0; i < enp->en_arch.ef10.ena_piobuf_count; i++) { rc = efx_mcdi_unlink_piobuf(enp, - enp->en_u.hunt.enu_pio_write_vi_base + i); + enp->en_arch.ef10.ena_pio_write_vi_base + i); if (rc != 0) break; } @@ -1785,7 +1786,7 @@ hunt_nic_fini( hunt_nic_free_piobufs(enp); (void) efx_mcdi_free_vis(enp); - enp->en_u.hunt.enu_vi_count = 0; + enp->en_arch.ef10.ena_vi_count = 0; } void Modified: head/sys/dev/sfxge/common/hunt_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_vpd.c Tue Jan 12 10:24:08 2016 (r293747) +++ head/sys/dev/sfxge/common/hunt_vpd.c Tue Jan 12 13:26:04 2016 (r293748) @@ -81,8 +81,8 @@ hunt_vpd_init( goto fail2; } - enp->en_u.hunt.enu_svpd = svpd; - enp->en_u.hunt.enu_svpd_length = svpd_size; + enp->en_arch.ef10.ena_svpd = svpd; + enp->en_arch.ef10.ena_svpd_length = svpd_size; out: return (0); @@ -197,7 +197,7 @@ hunt_vpd_verify( * Verify that there is no duplication between the static and * dynamic cfg sectors. */ - if (enp->en_u.hunt.enu_svpd_length == 0) + if (enp->en_arch.ef10.ena_svpd_length == 0) goto done; dcont = 0; @@ -213,8 +213,8 @@ hunt_vpd_verify( _NOTE(CONSTANTCONDITION) while (1) { if ((rc = efx_vpd_hunk_next( - enp->en_u.hunt.enu_svpd, - enp->en_u.hunt.enu_svpd_length, &stag, &skey, + enp->en_arch.ef10.ena_svpd, + enp->en_arch.ef10.ena_svpd_length, &stag, &skey, NULL, NULL, &scont)) != 0) goto fail3; if (scont == 0) @@ -254,14 +254,14 @@ hunt_vpd_reinit( /* * Only create an ID string if the dynamic cfg doesn't have one */ - if (enp->en_u.hunt.enu_svpd_length == 0) + if (enp->en_arch.ef10.ena_svpd_length == 0) wantpid = B_TRUE; else { unsigned int offset; uint8_t length; - rc = efx_vpd_hunk_get(enp->en_u.hunt.enu_svpd, - enp->en_u.hunt.enu_svpd_length, + rc = efx_vpd_hunk_get(enp->en_arch.ef10.ena_svpd, + enp->en_arch.ef10.ena_svpd_length, EFX_VPD_ID, 0, &offset, &length); if (rc == 0) wantpid = B_FALSE; @@ -298,13 +298,13 @@ hunt_vpd_get( EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); /* Attempt to satisfy the request from svpd first */ - if (enp->en_u.hunt.enu_svpd_length > 0) { - if ((rc = efx_vpd_hunk_get(enp->en_u.hunt.enu_svpd, - enp->en_u.hunt.enu_svpd_length, evvp->evv_tag, + if (enp->en_arch.ef10.ena_svpd_length > 0) { + if ((rc = efx_vpd_hunk_get(enp->en_arch.ef10.ena_svpd, + enp->en_arch.ef10.ena_svpd_length, evvp->evv_tag, evvp->evv_keyword, &offset, &length)) == 0) { evvp->evv_length = length; memcpy(evvp->evv_value, - enp->en_u.hunt.enu_svpd + offset, length); + enp->en_arch.ef10.ena_svpd + offset, length); return (0); } else if (rc != ENOENT) goto fail1; @@ -340,12 +340,12 @@ hunt_vpd_set( EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); /* If the provided (tag,keyword) exists in svpd, then it is readonly */ - if (enp->en_u.hunt.enu_svpd_length > 0) { + if (enp->en_arch.ef10.ena_svpd_length > 0) { unsigned int offset; uint8_t length; - if ((rc = efx_vpd_hunk_get(enp->en_u.hunt.enu_svpd, - enp->en_u.hunt.enu_svpd_length, evvp->evv_tag, + if ((rc = efx_vpd_hunk_get(enp->en_arch.ef10.ena_svpd, + enp->en_arch.ef10.ena_svpd_length, evvp->evv_tag, evvp->evv_keyword, &offset, &length)) == 0) { rc = EACCES; goto fail1; @@ -421,12 +421,12 @@ hunt_vpd_fini( { EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); - if (enp->en_u.hunt.enu_svpd_length > 0) { - EFSYS_KMEM_FREE(enp->en_esip, enp->en_u.hunt.enu_svpd_length, - enp->en_u.hunt.enu_svpd); + if (enp->en_arch.ef10.ena_svpd_length > 0) { + EFSYS_KMEM_FREE(enp->en_esip, enp->en_arch.ef10.ena_svpd_length, + enp->en_arch.ef10.ena_svpd); - enp->en_u.hunt.enu_svpd = NULL; - enp->en_u.hunt.enu_svpd_length = 0; + enp->en_arch.ef10.ena_svpd = NULL; + enp->en_arch.ef10.ena_svpd_length = 0; } } Modified: head/sys/dev/sfxge/common/medford_impl.h ============================================================================== --- head/sys/dev/sfxge/common/medford_impl.h Tue Jan 12 10:24:08 2016 (r293747) +++ head/sys/dev/sfxge/common/medford_impl.h Tue Jan 12 13:26:04 2016 (r293748) @@ -37,7 +37,7 @@ extern "C" { #endif - +#define MEDFORD_PIOBUF_NBUFS (16) #ifdef __cplusplus From owner-svn-src-head@freebsd.org Tue Jan 12 13:27:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72FBBA6CCA7; Tue, 12 Jan 2016 13:27:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A3211AE7; Tue, 12 Jan 2016 13:27:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CDRlSZ092756; Tue, 12 Jan 2016 13:27:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CDRl92092754; Tue, 12 Jan 2016 13:27:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121327.u0CDRl92092754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 13:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293749 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 13:27:48 -0000 Author: arybchik Date: Tue Jan 12 13:27:46 2016 New Revision: 293749 URL: https://svnweb.freebsd.org/changeset/base/293749 Log: sfxge: use NIC config in place of some Huntington specific PIO constants This should allow these functions to work for Medford as well. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4866 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/hunt_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Jan 12 13:26:04 2016 (r293748) +++ head/sys/dev/sfxge/common/efx.h Tue Jan 12 13:27:46 2016 (r293749) @@ -1128,6 +1128,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_buftbl_limit; uint32_t enc_piobuf_limit; uint32_t enc_piobuf_size; + uint32_t enc_piobuf_min_alloc_size; uint32_t enc_evq_timer_quantum_ns; uint32_t enc_evq_timer_max_us; uint32_t enc_clk_mult; Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Tue Jan 12 13:26:04 2016 (r293748) +++ head/sys/dev/sfxge/common/hunt_nic.c Tue Jan 12 13:27:46 2016 (r293749) @@ -768,6 +768,7 @@ hunt_nic_pio_alloc( __out uint32_t *offsetp, __out size_t *sizep) { + efx_nic_cfg_t *encp = &enp->en_nic_cfg; efx_drv_cfg_t *edcp = &enp->en_drv_cfg; uint32_t blk_per_buf; uint32_t buf, blk; @@ -785,7 +786,7 @@ hunt_nic_pio_alloc( rc = ENOMEM; goto fail1; } - blk_per_buf = HUNT_PIOBUF_SIZE / edcp->edc_pio_alloc_size; + blk_per_buf = encp->enc_piobuf_size / edcp->edc_pio_alloc_size; for (buf = 0; buf < enp->en_arch.ef10.ena_piobuf_count; buf++) { uint32_t *map = &enp->en_arch.ef10.ena_pio_alloc_map[buf]; @@ -1260,6 +1261,7 @@ hunt_board_cfg( encp->enc_piobuf_limit = HUNT_PIOBUF_NBUFS; encp->enc_piobuf_size = HUNT_PIOBUF_SIZE; + encp->enc_piobuf_min_alloc_size = HUNT_MIN_PIO_ALLOC_SIZE; /* * Get the current privilege mask. Note that this may be modified @@ -1470,7 +1472,8 @@ hunt_nic_set_drv_limits( uint32_t blk_size, blk_count, blks_per_piobuf; blk_size = - MAX(edlp->edl_min_pio_alloc_size, HUNT_MIN_PIO_ALLOC_SIZE); + MAX(edlp->edl_min_pio_alloc_size, + encp->enc_piobuf_min_alloc_size); blks_per_piobuf = encp->enc_piobuf_size / blk_size; EFSYS_ASSERT3U(blks_per_piobuf, <=, 32); From owner-svn-src-head@freebsd.org Tue Jan 12 13:29:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C723A6CD2A; Tue, 12 Jan 2016 13:29:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 081711C8E; Tue, 12 Jan 2016 13:29:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CDT6OW092849; Tue, 12 Jan 2016 13:29:06 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CDT5tH092845; Tue, 12 Jan 2016 13:29:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121329.u0CDT5tH092845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 13:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293750 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 13:29:07 -0000 Author: arybchik Date: Tue Jan 12 13:29:05 2016 New Revision: 293750 URL: https://svnweb.freebsd.org/changeset/base/293750 Log: sfxge: update SRAM methods to be no-ops on Medford as well Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4867 Modified: head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_sram.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_sram.c Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Tue Jan 12 13:27:46 2016 (r293749) +++ head/sys/dev/sfxge/common/efx_nic.c Tue Jan 12 13:29:05 2016 (r293750) @@ -291,7 +291,7 @@ static efx_nic_ops_t __efx_nic_hunt_ops hunt_nic_get_vi_pool, /* eno_get_vi_pool */ hunt_nic_get_bar_region, /* eno_get_bar_region */ #if EFSYS_OPT_DIAG - hunt_sram_test, /* eno_sram_test */ + ef10_sram_test, /* eno_sram_test */ hunt_nic_register_test, /* eno_register_test */ #endif /* EFSYS_OPT_DIAG */ hunt_nic_fini, /* eno_fini */ Modified: head/sys/dev/sfxge/common/efx_sram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_sram.c Tue Jan 12 13:27:46 2016 (r293749) +++ head/sys/dev/sfxge/common/efx_sram.c Tue Jan 12 13:29:05 2016 (r293750) @@ -55,20 +55,21 @@ efx_sram_buf_tbl_set( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); -#if EFSYS_OPT_HUNTINGTON - if (enp->en_family == EFX_FAMILY_HUNTINGTON) { +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD + if (enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD) { /* * FIXME: the efx_sram_buf_tbl_*() functionality needs to be * pulled inside the Falcon/Siena queue create/destroy code, * and then the original functions can be removed (see bug30834 * comment #1). But, for now, we just ensure that they are - * no-ops for Huntington, to allow bringing up existing drivers + * no-ops for EF10, to allow bringing up existing drivers * without modification. */ return (0); } -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ if (stop >= EFX_BUF_TBL_SIZE) { rc = EFBIG; @@ -176,20 +177,21 @@ efx_sram_buf_tbl_clear( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); -#if EFSYS_OPT_HUNTINGTON - if (enp->en_family == EFX_FAMILY_HUNTINGTON) { +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD + if (enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD) { /* * FIXME: the efx_sram_buf_tbl_*() functionality needs to be * pulled inside the Falcon/Siena queue create/destroy code, * and then the original functions can be removed (see bug30834 * comment #1). But, for now, we just ensure that they are - * no-ops for Huntington, to allow bringing up existing drivers + * no-ops for EF10, to allow bringing up existing drivers * without modification. */ return; } -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ EFSYS_ASSERT3U(stop, <, EFX_BUF_TBL_SIZE); Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:27:46 2016 (r293749) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:29:05 2016 (r293750) @@ -562,7 +562,7 @@ hunt_bist_stop( #if EFSYS_OPT_DIAG extern __checkReturn efx_rc_t -hunt_sram_test( +ef10_sram_test( __in efx_nic_t *enp, __in efx_sram_pattern_fn_t func); Modified: head/sys/dev/sfxge/common/hunt_sram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_sram.c Tue Jan 12 13:27:46 2016 (r293749) +++ head/sys/dev/sfxge/common/hunt_sram.c Tue Jan 12 13:29:05 2016 (r293750) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_DIAG __checkReturn efx_rc_t -hunt_sram_test( +ef10_sram_test( __in efx_nic_t *enp, __in efx_sram_pattern_fn_t func) { From owner-svn-src-head@freebsd.org Tue Jan 12 13:30:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A863A6CF31; Tue, 12 Jan 2016 13:30:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29BCF1F40; Tue, 12 Jan 2016 13:30:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CDUhR2092960; Tue, 12 Jan 2016 13:30:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CDUgA8092957; Tue, 12 Jan 2016 13:30:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121330.u0CDUgA8092957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 13:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293751 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 13:30:44 -0000 Author: arybchik Date: Tue Jan 12 13:30:42 2016 New Revision: 293751 URL: https://svnweb.freebsd.org/changeset/base/293751 Log: sfxge: rename hunt interrupt methods to ef10 and use on Medford All of these apply to both Huntington and Medford. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4868 Modified: head/sys/dev/sfxge/common/efx_intr.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_intr.c Modified: head/sys/dev/sfxge/common/efx_intr.c ============================================================================== --- head/sys/dev/sfxge/common/efx_intr.c Tue Jan 12 13:29:05 2016 (r293750) +++ head/sys/dev/sfxge/common/efx_intr.c Tue Jan 12 13:30:42 2016 (r293751) @@ -101,17 +101,16 @@ static efx_intr_ops_t __efx_intr_siena_o }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON -static efx_intr_ops_t __efx_intr_hunt_ops = { - hunt_intr_init, /* eio_init */ - hunt_intr_enable, /* eio_enable */ - hunt_intr_disable, /* eio_disable */ - hunt_intr_disable_unlocked, /* eio_disable_unlocked */ - hunt_intr_trigger, /* eio_trigger */ - hunt_intr_fini, /* eio_fini */ +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +static efx_intr_ops_t __efx_intr_ef10_ops = { + ef10_intr_init, /* eio_init */ + ef10_intr_enable, /* eio_enable */ + ef10_intr_disable, /* eio_disable */ + ef10_intr_disable_unlocked, /* eio_disable_unlocked */ + ef10_intr_trigger, /* eio_trigger */ + ef10_intr_fini, /* eio_fini */ }; -#endif /* EFSYS_OPT_HUNTINGTON */ - +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ __checkReturn efx_rc_t efx_intr_init( @@ -152,10 +151,16 @@ efx_intr_init( #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - eiop = (efx_intr_ops_t *)&__efx_intr_hunt_ops; + eiop = (efx_intr_ops_t *)&__efx_intr_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + eiop = (efx_intr_ops_t *)&__efx_intr_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ + default: EFSYS_ASSERT(B_FALSE); rc = ENOTSUP; Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:29:05 2016 (r293750) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:30:42 2016 (r293751) @@ -112,30 +112,30 @@ hunt_ev_rxlabel_fini( /* INTR */ __checkReturn efx_rc_t -hunt_intr_init( +ef10_intr_init( __in efx_nic_t *enp, __in efx_intr_type_t type, __in efsys_mem_t *esmp); void -hunt_intr_enable( +ef10_intr_enable( __in efx_nic_t *enp); void -hunt_intr_disable( +ef10_intr_disable( __in efx_nic_t *enp); void -hunt_intr_disable_unlocked( +ef10_intr_disable_unlocked( __in efx_nic_t *enp); __checkReturn efx_rc_t -hunt_intr_trigger( +ef10_intr_trigger( __in efx_nic_t *enp, __in unsigned int level); void -hunt_intr_fini( +ef10_intr_fini( __in efx_nic_t *enp); /* NIC */ Modified: head/sys/dev/sfxge/common/hunt_intr.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_intr.c Tue Jan 12 13:29:05 2016 (r293750) +++ head/sys/dev/sfxge/common/hunt_intr.c Tue Jan 12 13:30:42 2016 (r293751) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_HUNTINGTON __checkReturn efx_rc_t -hunt_intr_init( +ef10_intr_init( __in efx_nic_t *enp, __in efx_intr_type_t type, __in efsys_mem_t *esmp) @@ -50,7 +50,7 @@ hunt_intr_init( void -hunt_intr_enable( +ef10_intr_enable( __in efx_nic_t *enp) { _NOTE(ARGUNUSED(enp)) @@ -58,7 +58,7 @@ hunt_intr_enable( void -hunt_intr_disable( +ef10_intr_disable( __in efx_nic_t *enp) { _NOTE(ARGUNUSED(enp)) @@ -66,7 +66,7 @@ hunt_intr_disable( void -hunt_intr_disable_unlocked( +ef10_intr_disable_unlocked( __in efx_nic_t *enp) { _NOTE(ARGUNUSED(enp)) @@ -83,7 +83,8 @@ efx_mcdi_trigger_interrupt( MC_CMD_TRIGGER_INTERRUPT_OUT_LEN)]; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); if (level >= enp->en_nic_cfg.enc_intr_limit) { rc = EINVAL; @@ -118,7 +119,7 @@ fail1: } __checkReturn efx_rc_t -hunt_intr_trigger( +ef10_intr_trigger( __in efx_nic_t *enp, __in unsigned int level) { @@ -126,7 +127,10 @@ hunt_intr_trigger( efx_rc_t rc; if (encp->enc_bug41750_workaround) { - /* bug 41750: Test interrupts don't work on Greenport */ + /* + * bug 41750: Test interrupts don't work on Greenport + * bug 50084: Test interrupts don't work on VFs + */ rc = ENOTSUP; goto fail1; } @@ -146,7 +150,7 @@ fail1: void -hunt_intr_fini( +ef10_intr_fini( __in efx_nic_t *enp) { _NOTE(ARGUNUSED(enp)) From owner-svn-src-head@freebsd.org Tue Jan 12 13:32:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD975A6D0A3; Tue, 12 Jan 2016 13:32:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B687211B1; Tue, 12 Jan 2016 13:32:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CDW4kM093667; Tue, 12 Jan 2016 13:32:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CDW4cH093663; Tue, 12 Jan 2016 13:32:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121332.u0CDW4cH093663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 13:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293752 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 13:32:06 -0000 Author: arybchik Date: Tue Jan 12 13:32:04 2016 New Revision: 293752 URL: https://svnweb.freebsd.org/changeset/base/293752 Log: sfxge: rename hunt ev methods to ef10 and use for Medford Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4869 Modified: head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/hunt_ev.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_rx.c Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Tue Jan 12 13:30:42 2016 (r293751) +++ head/sys/dev/sfxge/common/efx_ev.c Tue Jan 12 13:32:04 2016 (r293752) @@ -139,20 +139,20 @@ static efx_ev_ops_t __efx_ev_siena_ops = }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON -static efx_ev_ops_t __efx_ev_hunt_ops = { - hunt_ev_init, /* eevo_init */ - hunt_ev_fini, /* eevo_fini */ - hunt_ev_qcreate, /* eevo_qcreate */ - hunt_ev_qdestroy, /* eevo_qdestroy */ - hunt_ev_qprime, /* eevo_qprime */ - hunt_ev_qpost, /* eevo_qpost */ - hunt_ev_qmoderate, /* eevo_qmoderate */ +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +static efx_ev_ops_t __efx_ev_ef10_ops = { + ef10_ev_init, /* eevo_init */ + ef10_ev_fini, /* eevo_fini */ + ef10_ev_qcreate, /* eevo_qcreate */ + ef10_ev_qdestroy, /* eevo_qdestroy */ + ef10_ev_qprime, /* eevo_qprime */ + ef10_ev_qpost, /* eevo_qpost */ + ef10_ev_qmoderate, /* eevo_qmoderate */ #if EFSYS_OPT_QSTATS - hunt_ev_qstats_update, /* eevo_qstats_update */ + ef10_ev_qstats_update, /* eevo_qstats_update */ #endif }; -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ __checkReturn efx_rc_t @@ -185,10 +185,16 @@ efx_ev_init( #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - eevop = (efx_ev_ops_t *)&__efx_ev_hunt_ops; + eevop = (efx_ev_ops_t *)&__efx_ev_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + eevop = (efx_ev_ops_t *)&__efx_ev_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ + default: EFSYS_ASSERT(0); rc = ENOTSUP; Modified: head/sys/dev/sfxge/common/hunt_ev.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_ev.c Tue Jan 12 13:30:42 2016 (r293751) +++ head/sys/dev/sfxge/common/hunt_ev.c Tue Jan 12 13:32:04 2016 (r293752) @@ -54,35 +54,35 @@ __FBSDID("$FreeBSD$"); static __checkReturn boolean_t -hunt_ev_rx( +ef10_ev_rx( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, __in_opt void *arg); static __checkReturn boolean_t -hunt_ev_tx( +ef10_ev_tx( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, __in_opt void *arg); static __checkReturn boolean_t -hunt_ev_driver( +ef10_ev_driver( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, __in_opt void *arg); static __checkReturn boolean_t -hunt_ev_drv_gen( +ef10_ev_drv_gen( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, __in_opt void *arg); static __checkReturn boolean_t -hunt_ev_mcdi( +ef10_ev_mcdi( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, @@ -230,7 +230,7 @@ fail1: __checkReturn efx_rc_t -hunt_ev_init( +ef10_ev_init( __in efx_nic_t *enp) { _NOTE(ARGUNUSED(enp)) @@ -238,14 +238,14 @@ hunt_ev_init( } void -hunt_ev_fini( +ef10_ev_fini( __in efx_nic_t *enp) { _NOTE(ARGUNUSED(enp)) } __checkReturn efx_rc_t -hunt_ev_qcreate( +ef10_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, @@ -272,11 +272,11 @@ hunt_ev_qcreate( } /* Set up the handler table */ - eep->ee_rx = hunt_ev_rx; - eep->ee_tx = hunt_ev_tx; - eep->ee_driver = hunt_ev_driver; - eep->ee_drv_gen = hunt_ev_drv_gen; - eep->ee_mcdi = hunt_ev_mcdi; + eep->ee_rx = ef10_ev_rx; + eep->ee_tx = ef10_ev_tx; + eep->ee_driver = ef10_ev_driver; + eep->ee_drv_gen = ef10_ev_drv_gen; + eep->ee_mcdi = ef10_ev_mcdi; /* * Set up the event queue @@ -299,18 +299,19 @@ fail1: } void -hunt_ev_qdestroy( +ef10_ev_qdestroy( __in efx_evq_t *eep) { efx_nic_t *enp = eep->ee_enp; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); (void) efx_mcdi_fini_evq(eep->ee_enp, eep->ee_index); } __checkReturn efx_rc_t -hunt_ev_qprime( +ef10_ev_qprime( __in efx_evq_t *eep, __in unsigned int count) { @@ -390,7 +391,7 @@ fail1: } void -hunt_ev_qpost( +ef10_ev_qpost( __in efx_evq_t *eep, __in uint16_t data) { @@ -406,7 +407,7 @@ hunt_ev_qpost( } __checkReturn efx_rc_t -hunt_ev_qmoderate( +ef10_ev_qmoderate( __in efx_evq_t *eep, __in unsigned int us) { @@ -463,14 +464,10 @@ fail1: #if EFSYS_OPT_QSTATS void -hunt_ev_qstats_update( +ef10_ev_qstats_update( __in efx_evq_t *eep, __inout_ecount(EV_NQSTATS) efsys_stat_t *stat) { - /* - * TBD: Consider a common Siena/Huntington function. The code is - * essentially identical. - */ unsigned int id; for (id = 0; id < EV_NQSTATS; id++) { @@ -484,7 +481,7 @@ hunt_ev_qstats_update( static __checkReturn boolean_t -hunt_ev_rx( +ef10_ev_rx( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, @@ -691,7 +688,7 @@ hunt_ev_rx( } static __checkReturn boolean_t -hunt_ev_tx( +ef10_ev_tx( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, @@ -726,7 +723,7 @@ hunt_ev_tx( } static __checkReturn boolean_t -hunt_ev_driver( +ef10_ev_driver( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, @@ -776,7 +773,7 @@ hunt_ev_driver( } static __checkReturn boolean_t -hunt_ev_drv_gen( +ef10_ev_drv_gen( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, @@ -804,7 +801,7 @@ hunt_ev_drv_gen( } static __checkReturn boolean_t -hunt_ev_mcdi( +ef10_ev_mcdi( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, @@ -1000,7 +997,7 @@ hunt_ev_mcdi( } void -hunt_ev_rxlabel_init( +ef10_ev_rxlabel_init( __in efx_evq_t *eep, __in efx_rxq_t *erp, __in unsigned int label) @@ -1017,7 +1014,7 @@ hunt_ev_rxlabel_init( } void -hunt_ev_rxlabel_fini( +ef10_ev_rxlabel_fini( __in efx_evq_t *eep, __in unsigned int label) { Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:30:42 2016 (r293751) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:32:04 2016 (r293752) @@ -56,15 +56,15 @@ extern "C" { /* EV */ __checkReturn efx_rc_t -hunt_ev_init( +ef10_ev_init( __in efx_nic_t *enp); void -hunt_ev_fini( +ef10_ev_fini( __in efx_nic_t *enp); __checkReturn efx_rc_t -hunt_ev_qcreate( +ef10_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, @@ -73,39 +73,39 @@ hunt_ev_qcreate( __in efx_evq_t *eep); void -hunt_ev_qdestroy( +ef10_ev_qdestroy( __in efx_evq_t *eep); __checkReturn efx_rc_t -hunt_ev_qprime( +ef10_ev_qprime( __in efx_evq_t *eep, __in unsigned int count); void -hunt_ev_qpost( +ef10_ev_qpost( __in efx_evq_t *eep, __in uint16_t data); __checkReturn efx_rc_t -hunt_ev_qmoderate( +ef10_ev_qmoderate( __in efx_evq_t *eep, __in unsigned int us); #if EFSYS_OPT_QSTATS void -hunt_ev_qstats_update( +ef10_ev_qstats_update( __in efx_evq_t *eep, __inout_ecount(EV_NQSTATS) efsys_stat_t *stat); #endif /* EFSYS_OPT_QSTATS */ void -hunt_ev_rxlabel_init( +ef10_ev_rxlabel_init( __in efx_evq_t *eep, __in efx_rxq_t *erp, __in unsigned int label); void -hunt_ev_rxlabel_fini( +ef10_ev_rxlabel_fini( __in efx_evq_t *eep, __in unsigned int label); Modified: head/sys/dev/sfxge/common/hunt_rx.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_rx.c Tue Jan 12 13:30:42 2016 (r293751) +++ head/sys/dev/sfxge/common/hunt_rx.c Tue Jan 12 13:32:04 2016 (r293752) @@ -727,7 +727,7 @@ hunt_rx_qcreate( erp->er_eep = eep; erp->er_label = label; - hunt_ev_rxlabel_init(eep, erp, label); + ef10_ev_rxlabel_init(eep, erp, label); return (0); @@ -749,7 +749,7 @@ hunt_rx_qdestroy( efx_evq_t *eep = erp->er_eep; unsigned int label = erp->er_label; - hunt_ev_rxlabel_fini(eep, label); + ef10_ev_rxlabel_fini(eep, label); EFSYS_ASSERT(enp->en_rx_qcount != 0); --enp->en_rx_qcount; From owner-svn-src-head@freebsd.org Tue Jan 12 13:33:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26136A6D169; Tue, 12 Jan 2016 13:33:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D950913B1; Tue, 12 Jan 2016 13:33:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CDXGH3095702; Tue, 12 Jan 2016 13:33:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CDXGpd095698; Tue, 12 Jan 2016 13:33:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121333.u0CDXGpd095698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 13:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293753 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 13:33:18 -0000 Author: arybchik Date: Tue Jan 12 13:33:16 2016 New Revision: 293753 URL: https://svnweb.freebsd.org/changeset/base/293753 Log: sfxge: rename hunt TX methods to ef10 and use for Medford Rename all except hunt_tx_qdesc_tso_create(), which creates a fw-assisted TSO v1 descriptor which isn't supported on Medford. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4870 Modified: head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_tx.c Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Tue Jan 12 13:32:04 2016 (r293752) +++ head/sys/dev/sfxge/common/efx_tx.c Tue Jan 12 13:33:16 2016 (r293753) @@ -179,29 +179,54 @@ static efx_tx_ops_t __efx_tx_siena_ops = #if EFSYS_OPT_HUNTINGTON static efx_tx_ops_t __efx_tx_hunt_ops = { - hunt_tx_init, /* etxo_init */ - hunt_tx_fini, /* etxo_fini */ - hunt_tx_qcreate, /* etxo_qcreate */ - hunt_tx_qdestroy, /* etxo_qdestroy */ - hunt_tx_qpost, /* etxo_qpost */ - hunt_tx_qpush, /* etxo_qpush */ - hunt_tx_qpace, /* etxo_qpace */ - hunt_tx_qflush, /* etxo_qflush */ - hunt_tx_qenable, /* etxo_qenable */ - hunt_tx_qpio_enable, /* etxo_qpio_enable */ - hunt_tx_qpio_disable, /* etxo_qpio_disable */ - hunt_tx_qpio_write, /* etxo_qpio_write */ - hunt_tx_qpio_post, /* etxo_qpio_post */ - hunt_tx_qdesc_post, /* etxo_qdesc_post */ - hunt_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ + ef10_tx_init, /* etxo_init */ + ef10_tx_fini, /* etxo_fini */ + ef10_tx_qcreate, /* etxo_qcreate */ + ef10_tx_qdestroy, /* etxo_qdestroy */ + ef10_tx_qpost, /* etxo_qpost */ + ef10_tx_qpush, /* etxo_qpush */ + ef10_tx_qpace, /* etxo_qpace */ + ef10_tx_qflush, /* etxo_qflush */ + ef10_tx_qenable, /* etxo_qenable */ + ef10_tx_qpio_enable, /* etxo_qpio_enable */ + ef10_tx_qpio_disable, /* etxo_qpio_disable */ + ef10_tx_qpio_write, /* etxo_qpio_write */ + ef10_tx_qpio_post, /* etxo_qpio_post */ + ef10_tx_qdesc_post, /* etxo_qdesc_post */ + ef10_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ hunt_tx_qdesc_tso_create, /* etxo_qdesc_tso_create */ - hunt_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ + ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ #if EFSYS_OPT_QSTATS - hunt_tx_qstats_update, /* etxo_qstats_update */ + ef10_tx_qstats_update, /* etxo_qstats_update */ #endif }; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD +static efx_tx_ops_t __efx_tx_medford_ops = { + ef10_tx_init, /* etxo_init */ + ef10_tx_fini, /* etxo_fini */ + ef10_tx_qcreate, /* etxo_qcreate */ + ef10_tx_qdestroy, /* etxo_qdestroy */ + ef10_tx_qpost, /* etxo_qpost */ + ef10_tx_qpush, /* etxo_qpush */ + ef10_tx_qpace, /* etxo_qpace */ + ef10_tx_qflush, /* etxo_qflush */ + ef10_tx_qenable, /* etxo_qenable */ + ef10_tx_qpio_enable, /* etxo_qpio_enable */ + ef10_tx_qpio_disable, /* etxo_qpio_disable */ + ef10_tx_qpio_write, /* etxo_qpio_write */ + ef10_tx_qpio_post, /* etxo_qpio_post */ + ef10_tx_qdesc_post, /* etxo_qdesc_post */ + ef10_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ + NULL, /* etxo_qdesc_tso_create */ + ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ +#if EFSYS_OPT_QSTATS + ef10_tx_qstats_update, /* etxo_qstats_update */ +#endif +}; +#endif /* EFSYS_OPT_MEDFORD */ + __checkReturn efx_rc_t efx_tx_init( __in efx_nic_t *enp) @@ -241,6 +266,12 @@ efx_tx_init( break; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + etxop = (efx_tx_ops_t *)&__efx_tx_medford_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ + default: EFSYS_ASSERT(0); rc = ENOTSUP; Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:32:04 2016 (r293752) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:33:16 2016 (r293753) @@ -572,15 +572,15 @@ ef10_sram_test( /* TX */ extern __checkReturn efx_rc_t -hunt_tx_init( +ef10_tx_init( __in efx_nic_t *enp); extern void -hunt_tx_fini( +ef10_tx_fini( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_tx_qcreate( +ef10_tx_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in unsigned int label, @@ -593,11 +593,11 @@ hunt_tx_qcreate( __out unsigned int *addedp); extern void -hunt_tx_qdestroy( +ef10_tx_qdestroy( __in efx_txq_t *etp); extern __checkReturn efx_rc_t -hunt_tx_qpost( +ef10_tx_qpost( __in efx_txq_t *etp, __in_ecount(n) efx_buffer_t *eb, __in unsigned int n, @@ -605,48 +605,48 @@ hunt_tx_qpost( __inout unsigned int *addedp); extern void -hunt_tx_qpush( +ef10_tx_qpush( __in efx_txq_t *etp, __in unsigned int added, __in unsigned int pushed); extern __checkReturn efx_rc_t -hunt_tx_qpace( +ef10_tx_qpace( __in efx_txq_t *etp, __in unsigned int ns); extern __checkReturn efx_rc_t -hunt_tx_qflush( +ef10_tx_qflush( __in efx_txq_t *etp); extern void -hunt_tx_qenable( +ef10_tx_qenable( __in efx_txq_t *etp); extern __checkReturn efx_rc_t -hunt_tx_qpio_enable( +ef10_tx_qpio_enable( __in efx_txq_t *etp); extern void -hunt_tx_qpio_disable( +ef10_tx_qpio_disable( __in efx_txq_t *etp); extern __checkReturn efx_rc_t -hunt_tx_qpio_write( +ef10_tx_qpio_write( __in efx_txq_t *etp, __in_ecount(buf_length) uint8_t *buffer, __in size_t buf_length, __in size_t pio_buf_offset); extern __checkReturn efx_rc_t -hunt_tx_qpio_post( +ef10_tx_qpio_post( __in efx_txq_t *etp, __in size_t pkt_length, __in unsigned int completed, __inout unsigned int *addedp); extern __checkReturn efx_rc_t -hunt_tx_qdesc_post( +ef10_tx_qdesc_post( __in efx_txq_t *etp, __in_ecount(n) efx_desc_t *ed, __in unsigned int n, @@ -654,7 +654,7 @@ hunt_tx_qdesc_post( __inout unsigned int *addedp); extern void -hunt_tx_qdesc_dma_create( +ef10_tx_qdesc_dma_create( __in efx_txq_t *etp, __in efsys_dma_addr_t addr, __in size_t size, @@ -670,7 +670,7 @@ hunt_tx_qdesc_tso_create( __out efx_desc_t *edp); extern void -hunt_tx_qdesc_vlantci_create( +ef10_tx_qdesc_vlantci_create( __in efx_txq_t *etp, __in uint16_t vlan_tci, __out efx_desc_t *edp); @@ -679,7 +679,7 @@ hunt_tx_qdesc_vlantci_create( #if EFSYS_OPT_QSTATS extern void -hunt_tx_qstats_update( +ef10_tx_qstats_update( __in efx_txq_t *etp, __inout_ecount(TX_NQSTATS) efsys_stat_t *stat); Modified: head/sys/dev/sfxge/common/hunt_tx.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_tx.c Tue Jan 12 13:32:04 2016 (r293752) +++ head/sys/dev/sfxge/common/hunt_tx.c Tue Jan 12 13:33:16 2016 (r293753) @@ -165,7 +165,7 @@ fail1: } __checkReturn efx_rc_t -hunt_tx_init( +ef10_tx_init( __in efx_nic_t *enp) { _NOTE(ARGUNUSED(enp)) @@ -173,14 +173,14 @@ hunt_tx_init( } void -hunt_tx_fini( +ef10_tx_fini( __in efx_nic_t *enp) { _NOTE(ARGUNUSED(enp)) } __checkReturn efx_rc_t -hunt_tx_qcreate( +ef10_tx_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in unsigned int label, @@ -218,7 +218,7 @@ hunt_tx_qcreate( (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0); EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc); - hunt_tx_qpush(etp, *addedp, 0); + ef10_tx_qpush(etp, *addedp, 0); return (0); @@ -229,7 +229,7 @@ fail1: } void -hunt_tx_qdestroy( +ef10_tx_qdestroy( __in efx_txq_t *etp) { /* FIXME */ @@ -238,7 +238,7 @@ hunt_tx_qdestroy( } __checkReturn efx_rc_t -hunt_tx_qpio_enable( +ef10_tx_qpio_enable( __in efx_txq_t *etp) { efx_nic_t *enp = etp->et_enp; @@ -294,7 +294,7 @@ fail1: } void -hunt_tx_qpio_disable( +ef10_tx_qpio_disable( __in efx_txq_t *etp) { efx_nic_t *enp = etp->et_enp; @@ -311,7 +311,7 @@ hunt_tx_qpio_disable( } __checkReturn efx_rc_t -hunt_tx_qpio_write( +ef10_tx_qpio_write( __in efx_txq_t *etp, __in_ecount(length) uint8_t *buffer, __in size_t length, @@ -359,7 +359,7 @@ fail1: } __checkReturn efx_rc_t -hunt_tx_qpio_post( +ef10_tx_qpio_post( __in efx_txq_t *etp, __in size_t pkt_length, __in unsigned int completed, @@ -412,7 +412,7 @@ fail1: } __checkReturn efx_rc_t -hunt_tx_qpost( +ef10_tx_qpost( __in efx_txq_t *etp, __in_ecount(n) efx_buffer_t *eb, __in unsigned int n, @@ -474,7 +474,7 @@ fail1: * hardware decides not to use the pushed descriptor. */ void -hunt_tx_qpush( +ef10_tx_qpush( __in efx_txq_t *etp, __in unsigned int added, __in unsigned int pushed) @@ -504,7 +504,7 @@ hunt_tx_qpush( } __checkReturn efx_rc_t -hunt_tx_qdesc_post( +ef10_tx_qdesc_post( __in efx_txq_t *etp, __in_ecount(n) efx_desc_t *ed, __in unsigned int n, @@ -546,7 +546,7 @@ fail1: } void -hunt_tx_qdesc_dma_create( +ef10_tx_qdesc_dma_create( __in efx_txq_t *etp, __in efsys_dma_addr_t addr, __in size_t size, @@ -590,7 +590,7 @@ hunt_tx_qdesc_tso_create( } void -hunt_tx_qdesc_vlantci_create( +ef10_tx_qdesc_vlantci_create( __in efx_txq_t *etp, __in uint16_t tci, __out efx_desc_t *edp) @@ -608,7 +608,7 @@ hunt_tx_qdesc_vlantci_create( __checkReturn efx_rc_t -hunt_tx_qpace( +ef10_tx_qpace( __in efx_txq_t *etp, __in unsigned int ns) { @@ -631,7 +631,7 @@ fail1: } __checkReturn efx_rc_t -hunt_tx_qflush( +ef10_tx_qflush( __in efx_txq_t *etp) { efx_nic_t *enp = etp->et_enp; @@ -649,7 +649,7 @@ fail1: } void -hunt_tx_qenable( +ef10_tx_qenable( __in efx_txq_t *etp) { /* FIXME */ @@ -659,15 +659,10 @@ hunt_tx_qenable( #if EFSYS_OPT_QSTATS void -hunt_tx_qstats_update( +ef10_tx_qstats_update( __in efx_txq_t *etp, __inout_ecount(TX_NQSTATS) efsys_stat_t *stat) { - /* - * TBD: Consider a common Siena/Huntington function. The code is - * essentially identical. - */ - unsigned int id; for (id = 0; id < TX_NQSTATS; id++) { From owner-svn-src-head@freebsd.org Tue Jan 12 13:34:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC798A6D206; Tue, 12 Jan 2016 13:34:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A6F215FD; Tue, 12 Jan 2016 13:34:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CDYuEj095796; Tue, 12 Jan 2016 13:34:56 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CDYuQ5095792; Tue, 12 Jan 2016 13:34:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121334.u0CDYuQ5095792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 13:34:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293754 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 13:34:57 -0000 Author: arybchik Date: Tue Jan 12 13:34:55 2016 New Revision: 293754 URL: https://svnweb.freebsd.org/changeset/base/293754 Log: sfxge: rename hunt RX methods to ef10 and use for Medford Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4871 Modified: head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/hunt_filter.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_rx.c Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Tue Jan 12 13:33:16 2016 (r293753) +++ head/sys/dev/sfxge/common/efx_rx.c Tue Jan 12 13:34:55 2016 (r293754) @@ -175,29 +175,29 @@ static efx_rx_ops_t __efx_rx_siena_ops = }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON -static efx_rx_ops_t __efx_rx_hunt_ops = { - hunt_rx_init, /* erxo_init */ - hunt_rx_fini, /* erxo_fini */ +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +static efx_rx_ops_t __efx_rx_ef10_ops = { + ef10_rx_init, /* erxo_init */ + ef10_rx_fini, /* erxo_fini */ #if EFSYS_OPT_RX_HDR_SPLIT - hunt_rx_hdr_split_enable, /* erxo_hdr_split_enable */ + ef10_rx_hdr_split_enable, /* erxo_hdr_split_enable */ #endif #if EFSYS_OPT_RX_SCATTER - hunt_rx_scatter_enable, /* erxo_scatter_enable */ + ef10_rx_scatter_enable, /* erxo_scatter_enable */ #endif #if EFSYS_OPT_RX_SCALE - hunt_rx_scale_mode_set, /* erxo_scale_mode_set */ - hunt_rx_scale_key_set, /* erxo_scale_key_set */ - hunt_rx_scale_tbl_set, /* erxo_scale_tbl_set */ + ef10_rx_scale_mode_set, /* erxo_scale_mode_set */ + ef10_rx_scale_key_set, /* erxo_scale_key_set */ + ef10_rx_scale_tbl_set, /* erxo_scale_tbl_set */ #endif - hunt_rx_qpost, /* erxo_qpost */ - hunt_rx_qpush, /* erxo_qpush */ - hunt_rx_qflush, /* erxo_qflush */ - hunt_rx_qenable, /* erxo_qenable */ - hunt_rx_qcreate, /* erxo_qcreate */ - hunt_rx_qdestroy, /* erxo_qdestroy */ + ef10_rx_qpost, /* erxo_qpost */ + ef10_rx_qpush, /* erxo_qpush */ + ef10_rx_qflush, /* erxo_qflush */ + ef10_rx_qenable, /* erxo_qenable */ + ef10_rx_qcreate, /* erxo_qcreate */ + ef10_rx_qdestroy, /* erxo_qdestroy */ }; -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ __checkReturn efx_rc_t @@ -235,10 +235,16 @@ efx_rx_init( #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - erxop = (efx_rx_ops_t *)&__efx_rx_hunt_ops; + erxop = (efx_rx_ops_t *)&__efx_rx_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + erxop = (efx_rx_ops_t *)&__efx_rx_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ + default: EFSYS_ASSERT(0); rc = ENOTSUP; @@ -607,7 +613,7 @@ efx_rx_qdestroy( * Hash values are in network (big-endian) byte order. * * - * On Huntington the pseudo-header is laid out as: + * On EF10 the pseudo-header is laid out as: * (See also SF-109306-TC section 9) * * Toeplitz hash (32 bits, little-endian) @@ -629,7 +635,8 @@ efx_psuedo_hdr_pkt_length_get( __in uint8_t *buffer, __out uint16_t *pkt_lengthp) { - if (enp->en_family != EFX_FAMILY_HUNTINGTON) { + if (enp->en_family != EFX_FAMILY_HUNTINGTON && + enp->en_family != EFX_FAMILY_MEDFORD) { EFSYS_ASSERT(0); return (ENOTSUP); } @@ -656,6 +663,7 @@ efx_psuedo_hdr_hash_get( (buffer[14] << 8) | buffer[15]); case EFX_FAMILY_HUNTINGTON: + case EFX_FAMILY_MEDFORD: return (buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | Modified: head/sys/dev/sfxge/common/hunt_filter.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_filter.c Tue Jan 12 13:33:16 2016 (r293753) +++ head/sys/dev/sfxge/common/hunt_filter.c Tue Jan 12 13:34:55 2016 (r293754) @@ -1351,7 +1351,7 @@ hunt_filter_default_rxq_set( #if EFSYS_OPT_RX_SCALE EFSYS_ASSERT((using_rss == B_FALSE) || - (enp->en_rss_context != HUNTINGTON_RSS_CONTEXT_INVALID)); + (enp->en_rss_context != EF10_RSS_CONTEXT_INVALID)); table->hft_using_rss = using_rss; #else EFSYS_ASSERT(using_rss == B_FALSE); Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:33:16 2016 (r293753) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:34:55 2016 (r293754) @@ -50,7 +50,7 @@ extern "C" { #define HUNTINGTON_RX_WPTR_ALIGN 8 /* Invalid RSS context handle */ -#define HUNTINGTON_RSS_CONTEXT_INVALID (0xffffffff) +#define EF10_RSS_CONTEXT_INVALID (0xffffffff) /* EV */ @@ -822,12 +822,12 @@ hunt_vpd_fini( /* RX */ extern __checkReturn efx_rc_t -hunt_rx_init( +ef10_rx_init( __in efx_nic_t *enp); #if EFSYS_OPT_RX_HDR_SPLIT extern __checkReturn efx_rc_t -hunt_rx_hdr_split_enable( +ef10_rx_hdr_split_enable( __in efx_nic_t *enp, __in unsigned int hdr_buf_size, __in unsigned int pld_buf_size); @@ -835,7 +835,7 @@ hunt_rx_hdr_split_enable( #if EFSYS_OPT_RX_SCATTER extern __checkReturn efx_rc_t -hunt_rx_scatter_enable( +ef10_rx_scatter_enable( __in efx_nic_t *enp, __in unsigned int buf_size); #endif /* EFSYS_OPT_RX_SCATTER */ @@ -844,20 +844,20 @@ hunt_rx_scatter_enable( #if EFSYS_OPT_RX_SCALE extern __checkReturn efx_rc_t -hunt_rx_scale_mode_set( +ef10_rx_scale_mode_set( __in efx_nic_t *enp, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert); extern __checkReturn efx_rc_t -hunt_rx_scale_key_set( +ef10_rx_scale_key_set( __in efx_nic_t *enp, __in_ecount(n) uint8_t *key, __in size_t n); extern __checkReturn efx_rc_t -hunt_rx_scale_tbl_set( +ef10_rx_scale_tbl_set( __in efx_nic_t *enp, __in_ecount(n) unsigned int *table, __in size_t n); @@ -865,7 +865,7 @@ hunt_rx_scale_tbl_set( #endif /* EFSYS_OPT_RX_SCALE */ extern void -hunt_rx_qpost( +ef10_rx_qpost( __in efx_rxq_t *erp, __in_ecount(n) efsys_dma_addr_t *addrp, __in size_t size, @@ -874,21 +874,21 @@ hunt_rx_qpost( __in unsigned int added); extern void -hunt_rx_qpush( +ef10_rx_qpush( __in efx_rxq_t *erp, __in unsigned int added, __inout unsigned int *pushedp); extern __checkReturn efx_rc_t -hunt_rx_qflush( +ef10_rx_qflush( __in efx_rxq_t *erp); extern void -hunt_rx_qenable( +ef10_rx_qenable( __in efx_rxq_t *erp); extern __checkReturn efx_rc_t -hunt_rx_qcreate( +ef10_rx_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in unsigned int label, @@ -900,11 +900,11 @@ hunt_rx_qcreate( __in efx_rxq_t *erp); extern void -hunt_rx_qdestroy( +ef10_rx_qdestroy( __in efx_rxq_t *erp); extern void -hunt_rx_fini( +ef10_rx_fini( __in efx_nic_t *enp); #if EFSYS_OPT_FILTER Modified: head/sys/dev/sfxge/common/hunt_rx.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_rx.c Tue Jan 12 13:33:16 2016 (r293753) +++ head/sys/dev/sfxge/common/hunt_rx.c Tue Jan 12 13:34:55 2016 (r293754) @@ -182,7 +182,7 @@ efx_mcdi_rss_context_alloc( } rss_context = MCDI_OUT_DWORD(req, RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID); - if (rss_context == HUNTINGTON_RSS_CONTEXT_INVALID) { + if (rss_context == EF10_RSS_CONTEXT_INVALID) { rc = ENOENT; goto fail3; } @@ -213,7 +213,7 @@ efx_mcdi_rss_context_free( MC_CMD_RSS_CONTEXT_FREE_OUT_LEN)]; efx_rc_t rc; - if (rss_context == HUNTINGTON_RSS_CONTEXT_INVALID) { + if (rss_context == EF10_RSS_CONTEXT_INVALID) { rc = EINVAL; goto fail1; } @@ -257,7 +257,7 @@ efx_mcdi_rss_context_set_flags( MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN)]; efx_rc_t rc; - if (rss_context == HUNTINGTON_RSS_CONTEXT_INVALID) { + if (rss_context == EF10_RSS_CONTEXT_INVALID) { rc = EINVAL; goto fail1; } @@ -313,7 +313,7 @@ efx_mcdi_rss_context_set_key( MC_CMD_RSS_CONTEXT_SET_KEY_OUT_LEN)]; efx_rc_t rc; - if (rss_context == HUNTINGTON_RSS_CONTEXT_INVALID) { + if (rss_context == EF10_RSS_CONTEXT_INVALID) { rc = EINVAL; goto fail1; } @@ -371,7 +371,7 @@ efx_mcdi_rss_context_set_table( uint8_t *req_table; int i, rc; - if (rss_context == HUNTINGTON_RSS_CONTEXT_INVALID) { + if (rss_context == EF10_RSS_CONTEXT_INVALID) { rc = EINVAL; goto fail1; } @@ -415,7 +415,7 @@ fail1: __checkReturn efx_rc_t -hunt_rx_init( +ef10_rx_init( __in efx_nic_t *enp) { #if EFSYS_OPT_RX_SCALE @@ -444,7 +444,7 @@ hunt_rx_init( #if EFSYS_OPT_RX_HDR_SPLIT __checkReturn efx_rc_t -hunt_rx_hdr_split_enable( +ef10_rx_hdr_split_enable( __in efx_nic_t *enp, __in unsigned int hdr_buf_size, __in unsigned int pld_buf_size) @@ -470,7 +470,7 @@ fail1: #if EFSYS_OPT_RX_SCATTER __checkReturn efx_rc_t -hunt_rx_scatter_enable( +ef10_rx_scatter_enable( __in efx_nic_t *enp, __in unsigned int buf_size) { @@ -481,7 +481,7 @@ hunt_rx_scatter_enable( #if EFSYS_OPT_RX_SCALE __checkReturn efx_rc_t -hunt_rx_scale_mode_set( +ef10_rx_scale_mode_set( __in efx_nic_t *enp, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, @@ -521,7 +521,7 @@ fail1: #if EFSYS_OPT_RX_SCALE __checkReturn efx_rc_t -hunt_rx_scale_key_set( +ef10_rx_scale_key_set( __in efx_nic_t *enp, __in_ecount(n) uint8_t *key, __in size_t n) @@ -550,7 +550,7 @@ fail1: #if EFSYS_OPT_RX_SCALE __checkReturn efx_rc_t -hunt_rx_scale_tbl_set( +ef10_rx_scale_tbl_set( __in efx_nic_t *enp, __in_ecount(n) unsigned int *table, __in size_t n) @@ -578,7 +578,7 @@ fail1: #endif /* EFSYS_OPT_RX_SCALE */ void -hunt_rx_qpost( +ef10_rx_qpost( __in efx_rxq_t *erp, __in_ecount(n) efsys_dma_addr_t *addrp, __in size_t size, @@ -616,7 +616,7 @@ hunt_rx_qpost( } void -hunt_rx_qpush( +ef10_rx_qpush( __in efx_rxq_t *erp, __in unsigned int added, __inout unsigned int *pushedp) @@ -647,7 +647,7 @@ hunt_rx_qpush( } __checkReturn efx_rc_t -hunt_rx_qflush( +ef10_rx_qflush( __in efx_rxq_t *erp) { efx_nic_t *enp = erp->er_enp; @@ -665,7 +665,7 @@ fail1: } void -hunt_rx_qenable( +ef10_rx_qenable( __in efx_rxq_t *erp) { /* FIXME */ @@ -674,7 +674,7 @@ hunt_rx_qenable( } __checkReturn efx_rc_t -hunt_rx_qcreate( +ef10_rx_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in unsigned int label, @@ -742,7 +742,7 @@ fail1: } void -hunt_rx_qdestroy( +ef10_rx_qdestroy( __in efx_rxq_t *erp) { efx_nic_t *enp = erp->er_enp; @@ -758,7 +758,7 @@ hunt_rx_qdestroy( } void -hunt_rx_fini( +ef10_rx_fini( __in efx_nic_t *enp) { #if EFSYS_OPT_RX_SCALE From owner-svn-src-head@freebsd.org Tue Jan 12 13:36:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6673FA6D353; Tue, 12 Jan 2016 13:36:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4086018B4; Tue, 12 Jan 2016 13:36:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CDaM7P095899; Tue, 12 Jan 2016 13:36:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CDaM9M095896; Tue, 12 Jan 2016 13:36:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121336.u0CDaM9M095896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 13:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293755 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 13:36:23 -0000 Author: arybchik Date: Tue Jan 12 13:36:21 2016 New Revision: 293755 URL: https://svnweb.freebsd.org/changeset/base/293755 Log: sfxge: rename Huntington VPD methods to ef10 and use for Medford Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4872 Modified: head/sys/dev/sfxge/common/efx_vpd.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_vpd.c Modified: head/sys/dev/sfxge/common/efx_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/efx_vpd.c Tue Jan 12 13:34:55 2016 (r293754) +++ head/sys/dev/sfxge/common/efx_vpd.c Tue Jan 12 13:36:21 2016 (r293755) @@ -91,22 +91,22 @@ static efx_vpd_ops_t __efx_vpd_siena_ops #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD -static efx_vpd_ops_t __efx_vpd_hunt_ops = { - hunt_vpd_init, /* evpdo_init */ - hunt_vpd_size, /* evpdo_size */ - hunt_vpd_read, /* evpdo_read */ - hunt_vpd_verify, /* evpdo_verify */ - hunt_vpd_reinit, /* evpdo_reinit */ - hunt_vpd_get, /* evpdo_get */ - hunt_vpd_set, /* evpdo_set */ - hunt_vpd_next, /* evpdo_next */ - hunt_vpd_write, /* evpdo_write */ - hunt_vpd_fini, /* evpdo_fini */ +static efx_vpd_ops_t __efx_vpd_ef10_ops = { + ef10_vpd_init, /* evpdo_init */ + ef10_vpd_size, /* evpdo_size */ + ef10_vpd_read, /* evpdo_read */ + ef10_vpd_verify, /* evpdo_verify */ + ef10_vpd_reinit, /* evpdo_reinit */ + ef10_vpd_get, /* evpdo_get */ + ef10_vpd_set, /* evpdo_set */ + ef10_vpd_next, /* evpdo_next */ + ef10_vpd_write, /* evpdo_write */ + ef10_vpd_fini, /* evpdo_fini */ }; -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ __checkReturn efx_rc_t efx_vpd_init( @@ -134,10 +134,16 @@ efx_vpd_init( #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - evpdop = (efx_vpd_ops_t *)&__efx_vpd_hunt_ops; + evpdop = (efx_vpd_ops_t *)&__efx_vpd_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + evpdop = (efx_vpd_ops_t *)&__efx_vpd_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ + default: EFSYS_ASSERT(0); rc = ENOTSUP; Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:34:55 2016 (r293754) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:36:21 2016 (r293755) @@ -758,48 +758,48 @@ hunt_nic_pio_unlink( #if EFSYS_OPT_VPD extern __checkReturn efx_rc_t -hunt_vpd_init( +ef10_vpd_init( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_vpd_size( +ef10_vpd_size( __in efx_nic_t *enp, __out size_t *sizep); extern __checkReturn efx_rc_t -hunt_vpd_read( +ef10_vpd_read( __in efx_nic_t *enp, __out_bcount(size) caddr_t data, __in size_t size); extern __checkReturn efx_rc_t -hunt_vpd_verify( +ef10_vpd_verify( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, __in size_t size); extern __checkReturn efx_rc_t -hunt_vpd_reinit( +ef10_vpd_reinit( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, __in size_t size); extern __checkReturn efx_rc_t -hunt_vpd_get( +ef10_vpd_get( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, __in size_t size, __inout efx_vpd_value_t *evvp); extern __checkReturn efx_rc_t -hunt_vpd_set( +ef10_vpd_set( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, __in size_t size, __in efx_vpd_value_t *evvp); extern __checkReturn efx_rc_t -hunt_vpd_next( +ef10_vpd_next( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, __in size_t size, @@ -807,13 +807,13 @@ hunt_vpd_next( __inout unsigned int *contp); extern __checkReturn efx_rc_t -hunt_vpd_write( +ef10_vpd_write( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, __in size_t size); extern void -hunt_vpd_fini( +ef10_vpd_fini( __in efx_nic_t *enp); #endif /* EFSYS_OPT_VPD */ Modified: head/sys/dev/sfxge/common/hunt_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_vpd.c Tue Jan 12 13:34:55 2016 (r293754) +++ head/sys/dev/sfxge/common/hunt_vpd.c Tue Jan 12 13:36:21 2016 (r293755) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include "ef10_tlv_layout.h" __checkReturn efx_rc_t -hunt_vpd_init( +ef10_vpd_init( __in efx_nic_t *enp) { caddr_t svpd; @@ -54,7 +54,8 @@ hunt_vpd_init( efx_rc_t rc; EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); pci_pf = enp->en_nic_cfg.enc_pf; /* @@ -98,13 +99,14 @@ fail1: } __checkReturn efx_rc_t -hunt_vpd_size( +ef10_vpd_size( __in efx_nic_t *enp, __out size_t *sizep) { efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); /* * This function returns the total size the user should allocate @@ -125,7 +127,7 @@ fail1: } __checkReturn efx_rc_t -hunt_vpd_read( +ef10_vpd_read( __in efx_nic_t *enp, __out_bcount(size) caddr_t data, __in size_t size) @@ -135,7 +137,8 @@ hunt_vpd_read( uint32_t pci_pf; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); pci_pf = enp->en_nic_cfg.enc_pf; @@ -169,7 +172,7 @@ fail1: } __checkReturn efx_rc_t -hunt_vpd_verify( +ef10_vpd_verify( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, __in size_t size) @@ -182,12 +185,13 @@ hunt_vpd_verify( unsigned int dcont; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); /* * Strictly you could take the view that dynamic vpd is optional. * Instead, to conform more closely to the read/verify/reinit() - * paradigm, we require dynamic vpd. hunt_vpd_reinit() will + * paradigm, we require dynamic vpd. ef10_vpd_reinit() will * reinitialize it as required. */ if ((rc = efx_vpd_hunk_verify(data, size, NULL)) != 0) @@ -243,7 +247,7 @@ fail1: } __checkReturn efx_rc_t -hunt_vpd_reinit( +ef10_vpd_reinit( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, __in size_t size) @@ -285,7 +289,7 @@ fail1: } __checkReturn efx_rc_t -hunt_vpd_get( +ef10_vpd_get( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, __in size_t size, @@ -295,7 +299,8 @@ hunt_vpd_get( uint8_t length; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); /* Attempt to satisfy the request from svpd first */ if (enp->en_arch.ef10.ena_svpd_length > 0) { @@ -329,7 +334,7 @@ fail1: } __checkReturn efx_rc_t -hunt_vpd_set( +ef10_vpd_set( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, __in size_t size, @@ -337,7 +342,8 @@ hunt_vpd_set( { efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); /* If the provided (tag,keyword) exists in svpd, then it is readonly */ if (enp->en_arch.ef10.ena_svpd_length > 0) { @@ -366,7 +372,7 @@ fail1: } __checkReturn efx_rc_t -hunt_vpd_next( +ef10_vpd_next( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, __in size_t size, @@ -379,7 +385,7 @@ hunt_vpd_next( } __checkReturn efx_rc_t -hunt_vpd_write( +ef10_vpd_write( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, __in size_t size) @@ -388,7 +394,8 @@ hunt_vpd_write( uint32_t pci_pf; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); pci_pf = enp->en_nic_cfg.enc_pf; @@ -416,10 +423,11 @@ fail1: } void -hunt_vpd_fini( +ef10_vpd_fini( __in efx_nic_t *enp) { - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); if (enp->en_arch.ef10.ena_svpd_length > 0) { EFSYS_KMEM_FREE(enp->en_esip, enp->en_arch.ef10.ena_svpd_length, From owner-svn-src-head@freebsd.org Tue Jan 12 13:37:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5297A6D525; Tue, 12 Jan 2016 13:37:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 834AA1B65; Tue, 12 Jan 2016 13:37:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CDbwZb095996; Tue, 12 Jan 2016 13:37:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CDbwpg095991; Tue, 12 Jan 2016 13:37:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121337.u0CDbwpg095991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 13:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293756 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 13:37:59 -0000 Author: arybchik Date: Tue Jan 12 13:37:58 2016 New Revision: 293756 URL: https://svnweb.freebsd.org/changeset/base/293756 Log: sfxge: rename hunt nvram methods and use for Medford Some new partitions have been added, but they shouldn't need to be handled any differently. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4873 Modified: head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nvram.c head/sys/dev/sfxge/common/hunt_vpd.c Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Tue Jan 12 13:36:21 2016 (r293755) +++ head/sys/dev/sfxge/common/efx_nvram.c Tue Jan 12 13:37:58 2016 (r293756) @@ -75,23 +75,23 @@ static efx_nvram_ops_t __efx_nvram_siena #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD -static efx_nvram_ops_t __efx_nvram_hunt_ops = { +static efx_nvram_ops_t __efx_nvram_ef10_ops = { #if EFSYS_OPT_DIAG - hunt_nvram_test, /* envo_test */ + ef10_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ - hunt_nvram_size, /* envo_size */ - hunt_nvram_get_version, /* envo_get_version */ - hunt_nvram_rw_start, /* envo_rw_start */ - hunt_nvram_read_chunk, /* envo_read_chunk */ - hunt_nvram_erase, /* envo_erase */ - hunt_nvram_write_chunk, /* envo_write_chunk */ - hunt_nvram_rw_finish, /* envo_rw_finish */ - hunt_nvram_set_version, /* envo_set_version */ + ef10_nvram_size, /* envo_size */ + ef10_nvram_get_version, /* envo_get_version */ + ef10_nvram_rw_start, /* envo_rw_start */ + ef10_nvram_read_chunk, /* envo_read_chunk */ + ef10_nvram_erase, /* envo_erase */ + ef10_nvram_write_chunk, /* envo_write_chunk */ + ef10_nvram_rw_finish, /* envo_rw_finish */ + ef10_nvram_set_version, /* envo_set_version */ }; -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ __checkReturn efx_rc_t efx_nvram_init( @@ -119,10 +119,16 @@ efx_nvram_init( #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - envop = (efx_nvram_ops_t *)&__efx_nvram_hunt_ops; + envop = (efx_nvram_ops_t *)&__efx_nvram_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + envop = (efx_nvram_ops_t *)&__efx_nvram_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ + default: EFSYS_ASSERT(0); rc = ENOTSUP; Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:36:21 2016 (r293755) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:37:58 2016 (r293756) @@ -42,7 +42,12 @@ extern "C" { #endif -#define HUNTINGTON_NVRAM_CHUNK 0x80 +/* + * FIXME: This is just a power of 2 which fits in an MCDI v1 message, and could + * possibly be increased, or the write size reported by newer firmware used + * instead. + */ +#define EF10_NVRAM_CHUNK 0x80 /* Alignment requirement for value written to RX WPTR: * the WPTR must be aligned to an 8 descriptor boundary @@ -296,7 +301,7 @@ hunt_mcdi_feature_supported( #if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD extern __checkReturn efx_rc_t -hunt_nvram_buf_read_tlv( +ef10_nvram_buf_read_tlv( __in efx_nic_t *enp, __in_bcount(max_seg_size) caddr_t seg_data, __in size_t max_seg_size, @@ -305,7 +310,7 @@ hunt_nvram_buf_read_tlv( __out size_t *sizep); extern __checkReturn efx_rc_t -hunt_nvram_buf_write_tlv( +ef10_nvram_buf_write_tlv( __inout_bcount(partn_size) caddr_t partn_data, __in size_t partn_size, __in uint32_t tag, @@ -314,7 +319,7 @@ hunt_nvram_buf_write_tlv( __out size_t *total_lengthp); extern __checkReturn efx_rc_t -hunt_nvram_partn_read_tlv( +ef10_nvram_partn_read_tlv( __in efx_nic_t *enp, __in uint32_t partn, __in uint32_t tag, @@ -322,7 +327,7 @@ hunt_nvram_partn_read_tlv( __out size_t *sizep); extern __checkReturn efx_rc_t -hunt_nvram_partn_write_tlv( +ef10_nvram_partn_write_tlv( __in efx_nic_t *enp, __in uint32_t partn, __in uint32_t tag, @@ -330,7 +335,7 @@ hunt_nvram_partn_write_tlv( __in size_t size); extern __checkReturn efx_rc_t -hunt_nvram_partn_write_segment_tlv( +ef10_nvram_partn_write_segment_tlv( __in efx_nic_t *enp, __in uint32_t partn, __in uint32_t tag, @@ -339,18 +344,18 @@ hunt_nvram_partn_write_segment_tlv( __in boolean_t all_segments); extern __checkReturn efx_rc_t -hunt_nvram_partn_size( +ef10_nvram_partn_size( __in efx_nic_t *enp, __in unsigned int partn, __out size_t *sizep); extern __checkReturn efx_rc_t -hunt_nvram_partn_lock( +ef10_nvram_partn_lock( __in efx_nic_t *enp, __in unsigned int partn); extern __checkReturn efx_rc_t -hunt_nvram_partn_read( +ef10_nvram_partn_read( __in efx_nic_t *enp, __in unsigned int partn, __in unsigned int offset, @@ -358,14 +363,14 @@ hunt_nvram_partn_read( __in size_t size); extern __checkReturn efx_rc_t -hunt_nvram_partn_erase( +ef10_nvram_partn_erase( __in efx_nic_t *enp, __in unsigned int partn, __in unsigned int offset, __in size_t size); extern __checkReturn efx_rc_t -hunt_nvram_partn_write( +ef10_nvram_partn_write( __in efx_nic_t *enp, __in unsigned int partn, __in unsigned int offset, @@ -373,7 +378,7 @@ hunt_nvram_partn_write( __in size_t size); extern void -hunt_nvram_partn_unlock( +ef10_nvram_partn_unlock( __in efx_nic_t *enp, __in unsigned int partn); @@ -384,32 +389,32 @@ hunt_nvram_partn_unlock( #if EFSYS_OPT_DIAG extern __checkReturn efx_rc_t -hunt_nvram_test( +ef10_nvram_test( __in efx_nic_t *enp); #endif /* EFSYS_OPT_DIAG */ extern __checkReturn efx_rc_t -hunt_nvram_size( +ef10_nvram_size( __in efx_nic_t *enp, __in efx_nvram_type_t type, __out size_t *sizep); extern __checkReturn efx_rc_t -hunt_nvram_get_version( +ef10_nvram_get_version( __in efx_nic_t *enp, __in efx_nvram_type_t type, __out uint32_t *subtypep, __out_ecount(4) uint16_t version[4]); extern __checkReturn efx_rc_t -hunt_nvram_rw_start( +ef10_nvram_rw_start( __in efx_nic_t *enp, __in efx_nvram_type_t type, __out size_t *pref_chunkp); extern __checkReturn efx_rc_t -hunt_nvram_read_chunk( +ef10_nvram_read_chunk( __in efx_nic_t *enp, __in efx_nvram_type_t type, __in unsigned int offset, @@ -417,12 +422,12 @@ hunt_nvram_read_chunk( __in size_t size); extern __checkReturn efx_rc_t -hunt_nvram_erase( +ef10_nvram_erase( __in efx_nic_t *enp, __in efx_nvram_type_t type); extern __checkReturn efx_rc_t -hunt_nvram_write_chunk( +ef10_nvram_write_chunk( __in efx_nic_t *enp, __in efx_nvram_type_t type, __in unsigned int offset, @@ -430,18 +435,18 @@ hunt_nvram_write_chunk( __in size_t size); extern void -hunt_nvram_rw_finish( +ef10_nvram_rw_finish( __in efx_nic_t *enp, __in efx_nvram_type_t type); extern __checkReturn efx_rc_t -hunt_nvram_partn_set_version( +ef10_nvram_partn_set_version( __in efx_nic_t *enp, __in unsigned int partn, __in_ecount(4) uint16_t version[4]); extern __checkReturn efx_rc_t -hunt_nvram_set_version( +ef10_nvram_set_version( __in efx_nic_t *enp, __in efx_nvram_type_t type, __in_ecount(4) uint16_t version[4]); Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Tue Jan 12 13:36:21 2016 (r293755) +++ head/sys/dev/sfxge/common/hunt_nvram.c Tue Jan 12 13:37:58 2016 (r293756) @@ -489,7 +489,7 @@ efx_nvram_tlv_validate( int pos; efx_rc_t rc; - EFX_STATIC_ASSERT(sizeof (*header) <= HUNTINGTON_NVRAM_CHUNK); + EFX_STATIC_ASSERT(sizeof (*header) <= EF10_NVRAM_CHUNK); if ((partn_data == NULL) || (partn_size == 0)) { rc = EINVAL; @@ -578,7 +578,7 @@ fail1: * beyond the first to be read. */ static __checkReturn efx_rc_t -hunt_nvram_read_tlv_segment( +ef10_nvram_read_tlv_segment( __in efx_nic_t *enp, __in uint32_t partn, __in size_t seg_offset, @@ -593,7 +593,7 @@ hunt_nvram_read_tlv_segment( int pos; efx_rc_t rc; - EFX_STATIC_ASSERT(sizeof (*header) <= HUNTINGTON_NVRAM_CHUNK); + EFX_STATIC_ASSERT(sizeof (*header) <= EF10_NVRAM_CHUNK); if ((seg_data == NULL) || (max_seg_size == 0)) { rc = EINVAL; @@ -601,8 +601,8 @@ hunt_nvram_read_tlv_segment( } /* Read initial chunk of the segment, starting at offset */ - if ((rc = hunt_nvram_partn_read(enp, partn, seg_offset, seg_data, - HUNTINGTON_NVRAM_CHUNK)) != 0) { + if ((rc = ef10_nvram_partn_read(enp, partn, seg_offset, seg_data, + EF10_NVRAM_CHUNK)) != 0) { goto fail2; } @@ -626,11 +626,11 @@ hunt_nvram_read_tlv_segment( } /* Read the remaining segment content */ - if (total_length > HUNTINGTON_NVRAM_CHUNK) { - if ((rc = hunt_nvram_partn_read(enp, partn, - seg_offset + HUNTINGTON_NVRAM_CHUNK, - seg_data + HUNTINGTON_NVRAM_CHUNK, - total_length - HUNTINGTON_NVRAM_CHUNK)) != 0) + if (total_length > EF10_NVRAM_CHUNK) { + if ((rc = ef10_nvram_partn_read(enp, partn, + seg_offset + EF10_NVRAM_CHUNK, + seg_data + EF10_NVRAM_CHUNK, + total_length - EF10_NVRAM_CHUNK)) != 0) goto fail6; } @@ -705,7 +705,7 @@ fail1: * buffer containing a TLV formatted segment. */ __checkReturn efx_rc_t -hunt_nvram_buf_read_tlv( +ef10_nvram_buf_read_tlv( __in efx_nic_t *enp, __in_bcount(max_seg_size) caddr_t seg_data, __in size_t max_seg_size, @@ -768,7 +768,7 @@ fail1: /* Read a single TLV item from the first segment in a TLV formatted partition */ __checkReturn efx_rc_t -hunt_nvram_partn_read_tlv( +ef10_nvram_partn_read_tlv( __in efx_nic_t *enp, __in uint32_t partn, __in uint32_t tag, @@ -783,7 +783,7 @@ hunt_nvram_partn_read_tlv( efx_rc_t rc; /* Allocate sufficient memory for the entire partition */ - if ((rc = hunt_nvram_partn_size(enp, partn, &partn_size)) != 0) + if ((rc = ef10_nvram_partn_size(enp, partn, &partn_size)) != 0) goto fail1; if (partn_size == 0) { @@ -807,7 +807,7 @@ hunt_nvram_partn_read_tlv( */ retry = 10; do { - rc = hunt_nvram_read_tlv_segment(enp, partn, 0, + rc = ef10_nvram_read_tlv_segment(enp, partn, 0, seg_data, partn_size); } while ((rc == EAGAIN) && (--retry > 0)); @@ -816,7 +816,7 @@ hunt_nvram_partn_read_tlv( goto fail4; } - if ((rc = hunt_nvram_buf_read_tlv(enp, seg_data, partn_size, + if ((rc = ef10_nvram_buf_read_tlv(enp, seg_data, partn_size, tag, &data, &length)) != 0) goto fail5; @@ -845,7 +845,7 @@ fail1: /* Compute the size of a segment. */ static __checkReturn efx_rc_t -hunt_nvram_buf_segment_size( +ef10_nvram_buf_segment_size( __in caddr_t seg_data, __in size_t max_seg_size, __out size_t *seg_sizep) @@ -976,7 +976,7 @@ fail1: * formatted segment. Historically partitions consisted of only one segment. */ __checkReturn efx_rc_t -hunt_nvram_buf_write_tlv( +ef10_nvram_buf_write_tlv( __inout_bcount(max_seg_size) caddr_t seg_data, __in size_t max_seg_size, __in uint32_t tag, @@ -1077,14 +1077,14 @@ fail1: * configuration. */ __checkReturn efx_rc_t -hunt_nvram_partn_write_tlv( +ef10_nvram_partn_write_tlv( __in efx_nic_t *enp, __in uint32_t partn, __in uint32_t tag, __in_bcount(size) caddr_t data, __in size_t size) { - return hunt_nvram_partn_write_segment_tlv(enp, partn, tag, data, + return ef10_nvram_partn_write_segment_tlv(enp, partn, tag, data, size, B_FALSE); } @@ -1093,7 +1093,7 @@ hunt_nvram_partn_write_tlv( * and optionally write a new tag to it. */ static __checkReturn efx_rc_t -hunt_nvram_segment_write_tlv( +ef10_nvram_segment_write_tlv( __in efx_nic_t *enp, __in uint32_t partn, __in uint32_t tag, @@ -1116,19 +1116,19 @@ hunt_nvram_segment_write_tlv( * this is the first segment in a partition. In this case the caller * must propogate the error. */ - status = hunt_nvram_read_tlv_segment(enp, partn, *partn_offsetp, + status = ef10_nvram_read_tlv_segment(enp, partn, *partn_offsetp, *seg_datap, *src_remain_lenp); if (status != 0) return (EINVAL); - status = hunt_nvram_buf_segment_size(*seg_datap, + status = ef10_nvram_buf_segment_size(*seg_datap, *src_remain_lenp, &original_segment_size); if (status != 0) return (EINVAL); if (write) { /* Update the contents of the segment in the buffer */ - if ((rc = hunt_nvram_buf_write_tlv(*seg_datap, + if ((rc = ef10_nvram_buf_write_tlv(*seg_datap, *dest_remain_lenp, tag, data, size, &modified_segment_size)) != 0) goto fail1; @@ -1176,7 +1176,7 @@ fail1: * invalidate them. */ __checkReturn efx_rc_t -hunt_nvram_partn_write_segment_tlv( +ef10_nvram_partn_write_segment_tlv( __in efx_nic_t *enp, __in uint32_t partn, __in uint32_t tag, @@ -1196,7 +1196,7 @@ hunt_nvram_partn_write_segment_tlv( EFSYS_ASSERT3U(partn, ==, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG); /* Allocate sufficient memory for the entire partition */ - if ((rc = hunt_nvram_partn_size(enp, partn, &partn_size)) != 0) + if ((rc = ef10_nvram_partn_size(enp, partn, &partn_size)) != 0) goto fail1; EFSYS_KMEM_ALLOC(enp->en_esip, partn_size, partn_data); @@ -1210,14 +1210,14 @@ hunt_nvram_partn_write_segment_tlv( segment_data = partn_data; /* Lock the partition */ - if ((rc = hunt_nvram_partn_lock(enp, partn)) != 0) + if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0) goto fail3; /* Iterate over each (potential) segment to update it. */ do { boolean_t write = all_segments || current_offset == 0; - rc = hunt_nvram_segment_write_tlv(enp, partn, tag, data, size, + rc = ef10_nvram_segment_write_tlv(enp, partn, tag, data, size, &segment_data, ¤t_offset, &remaining_original_length, &remaining_modified_length, write); if (rc != 0) { @@ -1236,7 +1236,7 @@ hunt_nvram_partn_write_segment_tlv( /* * We've run out of space. This should actually be dealt with by - * hunt_nvram_buf_write_tlv returning ENOSPC. + * ef10_nvram_buf_write_tlv returning ENOSPC. */ if (total_length > partn_size) { rc = ENOSPC; @@ -1244,16 +1244,16 @@ hunt_nvram_partn_write_segment_tlv( } /* Erase the whole partition in NVRAM */ - if ((rc = hunt_nvram_partn_erase(enp, partn, 0, partn_size)) != 0) + if ((rc = ef10_nvram_partn_erase(enp, partn, 0, partn_size)) != 0) goto fail6; /* Write new partition contents from the buffer to NVRAM */ - if ((rc = hunt_nvram_partn_write(enp, partn, 0, partn_data, + if ((rc = ef10_nvram_partn_write(enp, partn, 0, partn_data, total_length)) != 0) goto fail7; /* Unlock the partition */ - hunt_nvram_partn_unlock(enp, partn); + ef10_nvram_partn_unlock(enp, partn); EFSYS_KMEM_FREE(enp->en_esip, partn_size, partn_data); @@ -1268,7 +1268,7 @@ fail5: fail4: EFSYS_PROBE(fail4); - hunt_nvram_partn_unlock(enp, partn); + ef10_nvram_partn_unlock(enp, partn); fail3: EFSYS_PROBE(fail3); @@ -1286,7 +1286,7 @@ fail1: * not the data used by the segments in the partition. */ __checkReturn efx_rc_t -hunt_nvram_partn_size( +ef10_nvram_partn_size( __in efx_nic_t *enp, __in unsigned int partn, __out size_t *sizep) @@ -1306,7 +1306,7 @@ fail1: } __checkReturn efx_rc_t -hunt_nvram_partn_lock( +ef10_nvram_partn_lock( __in efx_nic_t *enp, __in unsigned int partn) { @@ -1324,7 +1324,7 @@ fail1: } __checkReturn efx_rc_t -hunt_nvram_partn_read( +ef10_nvram_partn_read( __in efx_nic_t *enp, __in unsigned int partn, __in unsigned int offset, @@ -1335,7 +1335,7 @@ hunt_nvram_partn_read( efx_rc_t rc; while (size > 0) { - chunk = MIN(size, HUNTINGTON_NVRAM_CHUNK); + chunk = MIN(size, EF10_NVRAM_CHUNK); if ((rc = efx_mcdi_nvram_read(enp, partn, offset, data, chunk)) != 0) { @@ -1356,7 +1356,7 @@ fail1: } __checkReturn efx_rc_t -hunt_nvram_partn_erase( +ef10_nvram_partn_erase( __in efx_nic_t *enp, __in unsigned int partn, __in unsigned int offset, @@ -1401,7 +1401,7 @@ fail1: } __checkReturn efx_rc_t -hunt_nvram_partn_write( +ef10_nvram_partn_write( __in efx_nic_t *enp, __in unsigned int partn, __in unsigned int offset, @@ -1426,7 +1426,7 @@ hunt_nvram_partn_write( goto fail2; } } else { - write_size = HUNTINGTON_NVRAM_CHUNK; + write_size = EF10_NVRAM_CHUNK; } while (size > 0) { @@ -1455,7 +1455,7 @@ fail1: } void -hunt_nvram_partn_unlock( +ef10_nvram_partn_unlock( __in efx_nic_t *enp, __in unsigned int partn) { @@ -1473,7 +1473,7 @@ fail1: } __checkReturn efx_rc_t -hunt_nvram_partn_set_version( +ef10_nvram_partn_set_version( __in efx_nic_t *enp, __in unsigned int partn, __in_ecount(4) uint16_t version[4]) @@ -1491,7 +1491,7 @@ hunt_nvram_partn_set_version( size = sizeof (partn_version) - (2 * sizeof (uint32_t)); /* Write the version number to all segments in the partition */ - if ((rc = hunt_nvram_partn_write_segment_tlv(enp, + if ((rc = ef10_nvram_partn_write_segment_tlv(enp, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, TLV_TAG_PARTITION_VERSION(partn), (caddr_t)&partn_version.version_w, size, B_TRUE)) != 0) @@ -1509,14 +1509,16 @@ fail1: #if EFSYS_OPT_NVRAM -typedef struct hunt_parttbl_entry_s { +/* FIXME: Update partition table for Medford */ + +typedef struct ef10_parttbl_entry_s { unsigned int partn; unsigned int port; efx_nvram_type_t nvtype; -} hunt_parttbl_entry_t; +} ef10_parttbl_entry_t; /* Translate EFX NVRAM types to firmware partition types */ -static hunt_parttbl_entry_t hunt_parttbl[] = { +static ef10_parttbl_entry_t ef10_parttbl[] = { {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 1, EFX_NVRAM_MC_FIRMWARE}, {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 2, EFX_NVRAM_MC_FIRMWARE}, {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 3, EFX_NVRAM_MC_FIRMWARE}, @@ -1547,19 +1549,19 @@ static hunt_parttbl_entry_t hunt_parttbl {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP} }; -static __checkReturn hunt_parttbl_entry_t * -hunt_parttbl_entry( +static __checkReturn ef10_parttbl_entry_t * +ef10_parttbl_entry( __in efx_nic_t *enp, __in efx_nvram_type_t type) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - hunt_parttbl_entry_t *entry; + ef10_parttbl_entry_t *entry; int i; EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - for (i = 0; i < EFX_ARRAY_SIZE(hunt_parttbl); i++) { - entry = &hunt_parttbl[i]; + for (i = 0; i < EFX_ARRAY_SIZE(ef10_parttbl); i++) { + entry = &ef10_parttbl[i]; if (entry->port == emip->emi_port && entry->nvtype == type) return (entry); @@ -1572,11 +1574,11 @@ hunt_parttbl_entry( #if EFSYS_OPT_DIAG __checkReturn efx_rc_t -hunt_nvram_test( +ef10_nvram_test( __in efx_nic_t *enp) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - hunt_parttbl_entry_t *entry; + ef10_parttbl_entry_t *entry; unsigned int npartns = 0; uint32_t *partns = NULL; size_t size; @@ -1601,8 +1603,8 @@ hunt_nvram_test( * Iterate over the list of supported partition types * applicable to *this* port */ - for (i = 0; i < EFX_ARRAY_SIZE(hunt_parttbl); i++) { - entry = &hunt_parttbl[i]; + for (i = 0; i < EFX_ARRAY_SIZE(ef10_parttbl); i++) { + entry = &ef10_parttbl[i]; if (entry->port != emip->emi_port) continue; @@ -1632,22 +1634,22 @@ fail1: #endif /* EFSYS_OPT_DIAG */ __checkReturn efx_rc_t -hunt_nvram_size( +ef10_nvram_size( __in efx_nic_t *enp, __in efx_nvram_type_t type, __out size_t *sizep) { - hunt_parttbl_entry_t *entry; + ef10_parttbl_entry_t *entry; uint32_t partn; efx_rc_t rc; - if ((entry = hunt_parttbl_entry(enp, type)) == NULL) { + if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { rc = ENOTSUP; goto fail1; } partn = entry->partn; - if ((rc = hunt_nvram_partn_size(enp, partn, sizep)) != 0) + if ((rc = ef10_nvram_partn_size(enp, partn, sizep)) != 0) goto fail2; return (0); @@ -1663,17 +1665,17 @@ fail1: } __checkReturn efx_rc_t -hunt_nvram_get_version( +ef10_nvram_get_version( __in efx_nic_t *enp, __in efx_nvram_type_t type, __out uint32_t *subtypep, __out_ecount(4) uint16_t version[4]) { - hunt_parttbl_entry_t *entry; + ef10_parttbl_entry_t *entry; uint32_t partn; efx_rc_t rc; - if ((entry = hunt_parttbl_entry(enp, type)) == NULL) { + if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { rc = ENOTSUP; goto fail1; } @@ -1697,26 +1699,26 @@ fail1: } __checkReturn efx_rc_t -hunt_nvram_rw_start( +ef10_nvram_rw_start( __in efx_nic_t *enp, __in efx_nvram_type_t type, __out size_t *chunk_sizep) { - hunt_parttbl_entry_t *entry; + ef10_parttbl_entry_t *entry; uint32_t partn; efx_rc_t rc; - if ((entry = hunt_parttbl_entry(enp, type)) == NULL) { + if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { rc = ENOTSUP; goto fail1; } partn = entry->partn; - if ((rc = hunt_nvram_partn_lock(enp, partn)) != 0) + if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0) goto fail2; if (chunk_sizep != NULL) - *chunk_sizep = HUNTINGTON_NVRAM_CHUNK; + *chunk_sizep = EF10_NVRAM_CHUNK; return (0); @@ -1729,22 +1731,22 @@ fail1: } __checkReturn efx_rc_t -hunt_nvram_read_chunk( +ef10_nvram_read_chunk( __in efx_nic_t *enp, __in efx_nvram_type_t type, __in unsigned int offset, __out_bcount(size) caddr_t data, __in size_t size) { - hunt_parttbl_entry_t *entry; + ef10_parttbl_entry_t *entry; efx_rc_t rc; - if ((entry = hunt_parttbl_entry(enp, type)) == NULL) { + if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { rc = ENOTSUP; goto fail1; } - if ((rc = hunt_nvram_partn_read(enp, entry->partn, + if ((rc = ef10_nvram_partn_read(enp, entry->partn, offset, data, size)) != 0) goto fail2; @@ -1759,23 +1761,23 @@ fail1: } __checkReturn efx_rc_t -hunt_nvram_erase( +ef10_nvram_erase( __in efx_nic_t *enp, __in efx_nvram_type_t type) { - hunt_parttbl_entry_t *entry; + ef10_parttbl_entry_t *entry; size_t size; efx_rc_t rc; - if ((entry = hunt_parttbl_entry(enp, type)) == NULL) { + if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { rc = ENOTSUP; goto fail1; } - if ((rc = hunt_nvram_partn_size(enp, entry->partn, &size)) != 0) + if ((rc = ef10_nvram_partn_size(enp, entry->partn, &size)) != 0) goto fail2; - if ((rc = hunt_nvram_partn_erase(enp, entry->partn, 0, size)) != 0) + if ((rc = ef10_nvram_partn_erase(enp, entry->partn, 0, size)) != 0) goto fail3; return (0); @@ -1791,22 +1793,22 @@ fail1: } __checkReturn efx_rc_t -hunt_nvram_write_chunk( +ef10_nvram_write_chunk( __in efx_nic_t *enp, __in efx_nvram_type_t type, __in unsigned int offset, __in_bcount(size) caddr_t data, __in size_t size) { - hunt_parttbl_entry_t *entry; + ef10_parttbl_entry_t *entry; efx_rc_t rc; - if ((entry = hunt_parttbl_entry(enp, type)) == NULL) { + if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { rc = ENOTSUP; goto fail1; } - if ((rc = hunt_nvram_partn_write(enp, entry->partn, + if ((rc = ef10_nvram_partn_write(enp, entry->partn, offset, data, size)) != 0) goto fail2; @@ -1821,33 +1823,33 @@ fail1: } void -hunt_nvram_rw_finish( +ef10_nvram_rw_finish( __in efx_nic_t *enp, __in efx_nvram_type_t type) { - hunt_parttbl_entry_t *entry; + ef10_parttbl_entry_t *entry; - if ((entry = hunt_parttbl_entry(enp, type)) != NULL) - hunt_nvram_partn_unlock(enp, entry->partn); + if ((entry = ef10_parttbl_entry(enp, type)) != NULL) + ef10_nvram_partn_unlock(enp, entry->partn); } __checkReturn efx_rc_t -hunt_nvram_set_version( +ef10_nvram_set_version( __in efx_nic_t *enp, __in efx_nvram_type_t type, __in_ecount(4) uint16_t version[4]) { - hunt_parttbl_entry_t *entry; + ef10_parttbl_entry_t *entry; unsigned int partn; efx_rc_t rc; - if ((entry = hunt_parttbl_entry(enp, type)) == NULL) { + if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { rc = ENOTSUP; goto fail1; } partn = entry->partn; - if ((rc = hunt_nvram_partn_set_version(enp, partn, version)) != 0) + if ((rc = ef10_nvram_partn_set_version(enp, partn, version)) != 0) goto fail2; return (0); Modified: head/sys/dev/sfxge/common/hunt_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_vpd.c Tue Jan 12 13:36:21 2016 (r293755) +++ head/sys/dev/sfxge/common/hunt_vpd.c Tue Jan 12 13:37:58 2016 (r293756) @@ -65,7 +65,7 @@ ef10_vpd_init( */ svpd = NULL; svpd_size = 0; - rc = hunt_nvram_partn_read_tlv(enp, + rc = ef10_nvram_partn_read_tlv(enp, NVRAM_PARTITION_TYPE_STATIC_CONFIG, TLV_TAG_PF_STATIC_VPD(pci_pf), &svpd, &svpd_size); @@ -142,7 +142,7 @@ ef10_vpd_read( pci_pf = enp->en_nic_cfg.enc_pf; - if ((rc = hunt_nvram_partn_read_tlv(enp, + if ((rc = ef10_nvram_partn_read_tlv(enp, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, TLV_TAG_PF_DYNAMIC_VPD(pci_pf), &dvpd, &dvpd_size)) != 0) @@ -404,7 +404,7 @@ ef10_vpd_write( goto fail1; /* Store new dynamic VPD in all segments in DYNAMIC_CONFIG partition */ - if ((rc = hunt_nvram_partn_write_segment_tlv(enp, + if ((rc = ef10_nvram_partn_write_segment_tlv(enp, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, TLV_TAG_PF_DYNAMIC_VPD(pci_pf), data, vpd_length, B_TRUE)) != 0) { From owner-svn-src-head@freebsd.org Tue Jan 12 13:39:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9478A6D5C2; Tue, 12 Jan 2016 13:39:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A44A1D04; Tue, 12 Jan 2016 13:39:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CDdQ0t096091; Tue, 12 Jan 2016 13:39:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CDdQBL096087; Tue, 12 Jan 2016 13:39:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121339.u0CDdQBL096087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 13:39:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293757 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 13:39:27 -0000 Author: arybchik Date: Tue Jan 12 13:39:25 2016 New Revision: 293757 URL: https://svnweb.freebsd.org/changeset/base/293757 Log: sfxge: rename hunt MCDI methods to ef10 and use for Medford Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4874 Modified: head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue Jan 12 13:37:58 2016 (r293756) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue Jan 12 13:39:25 2016 (r293757) @@ -56,20 +56,20 @@ static efx_mcdi_ops_t __efx_mcdi_siena_o #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD -static efx_mcdi_ops_t __efx_mcdi_hunt_ops = { - hunt_mcdi_init, /* emco_init */ - hunt_mcdi_request_copyin, /* emco_request_copyin */ - hunt_mcdi_request_copyout, /* emco_request_copyout */ - hunt_mcdi_poll_reboot, /* emco_poll_reboot */ - hunt_mcdi_poll_response, /* emco_poll_response */ - hunt_mcdi_read_response, /* emco_read_response */ - hunt_mcdi_fini, /* emco_fini */ - hunt_mcdi_feature_supported, /* emco_feature_supported */ +static efx_mcdi_ops_t __efx_mcdi_ef10_ops = { + ef10_mcdi_init, /* emco_init */ + ef10_mcdi_request_copyin, /* emco_request_copyin */ + ef10_mcdi_request_copyout, /* emco_request_copyout */ + ef10_mcdi_poll_reboot, /* emco_poll_reboot */ + ef10_mcdi_poll_response, /* emco_poll_response */ + ef10_mcdi_read_response, /* emco_read_response */ + ef10_mcdi_fini, /* emco_fini */ + ef10_mcdi_feature_supported, /* emco_feature_supported */ }; -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ @@ -100,10 +100,16 @@ efx_mcdi_init( #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - emcop = (efx_mcdi_ops_t *)&__efx_mcdi_hunt_ops; + emcop = (efx_mcdi_ops_t *)&__efx_mcdi_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + emcop = (efx_mcdi_ops_t *)&__efx_mcdi_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ + default: EFSYS_ASSERT(0); rc = ENOTSUP; @@ -1491,7 +1497,7 @@ fail1: #if EFSYS_OPT_BIST -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD /* * Enter bist offline mode. This is a fw mode which puts the NIC into a state * where memory BIST tests can be run and not much else can interfere or happen. @@ -1527,7 +1533,7 @@ fail1: return (rc); } -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ __checkReturn efx_rc_t efx_mcdi_bist_start( @@ -1788,7 +1794,7 @@ fail1: #endif /* EFSYS_OPT_MAC_STATS */ -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD /* * This function returns the pf and vf number of a function. If it is a pf the @@ -1887,7 +1893,7 @@ fail1: return (rc); } -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ __checkReturn efx_rc_t efx_mcdi_set_workaround( Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Tue Jan 12 13:37:58 2016 (r293756) +++ head/sys/dev/sfxge/common/efx_mcdi.h Tue Jan 12 13:39:25 2016 (r293757) @@ -188,11 +188,11 @@ efx_mcdi_mac_spoofing_supported( #if EFSYS_OPT_BIST -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD extern __checkReturn efx_rc_t efx_mcdi_bist_enable_offline( __in efx_nic_t *enp); -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ extern __checkReturn efx_rc_t efx_mcdi_bist_start( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:37:58 2016 (r293756) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:39:25 2016 (r293757) @@ -252,16 +252,16 @@ hunt_mac_stats_update( #if EFSYS_OPT_MCDI extern __checkReturn efx_rc_t -hunt_mcdi_init( +ef10_mcdi_init( __in efx_nic_t *enp, __in const efx_mcdi_transport_t *mtp); extern void -hunt_mcdi_fini( +ef10_mcdi_fini( __in efx_nic_t *enp); extern void -hunt_mcdi_request_copyin( +ef10_mcdi_request_copyin( __in efx_nic_t *enp, __in efx_mcdi_req_t *emrp, __in unsigned int seq, @@ -269,27 +269,27 @@ hunt_mcdi_request_copyin( __in boolean_t new_epoch); extern __checkReturn boolean_t -hunt_mcdi_poll_response( +ef10_mcdi_poll_response( __in efx_nic_t *enp); extern void -hunt_mcdi_read_response( +ef10_mcdi_read_response( __in efx_nic_t *enp, __out void *bufferp, __in size_t offset, __in size_t length); extern void -hunt_mcdi_request_copyout( +ef10_mcdi_request_copyout( __in efx_nic_t *enp, __in efx_mcdi_req_t *emrp); extern efx_rc_t -hunt_mcdi_poll_reboot( +ef10_mcdi_poll_reboot( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_mcdi_feature_supported( +ef10_mcdi_feature_supported( __in efx_nic_t *enp, __in efx_mcdi_feature_id_t id, __out boolean_t *supportedp); Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Tue Jan 12 13:37:58 2016 (r293756) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Tue Jan 12 13:39:25 2016 (r293757) @@ -36,12 +36,12 @@ __FBSDID("$FreeBSD$"); #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD #if EFSYS_OPT_MCDI #ifndef WITH_MCDI_V2 -#error "WITH_MCDI_V2 required for Huntington MCDIv2 commands." +#error "WITH_MCDI_V2 required for EF10 MCDIv2 commands." #endif typedef enum efx_mcdi_header_type_e { @@ -77,7 +77,7 @@ typedef enum efx_mcdi_header_type_e { __checkReturn efx_rc_t -hunt_mcdi_init( +ef10_mcdi_init( __in efx_nic_t *enp, __in const efx_mcdi_transport_t *emtp) { @@ -85,10 +85,11 @@ hunt_mcdi_init( efx_dword_t dword; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); EFSYS_ASSERT(enp->en_features & EFX_FEATURE_MCDI_DMA); - /* A host DMA buffer is required for Huntington MCDI */ + /* A host DMA buffer is required for EF10 MCDI */ if (esmp == NULL) { rc = EINVAL; goto fail1; @@ -107,7 +108,7 @@ hunt_mcdi_init( EFX_BAR_WRITED(enp, ER_DZ_MC_DB_HWRD_REG, &dword, B_FALSE); /* Save initial MC reboot status */ - (void) hunt_mcdi_poll_reboot(enp); + (void) ef10_mcdi_poll_reboot(enp); /* Start a new epoch (allow fresh MCDI requests to succeed) */ efx_mcdi_new_epoch(enp); @@ -123,7 +124,7 @@ fail1: } void -hunt_mcdi_fini( +ef10_mcdi_fini( __in efx_nic_t *enp) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); @@ -132,7 +133,7 @@ hunt_mcdi_fini( } void -hunt_mcdi_request_copyin( +ef10_mcdi_request_copyin( __in efx_nic_t *enp, __in efx_mcdi_req_t *emrp, __in unsigned int seq, @@ -148,7 +149,8 @@ hunt_mcdi_request_copyin( unsigned int pos; size_t offset; - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); xflags = 0; if (ev_cpl) @@ -225,7 +227,7 @@ hunt_mcdi_request_copyin( } void -hunt_mcdi_request_copyout( +ef10_mcdi_request_copyout( __in efx_nic_t *enp, __in efx_mcdi_req_t *emrp) { @@ -241,13 +243,13 @@ hunt_mcdi_request_copyout( /* Read the command header to detect MCDI response format */ hdr_len = sizeof (hdr[0]); - hunt_mcdi_read_response(enp, &hdr[0], 0, hdr_len); + ef10_mcdi_read_response(enp, &hdr[0], 0, hdr_len); if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) { /* * Read the actual payload length. The length given in the event * is only correct for responses with the V1 format. */ - hunt_mcdi_read_response(enp, &hdr[1], hdr_len, sizeof (hdr[1])); + ef10_mcdi_read_response(enp, &hdr[1], hdr_len, sizeof (hdr[1])); hdr_len += sizeof (hdr[1]); emrp->emr_out_length_used = EFX_DWORD_FIELD(hdr[1], @@ -256,7 +258,7 @@ hunt_mcdi_request_copyout( /* Copy payload out into caller supplied buffer */ bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length); - hunt_mcdi_read_response(enp, emrp->emr_out_buf, hdr_len, bytes); + ef10_mcdi_read_response(enp, emrp->emr_out_buf, hdr_len, bytes); #if EFSYS_OPT_MCDI_LOGGING if (emtp->emt_logger != NULL) { @@ -269,7 +271,7 @@ hunt_mcdi_request_copyout( } __checkReturn boolean_t -hunt_mcdi_poll_response( +ef10_mcdi_poll_response( __in efx_nic_t *enp) { const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; @@ -281,7 +283,7 @@ hunt_mcdi_poll_response( } void -hunt_mcdi_read_response( +ef10_mcdi_read_response( __in efx_nic_t *enp, __out void *bufferp, __in size_t offset, @@ -300,7 +302,7 @@ hunt_mcdi_read_response( } efx_rc_t -hunt_mcdi_poll_reboot( +ef10_mcdi_poll_reboot( __in efx_nic_t *enp) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); @@ -324,7 +326,7 @@ hunt_mcdi_poll_reboot( * * The Siena support for checking for MC reboot from status * flags is broken - see comments in siena_mcdi_poll_reboot(). - * As the generic MCDI code is shared the Huntington reboot + * As the generic MCDI code is shared the EF10 reboot * detection suffers similar problems. * * Do not report an error when the boot status changes until @@ -346,7 +348,7 @@ fail1: } __checkReturn efx_rc_t -hunt_mcdi_feature_supported( +ef10_mcdi_feature_supported( __in efx_nic_t *enp, __in efx_mcdi_feature_id_t id, __out boolean_t *supportedp) @@ -355,7 +357,8 @@ hunt_mcdi_feature_supported( uint32_t privilege_mask = encp->enc_privilege_mask; efx_rc_t rc; - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); /* * Use privilege mask state at MCDI attach. @@ -417,4 +420,4 @@ fail1: #endif /* EFSYS_OPT_MCDI */ -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ From owner-svn-src-head@freebsd.org Tue Jan 12 13:42:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FB78A6D764; Tue, 12 Jan 2016 13:42:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E157610DB; Tue, 12 Jan 2016 13:42:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CDgR3U098797; Tue, 12 Jan 2016 13:42:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CDgRs6098791; Tue, 12 Jan 2016 13:42:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121342.u0CDgRs6098791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 13:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293758 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 13:42:29 -0000 Author: arybchik Date: Tue Jan 12 13:42:27 2016 New Revision: 293758 URL: https://svnweb.freebsd.org/changeset/base/293758 Log: sfxge: remove obsolete common code PKTFILTER module The pktfilter module has been obsolete for some time, as it was replaced by newer features in filter module. With the removal of the storport driver, this module has no users and can be removed. Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4875 Modified: head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/hunt_impl.h Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Tue Jan 12 13:39:25 2016 (r293757) +++ head/sys/dev/sfxge/common/efsys.h Tue Jan 12 13:42:27 2016 (r293758) @@ -287,7 +287,6 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_RX_SCALE 1 #define EFSYS_OPT_QSTATS 1 #define EFSYS_OPT_FILTER 1 -#define EFSYS_OPT_MCAST_FILTER_LIST 1 #define EFSYS_OPT_RX_SCATTER 0 #define EFSYS_OPT_RX_HDR_SPLIT 0 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Jan 12 13:39:25 2016 (r293757) +++ head/sys/dev/sfxge/common/efx.h Tue Jan 12 13:42:27 2016 (r293758) @@ -508,35 +508,10 @@ efx_mac_fcntl_get( #define EFX_MAC_HASH_BITS (1 << 8) extern __checkReturn efx_rc_t -efx_pktfilter_init( - __in efx_nic_t *enp); - -extern void -efx_pktfilter_fini( - __in efx_nic_t *enp); - -extern __checkReturn efx_rc_t -efx_pktfilter_set( - __in efx_nic_t *enp, - __in boolean_t unicst, - __in boolean_t brdcst); - -extern __checkReturn efx_rc_t efx_mac_hash_set( __in efx_nic_t *enp, __in_ecount(EFX_MAC_HASH_BITS) unsigned int const *bucket); -#if EFSYS_OPT_MCAST_FILTER_LIST -extern __checkReturn efx_rc_t -efx_pktfilter_mcast_list_set( - __in efx_nic_t *enp, - __in uint8_t const *addrs, - __in int count); -#endif /* EFSYS_OPT_MCAST_FILTER_LIST */ - -extern __checkReturn efx_rc_t -efx_pktfilter_mcast_all( - __in efx_nic_t *enp); #if EFSYS_OPT_MAC_STATS Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue Jan 12 13:39:25 2016 (r293757) +++ head/sys/dev/sfxge/common/efx_check.h Tue Jan 12 13:42:27 2016 (r293758) @@ -397,12 +397,9 @@ # endif #endif /* EFSYS_OPT_WOL */ -/* Support calculating multicast pktfilter in common code */ -#if EFSYS_OPT_MCAST_FILTER_LIST -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "MCAST_FILTER_LIST requires FALCON or SIENA or HUNTINGTON or MEDFORD" -# endif +/* Obsolete option */ +#ifdef EFSYS_OPT_MCAST_FILTER_LIST +# error "MCAST_FILTER_LIST is obsolete and not supported" #endif /* EFSYS_OPT_MCAST_FILTER_LIST */ /* Support BIST */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue Jan 12 13:39:25 2016 (r293757) +++ head/sys/dev/sfxge/common/efx_impl.h Tue Jan 12 13:42:27 2016 (r293758) @@ -266,16 +266,6 @@ efx_filter_reconfigure( #endif /* EFSYS_OPT_FILTER */ -typedef struct efx_pktfilter_ops_s { - efx_rc_t (*epfo_set)(efx_nic_t *, - boolean_t unicst, - boolean_t brdcast); -#if EFSYS_OPT_MCAST_FILTER_LIST - efx_rc_t (*epfo_mcast_list_set)(efx_nic_t *, - uint8_t const *addrs, int count); -#endif /* EFSYS_OPT_MCAST_FILTER_LIST */ - efx_rc_t (*epfo_mcast_all)(efx_nic_t *); -} efx_pktfilter_ops_t; typedef struct efx_port_s { efx_mac_type_t ep_mac_type; @@ -624,7 +614,6 @@ struct efx_nic_s { efx_filter_t en_filter; efx_filter_ops_t *en_efop; #endif /* EFSYS_OPT_FILTER */ - efx_pktfilter_ops_t *en_epfop; #if EFSYS_OPT_MCDI efx_mcdi_t en_mcdi; #endif /* EFSYS_OPT_MCDI */ Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:39:25 2016 (r293757) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:42:27 2016 (r293758) @@ -1008,26 +1008,6 @@ hunt_filter_default_rxq_clear( #endif /* EFSYS_OPT_FILTER */ extern __checkReturn efx_rc_t -hunt_pktfilter_set( - __in efx_nic_t *enp, - __in boolean_t unicst, - __in boolean_t brdcst); - -#if EFSYS_OPT_MCAST_FILTER_LIST - -extern __checkReturn efx_rc_t -hunt_pktfilter_mcast_set( - __in efx_nic_t *enp, - __in uint8_t const *addrs, - __in int count); - -#endif /* EFSYS_OPT_MCAST_FILTER_LIST */ - -extern __checkReturn efx_rc_t -hunt_pktfilter_mcast_all( - __in efx_nic_t *enp); - -extern __checkReturn efx_rc_t efx_mcdi_get_function_info( __in efx_nic_t *enp, __out uint32_t *pfp, From owner-svn-src-head@freebsd.org Tue Jan 12 14:30:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09C1DA6C86C for ; Tue, 12 Jan 2016 14:30:14 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E16D61CD0 for ; Tue, 12 Jan 2016 14:30:13 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 12 Jan 2016 14:28:48 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0CEU52o004564; Tue, 12 Jan 2016 07:30:05 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452609005.46848.11.camel@freebsd.org> Subject: Re: svn commit: r293720 - head/sys/dev/hyperv/netvsc From: Ian Lepore To: Joel Dahl , Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 12 Jan 2016 07:30:05 -0700 In-Reply-To: <20160112075525.GA38087@ymer.vnode.se> References: <201601120141.u0C1fYbC080237@repo.freebsd.org> <20160112075525.GA38087@ymer.vnode.se> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 14:30:14 -0000 On Tue, 2016-01-12 at 08:55 +0100, Joel Dahl wrote: > On Tue, Jan 12, 2016 at 01:41:34AM +0000, Sepherosa Ziehau wrote: > > Author: sephe > > Date: Tue Jan 12 01:41:34 2016 > > New Revision: 293720 > > URL: https://svnweb.freebsd.org/changeset/base/293720 > > > > Log: > > hyperv/hn: Implement SIOC[SG]IFMEDIA support > > > > Many applications and kernel modules (e.g. bridge) rely on the > > ifmedia > > status report; give them what they want. > > > > Submitted by: Dexuan Cui > > Reviewed by: Jun Su , me, > > adrian > > Modified by: me (minor) > ^^^^^^^^^^^^^^^ Really? > > % finger me@freebsd.org > [freebsd.org] > Trying 8.8.178.110... > Login: me Name: Michael Elbel > Directory: /home/me Shell: > /usr/local/bin/bash > No Mail. > Mail forwarded to: > me@consol.de > # me > No Plan. > > ;-) > Really? You're complaining about the committer using the personal pronoun that refers to one's self in a context of referring to himself? Do we really, as a project, have nothing better to do than this endless nitpicking at the metadata in commit messages? -- Ian From owner-svn-src-head@freebsd.org Tue Jan 12 15:20:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7531CA6DDAD; Tue, 12 Jan 2016 15:20:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44139126B; Tue, 12 Jan 2016 15:20:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CFK3Ze033124; Tue, 12 Jan 2016 15:20:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CFK3nY033123; Tue, 12 Jan 2016 15:20:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121520.u0CFK3nY033123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 15:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293761 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:20:04 -0000 Author: arybchik Date: Tue Jan 12 15:20:03 2016 New Revision: 293761 URL: https://svnweb.freebsd.org/changeset/base/293761 Log: sfxge: remove unnecessary pulling out of soft bits from RX events These bigs are changed on Medford. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4876 Modified: head/sys/dev/sfxge/common/hunt_ev.c Modified: head/sys/dev/sfxge/common/hunt_ev.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_ev.c Tue Jan 12 14:33:17 2016 (r293760) +++ head/sys/dev/sfxge/common/hunt_ev.c Tue Jan 12 15:20:03 2016 (r293761) @@ -499,7 +499,6 @@ ef10_ev_rx( uint32_t l3_class; uint32_t l4_class; uint32_t next_read_lbits; - boolean_t soft1, soft2; uint16_t flags; boolean_t should_abort; efx_evq_rxq_state_t *eersp; @@ -561,10 +560,6 @@ ef10_ev_rx( flags |= EFX_DISCARD; } - /* FIXME: do we need soft bits from RXDP firmware ? */ - soft1 = (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_EV_SOFT1) != 0); - soft2 = (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_EV_SOFT2) != 0); - mcast = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_MAC_CLASS); if (mcast == ESE_DZ_MAC_CLASS_UCAST) flags |= EFX_PKT_UNICAST; From owner-svn-src-head@freebsd.org Tue Jan 12 15:20:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 028BFA6DE1F; Tue, 12 Jan 2016 15:20:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C85EF1538; Tue, 12 Jan 2016 15:20:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CFKrJh033285; Tue, 12 Jan 2016 15:20:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CFKr3I033284; Tue, 12 Jan 2016 15:20:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121520.u0CFKr3I033284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 15:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293762 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:20:55 -0000 Author: arybchik Date: Tue Jan 12 15:20:53 2016 New Revision: 293762 URL: https://svnweb.freebsd.org/changeset/base/293762 Log: sfxge: add new MCDI sensors to common code Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4877 Modified: head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Tue Jan 12 15:20:03 2016 (r293761) +++ head/sys/dev/sfxge/common/mcdi_mon.c Tue Jan 12 15:20:53 2016 (r293762) @@ -149,6 +149,13 @@ static const struct mcdi_sensor_map_s { STAT(Px, CONTROLLER_SLAVE_VPTAT_EXT_ADC), /* 0x46 SLAVE_VPTAT_EXT_ADC */ STAT(Px, CONTROLLER_SLAVE_INTERNAL_TEMP_EXT_ADC), /* 0x47 SLAVE_INTERNAL_TEMP_EXT_ADC */ + STAT_NO_SENSOR(), /* 0x48 (no sensor) */ + STAT(Px, SODIMM_VOUT), /* 0x49 SODIMM_VOUT */ + STAT(Px, SODIMM_0_TEMP), /* 0x4a SODIMM_0_TEMP */ + STAT(Px, SODIMM_1_TEMP), /* 0x4b SODIMM_1_TEMP */ + STAT(Px, PHY0_VCC), /* 0x4c PHY0_VCC */ + STAT(Px, PHY1_VCC), /* 0x4d PHY1_VCC */ + STAT(Px, CONTROLLER_TDIODE_TEMP), /* 0x4e CONTROLLER_TDIODE_TEMP */ }; #define MCDI_STATIC_SENSOR_ASSERT(_field) \ From owner-svn-src-head@freebsd.org Tue Jan 12 15:21:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CD01A6DF87; Tue, 12 Jan 2016 15:21:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30A111847; Tue, 12 Jan 2016 15:21:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CFLqaI036019; Tue, 12 Jan 2016 15:21:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CFLqWQ036018; Tue, 12 Jan 2016 15:21:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121521.u0CFLqWQ036018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 15:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293763 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:21:53 -0000 Author: arybchik Date: Tue Jan 12 15:21:52 2016 New Revision: 293763 URL: https://svnweb.freebsd.org/changeset/base/293763 Log: sfxge: add definitions for compressed satellite images to common code headers Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4878 Modified: head/sys/dev/sfxge/common/siena_flash.h Modified: head/sys/dev/sfxge/common/siena_flash.h ============================================================================== --- head/sys/dev/sfxge/common/siena_flash.h Tue Jan 12 15:20:53 2016 (r293762) +++ head/sys/dev/sfxge/common/siena_flash.h Tue Jan 12 15:21:52 2016 (r293763) @@ -91,6 +91,19 @@ typedef struct blob_hdr_s { /* GENERAT #define BLOB_CPU_TYPE_RXDI_VTBL1 (14) #define BLOB_CPU_TYPE_TXDI_VTBL1 (15) #define BLOB_CPU_TYPE_DUMPSPEC (32) +#define BLOB_CPU_TYPE_MC_XIP (33) + +#define BLOB_CPU_TYPE_INVALID (31) + +/* + * The upper four bits of the CPU type field specify the compression + * algorithm used for this blob. + */ +#define BLOB_COMPRESSION_MASK (0xf0000000) +#define BLOB_CPU_TYPE_MASK (0x0fffffff) + +#define BLOB_COMPRESSION_NONE (0x00000000) /* Stored as is */ +#define BLOB_COMPRESSION_LZ (0x10000000) /* see lib/lzdecoder.c */ typedef struct siena_mc_boot_hdr_s { /* GENERATED BY scripts/genfwdef */ efx_dword_t magic; /* = SIENA_MC_BOOT_MAGIC */ From owner-svn-src-head@freebsd.org Tue Jan 12 15:24:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DEB3A6D08D; Tue, 12 Jan 2016 15:24:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 621181BB9; Tue, 12 Jan 2016 15:24:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CFOE5G036523; Tue, 12 Jan 2016 15:24:14 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CFOEwQ036519; Tue, 12 Jan 2016 15:24:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121524.u0CFOEwQ036519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 15:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293764 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:24:15 -0000 Author: arybchik Date: Tue Jan 12 15:24:13 2016 New Revision: 293764 URL: https://svnweb.freebsd.org/changeset/base/293764 Log: sfxge: rename hunt filter methods, types etc. to ef10 and use for Medford New filters types may be added, but the same machinery should be able to handle them. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4881 Modified: head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/hunt_filter.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_mac.c Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Tue Jan 12 15:21:52 2016 (r293763) +++ head/sys/dev/sfxge/common/efx_filter.c Tue Jan 12 15:24:13 2016 (r293764) @@ -97,17 +97,17 @@ static efx_filter_ops_t __efx_filter_sie }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON -static efx_filter_ops_t __efx_filter_hunt_ops = { - hunt_filter_init, /* efo_init */ - hunt_filter_fini, /* efo_fini */ - hunt_filter_restore, /* efo_restore */ - hunt_filter_add, /* efo_add */ - hunt_filter_delete, /* efo_delete */ - hunt_filter_supported_filters, /* efo_supported_filters */ - hunt_filter_reconfigure, /* efo_reconfigure */ +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +static efx_filter_ops_t __efx_filter_ef10_ops = { + ef10_filter_init, /* efo_init */ + ef10_filter_fini, /* efo_fini */ + ef10_filter_restore, /* efo_restore */ + ef10_filter_add, /* efo_add */ + ef10_filter_delete, /* efo_delete */ + ef10_filter_supported_filters, /* efo_supported_filters */ + ef10_filter_reconfigure, /* efo_reconfigure */ }; -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ __checkReturn efx_rc_t efx_filter_insert( @@ -189,10 +189,16 @@ efx_filter_init( #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - efop = (efx_filter_ops_t *)&__efx_filter_hunt_ops; + efop = (efx_filter_ops_t *)&__efx_filter_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + efop = (efx_filter_ops_t *)&__efx_filter_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ + default: EFSYS_ASSERT(0); rc = ENOTSUP; Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue Jan 12 15:21:52 2016 (r293763) +++ head/sys/dev/sfxge/common/efx_impl.h Tue Jan 12 15:24:13 2016 (r293764) @@ -436,9 +436,9 @@ typedef struct efx_filter_s { #if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA falconsiena_filter_t *ef_falconsiena_filter; #endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON - hunt_filter_table_t *ef_hunt_filter_table; -#endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD + ef10_filter_table_t *ef_ef10_filter_table; +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ } efx_filter_t; extern void Modified: head/sys/dev/sfxge/common/hunt_filter.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_filter.c Tue Jan 12 15:21:52 2016 (r293763) +++ head/sys/dev/sfxge/common/hunt_filter.c Tue Jan 12 15:24:13 2016 (r293764) @@ -41,90 +41,91 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_FILTER -#define HFE_SPEC(hftp, index) ((hftp)->hft_entry[(index)].hfe_spec) +#define EFE_SPEC(eftp, index) ((eftp)->eft_entry[(index)].efe_spec) static efx_filter_spec_t * -hunt_filter_entry_spec( - __in const hunt_filter_table_t *hftp, +ef10_filter_entry_spec( + __in const ef10_filter_table_t *eftp, __in unsigned int index) { - return ((efx_filter_spec_t *)(HFE_SPEC(hftp, index) & - ~(uintptr_t)EFX_HUNT_FILTER_FLAGS)); + return ((efx_filter_spec_t *)(EFE_SPEC(eftp, index) & + ~(uintptr_t)EFX_EF10_FILTER_FLAGS)); } static boolean_t -hunt_filter_entry_is_busy( - __in const hunt_filter_table_t *hftp, +ef10_filter_entry_is_busy( + __in const ef10_filter_table_t *eftp, __in unsigned int index) { - if (HFE_SPEC(hftp, index) & EFX_HUNT_FILTER_FLAG_BUSY) + if (EFE_SPEC(eftp, index) & EFX_EF10_FILTER_FLAG_BUSY) return (B_TRUE); else return (B_FALSE); } static boolean_t -hunt_filter_entry_is_auto_old( - __in const hunt_filter_table_t *hftp, +ef10_filter_entry_is_auto_old( + __in const ef10_filter_table_t *eftp, __in unsigned int index) { - if (HFE_SPEC(hftp, index) & EFX_HUNT_FILTER_FLAG_AUTO_OLD) + if (EFE_SPEC(eftp, index) & EFX_EF10_FILTER_FLAG_AUTO_OLD) return (B_TRUE); else return (B_FALSE); } static void -hunt_filter_set_entry( - __inout hunt_filter_table_t *hftp, +ef10_filter_set_entry( + __inout ef10_filter_table_t *eftp, __in unsigned int index, __in_opt const efx_filter_spec_t *efsp) { - HFE_SPEC(hftp, index) = (uintptr_t)efsp; + EFE_SPEC(eftp, index) = (uintptr_t)efsp; } static void -hunt_filter_set_entry_busy( - __inout hunt_filter_table_t *hftp, +ef10_filter_set_entry_busy( + __inout ef10_filter_table_t *eftp, __in unsigned int index) { - HFE_SPEC(hftp, index) |= (uintptr_t)EFX_HUNT_FILTER_FLAG_BUSY; + EFE_SPEC(eftp, index) |= (uintptr_t)EFX_EF10_FILTER_FLAG_BUSY; } static void -hunt_filter_set_entry_not_busy( - __inout hunt_filter_table_t *hftp, +ef10_filter_set_entry_not_busy( + __inout ef10_filter_table_t *eftp, __in unsigned int index) { - HFE_SPEC(hftp, index) &= ~(uintptr_t)EFX_HUNT_FILTER_FLAG_BUSY; + EFE_SPEC(eftp, index) &= ~(uintptr_t)EFX_EF10_FILTER_FLAG_BUSY; } static void -hunt_filter_set_entry_auto_old( - __inout hunt_filter_table_t *hftp, +ef10_filter_set_entry_auto_old( + __inout ef10_filter_table_t *eftp, __in unsigned int index) { - EFSYS_ASSERT(hunt_filter_entry_spec(hftp, index) != NULL); - HFE_SPEC(hftp, index) |= (uintptr_t)EFX_HUNT_FILTER_FLAG_AUTO_OLD; + EFSYS_ASSERT(ef10_filter_entry_spec(eftp, index) != NULL); + EFE_SPEC(eftp, index) |= (uintptr_t)EFX_EF10_FILTER_FLAG_AUTO_OLD; } static void -hunt_filter_set_entry_not_auto_old( - __inout hunt_filter_table_t *hftp, +ef10_filter_set_entry_not_auto_old( + __inout ef10_filter_table_t *eftp, __in unsigned int index) { - HFE_SPEC(hftp, index) &= ~(uintptr_t)EFX_HUNT_FILTER_FLAG_AUTO_OLD; - EFSYS_ASSERT(hunt_filter_entry_spec(hftp, index) != NULL); + EFE_SPEC(eftp, index) &= ~(uintptr_t)EFX_EF10_FILTER_FLAG_AUTO_OLD; + EFSYS_ASSERT(ef10_filter_entry_spec(eftp, index) != NULL); } __checkReturn efx_rc_t -hunt_filter_init( +ef10_filter_init( __in efx_nic_t *enp) { efx_rc_t rc; - hunt_filter_table_t *hftp; + ef10_filter_table_t *eftp; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); #define MATCH_MASK(match) (EFX_MASK32(match) << EFX_LOW_BIT(match)) EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_HOST == @@ -149,14 +150,14 @@ hunt_filter_init( MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO)); #undef MATCH_MASK - EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (hunt_filter_table_t), hftp); + EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (ef10_filter_table_t), eftp); - if (!hftp) { + if (!eftp) { rc = ENOMEM; goto fail1; } - enp->en_filter.ef_hunt_filter_table = hftp; + enp->en_filter.ef_ef10_filter_table = eftp; return (0); @@ -167,14 +168,15 @@ fail1: } void -hunt_filter_fini( +ef10_filter_fini( __in efx_nic_t *enp) { - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); - if (enp->en_filter.ef_hunt_filter_table != NULL) { - EFSYS_KMEM_FREE(enp->en_esip, sizeof (hunt_filter_table_t), - enp->en_filter.ef_hunt_filter_table); + if (enp->en_filter.ef_ef10_filter_table != NULL) { + EFSYS_KMEM_FREE(enp->en_esip, sizeof (ef10_filter_table_t), + enp->en_filter.ef_ef10_filter_table); } } @@ -183,7 +185,7 @@ efx_mcdi_filter_op_add( __in efx_nic_t *enp, __in efx_filter_spec_t *spec, __in unsigned int filter_op, - __inout hunt_filter_handle_t *handle) + __inout ef10_filter_handle_t *handle) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN, @@ -201,9 +203,9 @@ efx_mcdi_filter_op_add( switch (filter_op) { case MC_CMD_FILTER_OP_IN_OP_REPLACE: MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO, - handle->hfh_lo); + handle->efh_lo); MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI, - handle->hfh_hi); + handle->efh_hi); /* Fall through */ case MC_CMD_FILTER_OP_IN_OP_INSERT: case MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE: @@ -302,8 +304,8 @@ efx_mcdi_filter_op_add( goto fail3; } - handle->hfh_lo = MCDI_OUT_DWORD(req, FILTER_OP_OUT_HANDLE_LO); - handle->hfh_hi = MCDI_OUT_DWORD(req, FILTER_OP_OUT_HANDLE_HI); + handle->efh_lo = MCDI_OUT_DWORD(req, FILTER_OP_OUT_HANDLE_LO); + handle->efh_hi = MCDI_OUT_DWORD(req, FILTER_OP_OUT_HANDLE_HI); return (0); @@ -322,7 +324,7 @@ static __checkReturn efx_rc_t efx_mcdi_filter_op_delete( __in efx_nic_t *enp, __in unsigned int filter_op, - __inout hunt_filter_handle_t *handle) + __inout ef10_filter_handle_t *handle) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN, @@ -351,8 +353,8 @@ efx_mcdi_filter_op_delete( goto fail1; } - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO, handle->hfh_lo); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI, handle->hfh_hi); + MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO, handle->efh_lo); + MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI, handle->efh_hi); efx_mcdi_execute(enp, &req); @@ -380,7 +382,7 @@ fail1: } static __checkReturn boolean_t -hunt_filter_equal( +ef10_filter_equal( __in const efx_filter_spec_t *left, __in const efx_filter_spec_t *right) { @@ -413,7 +415,7 @@ hunt_filter_equal( } static __checkReturn boolean_t -hunt_filter_same_dest( +ef10_filter_same_dest( __in const efx_filter_spec_t *left, __in const efx_filter_spec_t *right) { @@ -430,7 +432,7 @@ hunt_filter_same_dest( } static __checkReturn uint32_t -hunt_filter_hash( +ef10_filter_hash( __in efx_filter_spec_t *spec) { EFX_STATIC_ASSERT((sizeof (efx_filter_spec_t) % sizeof (uint32_t)) @@ -456,7 +458,7 @@ hunt_filter_hash( * exclusive. */ static __checkReturn boolean_t -hunt_filter_is_exclusive( +ef10_filter_is_exclusive( __in efx_filter_spec_t *spec) { if ((spec->efs_match_flags & EFX_FILTER_MATCH_LOC_MAC) && @@ -478,30 +480,31 @@ hunt_filter_is_exclusive( } __checkReturn efx_rc_t -hunt_filter_restore( +ef10_filter_restore( __in efx_nic_t *enp) { int tbl_id; efx_filter_spec_t *spec; - hunt_filter_table_t *hftp = enp->en_filter.ef_hunt_filter_table; + ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; boolean_t restoring; int state; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); - for (tbl_id = 0; tbl_id < EFX_HUNT_FILTER_TBL_ROWS; tbl_id++) { + for (tbl_id = 0; tbl_id < EFX_EF10_FILTER_TBL_ROWS; tbl_id++) { EFSYS_LOCK(enp->en_eslp, state); - spec = hunt_filter_entry_spec(hftp, tbl_id); + spec = ef10_filter_entry_spec(eftp, tbl_id); if (spec == NULL) { restoring = B_FALSE; - } else if (hunt_filter_entry_is_busy(hftp, tbl_id)) { + } else if (ef10_filter_entry_is_busy(eftp, tbl_id)) { /* Ignore busy entries. */ restoring = B_FALSE; } else { - hunt_filter_set_entry_busy(hftp, tbl_id); + ef10_filter_set_entry_busy(eftp, tbl_id); restoring = B_TRUE; } @@ -510,14 +513,14 @@ hunt_filter_restore( if (restoring == B_FALSE) continue; - if (hunt_filter_is_exclusive(spec)) { + if (ef10_filter_is_exclusive(spec)) { rc = efx_mcdi_filter_op_add(enp, spec, MC_CMD_FILTER_OP_IN_OP_INSERT, - &hftp->hft_entry[tbl_id].hfe_handle); + &eftp->eft_entry[tbl_id].efe_handle); } else { rc = efx_mcdi_filter_op_add(enp, spec, MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE, - &hftp->hft_entry[tbl_id].hfe_handle); + &eftp->eft_entry[tbl_id].efe_handle); } if (rc != 0) @@ -525,7 +528,7 @@ hunt_filter_restore( EFSYS_LOCK(enp->en_eslp, state); - hunt_filter_set_entry_not_busy(hftp, tbl_id); + ef10_filter_set_entry_not_busy(eftp, tbl_id); EFSYS_UNLOCK(enp->en_eslp, state); } @@ -542,17 +545,17 @@ fail1: * An arbitrary search limit for the software hash table. As per the linux net * driver. */ -#define EFX_HUNT_FILTER_SEARCH_LIMIT 200 +#define EF10_FILTER_SEARCH_LIMIT 200 static __checkReturn efx_rc_t -hunt_filter_add_internal( +ef10_filter_add_internal( __in efx_nic_t *enp, __inout efx_filter_spec_t *spec, __in boolean_t may_replace, __out_opt uint32_t *filter_id) { efx_rc_t rc; - hunt_filter_table_t *hftp = enp->en_filter.ef_hunt_filter_table; + ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t *saved_spec; uint32_t hash; unsigned int depth; @@ -562,13 +565,14 @@ hunt_filter_add_internal( int state; boolean_t locked = B_FALSE; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); #if EFSYS_OPT_RX_SCALE spec->efs_rss_context = enp->en_rss_context; #endif - hash = hunt_filter_hash(spec); + hash = ef10_filter_hash(spec); /* * FIXME: Add support for inserting filters of different priorities @@ -587,21 +591,21 @@ hunt_filter_add_internal( locked = B_TRUE; for (;;) { - i = (hash + depth) & (EFX_HUNT_FILTER_TBL_ROWS - 1); - saved_spec = hunt_filter_entry_spec(hftp, i); + i = (hash + depth) & (EFX_EF10_FILTER_TBL_ROWS - 1); + saved_spec = ef10_filter_entry_spec(eftp, i); if (!saved_spec) { if (ins_index < 0) { ins_index = i; } - } else if (hunt_filter_equal(spec, saved_spec)) { - if (hunt_filter_entry_is_busy(hftp, i)) + } else if (ef10_filter_equal(spec, saved_spec)) { + if (ef10_filter_entry_is_busy(eftp, i)) break; if (saved_spec->efs_priority == EFX_FILTER_PRI_AUTO) { ins_index = i; goto found; - } else if (hunt_filter_is_exclusive(spec)) { + } else if (ef10_filter_is_exclusive(spec)) { if (may_replace) { ins_index = i; goto found; @@ -619,7 +623,7 @@ hunt_filter_add_internal( * the first suitable slot or return EBUSY if * there was none. */ - if (depth == EFX_HUNT_FILTER_SEARCH_LIMIT) { + if (depth == EF10_FILTER_SEARCH_LIMIT) { if (ins_index < 0) { rc = EBUSY; goto fail2; @@ -639,11 +643,11 @@ found: * insert a conflicting filter while we're waiting for the * firmware must find the busy entry. */ - saved_spec = hunt_filter_entry_spec(hftp, ins_index); + saved_spec = ef10_filter_entry_spec(eftp, ins_index); if (saved_spec) { if (saved_spec->efs_priority == EFX_FILTER_PRI_AUTO) { /* This is a filter we are refreshing */ - hunt_filter_set_entry_not_auto_old(hftp, ins_index); + ef10_filter_set_entry_not_auto_old(eftp, ins_index); goto out_unlock; } @@ -655,9 +659,9 @@ found: goto fail3; } *saved_spec = *spec; - hunt_filter_set_entry(hftp, ins_index, saved_spec); + ef10_filter_set_entry(eftp, ins_index, saved_spec); } - hunt_filter_set_entry_busy(hftp, ins_index); + ef10_filter_set_entry_busy(eftp, ins_index); EFSYS_UNLOCK(enp->en_eslp, state); locked = B_FALSE; @@ -669,15 +673,15 @@ found: if (replacing) { rc = efx_mcdi_filter_op_add(enp, spec, MC_CMD_FILTER_OP_IN_OP_REPLACE, - &hftp->hft_entry[ins_index].hfe_handle); - } else if (hunt_filter_is_exclusive(spec)) { + &eftp->eft_entry[ins_index].efe_handle); + } else if (ef10_filter_is_exclusive(spec)) { rc = efx_mcdi_filter_op_add(enp, spec, MC_CMD_FILTER_OP_IN_OP_INSERT, - &hftp->hft_entry[ins_index].hfe_handle); + &eftp->eft_entry[ins_index].efe_handle); } else { rc = efx_mcdi_filter_op_add(enp, spec, MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE, - &hftp->hft_entry[ins_index].hfe_handle); + &eftp->eft_entry[ins_index].efe_handle); } if (rc != 0) @@ -694,7 +698,7 @@ found: saved_spec->efs_dmaq_id = spec->efs_dmaq_id; } - hunt_filter_set_entry_not_busy(hftp, ins_index); + ef10_filter_set_entry_not_busy(eftp, ins_index); out_unlock: @@ -713,8 +717,8 @@ fail4: EFSYS_KMEM_FREE(enp->en_esip, sizeof (*spec), saved_spec); saved_spec = NULL; } - hunt_filter_set_entry_not_busy(hftp, ins_index); - hunt_filter_set_entry(hftp, ins_index, NULL); + ef10_filter_set_entry_not_busy(eftp, ins_index); + ef10_filter_set_entry(eftp, ins_index, NULL); fail3: EFSYS_PROBE(fail3); @@ -732,14 +736,14 @@ fail1: } __checkReturn efx_rc_t -hunt_filter_add( +ef10_filter_add( __in efx_nic_t *enp, __inout efx_filter_spec_t *spec, __in boolean_t may_replace) { efx_rc_t rc; - rc = hunt_filter_add_internal(enp, spec, may_replace, NULL); + rc = ef10_filter_add_internal(enp, spec, may_replace, NULL); if (rc != 0) goto fail1; @@ -753,15 +757,15 @@ fail1: static __checkReturn efx_rc_t -hunt_filter_delete_internal( +ef10_filter_delete_internal( __in efx_nic_t *enp, __in uint32_t filter_id) { efx_rc_t rc; - hunt_filter_table_t *table = enp->en_filter.ef_hunt_filter_table; + ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t *spec; int state; - uint32_t filter_idx = filter_id % EFX_HUNT_FILTER_TBL_ROWS; + uint32_t filter_idx = filter_id % EFX_EF10_FILTER_TBL_ROWS; /* * Find the software table entry and mark it busy. Don't @@ -771,13 +775,13 @@ hunt_filter_delete_internal( * FIXME: What if the busy flag is never cleared? */ EFSYS_LOCK(enp->en_eslp, state); - while (hunt_filter_entry_is_busy(table, filter_idx)) { + while (ef10_filter_entry_is_busy(table, filter_idx)) { EFSYS_UNLOCK(enp->en_eslp, state); EFSYS_SPIN(1); EFSYS_LOCK(enp->en_eslp, state); } - if ((spec = hunt_filter_entry_spec(table, filter_idx)) != NULL) { - hunt_filter_set_entry_busy(table, filter_idx); + if ((spec = ef10_filter_entry_spec(table, filter_idx)) != NULL) { + ef10_filter_set_entry_busy(table, filter_idx); } EFSYS_UNLOCK(enp->en_eslp, state); @@ -790,20 +794,20 @@ hunt_filter_delete_internal( * Try to remove the hardware filter. This may fail if the MC has * rebooted (which frees all hardware filter resources). */ - if (hunt_filter_is_exclusive(spec)) { + if (ef10_filter_is_exclusive(spec)) { rc = efx_mcdi_filter_op_delete(enp, MC_CMD_FILTER_OP_IN_OP_REMOVE, - &table->hft_entry[filter_idx].hfe_handle); + &table->eft_entry[filter_idx].efe_handle); } else { rc = efx_mcdi_filter_op_delete(enp, MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE, - &table->hft_entry[filter_idx].hfe_handle); + &table->eft_entry[filter_idx].efe_handle); } /* Free the software table entry */ EFSYS_LOCK(enp->en_eslp, state); - hunt_filter_set_entry_not_busy(table, filter_idx); - hunt_filter_set_entry(table, filter_idx, NULL); + ef10_filter_set_entry_not_busy(table, filter_idx); + ef10_filter_set_entry(table, filter_idx, NULL); EFSYS_UNLOCK(enp->en_eslp, state); EFSYS_KMEM_FREE(enp->en_esip, sizeof (*spec), spec); @@ -824,12 +828,12 @@ fail1: } __checkReturn efx_rc_t -hunt_filter_delete( +ef10_filter_delete( __in efx_nic_t *enp, __inout efx_filter_spec_t *spec) { efx_rc_t rc; - hunt_filter_table_t *table = enp->en_filter.ef_hunt_filter_table; + ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t *saved_spec; unsigned int hash; unsigned int depth; @@ -837,22 +841,23 @@ hunt_filter_delete( int state; boolean_t locked = B_FALSE; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); - hash = hunt_filter_hash(spec); + hash = ef10_filter_hash(spec); EFSYS_LOCK(enp->en_eslp, state); locked = B_TRUE; depth = 1; for (;;) { - i = (hash + depth) & (EFX_HUNT_FILTER_TBL_ROWS - 1); - saved_spec = hunt_filter_entry_spec(table, i); - if (saved_spec && hunt_filter_equal(spec, saved_spec) && - hunt_filter_same_dest(spec, saved_spec)) { + i = (hash + depth) & (EFX_EF10_FILTER_TBL_ROWS - 1); + saved_spec = ef10_filter_entry_spec(table, i); + if (saved_spec && ef10_filter_equal(spec, saved_spec) && + ef10_filter_same_dest(spec, saved_spec)) { break; } - if (depth == EFX_HUNT_FILTER_SEARCH_LIMIT) { + if (depth == EF10_FILTER_SEARCH_LIMIT) { rc = ENOENT; goto fail1; } @@ -862,7 +867,7 @@ hunt_filter_delete( EFSYS_UNLOCK(enp->en_eslp, state); locked = B_FALSE; - rc = hunt_filter_delete_internal(enp, i); + rc = ef10_filter_delete_internal(enp, i); if (rc != 0) goto fail2; @@ -961,7 +966,7 @@ fail1: } __checkReturn efx_rc_t -hunt_filter_supported_filters( +ef10_filter_supported_filters( __in efx_nic_t *enp, __out uint32_t *list, __out size_t *length) @@ -980,13 +985,13 @@ fail1: } static __checkReturn efx_rc_t -hunt_filter_unicast_refresh( +ef10_filter_unicast_refresh( __in efx_nic_t *enp, __in_ecount(6) uint8_t const *addr, __in boolean_t all_unicst, __in efx_filter_flag_t filter_flags) { - hunt_filter_table_t *hftp = enp->en_filter.ef_hunt_filter_table; + ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t spec; efx_rc_t rc; @@ -996,11 +1001,11 @@ hunt_filter_unicast_refresh( /* Insert the filter for the local station address */ efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, - hftp->hft_default_rxq); + eftp->eft_default_rxq); efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, addr); - rc = hunt_filter_add_internal(enp, &spec, B_TRUE, - &hftp->hft_unicst_filter_index); + rc = ef10_filter_add_internal(enp, &spec, B_TRUE, + &eftp->eft_unicst_filter_index); if (rc != 0) { /* * Fall back to an unknown filter. We may be able to subscribe @@ -1008,7 +1013,7 @@ hunt_filter_unicast_refresh( */ goto use_uc_def; } - hftp->hft_unicst_filter_set = B_TRUE; + eftp->eft_unicst_filter_set = B_TRUE; return (0); @@ -1016,32 +1021,32 @@ use_uc_def: /* Insert the unknown unicast filter */ efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, - hftp->hft_default_rxq); + eftp->eft_default_rxq); efx_filter_spec_set_uc_def(&spec); - rc = hunt_filter_add_internal(enp, &spec, B_TRUE, - &hftp->hft_unicst_filter_index); + rc = ef10_filter_add_internal(enp, &spec, B_TRUE, + &eftp->eft_unicst_filter_index); if (rc != 0) goto fail1; - hftp->hft_unicst_filter_set = B_TRUE; + eftp->eft_unicst_filter_set = B_TRUE; return (0); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); - if (hftp->hft_unicst_filter_set != B_FALSE) { - (void) hunt_filter_delete_internal(enp, - hftp->hft_unicst_filter_index); + if (eftp->eft_unicst_filter_set != B_FALSE) { + (void) ef10_filter_delete_internal(enp, + eftp->eft_unicst_filter_index); - hftp->hft_unicst_filter_set = B_FALSE; + eftp->eft_unicst_filter_set = B_FALSE; } return (rc); } static __checkReturn efx_rc_t -hunt_filter_multicast_refresh( +ef10_filter_multicast_refresh( __in efx_nic_t *enp, __in boolean_t mulcst, __in boolean_t all_mulcst, @@ -1050,7 +1055,7 @@ hunt_filter_multicast_refresh( __in int count, __in efx_filter_flag_t filter_flags) { - hunt_filter_table_t *hftp = enp->en_filter.ef_hunt_filter_table; + ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t spec; uint8_t addr[6]; unsigned i; @@ -1063,25 +1068,25 @@ hunt_filter_multicast_refresh( count = 0; if (count + (brdcst ? 1 : 0) > - EFX_ARRAY_SIZE(hftp->hft_mulcst_filter_indexes)) { + EFX_ARRAY_SIZE(eftp->eft_mulcst_filter_indexes)) { /* Too many MAC addresses; use unknown multicast filter */ goto use_mc_def; } /* Insert/renew multicast address list filters */ - hftp->hft_mulcst_filter_count = count; - for (i = 0; i < hftp->hft_mulcst_filter_count; i++) { + eftp->eft_mulcst_filter_count = count; + for (i = 0; i < eftp->eft_mulcst_filter_count; i++) { efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, - hftp->hft_default_rxq); + eftp->eft_default_rxq); efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, &addrs[i * EFX_MAC_ADDR_LEN]); - rc = hunt_filter_add_internal(enp, &spec, B_TRUE, - &hftp->hft_mulcst_filter_indexes[i]); + rc = ef10_filter_add_internal(enp, &spec, B_TRUE, + &eftp->eft_mulcst_filter_indexes[i]); if (rc != 0) { /* Rollback, then use unknown multicast filter */ goto rollback; @@ -1090,18 +1095,18 @@ hunt_filter_multicast_refresh( if (brdcst == B_TRUE) { /* Insert/renew broadcast address filter */ - hftp->hft_mulcst_filter_count++; + eftp->eft_mulcst_filter_count++; efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, - hftp->hft_default_rxq); + eftp->eft_default_rxq); EFX_MAC_BROADCAST_ADDR_SET(addr); efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, addr); - rc = hunt_filter_add_internal(enp, &spec, B_TRUE, - &hftp->hft_mulcst_filter_indexes[ - hftp->hft_mulcst_filter_count - 1]); + rc = ef10_filter_add_internal(enp, &spec, B_TRUE, + &eftp->eft_mulcst_filter_indexes[ + eftp->eft_mulcst_filter_count - 1]); if (rc != 0) { /* Rollback, then use unknown multicast filter */ goto rollback; @@ -1116,24 +1121,24 @@ rollback: * before inserting the unknown multicast filter. */ while (i--) { - (void) hunt_filter_delete_internal(enp, - hftp->hft_mulcst_filter_indexes[i]); + (void) ef10_filter_delete_internal(enp, + eftp->eft_mulcst_filter_indexes[i]); } - hftp->hft_mulcst_filter_count = 0; + eftp->eft_mulcst_filter_count = 0; use_mc_def: /* Insert the unknown multicast filter */ efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, - hftp->hft_default_rxq); + eftp->eft_default_rxq); efx_filter_spec_set_mc_def(&spec); - rc = hunt_filter_add_internal(enp, &spec, B_TRUE, - &hftp->hft_mulcst_filter_indexes[0]); + rc = ef10_filter_add_internal(enp, &spec, B_TRUE, + &eftp->eft_mulcst_filter_indexes[0]); if (rc != 0) goto fail1; - hftp->hft_mulcst_filter_count = 1; + eftp->eft_mulcst_filter_count = 1; /* * FIXME: If brdcst == B_FALSE, add a filter to drop broadcast traffic. @@ -1192,7 +1197,7 @@ fail1: * still applied in this case). */ __checkReturn efx_rc_t -hunt_filter_reconfigure( +ef10_filter_reconfigure( __in efx_nic_t *enp, __in_ecount(6) uint8_t const *mac_addr, __in boolean_t all_unicst, @@ -1202,58 +1207,58 @@ hunt_filter_reconfigure( __in_ecount(6*count) uint8_t const *addrs, __in int count) { - hunt_filter_table_t *table = enp->en_filter.ef_hunt_filter_table; + ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; efx_filter_flag_t filter_flags; unsigned i; int all_unicst_rc; int all_mulcst_rc; efx_rc_t rc; - if (table->hft_default_rxq == NULL) { + if (table->eft_default_rxq == NULL) { /* * Filters direct traffic to the default RXQ, and so cannot be * inserted until it is available. Any currently configured * filters must be removed (ignore errors in case the MC * has rebooted, which removes hardware filters). */ - if (table->hft_unicst_filter_set != B_FALSE) { - (void) hunt_filter_delete_internal(enp, - table->hft_unicst_filter_index); - table->hft_unicst_filter_set = B_FALSE; + if (table->eft_unicst_filter_set != B_FALSE) { + (void) ef10_filter_delete_internal(enp, + table->eft_unicst_filter_index); + table->eft_unicst_filter_set = B_FALSE; } - for (i = 0; i < table->hft_mulcst_filter_count; i++) { - (void) hunt_filter_delete_internal(enp, - table->hft_mulcst_filter_indexes[i]); + for (i = 0; i < table->eft_mulcst_filter_count; i++) { + (void) ef10_filter_delete_internal(enp, + table->eft_mulcst_filter_indexes[i]); } - table->hft_mulcst_filter_count = 0; + table->eft_mulcst_filter_count = 0; return (0); } - if (table->hft_using_rss) + if (table->eft_using_rss) filter_flags = EFX_FILTER_FLAG_RX_RSS; else filter_flags = 0; /* Mark old filters which may need to be removed */ - if (table->hft_unicst_filter_set != B_FALSE) { - hunt_filter_set_entry_auto_old(table, - table->hft_unicst_filter_index); - } - for (i = 0; i < table->hft_mulcst_filter_count; i++) { - hunt_filter_set_entry_auto_old(table, - table->hft_mulcst_filter_indexes[i]); + if (table->eft_unicst_filter_set != B_FALSE) { + ef10_filter_set_entry_auto_old(table, + table->eft_unicst_filter_index); + } + for (i = 0; i < table->eft_mulcst_filter_count; i++) { + ef10_filter_set_entry_auto_old(table, + table->eft_mulcst_filter_indexes[i]); } /* Insert or renew unicast filters */ - if ((all_unicst_rc = hunt_filter_unicast_refresh(enp, mac_addr, + if ((all_unicst_rc = ef10_filter_unicast_refresh(enp, mac_addr, all_unicst, filter_flags)) != 0) { if (all_unicst == B_FALSE) { rc = all_unicst_rc; goto fail1; } /* Retry without all_unicast flag */ - rc = hunt_filter_unicast_refresh(enp, mac_addr, + rc = ef10_filter_unicast_refresh(enp, mac_addr, B_FALSE, filter_flags); if (rc != 0) goto fail2; @@ -1272,12 +1277,14 @@ hunt_filter_reconfigure( * filters. This ensures that encp->enc_workaround_bug26807 matches the * firmware state, and that later changes to enable/disable the * workaround will result in this function seeing a reset (FLR). + * + * FIXME: On Medford mulicast chaining should always be on. */ if ((rc = hunt_filter_get_workarounds(enp)) != 0) goto fail3; /* Insert or renew multicast filters */ - if ((all_mulcst_rc = hunt_filter_multicast_refresh(enp, mulcst, + if ((all_mulcst_rc = ef10_filter_multicast_refresh(enp, mulcst, all_mulcst, brdcst, addrs, count, filter_flags)) != 0) { if (all_mulcst == B_FALSE) { @@ -1285,7 +1292,7 @@ hunt_filter_reconfigure( goto fail4; } /* Retry without all_mulcast flag */ - rc = hunt_filter_multicast_refresh(enp, mulcst, + rc = ef10_filter_multicast_refresh(enp, mulcst, B_FALSE, brdcst, addrs, count, filter_flags); if (rc != 0) @@ -1293,9 +1300,9 @@ hunt_filter_reconfigure( } /* Remove old filters which were not renewed */ - for (i = 0; i < EFX_ARRAY_SIZE(table->hft_entry); i++) { - if (hunt_filter_entry_is_auto_old(table, i)) { - (void) hunt_filter_delete_internal(enp, i); + for (i = 0; i < EFX_ARRAY_SIZE(table->eft_entry); i++) { + if (ef10_filter_entry_is_auto_old(table, i)) { + (void) ef10_filter_delete_internal(enp, i); } } @@ -1319,9 +1326,9 @@ fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); /* Clear auto old flags */ - for (i = 0; i < EFX_ARRAY_SIZE(table->hft_entry); i++) { - if (hunt_filter_entry_is_auto_old(table, i)) { - hunt_filter_set_entry_not_auto_old(table, i); + for (i = 0; i < EFX_ARRAY_SIZE(table->eft_entry); i++) { + if (ef10_filter_entry_is_auto_old(table, i)) { + ef10_filter_set_entry_not_auto_old(table, i); } } @@ -1329,45 +1336,45 @@ fail1: } void -hunt_filter_get_default_rxq( +ef10_filter_get_default_rxq( __in efx_nic_t *enp, __out efx_rxq_t **erpp, __out boolean_t *using_rss) { - hunt_filter_table_t *table = enp->en_filter.ef_hunt_filter_table; + ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; - *erpp = table->hft_default_rxq; - *using_rss = table->hft_using_rss; + *erpp = table->eft_default_rxq; + *using_rss = table->eft_using_rss; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 12 15:25:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC313A6D124; Tue, 12 Jan 2016 15:25:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A744E1D34; Tue, 12 Jan 2016 15:25:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CFP3N5036696; Tue, 12 Jan 2016 15:25:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CFP3ii036691; Tue, 12 Jan 2016 15:25:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121525.u0CFP3ii036691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 15:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293765 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:25:05 -0000 Author: arybchik Date: Tue Jan 12 15:25:03 2016 New Revision: 293765 URL: https://svnweb.freebsd.org/changeset/base/293765 Log: sfxge: rework MCDI header version handling Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4882 Modified: head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/hunt_mcdi.c head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue Jan 12 15:24:13 2016 (r293764) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue Jan 12 15:25:03 2016 (r293765) @@ -643,7 +643,6 @@ efx_mcdi_ev_cpl( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; - efx_nic_cfg_t *encp = &enp->en_nic_cfg; efx_mcdi_req_t *emrp; int state; @@ -668,7 +667,7 @@ efx_mcdi_ev_cpl( emip->emi_pending_req = NULL; EFSYS_UNLOCK(enp->en_eslp, state); - if (encp->enc_mcdi_max_payload_length > MCDI_CTL_SDU_LEN_MAX_V1) { + if (emip->emi_max_version >= 2) { /* MCDIv2 response details do not fit into an event. */ efx_mcdi_read_response_header(enp, emrp); } else { Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Tue Jan 12 15:24:13 2016 (r293764) +++ head/sys/dev/sfxge/common/efx_mcdi.h Tue Jan 12 15:25:03 2016 (r293765) @@ -69,6 +69,7 @@ struct efx_mcdi_req_s { typedef struct efx_mcdi_iface_s { unsigned int emi_port; + unsigned int emi_max_version; unsigned int emi_seq; efx_mcdi_req_t *emi_pending_req; boolean_t emi_ev_cpl; Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Tue Jan 12 15:24:13 2016 (r293764) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Tue Jan 12 15:25:03 2016 (r293765) @@ -81,6 +81,7 @@ ef10_mcdi_init( __in efx_nic_t *enp, __in const efx_mcdi_transport_t *emtp) { + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efsys_mem_t *esmp = emtp->emt_dma_mem; efx_dword_t dword; efx_rc_t rc; @@ -89,6 +90,13 @@ ef10_mcdi_init( enp->en_family == EFX_FAMILY_MEDFORD); EFSYS_ASSERT(enp->en_features & EFX_FEATURE_MCDI_DMA); + /* + * All EF10 firmware supports MCDIv2 and MCDIv1. + * Medford BootROM supports MCDIv2 and MCDIv1. + * Huntington BootROM supports MCDIv1 only. + */ + emip->emi_max_version = 2; + /* A host DMA buffer is required for EF10 MCDI */ if (esmp == NULL) { rc = EINVAL; Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Tue Jan 12 15:24:13 2016 (r293764) +++ head/sys/dev/sfxge/common/siena_mcdi.c Tue Jan 12 15:25:03 2016 (r293765) @@ -244,6 +244,9 @@ siena_mcdi_init( goto fail1; } + /* Siena BootROM and firmware only support MCDIv1 */ + emip->emi_max_version = 1; + /* * Wipe the atomic reboot status so subsequent MCDI requests succeed. * BOOT_STATUS is preserved so eno_nic_probe() can boot out of the From owner-svn-src-head@freebsd.org Tue Jan 12 15:26:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B849A6D1E0; Tue, 12 Jan 2016 15:26:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F5CA1EBC; Tue, 12 Jan 2016 15:26:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CFQIOf036917; Tue, 12 Jan 2016 15:26:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CFQIx6036915; Tue, 12 Jan 2016 15:26:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121526.u0CFQIx6036915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 15:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293766 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:26:19 -0000 Author: arybchik Date: Tue Jan 12 15:26:17 2016 New Revision: 293766 URL: https://svnweb.freebsd.org/changeset/base/293766 Log: sfxge: remove obsolete efx_mac_hash_set() from common code This API has been replaced by efx_mac_multicast_list_set() and has no callers. Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4883 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mac.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Jan 12 15:25:03 2016 (r293765) +++ head/sys/dev/sfxge/common/efx.h Tue Jan 12 15:26:17 2016 (r293766) @@ -505,13 +505,6 @@ efx_mac_fcntl_get( __out unsigned int *fcntl_wantedp, __out unsigned int *fcntl_linkp); -#define EFX_MAC_HASH_BITS (1 << 8) - -extern __checkReturn efx_rc_t -efx_mac_hash_set( - __in efx_nic_t *enp, - __in_ecount(EFX_MAC_HASH_BITS) unsigned int const *bucket); - #if EFSYS_OPT_MAC_STATS Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Tue Jan 12 15:25:03 2016 (r293765) +++ head/sys/dev/sfxge/common/efx_mac.c Tue Jan 12 15:26:17 2016 (r293766) @@ -462,55 +462,6 @@ efx_mac_fcntl_get( *fcntl_wantedp = wanted; } -/* - * FIXME: efx_mac_hash_set() should be deleted once all its callers have been - * updated to use efx_mac_multicast_list_set(). - * Then efx_port_t.ep_multicst_hash could be made Falcon/Siena specific as - * well. - */ - __checkReturn efx_rc_t -efx_mac_hash_set( - __in efx_nic_t *enp, - __in_ecount(EFX_MAC_HASH_BITS) unsigned int const *bucket) -{ - efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; - efx_oword_t old_hash[2]; - unsigned int index; - efx_rc_t rc; - - EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); - EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); - - memcpy(old_hash, epp->ep_multicst_hash, sizeof (old_hash)); - - /* Set the lower 128 bits of the hash */ - EFX_ZERO_OWORD(epp->ep_multicst_hash[0]); - for (index = 0; index < 128; index++) { - if (bucket[index] != 0) - EFX_SET_OWORD_BIT(epp->ep_multicst_hash[0], index); - } - - /* Set the upper 128 bits of the hash */ - EFX_ZERO_OWORD(epp->ep_multicst_hash[1]); - for (index = 0; index < 128; index++) { - if (bucket[index + 128] != 0) - EFX_SET_OWORD_BIT(epp->ep_multicst_hash[1], index); - } - - if ((rc = emop->emo_reconfigure(enp)) != 0) - goto fail1; - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - memcpy(epp->ep_multicst_hash, old_hash, sizeof (old_hash)); - - return (rc); -} - __checkReturn efx_rc_t efx_mac_multicast_list_set( __in efx_nic_t *enp, @@ -912,6 +863,8 @@ fail1: #if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#define EFX_MAC_HASH_BITS (1 << 8) + /* Compute the multicast hash as used on Falcon and Siena. */ static void falconsiena_mac_multicast_hash_compute( From owner-svn-src-head@freebsd.org Tue Jan 12 15:27:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DB0EA6D23D; Tue, 12 Jan 2016 15:27:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1B0E1080; Tue, 12 Jan 2016 15:27:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CFRB8k037097; Tue, 12 Jan 2016 15:27:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CFRBav037096; Tue, 12 Jan 2016 15:27:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121527.u0CFRBav037096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 15:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293767 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:27:13 -0000 Author: arybchik Date: Tue Jan 12 15:27:11 2016 New Revision: 293767 URL: https://svnweb.freebsd.org/changeset/base/293767 Log: sfxge: cleanup: improve consistency in efx_check.h Make error messages consistent, and remove redundant checks. Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4884 Modified: head/sys/dev/sfxge/common/efx_check.h Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue Jan 12 15:26:17 2016 (r293766) +++ head/sys/dev/sfxge/common/efx_check.h Tue Jan 12 15:27:11 2016 (r293767) @@ -61,9 +61,6 @@ /* Decode fatal errors */ #if EFSYS_OPT_DECODE_INTR_FATAL # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA) -# if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "INTR_FATAL not supported on HUNTINGTON or MEDFORD" -# endif # error "INTR_FATAL requires FALCON or SIENA" # endif #endif /* EFSYS_OPT_DECODE_INTR_FATAL */ @@ -138,9 +135,6 @@ /* Support management controller messages */ #if EFSYS_OPT_MCDI # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# if EFSYS_OPT_FALCON -# error "MCDI not supported on FALCON" -# endif # error "MCDI requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_MCDI */ @@ -186,14 +180,14 @@ # endif #endif /* EFSYS_OPT_MON_NULL */ -/* Support Siena monitor */ +/* Obsolete option */ #ifdef EFSYS_OPT_MON_SIENA -# error "MON_SIENA is obsolete use MON_MCDI" +# error "MON_SIENA is obsolete (replaced by MON_MCDI)." #endif /* EFSYS_OPT_MON_SIENA*/ -/* Support Huntington monitor */ +/* Obsolete option */ #ifdef EFSYS_OPT_MON_HUNTINGTON -# error "MON_HUNTINGTON is obsolete use MON_MCDI" +# error "MON_HUNTINGTON is obsolete (replaced by MON_MCDI)." #endif /* EFSYS_OPT_MON_HUNTINGTON*/ /* Support monitor statistics (voltage/temperature) */ @@ -265,9 +259,9 @@ # endif #endif /* EFSYS_OPT_PCIE_TUNE */ -/* Support PHY BIST diagnostics */ +/* Obsolete option */ #if EFSYS_OPT_PHY_BIST -# error "PHY_BIST is obsolete. It has been replaced by the BIST option." +# error "PHY_BIST is obsolete (replaced by BIST)." #endif /* EFSYS_OPT_PHY_BIST */ /* Support PHY flags */ @@ -379,7 +373,7 @@ /* Obsolete option */ #ifdef EFSYS_OPT_STAT_NAME -# error "EFSYS_OPT_STAT_NAME is obsolete (replaced by EFSYS_OPT_NAMES)." +# error "STAT_NAME is obsolete (replaced by NAMES)." #endif /* Support PCI Vital Product Data (VPD) */ @@ -399,7 +393,7 @@ /* Obsolete option */ #ifdef EFSYS_OPT_MCAST_FILTER_LIST -# error "MCAST_FILTER_LIST is obsolete and not supported" +# error "MCAST_FILTER_LIST is obsolete and is not supported" #endif /* EFSYS_OPT_MCAST_FILTER_LIST */ /* Support BIST */ From owner-svn-src-head@freebsd.org Tue Jan 12 15:28:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A58F9A6D2BA; Tue, 12 Jan 2016 15:28:00 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 9B487124B; Tue, 12 Jan 2016 15:28:00 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 994911DDC; Tue, 12 Jan 2016 15:28:00 +0000 (UTC) Date: Tue, 12 Jan 2016 15:28:00 +0000 From: Alexey Dokuchaev To: Ian Lepore Cc: Joel Dahl , Sepherosa Ziehau , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r293720 - head/sys/dev/hyperv/netvsc Message-ID: <20160112152800.GA94850@FreeBSD.org> References: <201601120141.u0C1fYbC080237@repo.freebsd.org> <20160112075525.GA38087@ymer.vnode.se> <1452609005.46848.11.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1452609005.46848.11.camel@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:28:00 -0000 On Tue, Jan 12, 2016 at 07:30:05AM -0700, Ian Lepore wrote: > On Tue, 2016-01-12 at 08:55 +0100, Joel Dahl wrote: > > On Tue, Jan 12, 2016 at 01:41:34AM +0000, Sepherosa Ziehau wrote: > > > Author: sephe > > > Date: Tue Jan 12 01:41:34 2016 > > > New Revision: 293720 > > > URL: https://svnweb.freebsd.org/changeset/base/293720 > > > > > > [...] > > > Modified by: me (minor) > > > > % finger me@freebsd.org > > [freebsd.org] > > Trying 8.8.178.110... > > Login: me Name: Michael Elbel > > Really? You're complaining about the committer using the personal > pronoun that refers to one's self in a context of referring to himself? I understand you; with certain entries like `me' or `myself' it does look silly indeed, however... > Do we really, as a project, have nothing better to do than this endless > nitpicking at the metadata in commit messages? ... many of us neglect to give enough thinking and thus often give bogus attribution in the logs; while complaining over personal pronouns is off the line, the problem still stands, and I'm glad that people are paying attention to these things. Please don't be hard on Joel. Generally, "Submitted by: foo (modified)" should be enough metadata to reflect the fact that submitted changes were not applied verbatim; which in turn is appropriate amendment for more of less substantial changes, trivial modifications do not warrant it. ./danfe From owner-svn-src-head@freebsd.org Tue Jan 12 15:28:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C23E0A6D2FD; Tue, 12 Jan 2016 15:28:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D5CB13A1; Tue, 12 Jan 2016 15:28:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CFSAXJ037283; Tue, 12 Jan 2016 15:28:10 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CFSAYo037282; Tue, 12 Jan 2016 15:28:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121528.u0CFSAYo037282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 15:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293768 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:28:12 -0000 Author: arybchik Date: Tue Jan 12 15:28:10 2016 New Revision: 293768 URL: https://svnweb.freebsd.org/changeset/base/293768 Log: sfxge: update NVRAM partition lookup for Medford Prior to Medford, option ROM config was stored with one partition per network port. Medford stores option ROM config in a single partition (as an array of configurations, one per PF). Update the EFXname /port to MCDI partition mapping for this. Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4885 Modified: head/sys/dev/sfxge/common/hunt_nvram.c Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Tue Jan 12 15:27:11 2016 (r293767) +++ head/sys/dev/sfxge/common/hunt_nvram.c Tue Jan 12 15:28:10 2016 (r293768) @@ -1509,8 +1509,6 @@ fail1: #if EFSYS_OPT_NVRAM -/* FIXME: Update partition table for Medford */ - typedef struct ef10_parttbl_entry_s { unsigned int partn; unsigned int port; @@ -1518,7 +1516,7 @@ typedef struct ef10_parttbl_entry_s { } ef10_parttbl_entry_t; /* Translate EFX NVRAM types to firmware partition types */ -static ef10_parttbl_entry_t ef10_parttbl[] = { +static ef10_parttbl_entry_t hunt_parttbl[] = { {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 1, EFX_NVRAM_MC_FIRMWARE}, {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 2, EFX_NVRAM_MC_FIRMWARE}, {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 3, EFX_NVRAM_MC_FIRMWARE}, @@ -1549,6 +1547,37 @@ static ef10_parttbl_entry_t ef10_parttbl {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP} }; +static ef10_parttbl_entry_t medford_parttbl[] = { + {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 1, EFX_NVRAM_MC_FIRMWARE}, + {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 2, EFX_NVRAM_MC_FIRMWARE}, + {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 3, EFX_NVRAM_MC_FIRMWARE}, + {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 4, EFX_NVRAM_MC_FIRMWARE}, + {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 1, EFX_NVRAM_MC_GOLDEN}, + {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 2, EFX_NVRAM_MC_GOLDEN}, + {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 3, EFX_NVRAM_MC_GOLDEN}, + {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 4, EFX_NVRAM_MC_GOLDEN}, + {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 1, EFX_NVRAM_BOOTROM}, + {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 2, EFX_NVRAM_BOOTROM}, + {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 3, EFX_NVRAM_BOOTROM}, + {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 4, EFX_NVRAM_BOOTROM}, + {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 1, EFX_NVRAM_BOOTROM_CFG}, + {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 2, EFX_NVRAM_BOOTROM_CFG}, + {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 3, EFX_NVRAM_BOOTROM_CFG}, + {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 4, EFX_NVRAM_BOOTROM_CFG}, + {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 1, EFX_NVRAM_DYNAMIC_CFG}, + {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 2, EFX_NVRAM_DYNAMIC_CFG}, + {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 3, EFX_NVRAM_DYNAMIC_CFG}, + {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 4, EFX_NVRAM_DYNAMIC_CFG}, + {NVRAM_PARTITION_TYPE_FPGA, 1, EFX_NVRAM_FPGA}, + {NVRAM_PARTITION_TYPE_FPGA, 2, EFX_NVRAM_FPGA}, + {NVRAM_PARTITION_TYPE_FPGA, 3, EFX_NVRAM_FPGA}, + {NVRAM_PARTITION_TYPE_FPGA, 4, EFX_NVRAM_FPGA}, + {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 1, EFX_NVRAM_FPGA_BACKUP}, + {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 2, EFX_NVRAM_FPGA_BACKUP}, + {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 3, EFX_NVRAM_FPGA_BACKUP}, + {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP} +}; + static __checkReturn ef10_parttbl_entry_t * ef10_parttbl_entry( __in efx_nic_t *enp, @@ -1556,17 +1585,39 @@ ef10_parttbl_entry( { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); ef10_parttbl_entry_t *entry; - int i; + ef10_parttbl_entry_t *parttbl; + size_t parttbl_size = 0; + unsigned int i; EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - for (i = 0; i < EFX_ARRAY_SIZE(ef10_parttbl); i++) { - entry = &ef10_parttbl[i]; - - if (entry->port == emip->emi_port && entry->nvtype == type) - return (entry); + switch (enp->en_family) { + case EFX_FAMILY_HUNTINGTON: + parttbl = hunt_parttbl; + parttbl_size = EFX_ARRAY_SIZE(hunt_parttbl); + break; + + case EFX_FAMILY_MEDFORD: + parttbl = medford_parttbl; + parttbl_size = EFX_ARRAY_SIZE(medford_parttbl); + break; + + default: + EFSYS_ASSERT(B_FALSE); + goto not_found; + } + + if (parttbl != NULL) { + for (i = 0; i < parttbl_size; i++) { + entry = &parttbl[i]; + + if (entry->port == emip->emi_port && + entry->nvtype == type) { + return (entry); + } + } } - +not_found: return (NULL); } @@ -1579,10 +1630,12 @@ ef10_nvram_test( { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); ef10_parttbl_entry_t *entry; + ef10_parttbl_entry_t *parttbl; + size_t parttbl_size = 0; unsigned int npartns = 0; uint32_t *partns = NULL; size_t size; - int i; + unsigned int i; unsigned int j; efx_rc_t rc; @@ -1603,8 +1656,24 @@ ef10_nvram_test( * Iterate over the list of supported partition types * applicable to *this* port */ - for (i = 0; i < EFX_ARRAY_SIZE(ef10_parttbl); i++) { - entry = &ef10_parttbl[i]; + switch (enp->en_family) { + case EFX_FAMILY_HUNTINGTON: + parttbl = hunt_parttbl; + parttbl_size = EFX_ARRAY_SIZE(hunt_parttbl); + break; + + case EFX_FAMILY_MEDFORD: + parttbl = medford_parttbl; + parttbl_size = EFX_ARRAY_SIZE(medford_parttbl); + break; + + default: + EFSYS_ASSERT(B_FALSE); + goto fail3; + } + + for (i = 0; i < parttbl_size; i++) { + entry = &parttbl[i]; if (entry->port != emip->emi_port) continue; @@ -1613,7 +1682,7 @@ ef10_nvram_test( if (entry->partn == partns[j]) { rc = efx_mcdi_nvram_test(enp, entry->partn); if (rc != 0) - goto fail3; + goto fail4; } } } @@ -1621,6 +1690,8 @@ ef10_nvram_test( EFSYS_KMEM_FREE(enp->en_esip, size, partns); return (0); +fail4: + EFSYS_PROBE(fail3); fail3: EFSYS_PROBE(fail3); fail2: From owner-svn-src-head@freebsd.org Tue Jan 12 15:29:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AD38A6D3D3; Tue, 12 Jan 2016 15:29:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0431C176A; Tue, 12 Jan 2016 15:29:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CFSxPT037549; Tue, 12 Jan 2016 15:28:59 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CFSx8G037544; Tue, 12 Jan 2016 15:28:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121528.u0CFSx8G037544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 15:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293769 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:29:01 -0000 Author: arybchik Date: Tue Jan 12 15:28:59 2016 New Revision: 293769 URL: https://svnweb.freebsd.org/changeset/base/293769 Log: sfxge: fix interrupt handling for Medford Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4886 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_intr.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_intr.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue Jan 12 15:28:10 2016 (r293768) +++ head/sys/dev/sfxge/common/efx_impl.h Tue Jan 12 15:28:59 2016 (r293769) @@ -342,6 +342,10 @@ typedef struct efx_intr_ops_s { void (*eio_disable)(efx_nic_t *); void (*eio_disable_unlocked)(efx_nic_t *); efx_rc_t (*eio_trigger)(efx_nic_t *, unsigned int); + void (*eio_status_line)(efx_nic_t *, boolean_t *, uint32_t *); + void (*eio_status_message)(efx_nic_t *, unsigned int, + boolean_t *); + void (*eio_fatal)(efx_nic_t *); void (*eio_fini)(efx_nic_t *); } efx_intr_ops_t; Modified: head/sys/dev/sfxge/common/efx_intr.c ============================================================================== --- head/sys/dev/sfxge/common/efx_intr.c Tue Jan 12 15:28:10 2016 (r293768) +++ head/sys/dev/sfxge/common/efx_intr.c Tue Jan 12 15:28:59 2016 (r293769) @@ -67,15 +67,27 @@ static void falconsiena_intr_fini( __in efx_nic_t *enp); +static void +falconsiena_intr_status_line( + __in efx_nic_t *enp, + __out boolean_t *fatalp, + __out uint32_t *qmaskp); -static __checkReturn boolean_t -falconsiena_intr_check_fatal( - __in efx_nic_t *enp); +static void +falconsiena_intr_status_message( + __in efx_nic_t *enp, + __in unsigned int message, + __out boolean_t *fatalp); static void falconsiena_intr_fatal( __in efx_nic_t *enp); +static __checkReturn boolean_t +falconsiena_intr_check_fatal( + __in efx_nic_t *enp); + + #endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ @@ -86,6 +98,9 @@ static efx_intr_ops_t __efx_intr_falcon_ falconsiena_intr_disable, /* eio_disable */ falconsiena_intr_disable_unlocked, /* eio_disable_unlocked */ falconsiena_intr_trigger, /* eio_trigger */ + falconsiena_intr_status_line, /* eio_status_line */ + falconsiena_intr_status_message, /* eio_status_message */ + falconsiena_intr_fatal, /* eio_fatal */ falconsiena_intr_fini, /* eio_fini */ }; #endif /* EFSYS_OPT_FALCON */ @@ -97,6 +112,9 @@ static efx_intr_ops_t __efx_intr_siena_o falconsiena_intr_disable, /* eio_disable */ falconsiena_intr_disable_unlocked, /* eio_disable_unlocked */ falconsiena_intr_trigger, /* eio_trigger */ + falconsiena_intr_status_line, /* eio_status_line */ + falconsiena_intr_status_message, /* eio_status_message */ + falconsiena_intr_fatal, /* eio_fatal */ falconsiena_intr_fini, /* eio_fini */ }; #endif /* EFSYS_OPT_SIENA */ @@ -108,6 +126,9 @@ static efx_intr_ops_t __efx_intr_ef10_op ef10_intr_disable, /* eio_disable */ ef10_intr_disable_unlocked, /* eio_disable_unlocked */ ef10_intr_trigger, /* eio_trigger */ + ef10_intr_status_line, /* eio_status_line */ + ef10_intr_status_message, /* eio_status_message */ + ef10_intr_fatal, /* eio_fatal */ ef10_intr_fini, /* eio_fini */ }; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ @@ -261,35 +282,12 @@ efx_intr_status_line( __out uint32_t *qmaskp) { efx_intr_t *eip = &(enp->en_intr); - efx_dword_t dword; + efx_intr_ops_t *eiop = eip->ei_eiop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); - /* Ensure Huntington and Falcon/Siena ISR at same location */ - EFX_STATIC_ASSERT(FR_BZ_INT_ISR0_REG_OFST == - ER_DZ_BIU_INT_ISR_REG_OFST); - - /* - * Read the queue mask and implicitly acknowledge the - * interrupt. - */ - EFX_BAR_READD(enp, FR_BZ_INT_ISR0_REG, &dword, B_FALSE); - *qmaskp = EFX_DWORD_FIELD(dword, EFX_DWORD_0); - - EFSYS_PROBE1(qmask, uint32_t, *qmaskp); - -#if EFSYS_OPT_HUNTINGTON - if (enp->en_family == EFX_FAMILY_HUNTINGTON) { - /* Huntington reports fatal errors via events */ - *fatalp = B_FALSE; - return; - } -#endif - if (*qmaskp & (1U << eip->ei_level)) - *fatalp = falconsiena_intr_check_fatal(enp); - else - *fatalp = B_FALSE; + eiop->eio_status_line(enp, fatalp, qmaskp); } void @@ -299,39 +297,25 @@ efx_intr_status_message( __out boolean_t *fatalp) { efx_intr_t *eip = &(enp->en_intr); + efx_intr_ops_t *eiop = eip->ei_eiop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); -#if EFSYS_OPT_HUNTINGTON - if (enp->en_family == EFX_FAMILY_HUNTINGTON) { - /* Huntington reports fatal errors via events */ - *fatalp = B_FALSE; - return; - } -#endif - if (message == eip->ei_level) - *fatalp = falconsiena_intr_check_fatal(enp); - else - *fatalp = B_FALSE; + eiop->eio_status_message(enp, message, fatalp); } void efx_intr_fatal( __in efx_nic_t *enp) { + efx_intr_t *eip = &(enp->en_intr); + efx_intr_ops_t *eiop = eip->ei_eiop; + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); -#if EFSYS_OPT_HUNTINGTON - if (enp->en_family == EFX_FAMILY_HUNTINGTON) { - /* Huntington reports fatal errors via events */ - return; - } -#endif -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA - falconsiena_intr_fatal(enp); -#endif + eiop->eio_fatal(enp); } @@ -514,6 +498,51 @@ falconsiena_intr_check_fatal( return (B_FALSE); } +static void +falconsiena_intr_status_line( + __in efx_nic_t *enp, + __out boolean_t *fatalp, + __out uint32_t *qmaskp) +{ + efx_intr_t *eip = &(enp->en_intr); + efx_dword_t dword; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); + + /* + * Read the queue mask and implicitly acknowledge the + * interrupt. + */ + EFX_BAR_READD(enp, FR_BZ_INT_ISR0_REG, &dword, B_FALSE); + *qmaskp = EFX_DWORD_FIELD(dword, EFX_DWORD_0); + + EFSYS_PROBE1(qmask, uint32_t, *qmaskp); + + if (*qmaskp & (1U << eip->ei_level)) + *fatalp = falconsiena_intr_check_fatal(enp); + else + *fatalp = B_FALSE; +} + +static void +falconsiena_intr_status_message( + __in efx_nic_t *enp, + __in unsigned int message, + __out boolean_t *fatalp) +{ + efx_intr_t *eip = &(enp->en_intr); + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); + + if (message == eip->ei_level) + *fatalp = falconsiena_intr_check_fatal(enp); + else + *fatalp = B_FALSE; +} + + static void falconsiena_intr_fatal( __in efx_nic_t *enp) Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 15:28:10 2016 (r293768) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 15:28:59 2016 (r293769) @@ -140,6 +140,21 @@ ef10_intr_trigger( __in unsigned int level); void +ef10_intr_status_line( + __in efx_nic_t *enp, + __out boolean_t *fatalp, + __out uint32_t *qmaskp); + + void +ef10_intr_status_message( + __in efx_nic_t *enp, + __in unsigned int message, + __out boolean_t *fatalp); + + void +ef10_intr_fatal( + __in efx_nic_t *enp); + void ef10_intr_fini( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/hunt_intr.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_intr.c Tue Jan 12 15:28:10 2016 (r293768) +++ head/sys/dev/sfxge/common/hunt_intr.c Tue Jan 12 15:28:59 2016 (r293769) @@ -148,6 +148,48 @@ fail1: return (rc); } + void +ef10_intr_status_line( + __in efx_nic_t *enp, + __out boolean_t *fatalp, + __out uint32_t *qmaskp) +{ + efx_dword_t dword; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); + + /* Read the queue mask and implicitly acknowledge the interrupt. */ + EFX_BAR_READD(enp, ER_DZ_BIU_INT_ISR_REG, &dword, B_FALSE); + *qmaskp = EFX_DWORD_FIELD(dword, EFX_DWORD_0); + + EFSYS_PROBE1(qmask, uint32_t, *qmaskp); + + *fatalp = B_FALSE; +} + + void +ef10_intr_status_message( + __in efx_nic_t *enp, + __in unsigned int message, + __out boolean_t *fatalp) +{ + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); + + _NOTE(ARGUNUSED(enp, message)) + + /* EF10 fatal errors are reported via events */ + *fatalp = B_FALSE; +} + + void +ef10_intr_fatal( + __in efx_nic_t *enp) +{ + /* EF10 fatal errors are reported via events */ + _NOTE(ARGUNUSED(enp)) +} void ef10_intr_fini( From owner-svn-src-head@freebsd.org Tue Jan 12 15:31:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA11DA6D5FB; Tue, 12 Jan 2016 15:31:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7B0E1A6E; Tue, 12 Jan 2016 15:31:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CFVKMG040509; Tue, 12 Jan 2016 15:31:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CFVKwb040504; Tue, 12 Jan 2016 15:31:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121531.u0CFVKwb040504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 15:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293770 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:31:22 -0000 Author: arybchik Date: Tue Jan 12 15:31:20 2016 New Revision: 293770 URL: https://svnweb.freebsd.org/changeset/base/293770 Log: sfxge: cleanup: use consistent types for NVRAM partitions Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4887 Modified: head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nvram.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_nvram.c head/sys/dev/sfxge/common/siena_vpd.c Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 15:28:59 2016 (r293769) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 15:31:20 2016 (r293770) @@ -361,18 +361,18 @@ ef10_nvram_partn_write_segment_tlv( extern __checkReturn efx_rc_t ef10_nvram_partn_size( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __out size_t *sizep); extern __checkReturn efx_rc_t ef10_nvram_partn_lock( __in efx_nic_t *enp, - __in unsigned int partn); + __in uint32_t partn); extern __checkReturn efx_rc_t ef10_nvram_partn_read( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in unsigned int offset, __out_bcount(size) caddr_t data, __in size_t size); @@ -380,14 +380,14 @@ ef10_nvram_partn_read( extern __checkReturn efx_rc_t ef10_nvram_partn_erase( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in unsigned int offset, __in size_t size); extern __checkReturn efx_rc_t ef10_nvram_partn_write( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in unsigned int offset, __out_bcount(size) caddr_t data, __in size_t size); @@ -395,7 +395,7 @@ ef10_nvram_partn_write( extern void ef10_nvram_partn_unlock( __in efx_nic_t *enp, - __in unsigned int partn); + __in uint32_t partn); #endif /* EFSYS_OPT_NVRAM || EFSYS_OPT_VPD */ @@ -457,7 +457,7 @@ ef10_nvram_rw_finish( extern __checkReturn efx_rc_t ef10_nvram_partn_set_version( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in_ecount(4) uint16_t version[4]); extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Tue Jan 12 15:28:59 2016 (r293769) +++ head/sys/dev/sfxge/common/hunt_nvram.c Tue Jan 12 15:31:20 2016 (r293770) @@ -1288,7 +1288,7 @@ fail1: __checkReturn efx_rc_t ef10_nvram_partn_size( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __out size_t *sizep) { efx_rc_t rc; @@ -1308,7 +1308,7 @@ fail1: __checkReturn efx_rc_t ef10_nvram_partn_lock( __in efx_nic_t *enp, - __in unsigned int partn) + __in uint32_t partn) { efx_rc_t rc; @@ -1326,7 +1326,7 @@ fail1: __checkReturn efx_rc_t ef10_nvram_partn_read( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in unsigned int offset, __out_bcount(size) caddr_t data, __in size_t size) @@ -1358,7 +1358,7 @@ fail1: __checkReturn efx_rc_t ef10_nvram_partn_erase( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in unsigned int offset, __in size_t size) { @@ -1403,7 +1403,7 @@ fail1: __checkReturn efx_rc_t ef10_nvram_partn_write( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in unsigned int offset, __out_bcount(size) caddr_t data, __in size_t size) @@ -1457,7 +1457,7 @@ fail1: void ef10_nvram_partn_unlock( __in efx_nic_t *enp, - __in unsigned int partn) + __in uint32_t partn) { boolean_t reboot; efx_rc_t rc; @@ -1475,7 +1475,7 @@ fail1: __checkReturn efx_rc_t ef10_nvram_partn_set_version( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in_ecount(4) uint16_t version[4]) { struct tlv_partition_version partn_version; @@ -1911,7 +1911,7 @@ ef10_nvram_set_version( __in_ecount(4) uint16_t version[4]) { ef10_parttbl_entry_t *entry; - unsigned int partn; + uint32_t partn; efx_rc_t rc; if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Tue Jan 12 15:28:59 2016 (r293769) +++ head/sys/dev/sfxge/common/siena_impl.h Tue Jan 12 15:31:20 2016 (r293770) @@ -158,18 +158,18 @@ siena_mcdi_feature_supported( extern __checkReturn efx_rc_t siena_nvram_partn_size( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __out size_t *sizep); extern __checkReturn efx_rc_t siena_nvram_partn_lock( __in efx_nic_t *enp, - __in unsigned int partn); + __in uint32_t partn); extern __checkReturn efx_rc_t siena_nvram_partn_read( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in unsigned int offset, __out_bcount(size) caddr_t data, __in size_t size); @@ -177,14 +177,14 @@ siena_nvram_partn_read( extern __checkReturn efx_rc_t siena_nvram_partn_erase( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in unsigned int offset, __in size_t size); extern __checkReturn efx_rc_t siena_nvram_partn_write( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in unsigned int offset, __out_bcount(size) caddr_t data, __in size_t size); @@ -192,12 +192,12 @@ siena_nvram_partn_write( extern void siena_nvram_partn_unlock( __in efx_nic_t *enp, - __in unsigned int partn); + __in uint32_t partn); extern __checkReturn efx_rc_t siena_nvram_get_dynamic_cfg( __in efx_nic_t *enp, - __in unsigned int index, + __in uint32_t partn, __in boolean_t vpd, __out siena_mc_dynamic_config_hdr_t **dcfgp, __out size_t *sizep); @@ -223,7 +223,7 @@ siena_nvram_size( extern __checkReturn efx_rc_t siena_nvram_get_subtype( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __out uint32_t *subtypep); extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Tue Jan 12 15:28:59 2016 (r293769) +++ head/sys/dev/sfxge/common/siena_nvram.c Tue Jan 12 15:31:20 2016 (r293770) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); __checkReturn efx_rc_t siena_nvram_partn_size( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __out size_t *sizep) { efx_rc_t rc; @@ -72,7 +72,7 @@ fail1: __checkReturn efx_rc_t siena_nvram_partn_lock( __in efx_nic_t *enp, - __in unsigned int partn) + __in uint32_t partn) { efx_rc_t rc; @@ -91,7 +91,7 @@ fail1: __checkReturn efx_rc_t siena_nvram_partn_read( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in unsigned int offset, __out_bcount(size) caddr_t data, __in size_t size) @@ -123,7 +123,7 @@ fail1: __checkReturn efx_rc_t siena_nvram_partn_erase( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in unsigned int offset, __in size_t size) { @@ -144,7 +144,7 @@ fail1: __checkReturn efx_rc_t siena_nvram_partn_write( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in unsigned int offset, __out_bcount(size) caddr_t data, __in size_t size) @@ -176,7 +176,7 @@ fail1: void siena_nvram_partn_unlock( __in efx_nic_t *enp, - __in unsigned int partn) + __in uint32_t partn) { boolean_t reboot; efx_rc_t rc; @@ -326,7 +326,7 @@ fail1: __checkReturn efx_rc_t siena_nvram_get_dynamic_cfg( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __in boolean_t vpd, __out siena_mc_dynamic_config_hdr_t **dcfgp, __out size_t *sizep) @@ -455,7 +455,7 @@ fail1: __checkReturn efx_rc_t siena_nvram_get_subtype( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __out uint32_t *subtypep) { efx_mcdi_req_t req; @@ -515,8 +515,8 @@ siena_nvram_get_version( { siena_mc_dynamic_config_hdr_t *dcfg; siena_parttbl_entry_t *entry; - unsigned int dcfg_partn; - unsigned int partn; + uint32_t dcfg_partn; + uint32_t partn; unsigned int i; efx_rc_t rc; Modified: head/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/siena_vpd.c Tue Jan 12 15:28:59 2016 (r293769) +++ head/sys/dev/sfxge/common/siena_vpd.c Tue Jan 12 15:31:20 2016 (r293770) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); static __checkReturn efx_rc_t siena_vpd_get_static( __in efx_nic_t *enp, - __in unsigned int partn, + __in uint32_t partn, __deref_out_bcount_opt(*sizep) caddr_t *svpdp, __out size_t *sizep) { @@ -207,7 +207,7 @@ siena_vpd_size( __out size_t *sizep) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - unsigned int partn; + uint32_t partn; efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); From owner-svn-src-head@freebsd.org Tue Jan 12 15:31:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43140A6D636; Tue, 12 Jan 2016 15:31:34 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 111F41C06; Tue, 12 Jan 2016 15:31:33 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CFVXA4040587; Tue, 12 Jan 2016 15:31:33 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CFVWis040586; Tue, 12 Jan 2016 15:31:32 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601121531.u0CFVWis040586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 12 Jan 2016 15:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293771 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:31:34 -0000 Author: skra Date: Tue Jan 12 15:31:32 2016 New Revision: 293771 URL: https://svnweb.freebsd.org/changeset/base/293771 Log: Fix local macro for early KVA allocation. Only crashdumpmap allocation was affected which is used for temporary mappings during panic dump. Approved by: kib (mentor) Modified: head/sys/arm/arm/pmap-v6-new.c Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Tue Jan 12 15:31:20 2016 (r293770) +++ head/sys/arm/arm/pmap-v6-new.c Tue Jan 12 15:31:32 2016 (r293771) @@ -1109,7 +1109,7 @@ pmap_bootstrap(vm_offset_t firstaddr) * mapping of pages. */ #define SYSMAP(c, p, v, n) do { \ - v = (c)pmap_preboot_reserve_pages(1); \ + v = (c)pmap_preboot_reserve_pages(n); \ p = pt2map_entry((vm_offset_t)v); \ } while (0) From owner-svn-src-head@freebsd.org Tue Jan 12 15:33:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 671EBA6D761; Tue, 12 Jan 2016 15:33:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2976E1FE1; Tue, 12 Jan 2016 15:33:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CFXn3C041116; Tue, 12 Jan 2016 15:33:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CFXnbo041115; Tue, 12 Jan 2016 15:33:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121533.u0CFXnbo041115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 15:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293772 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:33:50 -0000 Author: arybchik Date: Tue Jan 12 15:33:48 2016 New Revision: 293772 URL: https://svnweb.freebsd.org/changeset/base/293772 Log: sfxge: pass context type and num_queues to efx_mcdi_rss_context_alloc Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4890 Modified: head/sys/dev/sfxge/common/hunt_rx.c Modified: head/sys/dev/sfxge/common/hunt_rx.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_rx.c Tue Jan 12 15:31:32 2016 (r293771) +++ head/sys/dev/sfxge/common/hunt_rx.c Tue Jan 12 15:33:48 2016 (r293772) @@ -147,14 +147,34 @@ fail1: static __checkReturn efx_rc_t efx_mcdi_rss_context_alloc( __in efx_nic_t *enp, + __in efx_rx_scale_support_t scale_support, + __in uint32_t num_queues, __out uint32_t *rss_contextp) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN, MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN)]; uint32_t rss_context; + uint32_t context_type; efx_rc_t rc; + if (num_queues > EFX_MAXRSS) { + rc = EINVAL; + goto fail1; + } + + switch (scale_support) { + case EFX_RX_SCALE_EXCLUSIVE: + context_type = MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_EXCLUSIVE; + break; + case EFX_RX_SCALE_SHARED: + context_type = MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_SHARED; + break; + default: + rc = EINVAL; + goto fail2; + } + (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_RSS_CONTEXT_ALLOC; req.emr_in_buf = payload; @@ -164,33 +184,36 @@ efx_mcdi_rss_context_alloc( MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID, EVB_PORT_ID_ASSIGNED); - MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_TYPE, - MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_EXCLUSIVE); + MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_TYPE, context_type); /* NUM_QUEUES is only used to validate indirection table offsets */ - MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_NUM_QUEUES, 64); + MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_NUM_QUEUES, num_queues); efx_mcdi_execute(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail1; + goto fail3; } if (req.emr_out_length_used < MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN) { rc = EMSGSIZE; - goto fail2; + goto fail4; } rss_context = MCDI_OUT_DWORD(req, RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID); if (rss_context == EF10_RSS_CONTEXT_INVALID) { rc = ENOENT; - goto fail3; + goto fail5; } *rss_contextp = rss_context; return (0); +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: @@ -420,7 +443,8 @@ ef10_rx_init( { #if EFSYS_OPT_RX_SCALE - if (efx_mcdi_rss_context_alloc(enp, &enp->en_rss_context) == 0) { + if (efx_mcdi_rss_context_alloc(enp, EFX_RX_SCALE_EXCLUSIVE, EFX_MAXRSS, + &enp->en_rss_context) == 0) { /* * Allocated an exclusive RSS context, which allows both the * indirection table and key to be modified. From owner-svn-src-head@freebsd.org Tue Jan 12 15:35:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B256AA6D7E5; Tue, 12 Jan 2016 15:35:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 697AD1374; Tue, 12 Jan 2016 15:35:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CFZ0hg041442; Tue, 12 Jan 2016 15:35:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CFZ0as041438; Tue, 12 Jan 2016 15:35:00 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121535.u0CFZ0as041438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 15:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293773 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:35:01 -0000 Author: arybchik Date: Tue Jan 12 15:35:00 2016 New Revision: 293773 URL: https://svnweb.freebsd.org/changeset/base/293773 Log: sfxge: remove obsolete lookahead split RXQ support Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4891 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/hunt_rx.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Jan 12 15:33:48 2016 (r293772) +++ head/sys/dev/sfxge/common/efx.h Tue Jan 12 15:35:00 2016 (r293773) @@ -1916,8 +1916,6 @@ efx_psuedo_hdr_pkt_length_get( typedef enum efx_rxq_type_e { EFX_RXQ_TYPE_DEFAULT, - EFX_RXQ_TYPE_SPLIT_HEADER, - EFX_RXQ_TYPE_SPLIT_PAYLOAD, EFX_RXQ_TYPE_SCATTER, EFX_RXQ_NTYPES } efx_rxq_type_t; Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Tue Jan 12 15:33:48 2016 (r293772) +++ head/sys/dev/sfxge/common/efx_rx.c Tue Jan 12 15:35:00 2016 (r293773) @@ -1246,7 +1246,6 @@ falconsiena_rx_qcreate( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_oword_t oword; uint32_t size; - boolean_t split; boolean_t jumbo; efx_rc_t rc; @@ -1277,7 +1276,6 @@ falconsiena_rx_qcreate( switch (type) { case EFX_RXQ_TYPE_DEFAULT: - split = B_FALSE; jumbo = B_FALSE; break; @@ -1307,7 +1305,6 @@ falconsiena_rx_qcreate( rc = EINVAL; goto fail4; } - split = B_FALSE; jumbo = B_TRUE; break; #endif /* EFSYS_OPT_RX_SCATTER */ @@ -1318,10 +1315,7 @@ falconsiena_rx_qcreate( } /* Set up the new descriptor queue */ - EFX_POPULATE_OWORD_10(oword, - FRF_CZ_RX_HDR_SPLIT, split, - FRF_AZ_RX_ISCSI_DDIG_EN, 0, - FRF_AZ_RX_ISCSI_HDIG_EN, 0, + EFX_POPULATE_OWORD_7(oword, FRF_AZ_RX_DESCQ_BUF_BASE_ID, id, FRF_AZ_RX_DESCQ_EVQ_ID, eep->ee_index, FRF_AZ_RX_DESCQ_OWNER_ID, 0, Modified: head/sys/dev/sfxge/common/hunt_rx.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_rx.c Tue Jan 12 15:33:48 2016 (r293772) +++ head/sys/dev/sfxge/common/hunt_rx.c Tue Jan 12 15:35:00 2016 (r293773) @@ -739,11 +739,6 @@ ef10_rx_qcreate( disable_scatter = B_FALSE; } - /* - * Note: EFX_RXQ_TYPE_SPLIT_HEADER and EFX_RXQ_TYPE_SPLIT_PAYLOAD are - * not supported here. - */ - if ((rc = efx_mcdi_init_rxq(enp, n, eep->ee_index, label, index, esmp, disable_scatter)) != 0) goto fail3; From owner-svn-src-head@freebsd.org Tue Jan 12 15:37:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3D71A6D8ED for ; Tue, 12 Jan 2016 15:37:33 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qg0-x232.google.com (mail-qg0-x232.google.com [IPv6:2607:f8b0:400d:c04::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98BB81778 for ; Tue, 12 Jan 2016 15:37:33 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qg0-x232.google.com with SMTP id e32so342255775qgf.3 for ; Tue, 12 Jan 2016 07:37:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=9vby9x/gmBh3JB7Xkg5OW49rNpeQYIyYJwU2H9e4v5E=; b=pxUB1pbXZ6DG4CALifJhJNGoC8onsiSVRVRQx9qFxFU98KrI8ShxJL7LWlNF0UWgdS zizmoOhbcd0g+2C95lkQjyOrniek5z9hzGoi3kmicOE+jD7JZIY1mkKRKEtOoStCrgFL K2MqemmQEMy14tWVwuaGt+c5UN2qkHBqbgS194nE8mVa8zsq0TVHs801RKNzE8u4VMBy EFrChJlVMd5qoxHf6hAdOqvVP1gc1dakal3dX3G2b9kwokiIyQZRIZaE6VRfRQPy85kp I0RCOORZka2d2Xl23eqQfyntoUzRC2uynwKyki7G4JfX3n/ujYOan4ZYacd/Wk8Dn5T+ oMhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=9vby9x/gmBh3JB7Xkg5OW49rNpeQYIyYJwU2H9e4v5E=; b=Y31BzAbzseiKEYbQPWPv3OEFeTDdqTfmA+y1SAGH3dH/TSxbD/bmwcvb1DQWOnzbJy 0jxOoL7bvN0RsqWZmDd3HdAGSEvahJwRFZAyuq30aGa7CLjfs0vD6TgyoDQiNKRQq7vK V1+wy83CqNNGhnh3hgd+U88kFBvSEmqWgj54lBD3LieyLuRkmJ93F1cGf//vo5H8ZvRj yLimdPtvhZTq1fQwqauKWO6UK48LGduVRlicd41uXBpUg84Zd5w9VcOfKh5jqY3z4/s0 JpYWhavl1KelRsARtYphc80I4N+pgwe+GQKGt6iNemgApI6aAmZalQam5Nek30o/X3Il szSg== X-Gm-Message-State: ALoCoQkhh4mRqS+i7hgloCR8deCUxDjQoYPId51n9e4izjy6vibgdFmSRueoesTTk0MX9ER/XmIjfQKXCPRv5z4qiXirUZGLTw== X-Received: by 10.140.161.9 with SMTP id h9mr98215224qhh.82.1452613052619; Tue, 12 Jan 2016 07:37:32 -0800 (PST) Received: from mutt-hardenedbsd ([63.88.83.104]) by smtp.gmail.com with ESMTPSA id s65sm56344063qhb.39.2016.01.12.07.37.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jan 2016 07:37:30 -0800 (PST) Date: Tue, 12 Jan 2016 10:37:29 -0500 From: Shawn Webb To: Antoine Brodin Cc: Gleb Smirnoff , Dirk Meyer , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat Message-ID: <20160112153729.GA86007@mutt-hardenedbsd> References: <201601082034.u08KYvLv075281@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9amGYk9869ThD9tj" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hardenedbsd 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 15:37:34 -0000 --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 09, 2016 at 07:41:57PM +0000, Antoine Brodin wrote: > On Fri, Jan 8, 2016 at 8:34 PM, Gleb Smirnoff wrote: > > Author: glebius > > Date: Fri Jan 8 20:34:57 2016 > > New Revision: 293439 > > URL: https://svnweb.freebsd.org/changeset/base/293439 > > > > Log: > > New sendfile(2) syscall. A joint effort of NGINX and Netflix from 201= 3 and > > up to now. >=20 > Hi, >=20 > "SF_FLAGS" addition seems to break graphics/graphviz on head. > See error log at: > http://beefy3.nyi.freebsd.org/data/head-i386-default/p405601_s293454/logs= /errors/graphviz-2.38.0_10.log > 739 ports are skipped due to this failure. I've run into this, too. Thanks, --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --9amGYk9869ThD9tj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWlR22AAoJEGqEZY9SRW7ubNQP/j1fqaZl3CMSV8gLhZw8oU1n JEOgu65aAaNps0In/Yu5zmQhr2A49uYpJGlk26nqsIeaxjfBIkr6OmHjm+mVtr29 w4Zc+Mp82rgtI4va0Z3YG7hq1x1cnl77SA5pJOYEfaN/GBIy9kYDwCBxOnqq/FgB 1pOHJzG2/XmNg+u0G0eX0HP+63aTxCYca9XcnHgluT2qwnd0/bRT4GpiUBTVm2wX NSQr32ZnbXn0fyJtkDuSrdB98bj59bO9Atqpf8FandM5rArIXNAZ8/yGwl+IW2rU MuKe/0yKPQX/s8jKFkgT0u3gGqHrYYPP1nMLdkUwqom86O4U/IGhrZhe45zYNslv lkeRrUL65C3XhxGJ03vMLjEWWHLMzvhPzDbgRm/Z4WjcrIZk3IDdLx2xFycfbnoJ vuQTjyXBxAddSeHcLJeBndaqYuulQmSS7FZv54iAPbfZ85qDDk/Ta6htd6DsSYfY x8hiug8cWW5avkz/ExOHbI/2SoJ9OxTMjh9IQ1azyBmD1WMFO5HcALyw1lM0LccM LF2B6XZ0vK/82ZhoSwYmGCIqmWiM6ojfgQlQvFdSAyjMv3MYHFMX7apRFmvc68kf BRTVCmlbKweTS1MWbgi1jHmw38Lr9b+gll9oLfVYdLmPTFypJw7qli/trR8idjnj 6o2csC7EyrJdiobppxTT =oqzK -----END PGP SIGNATURE----- --9amGYk9869ThD9tj-- From owner-svn-src-head@freebsd.org Tue Jan 12 16:19:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3379A6CD7D; Tue, 12 Jan 2016 16:19:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22d.google.com (mail-ig0-x22d.google.com [IPv6:2607:f8b0:4001:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83AFB157F; Tue, 12 Jan 2016 16:19:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22d.google.com with SMTP id ik10so150795186igb.1; Tue, 12 Jan 2016 08:19:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=0KIINahnjaUpoorw8sDy4QbLWvnqjjKhTZgkiu9v3Nw=; b=WrNHT4ZykF/TG7WdsAzuBDMMZ4pMcBSPehEmsMJRmU0iyoyF2EyLYSJ6hofXU1llz2 e/oN3Eq4zLGgd97PZC8yNlmKaxPyH3rwuQhzIMUZ35Xi05FxHjFO3SRJiKRPcNtQLoTg vgpliD2sSQcplopjxXt4DDcNSLwt78xGfnTh6Iskjb/f0gjhba69odTRx3CsiaWPk9cx VFsGtH1RuAmnSWXUnmdoM+oAXg2egNkQDXmDbA6IhQI4FDAWK34BG3IxMG56YLsuH/WS vT2VMOcb3VVZKZGetPR5OBi6uqAdcwbYfSc8f+IPiPeykBcLVDzi4K2mXIcJf5KTTb98 6rlQ== MIME-Version: 1.0 X-Received: by 10.50.171.225 with SMTP id ax1mr17305127igc.61.1452615594848; Tue, 12 Jan 2016 08:19:54 -0800 (PST) Received: by 10.36.121.202 with HTTP; Tue, 12 Jan 2016 08:19:54 -0800 (PST) In-Reply-To: <20160112153729.GA86007@mutt-hardenedbsd> References: <201601082034.u08KYvLv075281@repo.freebsd.org> <20160112153729.GA86007@mutt-hardenedbsd> Date: Tue, 12 Jan 2016 08:19:54 -0800 Message-ID: Subject: Re: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat From: Adrian Chadd To: Shawn Webb Cc: Antoine Brodin , Gleb Smirnoff , Dirk Meyer , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 16:19:55 -0000 Has this been addressed yet? -a On 12 January 2016 at 07:37, Shawn Webb wrote: > On Sat, Jan 09, 2016 at 07:41:57PM +0000, Antoine Brodin wrote: >> On Fri, Jan 8, 2016 at 8:34 PM, Gleb Smirnoff wrote: >> > Author: glebius >> > Date: Fri Jan 8 20:34:57 2016 >> > New Revision: 293439 >> > URL: https://svnweb.freebsd.org/changeset/base/293439 >> > >> > Log: >> > New sendfile(2) syscall. A joint effort of NGINX and Netflix from 2013 and >> > up to now. >> >> Hi, >> >> "SF_FLAGS" addition seems to break graphics/graphviz on head. >> See error log at: >> http://beefy3.nyi.freebsd.org/data/head-i386-default/p405601_s293454/logs/errors/graphviz-2.38.0_10.log >> 739 ports are skipped due to this failure. > > I've run into this, too. > > Thanks, > > -- > Shawn Webb > HardenedBSD > > GPG Key ID: 0x6A84658F52456EEE > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE From owner-svn-src-head@freebsd.org Tue Jan 12 16:21:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D11DCA6CE70; Tue, 12 Jan 2016 16:21:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E8921984; Tue, 12 Jan 2016 16:21:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CGLYec070362; Tue, 12 Jan 2016 16:21:34 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CGLYMQ070361; Tue, 12 Jan 2016 16:21:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601121621.u0CGLYMQ070361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 12 Jan 2016 16:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293774 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 16:21:35 -0000 Author: arybchik Date: Tue Jan 12 16:21:34 2016 New Revision: 293774 URL: https://svnweb.freebsd.org/changeset/base/293774 Log: sfxge: regenerate MCDI header Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Tue Jan 12 15:35:00 2016 (r293773) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Tue Jan 12 16:21:34 2016 (r293774) @@ -299,6 +299,9 @@ * have already installed filters. See the comment at * MC_CMD_WORKAROUND_BUG26807. */ #define MC_CMD_ERR_FILTERS_PRESENT 0x1014 +/* The clock whose frequency you've attempted to set set + * doesn't exist on this NIC */ +#define MC_CMD_ERR_NO_CLOCK 0x1015 #define MC_CMD_ERR_CODE_OFST 0 @@ -318,9 +321,11 @@ /* Point to the copycode entry point. */ #define SIENA_MC_BOOTROM_COPYCODE_VEC (0x800 - 3 * 0x4) #define HUNT_MC_BOOTROM_COPYCODE_VEC (0x8000 - 3 * 0x4) +#define MEDFORD_MC_BOOTROM_COPYCODE_VEC (0x10000 - 3 * 0x4) /* Points to the recovery mode entry point. */ #define SIENA_MC_BOOTROM_NOFLASH_VEC (0x800 - 2 * 0x4) #define HUNT_MC_BOOTROM_NOFLASH_VEC (0x8000 - 2 * 0x4) +#define MEDFORD_MC_BOOTROM_NOFLASH_VEC (0x10000 - 2 * 0x4) /* The command set exported by the boot ROM (MCDI v0) */ #define MC_CMD_GET_VERSION_V0_SUPPORTED_FUNCS { \ @@ -1456,9 +1461,11 @@ #define MC_CMD_FC_IN_DDR_TEST_START_B1_WIDTH 1 /* MC_CMD_FC_IN_DDR_TEST_POLL msgrequest */ -#define MC_CMD_FC_IN_DDR_TEST_POLL_LEN 8 +#define MC_CMD_FC_IN_DDR_TEST_POLL_LEN 12 #define MC_CMD_FC_IN_DDR_TEST_CMD_OFST 0 /* MC_CMD_FC_IN_DDR_TEST_HEADER_OFST 4 */ +/* Clear previous test result and prepare for restarting DDR test */ +#define MC_CMD_FC_IN_DDR_TEST_POLL_CLEAR_RESULT_FOR_DDR_TEST_OFST 8 /* MC_CMD_FC_IN_GET_ASSERT msgrequest */ #define MC_CMD_FC_IN_GET_ASSERT_LEN 4 @@ -1475,6 +1482,10 @@ #define MC_CMD_FC_IN_FPGA_BUILD_SERVICES 0x2 /* enum: Get the BSP version */ #define MC_CMD_FC_IN_FPGA_BUILD_BSP_VERSION 0x3 +/* enum: Get build register for V2 (SFA974X) */ +#define MC_CMD_FC_IN_FPGA_BUILD_BUILD_V2 0x4 +/* enum: GEt the services register for V2 (SFA974X) */ +#define MC_CMD_FC_IN_FPGA_BUILD_SERVICES_V2 0x5 /* MC_CMD_FC_IN_READ_MAP msgrequest */ #define MC_CMD_FC_IN_READ_MAP_LEN 8 @@ -1832,6 +1843,7 @@ #define MC_CMD_FC_IN_DDR_OP_OFST 4 #define MC_CMD_FC_IN_DDR_SET_SPD 0x0 /* enum */ #define MC_CMD_FC_IN_DDR_GET_STATUS 0x1 /* enum */ +#define MC_CMD_FC_IN_DDR_SET_INFO 0x2 /* enum */ #define MC_CMD_FC_IN_DDR_BANK_OFST 8 #define MC_CMD_FC_IN_DDR_BANK_B0 0x0 /* enum */ #define MC_CMD_FC_IN_DDR_BANK_B1 0x1 /* enum */ @@ -1855,6 +1867,15 @@ /* Page index of the spd data copied into MC_CMD_FC_IN_DDR_SPD */ #define MC_CMD_FC_IN_DDR_SPD_PAGE_ID_OFST 144 +/* MC_CMD_FC_IN_DDR_SET_INFO msgrequest */ +#define MC_CMD_FC_IN_DDR_SET_INFO_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_DDR_OP_OFST 4 */ +/* Affected bank */ +/* MC_CMD_FC_IN_DDR_BANK_OFST 8 */ +/* Size of DDR */ +#define MC_CMD_FC_IN_DDR_SIZE_OFST 12 + /* MC_CMD_FC_IN_DDR_GET_STATUS msgrequest */ #define MC_CMD_FC_IN_DDR_GET_STATUS_LEN 12 /* MC_CMD_FC_IN_CMD_OFST 0 */ @@ -2387,6 +2408,116 @@ #define MC_CMD_FC_OUT_FPGA_BUILD_REVISION_HIGH_LBN 0 #define MC_CMD_FC_OUT_FPGA_BUILD_REVISION_HIGH_WIDTH 16 +/* MC_CMD_FC_OUT_FPGA_BUILD_V2 msgresponse */ +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_LEN 32 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_COMPONENT_INFO_OFST 0 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_IS_APPLICATION_LBN 31 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_IS_APPLICATION_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_IS_LICENSED_LBN 30 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_IS_LICENSED_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_COMPONENT_ID_LBN 16 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_COMPONENT_ID_WIDTH 14 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_VERSION_MAJOR_LBN 12 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_VERSION_MAJOR_WIDTH 4 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_VERSION_MINOR_LBN 4 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_VERSION_MINOR_WIDTH 8 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_BUILD_NUM_LBN 0 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_BUILD_NUM_WIDTH 4 +/* Build timestamp (seconds since epoch) */ +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_TIMESTAMP_OFST 4 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_PARAMETERS_OFST 8 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_PMA_PASSTHROUGH_LBN 31 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_PMA_PASSTHROUGH_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SODIMM2_QDR_DEF_LBN 29 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SODIMM2_QDR_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SODIMM1_QDR_DEF_LBN 28 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SODIMM1_QDR_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DDR3_ECC_ENABLED_LBN 27 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DDR3_ECC_ENABLED_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DISCRETE2_DDR3_DEF_LBN 26 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DISCRETE2_DDR3_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DISCRETE1_DDR3_DEF_LBN 25 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DISCRETE1_DDR3_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SODIMM2_TO_DDR3_DEF_LBN 24 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SODIMM2_TO_DDR3_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SODIMM1_T0_DDR3_DEF_LBN 23 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SODIMM1_T0_DDR3_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DISCRETE2_RLDRAM_DEF_LBN 22 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DISCRETE2_RLDRAM_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DISCRETE1_RLDRAM_DEF_LBN 21 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DISCRETE1_RLDRAM_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SODIMM2_RLDRAM_DEF_LBN 20 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SODIMM2_RLDRAM_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SODIMM1_RLDRAM_DEF_LBN 19 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SODIMM1_RLDRAM_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_NIC0_3_SPEED_LBN 18 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_NIC0_3_SPEED_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_NIC0_3_SPEED_10G 0x0 /* enum */ +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_NIC0_3_SPEED_40G 0x1 /* enum */ +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP4_7_SPEED_LBN 17 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP4_7_SPEED_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP4_7_SPEED_10G 0x0 /* enum */ +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP4_7_SPEED_40G 0x1 /* enum */ +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP0_3_SPEED_LBN 16 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP0_3_SPEED_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP0_3_SPEED_10G 0x0 /* enum */ +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP0_3_SPEED_40G 0x1 /* enum */ +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP7_DEF_LBN 15 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP7_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP6_DEF_LBN 14 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP6_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP5_DEF_LBN 13 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP5_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP4_DEF_LBN 12 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP4_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP3_DEF_LBN 11 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP3_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP2_DEF_LBN 10 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP2_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP1_DEF_LBN 9 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP1_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP0_DEF_LBN 8 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_SFP0_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_NIC3_DEF_LBN 7 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_NIC3_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_NIC2_DEF_LBN 6 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_NIC2_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_NIC1_DEF_LBN 5 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_NIC1_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_NIC0_DEF_LBN 4 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_NIC0_DEF_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_FPGA_TYPE_LBN 0 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_FPGA_TYPE_WIDTH 4 +#define MC_CMD_FC_FPGA_V2_TYPE_A3 0x0 /* enum */ +#define MC_CMD_FC_FPGA_V2_TYPE_A4 0x1 /* enum */ +#define MC_CMD_FC_FPGA_V2_TYPE_A5 0x2 /* enum */ +#define MC_CMD_FC_FPGA_V2_TYPE_A7 0x3 /* enum */ +#define MC_CMD_FC_FPGA_V2_TYPE_D3 0x8 /* enum */ +#define MC_CMD_FC_FPGA_V2_TYPE_D4 0x9 /* enum */ +#define MC_CMD_FC_FPGA_V2_TYPE_D5 0xa /* enum */ +#define MC_CMD_FC_FPGA_V2_TYPE_D7 0xb /* enum */ +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_IDENTIFIER_OFST 12 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_CHANGESET_LBN 0 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_CHANGESET_WIDTH 16 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_BUILD_FLAG_LBN 16 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_BUILD_FLAG_WIDTH 1 +/* MC_CMD_FC_FPGA_BUILD_FLAG_INTERNAL 0x0 */ +/* MC_CMD_FC_FPGA_BUILD_FLAG_RELEASE 0x1 */ +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_VERSION_HI_OFST 16 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DEPLOYMENT_VERSION_MINOR_LBN 0 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DEPLOYMENT_VERSION_MINOR_WIDTH 16 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DEPLOYMENT_VERSION_MAJOR_LBN 16 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DEPLOYMENT_VERSION_MAJOR_WIDTH 16 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_VERSION_LO_OFST 20 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DEPLOYMENT_VERSION_BUILD_LBN 0 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DEPLOYMENT_VERSION_BUILD_WIDTH 16 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DEPLOYMENT_VERSION_MICRO_LBN 16 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_DEPLOYMENT_VERSION_MICRO_WIDTH 16 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_REVISION_LO_OFST 24 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_REVISION_HI_OFST 28 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_REVISION_HIGH_LBN 0 +#define MC_CMD_FC_OUT_FPGA_BUILD_V2_REVISION_HIGH_WIDTH 16 + /* MC_CMD_FC_OUT_FPGA_SERVICES msgresponse */ #define MC_CMD_FC_OUT_FPGA_SERVICES_LEN 32 #define MC_CMD_FC_OUT_FPGA_SERVICES_COMPONENT_INFO_OFST 0 @@ -2437,6 +2568,40 @@ #define MC_CMD_FC_OUT_FPGA_SERVICES_REVISION_HIGH_LBN 0 #define MC_CMD_FC_OUT_FPGA_SERVICES_REVISION_HIGH_WIDTH 16 +/* MC_CMD_FC_OUT_FPGA_SERVICES_V2 msgresponse */ +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_LEN 32 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_COMPONENT_INFO_OFST 0 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_IS_APPLICATION_LBN 31 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_IS_APPLICATION_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_IS_LICENSED_LBN 30 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_IS_LICENSED_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_COMPONENT_ID_LBN 16 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_COMPONENT_ID_WIDTH 14 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_VERSION_MAJOR_LBN 12 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_VERSION_MAJOR_WIDTH 4 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_VERSION_MINOR_LBN 4 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_VERSION_MINOR_WIDTH 8 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_BUILD_NUM_LBN 0 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_BUILD_NUM_WIDTH 4 +/* Build timestamp (seconds since epoch) */ +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_TIMESTAMP_OFST 4 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_PARAMETERS_OFST 8 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_PTP_ENABLED_LBN 0 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_PTP_ENABLED_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_FC_FLASH_BOOTED_LBN 8 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_FC_FLASH_BOOTED_WIDTH 1 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_IDENTIFIER_OFST 12 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_CHANGESET_LBN 0 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_CHANGESET_WIDTH 16 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_BUILD_FLAG_LBN 16 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_BUILD_FLAG_WIDTH 1 +/* MC_CMD_FC_FPGA_BUILD_FLAG_INTERNAL 0x0 */ +/* MC_CMD_FC_FPGA_BUILD_FLAG_RELEASE 0x1 */ +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_REVISION_LO_OFST 24 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_REVISION_HI_OFST 28 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_REVISION_HIGH_LBN 0 +#define MC_CMD_FC_OUT_FPGA_SERVICES_V2_REVISION_HIGH_WIDTH 16 + /* MC_CMD_FC_OUT_BSP_VERSION msgresponse */ #define MC_CMD_FC_OUT_BSP_VERSION_LEN 4 /* Qsys system ID */ @@ -2718,6 +2883,9 @@ /* MC_CMD_FC_OUT_DDR_SET_SPD msgresponse */ #define MC_CMD_FC_OUT_DDR_SET_SPD_LEN 0 +/* MC_CMD_FC_OUT_DDR_SET_INFO msgresponse */ +#define MC_CMD_FC_OUT_DDR_SET_INFO_LEN 0 + /* MC_CMD_FC_OUT_DDR_GET_STATUS msgresponse */ #define MC_CMD_FC_OUT_DDR_GET_STATUS_LEN 4 #define MC_CMD_FC_OUT_DDR_GET_STATUS_FLAGS_OFST 0 @@ -3131,6 +3299,8 @@ #define MC_CMD_AOE_OUT_INFO_FPGA_VERSION_OFST 12 /* FPGA type - read from CPLD straps */ #define MC_CMD_AOE_OUT_INFO_FPGA_TYPE_OFST 16 +#define MC_CMD_AOE_OUT_INFO_FPGA_TYPE_A5_C2 0x1 /* enum */ +#define MC_CMD_AOE_OUT_INFO_FPGA_TYPE_A7_C2 0x2 /* enum */ /* FPGA state (debug) */ #define MC_CMD_AOE_OUT_INFO_FPGA_STATE_OFST 20 /* FPGA image - partition from which loaded */ @@ -3144,23 +3314,28 @@ /* Random pieces of information */ #define MC_CMD_AOE_OUT_INFO_FLAGS_OFST 32 /* enum: Power to FPGA supplied by PEG connector, not PCIe bus */ -#define MC_CMD_AOE_OUT_INFO_PEG_POWER 0x1 +#define MC_CMD_AOE_OUT_INFO_PEG_POWER 0x1 /* enum: CPLD apparently good */ -#define MC_CMD_AOE_OUT_INFO_CPLD_GOOD 0x2 +#define MC_CMD_AOE_OUT_INFO_CPLD_GOOD 0x2 /* enum: FPGA working normally */ -#define MC_CMD_AOE_OUT_INFO_FPGA_GOOD 0x4 +#define MC_CMD_AOE_OUT_INFO_FPGA_GOOD 0x4 /* enum: FPGA is powered */ -#define MC_CMD_AOE_OUT_INFO_FPGA_POWER 0x8 +#define MC_CMD_AOE_OUT_INFO_FPGA_POWER 0x8 /* enum: Board has incompatible SODIMMs fitted */ -#define MC_CMD_AOE_OUT_INFO_BAD_SODIMM 0x10 +#define MC_CMD_AOE_OUT_INFO_BAD_SODIMM 0x10 /* enum: Board has ByteBlaster connected */ -#define MC_CMD_AOE_OUT_INFO_HAS_BYTEBLASTER 0x20 -/* Revision of Modena board */ +#define MC_CMD_AOE_OUT_INFO_HAS_BYTEBLASTER 0x20 +/* enum: FPGA Boot flash has an invalid header. */ +#define MC_CMD_AOE_OUT_INFO_FPGA_BAD_BOOT_HDR 0x40 +/* enum: FPGA Application flash is accessible. */ +#define MC_CMD_AOE_OUT_INFO_FPGA_APP_FLASH_GOOD 0x80 +/* Revision of Modena and Sorrento boards. Sorrento can be R1_2 or R1_3. */ #define MC_CMD_AOE_OUT_INFO_BOARD_REVISION_OFST 36 #define MC_CMD_AOE_OUT_INFO_UNKNOWN 0x0 /* enum */ #define MC_CMD_AOE_OUT_INFO_R1_0 0x10 /* enum */ #define MC_CMD_AOE_OUT_INFO_R1_1 0x11 /* enum */ #define MC_CMD_AOE_OUT_INFO_R1_2 0x12 /* enum */ +#define MC_CMD_AOE_OUT_INFO_R1_3 0x13 /* enum */ /* Result of FC booting - not valid while a ByteBlaster is connected. */ #define MC_CMD_AOE_OUT_INFO_FC_BOOT_RESULT_OFST 40 /* enum: No error */ @@ -3931,15 +4106,30 @@ /* MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS msgresponse */ #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_LEN 16 -/* Uncorrected error on transmit timestamps in NIC clock format */ +/* Uncorrected error on PTP transmit timestamps in NIC clock format */ #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_TRANSMIT_OFST 0 -/* Uncorrected error on receive timestamps in NIC clock format */ +/* Uncorrected error on PTP receive timestamps in NIC clock format */ #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_RECEIVE_OFST 4 /* Uncorrected error on PPS output in NIC clock format */ #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_PPS_OUT_OFST 8 /* Uncorrected error on PPS input in NIC clock format */ #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_PPS_IN_OFST 12 +/* MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2 msgresponse */ +#define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_LEN 24 +/* Uncorrected error on PTP transmit timestamps in NIC clock format */ +#define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PTP_TX_OFST 0 +/* Uncorrected error on PTP receive timestamps in NIC clock format */ +#define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PTP_RX_OFST 4 +/* Uncorrected error on PPS output in NIC clock format */ +#define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PPS_OUT_OFST 8 +/* Uncorrected error on PPS input in NIC clock format */ +#define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PPS_IN_OFST 12 +/* Uncorrected error on non-PTP transmit timestamps in NIC clock format */ +#define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_GENERAL_TX_OFST 16 +/* Uncorrected error on non-PTP receive timestamps in NIC clock format */ +#define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_GENERAL_RX_OFST 20 + /* MC_CMD_PTP_OUT_MANFTEST_PPS msgresponse */ #define MC_CMD_PTP_OUT_MANFTEST_PPS_LEN 4 /* Results of testing */ @@ -5203,7 +5393,7 @@ #define MC_CMD_SET_MAC 0x2c #undef MC_CMD_0x2c_PRIVILEGE_CTG -#define MC_CMD_0x2c_PRIVILEGE_CTG SRIOV_CTG_LINK +#define MC_CMD_0x2c_PRIVILEGE_CTG SRIOV_CTG_GENERAL /* MC_CMD_SET_MAC_IN msgrequest */ #define MC_CMD_SET_MAC_IN_LEN 28 @@ -5950,6 +6140,37 @@ /* amount to read in bytes */ #define MC_CMD_NVRAM_READ_IN_LENGTH_OFST 8 +/* MC_CMD_NVRAM_READ_IN_V2 msgrequest */ +#define MC_CMD_NVRAM_READ_IN_V2_LEN 16 +#define MC_CMD_NVRAM_READ_IN_V2_TYPE_OFST 0 +/* Enum values, see field(s): */ +/* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */ +#define MC_CMD_NVRAM_READ_IN_V2_OFFSET_OFST 4 +/* amount to read in bytes */ +#define MC_CMD_NVRAM_READ_IN_V2_LENGTH_OFST 8 +/* Optional control info. If a partition is stored with an A/B versioning + * scheme (i.e. in more than one physical partition in NVRAM) the host can set + * this to control which underlying physical partition is used to read data + * from. This allows it to perform a read-modify-write-verify with the write + * lock continuously held by calling NVRAM_UPDATE_START, reading the old + * contents using MODE=TARGET_CURRENT, overwriting the old partition and then + * verifying by reading with MODE=TARGET_BACKUP. + */ +#define MC_CMD_NVRAM_READ_IN_V2_MODE_OFST 12 +/* enum: Same as omitting MODE: caller sees data in current partition unless it + * holds the write lock in which case it sees data in the partition it is + * updating. + */ +#define MC_CMD_NVRAM_READ_IN_V2_DEFAULT 0x0 +/* enum: Read from the current partition of an A/B pair, even if holding the + * write lock. + */ +#define MC_CMD_NVRAM_READ_IN_V2_TARGET_CURRENT 0x1 +/* enum: Read from the non-current (i.e. to be updated) partition of an A/B + * pair + */ +#define MC_CMD_NVRAM_READ_IN_V2_TARGET_BACKUP 0x2 + /* MC_CMD_NVRAM_READ_OUT msgresponse */ #define MC_CMD_NVRAM_READ_OUT_LENMIN 1 #define MC_CMD_NVRAM_READ_OUT_LENMAX 252 @@ -6329,6 +6550,8 @@ #define MC_CMD_SENSOR_PHY0_VCC 0x4c /* enum: Voltage supplied to the QSFP #1 from their power supply: mV */ #define MC_CMD_SENSOR_PHY1_VCC 0x4d +/* enum: Controller die temperature (TDIODE): degC */ +#define MC_CMD_SENSOR_CONTROLLER_TDIODE_TEMP 0x4e /* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF */ #define MC_CMD_SENSOR_ENTRY_OFST 4 #define MC_CMD_SENSOR_ENTRY_LEN 8 @@ -6406,7 +6629,7 @@ /* MC_CMD_READ_SENSORS_EXT_IN msgrequest */ #define MC_CMD_READ_SENSORS_EXT_IN_LEN 12 -/* DMA address of host buffer for sensor readings */ +/* DMA address of host buffer for sensor readings (must be 4Kbyte aligned). */ #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_OFST 0 #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_LEN 8 #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_LO_OFST 0 @@ -7656,6 +7879,88 @@ #define LICENSED_APP_ID_ID_LBN 0 #define LICENSED_APP_ID_ID_WIDTH 32 +/* LICENSED_FEATURES structuredef */ +#define LICENSED_FEATURES_LEN 8 +/* Bitmask of licensed firmware features */ +#define LICENSED_FEATURES_MASK_OFST 0 +#define LICENSED_FEATURES_MASK_LEN 8 +#define LICENSED_FEATURES_MASK_LO_OFST 0 +#define LICENSED_FEATURES_MASK_HI_OFST 4 +#define LICENSED_FEATURES_RX_CUT_THROUGH_LBN 0 +#define LICENSED_FEATURES_RX_CUT_THROUGH_WIDTH 1 +#define LICENSED_FEATURES_PIO_LBN 1 +#define LICENSED_FEATURES_PIO_WIDTH 1 +#define LICENSED_FEATURES_EVQ_TIMER_LBN 2 +#define LICENSED_FEATURES_EVQ_TIMER_WIDTH 1 +#define LICENSED_FEATURES_CLOCK_LBN 3 +#define LICENSED_FEATURES_CLOCK_WIDTH 1 +#define LICENSED_FEATURES_RX_TIMESTAMPS_LBN 4 +#define LICENSED_FEATURES_RX_TIMESTAMPS_WIDTH 1 +#define LICENSED_FEATURES_TX_TIMESTAMPS_LBN 5 +#define LICENSED_FEATURES_TX_TIMESTAMPS_WIDTH 1 +#define LICENSED_FEATURES_RX_SNIFF_LBN 6 +#define LICENSED_FEATURES_RX_SNIFF_WIDTH 1 +#define LICENSED_FEATURES_TX_SNIFF_LBN 7 +#define LICENSED_FEATURES_TX_SNIFF_WIDTH 1 +#define LICENSED_FEATURES_PROXY_FILTER_OPS_LBN 8 +#define LICENSED_FEATURES_PROXY_FILTER_OPS_WIDTH 1 +#define LICENSED_FEATURES_MASK_LBN 0 +#define LICENSED_FEATURES_MASK_WIDTH 64 + +/* LICENSED_V3_APPS structuredef */ +#define LICENSED_V3_APPS_LEN 8 +/* Bitmask of licensed applications */ +#define LICENSED_V3_APPS_MASK_OFST 0 +#define LICENSED_V3_APPS_MASK_LEN 8 +#define LICENSED_V3_APPS_MASK_LO_OFST 0 +#define LICENSED_V3_APPS_MASK_HI_OFST 4 +#define LICENSED_V3_APPS_ONLOAD_LBN 0 +#define LICENSED_V3_APPS_ONLOAD_WIDTH 1 +#define LICENSED_V3_APPS_PTP_LBN 1 +#define LICENSED_V3_APPS_PTP_WIDTH 1 +#define LICENSED_V3_APPS_SOLARCAPTURE_PRO_LBN 2 +#define LICENSED_V3_APPS_SOLARCAPTURE_PRO_WIDTH 1 +#define LICENSED_V3_APPS_SOLARSECURE_LBN 3 +#define LICENSED_V3_APPS_SOLARSECURE_WIDTH 1 +#define LICENSED_V3_APPS_PERF_MONITOR_LBN 4 +#define LICENSED_V3_APPS_PERF_MONITOR_WIDTH 1 +#define LICENSED_V3_APPS_SOLARCAPTURE_LIVE_LBN 5 +#define LICENSED_V3_APPS_SOLARCAPTURE_LIVE_WIDTH 1 +#define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_LBN 6 +#define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_WIDTH 1 +#define LICENSED_V3_APPS_NETWORK_ACCESS_CONTROL_LBN 7 +#define LICENSED_V3_APPS_NETWORK_ACCESS_CONTROL_WIDTH 1 +#define LICENSED_V3_APPS_MASK_LBN 0 +#define LICENSED_V3_APPS_MASK_WIDTH 64 + +/* LICENSED_V3_FEATURES structuredef */ +#define LICENSED_V3_FEATURES_LEN 8 +/* Bitmask of licensed firmware features */ +#define LICENSED_V3_FEATURES_MASK_OFST 0 +#define LICENSED_V3_FEATURES_MASK_LEN 8 +#define LICENSED_V3_FEATURES_MASK_LO_OFST 0 +#define LICENSED_V3_FEATURES_MASK_HI_OFST 4 +#define LICENSED_V3_FEATURES_RX_CUT_THROUGH_LBN 0 +#define LICENSED_V3_FEATURES_RX_CUT_THROUGH_WIDTH 1 +#define LICENSED_V3_FEATURES_PIO_LBN 1 +#define LICENSED_V3_FEATURES_PIO_WIDTH 1 +#define LICENSED_V3_FEATURES_EVQ_TIMER_LBN 2 +#define LICENSED_V3_FEATURES_EVQ_TIMER_WIDTH 1 +#define LICENSED_V3_FEATURES_CLOCK_LBN 3 +#define LICENSED_V3_FEATURES_CLOCK_WIDTH 1 +#define LICENSED_V3_FEATURES_RX_TIMESTAMPS_LBN 4 +#define LICENSED_V3_FEATURES_RX_TIMESTAMPS_WIDTH 1 +#define LICENSED_V3_FEATURES_TX_TIMESTAMPS_LBN 5 +#define LICENSED_V3_FEATURES_TX_TIMESTAMPS_WIDTH 1 +#define LICENSED_V3_FEATURES_RX_SNIFF_LBN 6 +#define LICENSED_V3_FEATURES_RX_SNIFF_WIDTH 1 +#define LICENSED_V3_FEATURES_TX_SNIFF_LBN 7 +#define LICENSED_V3_FEATURES_TX_SNIFF_WIDTH 1 +#define LICENSED_V3_FEATURES_PROXY_FILTER_OPS_LBN 8 +#define LICENSED_V3_FEATURES_PROXY_FILTER_OPS_WIDTH 1 +#define LICENSED_V3_FEATURES_MASK_LBN 0 +#define LICENSED_V3_FEATURES_MASK_WIDTH 64 + /* TX_TIMESTAMP_EVENT structuredef */ #define TX_TIMESTAMP_EVENT_LEN 6 /* lower 16 bits of timestamp data */ @@ -8050,6 +8355,8 @@ #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_IP_CSUM_EN_WIDTH 1 #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN_LBN 11 #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN_WIDTH 1 +#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TSOV2_EN_LBN 12 +#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TSOV2_EN_WIDTH 1 /* Owner ID to use if in buffer mode (zero if physical) */ #define MC_CMD_INIT_TXQ_EXT_IN_OWNER_ID_OFST 20 /* The port ID associated with the v-adaptor which should contain this DMAQ. */ @@ -8923,7 +9230,10 @@ /***********************************/ /* MC_CMD_PARSER_DISP_RW - * Direct read/write of parser-dispatcher state (DICPUs and LUE) for debugging + * Direct read/write of parser-dispatcher state (DICPUs and LUE) for debugging. + * Please note that this interface is only of use to debug tools which have + * knowledge of firmware and hardware data structures; nothing here is intended + * for use by normal driver code. */ #define MC_CMD_PARSER_DISP_RW 0xe5 #undef MC_CMD_0xe5_PRIVILEGE_CTG @@ -8942,6 +9252,12 @@ #define MC_CMD_PARSER_DISP_RW_IN_LUE 0x2 /* enum: Lookup engine (with requested metadata format) */ #define MC_CMD_PARSER_DISP_RW_IN_LUE_VERSIONED_METADATA 0x3 +/* enum: RX0 dispatcher CPU (alias for RX_DICPU; Medford has 2 RX DICPUs) */ +#define MC_CMD_PARSER_DISP_RW_IN_RX0_DICPU 0x0 +/* enum: RX1 dispatcher CPU (only valid for Medford) */ +#define MC_CMD_PARSER_DISP_RW_IN_RX1_DICPU 0x4 +/* enum: Miscellaneous other state (only valid for Medford) */ +#define MC_CMD_PARSER_DISP_RW_IN_MISC_STATE 0x5 /* identifies the type of operation requested */ #define MC_CMD_PARSER_DISP_RW_IN_OP_OFST 4 /* enum: read a word of DICPU DMEM or a LUE entry */ @@ -8950,8 +9266,12 @@ #define MC_CMD_PARSER_DISP_RW_IN_WRITE 0x1 /* enum: read-modify-write a word of DICPU DMEM (not valid for LUE) */ #define MC_CMD_PARSER_DISP_RW_IN_RMW 0x2 -/* data memory address or LUE index */ +/* data memory address (DICPU targets) or LUE index (LUE targets) */ #define MC_CMD_PARSER_DISP_RW_IN_ADDRESS_OFST 8 +/* selector (for MISC_STATE target) */ +#define MC_CMD_PARSER_DISP_RW_IN_SELECTOR_OFST 8 +/* enum: Port to datapath mapping */ +#define MC_CMD_PARSER_DISP_RW_IN_PORT_DP_MAPPING 0x1 /* value to write (for DMEM writes) */ #define MC_CMD_PARSER_DISP_RW_IN_DMEM_WRITE_VALUE_OFST 12 /* XOR value (for DMEM read-modify-writes: new = (old & mask) ^ value) */ @@ -8976,6 +9296,12 @@ */ #define MC_CMD_PARSER_DISP_RW_OUT_LUE_MGR_STATE_OFST 20 #define MC_CMD_PARSER_DISP_RW_OUT_LUE_MGR_STATE_LEN 32 +/* datapath(s) used for each port (for MISC_STATE PORT_DP_MAPPING selector) */ +#define MC_CMD_PARSER_DISP_RW_OUT_PORT_DP_MAPPING_OFST 0 +#define MC_CMD_PARSER_DISP_RW_OUT_PORT_DP_MAPPING_LEN 4 +#define MC_CMD_PARSER_DISP_RW_OUT_PORT_DP_MAPPING_NUM 4 +#define MC_CMD_PARSER_DISP_RW_OUT_DP0 0x1 /* enum */ +#define MC_CMD_PARSER_DISP_RW_OUT_DP1 0x2 /* enum */ /***********************************/ @@ -9656,6 +9982,14 @@ #define MC_CMD_GET_CAPABILITIES_OUT_LEN 20 /* First word of flags. */ #define MC_CMD_GET_CAPABILITIES_OUT_FLAGS1_OFST 0 +#define MC_CMD_GET_CAPABILITIES_OUT_VPORT_RECONFIGURE_LBN 3 +#define MC_CMD_GET_CAPABILITIES_OUT_VPORT_RECONFIGURE_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_OUT_TX_STRIPING_LBN 4 +#define MC_CMD_GET_CAPABILITIES_OUT_TX_STRIPING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_OUT_VADAPTOR_QUERY_LBN 5 +#define MC_CMD_GET_CAPABILITIES_OUT_VADAPTOR_QUERY_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_OUT_EVB_PORT_VLAN_RESTRICT_LBN 6 +#define MC_CMD_GET_CAPABILITIES_OUT_EVB_PORT_VLAN_RESTRICT_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_OUT_DRV_ATTACH_PREBOOT_LBN 7 #define MC_CMD_GET_CAPABILITIES_OUT_DRV_ATTACH_PREBOOT_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_OUT_RX_FORCE_EVENT_MERGING_LBN 8 @@ -9824,6 +10158,200 @@ /* Licensed capabilities */ #define MC_CMD_GET_CAPABILITIES_OUT_LICENSE_CAPABILITIES_OFST 16 +/* MC_CMD_GET_CAPABILITIES_V2_IN msgrequest */ +#define MC_CMD_GET_CAPABILITIES_V2_IN_LEN 0 + +/* MC_CMD_GET_CAPABILITIES_V2_OUT msgresponse */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_LEN 26 +/* First word of flags. */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_FLAGS1_OFST 0 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_VPORT_RECONFIGURE_LBN 3 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_VPORT_RECONFIGURE_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_STRIPING_LBN 4 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_STRIPING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_VADAPTOR_QUERY_LBN 5 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_VADAPTOR_QUERY_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_EVB_PORT_VLAN_RESTRICT_LBN 6 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_EVB_PORT_VLAN_RESTRICT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_DRV_ATTACH_PREBOOT_LBN 7 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_DRV_ATTACH_PREBOOT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_FORCE_EVENT_MERGING_LBN 8 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_FORCE_EVENT_MERGING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_SET_MAC_ENHANCED_LBN 9 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_SET_MAC_ENHANCED_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_LBN 10 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 11 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MAC_SECURITY_FILTERING_LBN 12 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MAC_SECURITY_FILTERING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_ADDITIONAL_RSS_MODES_LBN 13 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_ADDITIONAL_RSS_MODES_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_QBB_LBN 14 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_QBB_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PACKED_STREAM_VAR_BUFFERS_LBN 15 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PACKED_STREAM_VAR_BUFFERS_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_RSS_LIMITED_LBN 16 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_RSS_LIMITED_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PACKED_STREAM_LBN 17 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PACKED_STREAM_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_INCLUDE_FCS_LBN 18 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_INCLUDE_FCS_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VLAN_INSERTION_LBN 19 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VLAN_INSERTION_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_VLAN_STRIPPING_LBN 20 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_VLAN_STRIPPING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_LBN 21 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PREFIX_LEN_0_LBN 22 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PREFIX_LEN_0_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PREFIX_LEN_14_LBN 23 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PREFIX_LEN_14_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_TIMESTAMP_LBN 24 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_TIMESTAMP_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_BATCHING_LBN 25 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_BATCHING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_MCAST_FILTER_CHAINING_LBN 26 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_MCAST_FILTER_CHAINING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_PM_AND_RXDP_COUNTERS_LBN 27 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DISABLE_SCATTER_LBN 28 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DISABLE_SCATTER_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MCAST_UDP_LOOPBACK_LBN 29 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MCAST_UDP_LOOPBACK_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_EVB_LBN 30 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_EVB_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_VXLAN_NVGRE_LBN 31 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_VXLAN_NVGRE_WIDTH 1 +/* RxDPCPU firmware id. */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DPCPU_FW_ID_OFST 4 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DPCPU_FW_ID_LEN 2 +/* enum: Standard RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP 0x0 +/* enum: Low latency RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_LOW_LATENCY 0x1 +/* enum: Packed stream RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_PACKED_STREAM 0x2 +/* enum: BIST RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_BIST 0x10a +/* enum: RXDP Test firmware image 1 */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_TO_MC_CUT_THROUGH 0x101 +/* enum: RXDP Test firmware image 2 */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD 0x102 +/* enum: RXDP Test firmware image 3 */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD_FIRST 0x103 +/* enum: RXDP Test firmware image 4 */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_EVERY_EVENT_BATCHABLE 0x104 +/* enum: RXDP Test firmware image 5 */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_BACKPRESSURE 0x105 +/* enum: RXDP Test firmware image 6 */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_PACKET_EDITS 0x106 +/* enum: RXDP Test firmware image 7 */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_RX_HDR_SPLIT 0x107 +/* enum: RXDP Test firmware image 8 */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_DISABLE_DL 0x108 +/* enum: RXDP Test firmware image 9 */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_DOORBELL_DELAY 0x10b +/* TxDPCPU firmware id. */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_DPCPU_FW_ID_OFST 6 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_DPCPU_FW_ID_LEN 2 +/* enum: Standard TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP 0x0 +/* enum: Low latency TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_LOW_LATENCY 0x1 +/* enum: High packet rate TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_HIGH_PACKET_RATE 0x3 +/* enum: BIST TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_BIST 0x12d +/* enum: TXDP Test firmware image 1 */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_TEST_FW_TSO_EDIT 0x101 +/* enum: TXDP Test firmware image 2 */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_OFST 8 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_LEN 2 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_REV_LBN 0 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_REV_WIDTH 12 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_TYPE_LBN 12 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_TYPE_WIDTH 4 +/* enum: reserved value - do not use (may indicate alternative interpretation + * of REV field in future) + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_RESERVED 0x0 +/* enum: Trivial RX PD firmware for early Huntington development (Huntington + * development only) + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_FIRST_PKT 0x1 +/* enum: RX PD firmware with approximately Siena-compatible behaviour + * (Huntington development only) + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2 +/* enum: Virtual switching (full feature) RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_VSWITCH 0x3 +/* enum: siena_compat variant RX PD firmware using PM rather than MAC + * (Huntington development only) + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_SIENA_COMPAT_PM 0x4 +/* enum: Low latency RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_LOW_LATENCY 0x5 +/* enum: Packed stream RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_PACKED_STREAM 0x6 +/* enum: RX PD firmware handling layer 2 only for high packet rate performance + * tests (Medford development only) + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7 +/* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe +/* enum: RX PD firmware parsing but not filtering network overlay tunnel + * encapsulations (Medford development only) + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_TESTFW_ENCAP_PARSING_ONLY 0xf +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_OFST 10 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_LEN 2 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_REV_LBN 0 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_REV_WIDTH 12 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_TYPE_LBN 12 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_TYPE_WIDTH 4 +/* enum: reserved value - do not use (may indicate alternative interpretation + * of REV field in future) + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_RESERVED 0x0 +/* enum: Trivial TX PD firmware for early Huntington development (Huntington + * development only) + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_FIRST_PKT 0x1 +/* enum: TX PD firmware with approximately Siena-compatible behaviour + * (Huntington development only) + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2 +/* enum: Virtual switching (full feature) TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_VSWITCH 0x3 +/* enum: siena_compat variant TX PD firmware using PM rather than MAC + * (Huntington development only) + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_SIENA_COMPAT_PM 0x4 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_LOW_LATENCY 0x5 /* enum */ +/* enum: TX PD firmware handling layer 2 only for high packet rate performance + * tests (Medford development only) + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7 +/* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe +/* Hardware capabilities of NIC */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_HW_CAPABILITIES_OFST 12 +/* Licensed capabilities */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_LICENSE_CAPABILITIES_OFST 16 +/* Second word of flags. Not present on older firmware (check the length). */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_FLAGS2_OFST 20 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_LBN 0 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_ENCAP_LBN 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_ENCAP_WIDTH 1 +/* Number of FATSOv2 contexts per datapath supported by this NIC. Not present + * on older firmware (check the length). + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS_OFST 24 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS_LEN 2 + /***********************************/ /* MC_CMD_V2_EXTN @@ -10545,10 +11073,17 @@ #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN 8 /* The handle of the RSS context */ #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_RSS_CONTEXT_ID_OFST 0 -/* Hash control flags. The _EN bits are always supported. The _MODE bits only - * work when the firmware reports ADDITIONAL_RSS_MODES in - * MC_CMD_GET_CAPABILITIES and override the _EN bits if any of them are not 0. - * See the RSS_MODE structure for the meaning of the mode bits. +/* Hash control flags. The _EN bits are always supported, but new modes are + * available when ADDITIONAL_RSS_MODES is reported by MC_CMD_GET_CAPABILITIES: + * in this case, the MODE fields may be set to non-zero values, and will take + * effect regardless of the settings of the _EN flags. See the RSS_MODE + * structure for the meaning of the mode bits. Drivers must check the + * capability before trying to set any _MODE fields, as older firmware will + * reject any attempt to set the FLAGS field to a value > 0xff with EINVAL. In + * the case where all the _MODE flags are zero, the _EN flags take effect, + * providing backward compatibility for existing drivers. (Setting all _MODE + * *and* all _EN flags to zero is valid, to disable RSS spreading for that + * particular packet type.) */ #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_FLAGS_OFST 4 #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN_LBN 0 @@ -10594,11 +11129,18 @@ /* MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT msgresponse */ #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_LEN 8 -/* Hash control flags. If any _MODE bits are non-zero (which will only be true - * when the firmware reports ADDITIONAL_RSS_MODES) then the _EN bits should be - * disregarded (but are guaranteed to be consistent with the _MODE bits if - * RSS_CONTEXT_SET_FLAGS has never been called for this context since it was - * allocated). +/* Hash control flags. If all _MODE bits are zero (which will always be true + * for older firmware which does not report the ADDITIONAL_RSS_MODES + * capability), the _EN bits report the state. If any _MODE bits are non-zero + * (which will only be true when the firmware reports ADDITIONAL_RSS_MODES) + * then the _EN bits should be disregarded, although the _MODE flags are + * guaranteed to be consistent with the _EN flags for a freshly-allocated RSS + * context and in the case where the _EN flags were used in the SET. This + * provides backward compatibility: old drivers will not be attempting to + * derive any meaning from the _MODE bits (and can never set them to any value + * not representable by the _EN bits); new drivers can always determine the + * mode by looking only at the _MODE bits; the value returned by a GET can + * always be used for a SET regardless of old/new driver vs. old/new firmware. */ #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_FLAGS_OFST 4 #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV4_EN_LBN 0 @@ -11568,32 +12110,38 @@ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_MAXNUM 63 #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_ID_LBN 0 #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_ID_WIDTH 8 -/* enum: Attenuation (0-15, TBD for Medford) */ +/* enum: Attenuation (0-15, Huntington) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_ATT 0x0 -/* enum: CTLE Boost (0-15, TBD for Medford) */ +/* enum: CTLE Boost (0-15, Huntington) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_BOOST 0x1 -/* enum: Edge DFE Tap1 (0 - max negative, 64 - zero, 127 - max positive, TBD - * for Medford) +/* enum: Edge DFE Tap1 (Huntington - 0 - max negative, 64 - zero, 127 - max + * positive, Medford - 0-31) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP1 0x2 -/* enum: Edge DFE Tap2 (0 - max negative, 32 - zero, 63 - max positive, TBD for - * Medford) +/* enum: Edge DFE Tap2 (Huntington - 0 - max negative, 32 - zero, 63 - max + * positive, Medford - 0-31) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP2 0x3 -/* enum: Edge DFE Tap3 (0 - max negative, 32 - zero, 63 - max positive, TBD for - * Medford) +/* enum: Edge DFE Tap3 (Huntington - 0 - max negative, 32 - zero, 63 - max + * positive, Medford - 0-16) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP3 0x4 -/* enum: Edge DFE Tap4 (0 - max negative, 32 - zero, 63 - max positive, TBD for - * Medford) +/* enum: Edge DFE Tap4 (Huntington - 0 - max negative, 32 - zero, 63 - max + * positive, Medford - 0-16) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP4 0x5 -/* enum: Edge DFE Tap5 (0 - max negative, 32 - zero, 63 - max positive, TBD for - * Medford) +/* enum: Edge DFE Tap5 (Huntington - 0 - max negative, 32 - zero, 63 - max + * positive, Medford - 0-16) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP5 0x6 -/* enum: Edge DFE DLEV (TBD for Medford) */ +/* enum: Edge DFE DLEV (0-128 for Medford) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_DLEV 0x7 +/* enum: Variable Gain Amplifier (0-15, Medford) */ +#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_VGA 0x8 +/* enum: CTLE EQ Capacitor (0-15, Medford) */ +#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CTLE_EQC 0x9 +/* enum: CTLE EQ Resistor (0-7, Medford) */ +#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CTLE_EQRES 0xa #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LANE_LBN 8 #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LANE_WIDTH 3 #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_0 0x0 /* enum */ @@ -11665,26 +12213,32 @@ #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_MAXNUM 63 #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_ID_LBN 0 #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_ID_WIDTH 8 -/* enum: TX Amplitude */ +/* enum: TX Amplitude (Huntington, Medford) */ #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_LEV 0x0 -/* enum: De-Emphasis Tap1 Magnitude (0-7) */ +/* enum: De-Emphasis Tap1 Magnitude (0-7) (Huntington) */ #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_MODE 0x1 /* enum: De-Emphasis Tap1 Fine */ #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_DTLEV 0x2 -/* enum: De-Emphasis Tap2 Magnitude (0-6) */ +/* enum: De-Emphasis Tap2 Magnitude (0-6) (Huntington) */ #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_D2 0x3 -/* enum: De-Emphasis Tap2 Fine */ +/* enum: De-Emphasis Tap2 Fine (Huntington) */ #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_D2TLEV 0x4 -/* enum: Pre-Emphasis Magnitude */ +/* enum: Pre-Emphasis Magnitude (Huntington) */ #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_E 0x5 -/* enum: Pre-Emphasis Fine */ +/* enum: Pre-Emphasis Fine (Huntington) */ #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_ETLEV 0x6 -/* enum: TX Slew Rate Coarse control */ +/* enum: TX Slew Rate Coarse control (Huntington) */ #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_PREDRV_DLY 0x7 -/* enum: TX Slew Rate Fine control */ +/* enum: TX Slew Rate Fine control (Huntington) */ #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_SR_SET 0x8 -/* enum: TX Termination Impedance control */ +/* enum: TX Termination Impedance control (Huntington) */ #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_RT_SET 0x9 +/* enum: TX Amplitude Fine control (Medford) */ +#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_LEV_FINE 0xa +/* enum: Pre-shoot Tap (Medford) */ +#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TAP_ADV 0xb +/* enum: De-emphasis Tap (Medford) */ +#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TAP_DLY 0xc #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LANE_LBN 8 #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LANE_WIDTH 3 #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_0 0x0 /* enum */ @@ -11871,8 +12425,12 @@ #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_DLEV 0x7 /* enum: Figure of Merit */ #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_FOM 0x8 +/* enum: CTLE EQ Capacitor (HF Gain) */ +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_CTLE_EQC 0x9 +/* enum: CTLE EQ Resistor (DC Gain) */ +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_CTLE_EQRES 0xa #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LANE_LBN 8 -#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LANE_WIDTH 4 +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LANE_WIDTH 5 #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_0 0x0 /* enum */ #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_1 0x1 /* enum */ #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_2 0x2 /* enum */ @@ -11881,12 +12439,57 @@ #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_5 0x5 /* enum */ #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_6 0x6 /* enum */ #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_7 0x7 /* enum */ -#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_ALL 0x8 /* enum */ -#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_RESERVED_LBN 12 -#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_RESERVED_WIDTH 12 +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_8 0x8 /* enum */ +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_9 0x9 /* enum */ +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_10 0xa /* enum */ +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_11 0xb /* enum */ +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_12 0xc /* enum */ +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_13 0xd /* enum */ +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_14 0xe /* enum */ +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_15 0xf /* enum */ +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_ALL 0x10 /* enum */ +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_LBN 13 +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_WIDTH 1 +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_RESERVED_LBN 14 +#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_RESERVED_WIDTH 10 #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_LBN 24 #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_WIDTH 8 +/* MC_CMD_PCIE_TUNE_RXEQ_SET_IN msgrequest */ +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_LENMIN 8 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_LENMAX 252 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_LEN(num) (4+4*(num)) +/* Requested operation */ +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PCIE_TUNE_OP_OFST 0 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PCIE_TUNE_OP_LEN 1 +/* Align the arguments to 32 bits */ +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PCIE_TUNE_RSVD_OFST 1 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PCIE_TUNE_RSVD_LEN 3 +/* RXEQ Parameter */ +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_OFST 4 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_LEN 4 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_MINNUM 1 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_MAXNUM 62 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_ID_LBN 0 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_ID_WIDTH 8 +/* Enum values, see field(s): */ +/* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT/PARAM_ID */ +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_LANE_LBN 8 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_LANE_WIDTH 5 +/* Enum values, see field(s): */ +/* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT/PARAM_LANE */ +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_LBN 13 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_WIDTH 1 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_RESERVED_LBN 14 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_RESERVED_WIDTH 2 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_INITIAL_LBN 16 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_INITIAL_WIDTH 8 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_RESERVED2_LBN 24 +#define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_RESERVED2_WIDTH 8 + +/* MC_CMD_PCIE_TUNE_RXEQ_SET_OUT msgresponse */ +#define MC_CMD_PCIE_TUNE_RXEQ_SET_OUT_LEN 0 + /* MC_CMD_PCIE_TUNE_TXEQ_GET_IN msgrequest */ #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_LEN 4 /* Requested operation */ @@ -11961,6 +12564,7 @@ /***********************************/ /* MC_CMD_LICENSING * Operations on the NVRAM_PARTITION_TYPE_LICENSE application license partition + * - not used for V3 licensing */ #define MC_CMD_LICENSING 0xf3 #undef MC_CMD_0xf3_PRIVILEGE_CTG @@ -12006,6 +12610,95 @@ /***********************************/ +/* MC_CMD_LICENSING_V3 + * Operations on the NVRAM_PARTITION_TYPE_LICENSE application license partition + * - V3 licensing (Medford) + */ +#define MC_CMD_LICENSING_V3 0xd0 +#undef MC_CMD_0xd0_PRIVILEGE_CTG + +#define MC_CMD_0xd0_PRIVILEGE_CTG SRIOV_CTG_GENERAL + +/* MC_CMD_LICENSING_V3_IN msgrequest */ +#define MC_CMD_LICENSING_V3_IN_LEN 4 +/* identifies the type of operation requested */ +#define MC_CMD_LICENSING_V3_IN_OP_OFST 0 +/* enum: re-read and apply licenses after a license key partition update; note + * that this operation returns a zero-length response + */ +#define MC_CMD_LICENSING_V3_IN_OP_UPDATE_LICENSE 0x0 +/* enum: report counts of installed licenses */ +#define MC_CMD_LICENSING_V3_IN_OP_REPORT_LICENSE 0x1 + +/* MC_CMD_LICENSING_V3_OUT msgresponse */ +#define MC_CMD_LICENSING_V3_OUT_LEN 88 +/* count of keys which are valid */ +#define MC_CMD_LICENSING_V3_OUT_VALID_KEYS_OFST 0 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 12 16:29:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78555A802C5; Tue, 12 Jan 2016 16:29:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6076A1094; Tue, 12 Jan 2016 16:29:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u0CGTRe1041153 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 12 Jan 2016 08:29:27 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u0CGTRmx041152; Tue, 12 Jan 2016 08:29:27 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 12 Jan 2016 08:29:27 -0800 From: Gleb Smirnoff To: Adrian Chadd Cc: Shawn Webb , Antoine Brodin , Dirk Meyer , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat Message-ID: <20160112162927.GK1906@FreeBSD.org> References: <201601082034.u08KYvLv075281@repo.freebsd.org> <20160112153729.GA86007@mutt-hardenedbsd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 16:29:28 -0000 Antoine said that he is going to handle it. On Tue, Jan 12, 2016 at 08:19:54AM -0800, Adrian Chadd wrote: A> Has this been addressed yet? A> A> A> -a A> A> A> On 12 January 2016 at 07:37, Shawn Webb wrote: A> > On Sat, Jan 09, 2016 at 07:41:57PM +0000, Antoine Brodin wrote: A> >> On Fri, Jan 8, 2016 at 8:34 PM, Gleb Smirnoff wrote: A> >> > Author: glebius A> >> > Date: Fri Jan 8 20:34:57 2016 A> >> > New Revision: 293439 A> >> > URL: https://svnweb.freebsd.org/changeset/base/293439 A> >> > A> >> > Log: A> >> > New sendfile(2) syscall. A joint effort of NGINX and Netflix from 2013 and A> >> > up to now. A> >> A> >> Hi, A> >> A> >> "SF_FLAGS" addition seems to break graphics/graphviz on head. A> >> See error log at: A> >> http://beefy3.nyi.freebsd.org/data/head-i386-default/p405601_s293454/logs/errors/graphviz-2.38.0_10.log A> >> 739 ports are skipped due to this failure. A> > A> > I've run into this, too. A> > A> > Thanks, A> > A> > -- A> > Shawn Webb A> > HardenedBSD A> > A> > GPG Key ID: 0x6A84658F52456EEE A> > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Tue Jan 12 16:31:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFD74A803AB; Tue, 12 Jan 2016 16:31:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C386313AA; Tue, 12 Jan 2016 16:31:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CGV7kD074495; Tue, 12 Jan 2016 16:31:07 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CGV7v6074494; Tue, 12 Jan 2016 16:31:07 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601121631.u0CGV7v6074494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 12 Jan 2016 16:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293775 - head/sys/boot/uboot/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 16:31:09 -0000 Author: ian Date: Tue Jan 12 16:31:07 2016 New Revision: 293775 URL: https://svnweb.freebsd.org/changeset/base/293775 Log: Cast using uintfptr_t and eliminate the cast to uint64_t which is uneeded because rounding down cannot increase the number of bits needed to express the result. I had no idea there was such a thing as uintfptr_t. Requested by: bde Modified: head/sys/boot/uboot/lib/copy.c Modified: head/sys/boot/uboot/lib/copy.c ============================================================================== --- head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:21:34 2016 (r293774) +++ head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:31:07 2016 (r293775) @@ -100,7 +100,7 @@ uboot_loadaddr(u_int type, void *data, u biggest_block = 0; biggest_size = 0; - subldr = rounddown2((uint64_t)(uintptr_t)_start, KERN_ALIGN); + subldr = rounddown2((uintfptr_t)_start, KERN_ALIGN); eubldr = roundup2((uint64_t)uboot_heap_end, KERN_ALIGN); for (i = 0; i < si->mr_no; i++) { if (si->mr[i].flags != MR_ATTR_DRAM) From owner-svn-src-head@freebsd.org Tue Jan 12 16:49:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6055A80B06; Tue, 12 Jan 2016 16:49:33 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D9261259; Tue, 12 Jan 2016 16:49:33 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm0-x230.google.com with SMTP id b14so330221246wmb.1; Tue, 12 Jan 2016 08:49:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-type:content-transfer-encoding; bh=pl6SI2AeW04yS/uJEq/GBEUSM5FiSJYoUTYhFP4Y9WM=; b=GY6NNcpvhclNlJamgGKpZUys6kxZoK43h/rrsWhISoSFPsPSTPwzK0QWMS83kEVMGm 4/Bc1IQzE7OaYqX/KJ0oM1TPaQKfoHMn3PQdXTRGyUDsVNtJ2QKOo2eBNMblAakePCJh 9KjEMnYqdBIL31gYYPHdDFG2Ys/gWZz11LfScY0Nz9Z85mwuk1XTiW8MByN9McSfQz/d pAht3KYo832mDnQYcURxAob8U7MZJy3xPNyTO89YWitiFY2T1KqKfbaCXo8Or9fz6pm1 L8Nd9Kz84ybOgYmJ9xj89jwevIsI+BXyVAy7AKdkwwEQSLS4BBPH7QxOJvbmWUHvYXxz u/iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-type :content-transfer-encoding; bh=pl6SI2AeW04yS/uJEq/GBEUSM5FiSJYoUTYhFP4Y9WM=; b=YrdPNb9It1wYa3azqxQQpQaxXoksIaIL7k0NIrsYKORmAL1LdbKSkhB7J/mXcuIhOa QkATp8InWcWiEH5gOHxnu7h5cuQtvn57uoHIAkLRa9oN/6PTPRHWoL+wa613s8P27LlI 3eH59DEv2lOKPYyOM9hCLXaqT2Anzad+OQnnnNUJ4JRHT0lRL4exRLdQt3ShA2lFGYe1 kjOl8OdA4NXx6R6mP7EvgFmrB/Ajq4GXqEz4Mgn+yW+ZGq4GDIvxRnQWY52X+zebBVP5 cLQrWmURcRJtoL5dKlHTi6cu7qvWjqvYTxL3dWIQPd8sgBMgzXzNXsAE0nRtil30MAy7 gnlQ== X-Gm-Message-State: ALoCoQk/X8pGLfo+8Z4P0RRIR/YIUFVFyhiz8G2pSbyN/E46iVlDjPvVXkI+yG8Bfokqxj2T9BHZmQz0iyvyvGHA4gbnd0GXDg== X-Received: by 10.194.156.199 with SMTP id wg7mr142007709wjb.114.1452617371823; Tue, 12 Jan 2016 08:49:31 -0800 (PST) Received: from ernst.home (p578E3BF4.dip0.t-ipconnect.de. [87.142.59.244]) by smtp.gmail.com with ESMTPSA id cv10sm74654930wjb.17.2016.01.12.08.49.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jan 2016 08:49:30 -0800 (PST) Date: Tue, 12 Jan 2016 17:49:30 +0100 From: Gary Jennejohn To: Joel Dahl Cc: Sepherosa Ziehau , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r293720 - head/sys/dev/hyperv/netvsc Message-ID: <20160112174930.679dc4d4@ernst.home> In-Reply-To: <20160112075525.GA38087@ymer.vnode.se> References: <201601120141.u0C1fYbC080237@repo.freebsd.org> <20160112075525.GA38087@ymer.vnode.se> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 16:49:34 -0000 On Tue, 12 Jan 2016 08:55:25 +0100 Joel Dahl wrote: > On Tue, Jan 12, 2016 at 01:41:34AM +0000, Sepherosa Ziehau wrote: > > Author: sephe > > Date: Tue Jan 12 01:41:34 2016 > > New Revision: 293720 > > URL: https://svnweb.freebsd.org/changeset/base/293720 > > > > Log: > > hyperv/hn: Implement SIOC[SG]IFMEDIA support > > > > Many applications and kernel modules (e.g. bridge) rely on the ifmedia > > status report; give them what they want. > > > > Submitted by: Dexuan Cui > > Reviewed by: Jun Su , me, adrian > > Modified by: me (minor) > ^^^^^^^^^^^^^^^ Really? > > % finger me@freebsd.org > [freebsd.org] > Trying 8.8.178.110... > Login: me Name: Michael Elbel > Directory: /home/me Shell: /usr/local/bin/bash > No Mail. > Mail forwarded to: > me@consol.de > # me > No Plan. > Michael has been in the password file since the early 1990s when jkh added him and a number of other friends/colleagues from his days in Germany, including myself (gj@, but I had a commit bit at one time). Michael never had a commit bit and I doubt that he's even logged into freefall for years. Maybe his name should be changed to melbel, which would eliminate the me/me@ kerfuffle. -- Gary Jennejohn From owner-svn-src-head@freebsd.org Tue Jan 12 17:28:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC5A3A6DABE; Tue, 12 Jan 2016 17:28:18 +0000 (UTC) (envelope-from jordanhubbard@icloud.com) Received: from pv33p03im-asmtp002.me.com (pv33p03im-asmtp002.me.com [17.143.180.11]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C27581105; Tue, 12 Jan 2016 17:28:18 +0000 (UTC) (envelope-from jordanhubbard@icloud.com) Received: from [10.2.200.126] (mobile-166-171-251-094.mycingular.net [166.171.251.94]) by pv33p03im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O0U00KWCOIPZ040@pv33p03im-asmtp002.me.com>; Tue, 12 Jan 2016 17:28:04 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-01-12_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1601120314 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (1.0) Subject: Re: svn commit: r293720 - head/sys/dev/hyperv/netvsc From: Jordan Hubbard X-Mailer: iPhone Mail (13C75) In-reply-to: <20160112174930.679dc4d4@ernst.home> Date: Tue, 12 Jan 2016 09:28:00 -0800 Cc: Joel Dahl , Sepherosa Ziehau , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-transfer-encoding: 7bit Message-id: <697A2815-F0F0-457B-8E3F-3F9BD2C87B09@icloud.com> References: <201601120141.u0C1fYbC080237@repo.freebsd.org> <20160112075525.GA38087@ymer.vnode.se> <20160112174930.679dc4d4@ernst.home> To: gljennjohn@gmail.com X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 17:28:19 -0000 Or hellsbells. :-) Sent from my iPhone > On Jan 12, 2016, at 08:49, Gary Jennejohn wrote: > > > Maybe his name should be changed to melbel, which would eliminate > the me/me@ kerfuffle. From owner-svn-src-head@freebsd.org Tue Jan 12 17:31:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 308E4A6DBE0; Tue, 12 Jan 2016 17:31:28 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [66.135.54.68]) by mx1.freebsd.org (Postfix) with ESMTP id 18D091750; Tue, 12 Jan 2016 17:31:27 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: by mail.soaustin.net (Postfix, from userid 502) id B78F156085; Tue, 12 Jan 2016 11:31:26 -0600 (CST) Date: Tue, 12 Jan 2016 11:31:26 -0600 From: Mark Linimon To: Gary Jennejohn Cc: Joel Dahl , svn-src-head@freebsd.org, Sepherosa Ziehau , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r293720 - head/sys/dev/hyperv/netvsc Message-ID: <20160112173126.GA32215@lonesome.com> References: <201601120141.u0C1fYbC080237@repo.freebsd.org> <20160112075525.GA38087@ymer.vnode.se> <20160112174930.679dc4d4@ernst.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160112174930.679dc4d4@ernst.home> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 17:31:28 -0000 On Tue, Jan 12, 2016 at 05:49:30PM +0100, Gary Jennejohn wrote: > Maybe his name should be changed to melbel, which would eliminate > the me/me@ kerfuffle. Or just start using the convention 'self' in commits. mcl From owner-svn-src-head@freebsd.org Tue Jan 12 17:37:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F7C0A6DDE6; Tue, 12 Jan 2016 17:37:40 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ob0-x22b.google.com (mail-ob0-x22b.google.com [IPv6:2607:f8b0:4003:c01::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 063CB1C2B; Tue, 12 Jan 2016 17:37:40 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ob0-x22b.google.com with SMTP id py5so65320639obc.2; Tue, 12 Jan 2016 09:37:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FnYP8TJHZt1lSedGH1dCDyV1NLO6ONE48gBWYIN6XdQ=; b=ueN1Of7n5eDmY/1WNtsLpIWblrTbPzAK8fxJ++Uh54ex73sGz0o4CoR2CQ0ugx4upf AN5FK5L9uk1uGn+9aQZXKb73Zwp7ZJJIHSajKITlthAkO8+s4eYQtnzyKE41CYt0Srj5 j6Qy4ziKGzoMlZesu5uAFv0t4qga3XI+6LKfZcN+SvM7JnHgCV77f56Y820em3IHt1y1 8mtrJlDatYGoVNb6XbDPNVCtFnxVE5ghz/MRZGjmaPYJLOBPtdnxD/CE1RhFn40DeDl2 /Hk50pPeXlfOGzHNM0swYN/r76q2W4jjjczqjvNCjwKgefI85DN4/OQmZRagFRjCWRcc ncPA== X-Received: by 10.60.95.131 with SMTP id dk3mr103691546oeb.78.1452620259332; Tue, 12 Jan 2016 09:37:39 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:b980:6bbd:8e63:84c0? ([2601:601:800:126d:b980:6bbd:8e63:84c0]) by smtp.gmail.com with ESMTPSA id i8sm54702592obt.3.2016.01.12.09.37.36 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jan 2016 09:37:37 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293720 - head/sys/dev/hyperv/netvsc From: NGie Cooper In-Reply-To: <1452609005.46848.11.camel@freebsd.org> Date: Tue, 12 Jan 2016 09:37:35 -0800 Cc: Joel Dahl , Sepherosa Ziehau , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5DB49BC5-8B67-4493-8844-D3556D340E10@gmail.com> References: <201601120141.u0C1fYbC080237@repo.freebsd.org> <20160112075525.GA38087@ymer.vnode.se> <1452609005.46848.11.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 17:37:40 -0000 > On Jan 12, 2016, at 06:30, Ian Lepore wrote: =E2=80=A6 > Really? You're complaining about the committer using the personal > pronoun that refers to one's self in a context of referring to = himself? >=20 > Do we really, as a project, have nothing better to do than this = endless > nitpicking at the metadata in commit messages? Xin called me out on it several months ago, and I agree: if I = have to MFC someone=E2=80=99s change, it=E2=80=99s better when it says = the committers handle as opposed to =E2=80=9Cme=E2=80=9D. Not everyone = speaks English after all... Thanks, -NGie= From owner-svn-src-head@freebsd.org Tue Jan 12 18:42:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CFF5A80932; Tue, 12 Jan 2016 18:42:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CA151177; Tue, 12 Jan 2016 18:42:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CIg1pH021186; Tue, 12 Jan 2016 18:42:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CIg05i021181; Tue, 12 Jan 2016 18:42:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601121842.u0CIg05i021181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 12 Jan 2016 18:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293781 - in head: share/man/man4 sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 18:42:02 -0000 Author: ian Date: Tue Jan 12 18:42:00 2016 New Revision: 293781 URL: https://svnweb.freebsd.org/changeset/base/293781 Log: Restore uart PPS signal capture polarity to its historical norm, and add an option to invert the polarity in software. Also add an option to capture very narrow pulses by using the hardware's MSR delta-bit capability of latching line state changes. This effectively reverts the mistake I made in r286595 which was based on empirical measurements made on hardware using TTL-level signaling, in which the logic levels are inverted from RS-232. Thus, this re-syncs the polarity with the requirements of RFC 2783, which is writen in terms of RS-232 signaling. Narrow-pulse mode uses the ability of most ns8250 and similar chips to provide a delta indication in the modem status register. The hardware is able to notice and latch the change when the pulse width is shorter than interrupt latency, which results in the signal no longer being asserted by time the interrupt service code runs. When running in this mode we get notified only that "a pulse happened" so the driver synthesizes both an ASSERT and a CLEAR event (with the same timestamp for each). When the pulse width is about equal to the interrupt latency the driver may intermittantly see both edges of the pulse. To prevent generating spurious events, the driver implements a half-second lockout period after generating an event before it will generate another. Differential Revision: https://reviews.freebsd.org/D4477 Added: head/sys/dev/uart/uart_ppstypes.h (contents, props changed) Modified: head/share/man/man4/uart.4 head/sys/dev/uart/uart_bus.h head/sys/dev/uart/uart_core.c head/sys/dev/uart/uart_dev_ns8250.c Modified: head/share/man/man4/uart.4 ============================================================================== --- head/share/man/man4/uart.4 Tue Jan 12 18:33:53 2016 (r293780) +++ head/share/man/man4/uart.4 Tue Jan 12 18:42:00 2016 (r293781) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2015 +.Dd December 9, 2015 .Dt UART 4 .Os .Sh NAME @@ -160,7 +160,9 @@ The API, accessed via is available on the tty device. To use the PPS capture feature with .Xr ntpd 8 , -symlink the tty device to +symlink the tty callout device +.Va /dev/cuau? +to .Va /dev/pps0. .Pp The @@ -175,15 +177,54 @@ it can be set in .Xr loader.conf 5 or .Xr sysctl.conf 5 . +.Pp The following capture modes are available: .Bl -tag -compact -offset "mmmm" -width "mmmm" -.It 0 +.It 0x00 Capture disabled. -.It 1 +.It 0x01 Capture pulses on the CTS line. -.It 2 -Capture pulses on the DCD line (default). +.It 0x02 +Capture pulses on the DCD line. .El +.Pp +The following values may be ORed with the capture mode to configure +capture processing options: +.Bl -tag -compact -offset "mmmm" -width "mmmm" +.It 0x10 +Invert the pulse (RS-232 logic low = ASSERT, high = CLEAR). +.It 0x20 +Attempt to capture narrow pulses. +.El +.Pp +Add the narrow pulse option when the incoming PPS pulse width is small +enough to prevent reliable capture in normal mode. +In narrow mode the driver uses the hardware's ability to latch a line +state change; not all hardware has this capability. +The hardware latch provides a reliable indication that a pulse occurred, +but prevents distinguishing between the CLEAR and ASSERT edges of the pulse. +For each detected pulse, the driver synthesizes both an ASSERT and a CLEAR +event, using the same timestamp for each. +To prevent spurious events when the hardware is intermittently able to +see both edges of a pulse, the driver will not generate a new pair of +events within a half second of the prior pair. +Both normal and narrow pulse modes work with +.Xr ntpd 8 . +.Pp +Add the invert option when the connection to the uart device uses TTL +level signals, or when the PPS source emits inverted pulses. +RFC 2783 defines an ASSERT event as a higher-voltage line level, and a CLEAR +event as a lower-voltage line level, in the context of the RS-232 protocol. +The modem control signals on a TTL-level connection are typically +inverted from the RS-232 levels. +For example, carrier presence is indicated by a high signal on an RS-232 +DCD line, and by a low signal on a TTL DCD line. +This is due to the use of inverting line driver buffers to convert between +TTL and RS-232 line levels in most hardware designs. +Generally speaking, a connection to a DB-9 style connector is an RS-232 +level signal at up to 12 volts. +A connection to header pins or an edge-connector on an embedded board +is typically a TTL signal at 3.3 or 5 volts. .Sh FILES .Bl -tag -width ".Pa /dev/ttyu?.init" -compact .It Pa /dev/ttyu? Modified: head/sys/dev/uart/uart_bus.h ============================================================================== --- head/sys/dev/uart/uart_bus.h Tue Jan 12 18:33:53 2016 (r293780) +++ head/sys/dev/uart/uart_bus.h Tue Jan 12 18:42:00 2016 (r293781) @@ -113,6 +113,7 @@ struct uart_softc { /* Pulse capturing support (PPS). */ struct pps_state sc_pps; int sc_pps_mode; + sbintime_t sc_pps_captime; /* Upper layer data. */ void *sc_softih; Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Tue Jan 12 18:33:53 2016 (r293780) +++ head/sys/dev/uart/uart_core.c Tue Jan 12 18:42:00 2016 (r293781) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "uart_if.h" @@ -70,47 +71,47 @@ static int uart_force_poll; SYSCTL_INT(_debug, OID_AUTO, uart_force_poll, CTLFLAG_RDTUN, &uart_force_poll, 0, "Force UART polling"); -#define PPS_MODE_DISABLED 0 -#define PPS_MODE_CTS 1 -#define PPS_MODE_DCD 2 - static inline int -uart_pps_signal(int pps_mode) +uart_pps_mode_valid(int pps_mode) { + int opt; - switch(pps_mode) { - case PPS_MODE_CTS: - return (SER_CTS); - case PPS_MODE_DCD: - return (SER_DCD); - } - return (0); + switch(pps_mode & UART_PPS_SIGNAL_MASK) { + case UART_PPS_DISABLED: + case UART_PPS_CTS: + case UART_PPS_DCD: + break; + default: + return (false); + } + + opt = pps_mode & UART_PPS_OPTION_MASK; + if ((opt & ~(UART_PPS_INVERT_PULSE | UART_PPS_NARROW_PULSE)) != 0) + return (false); + + return (true); } -static inline int -uart_pps_mode_valid(int pps_mode) + +static void +uart_pps_print_mode(struct uart_softc *sc) { - switch(pps_mode) { - case PPS_MODE_DISABLED: - case PPS_MODE_CTS: - case PPS_MODE_DCD: - return (true); - } - return (false); -} - -static const char * -uart_pps_mode_name(int pps_mode) -{ - switch(pps_mode) { - case PPS_MODE_DISABLED: - return ("disabled"); - case PPS_MODE_CTS: - return ("CTS"); - case PPS_MODE_DCD: - return ("DCD"); - } - return ("invalid"); + device_printf(sc->sc_dev, "PPS capture mode: "); + switch(sc->sc_pps_mode) { + case UART_PPS_DISABLED: + printf("disabled"); + case UART_PPS_CTS: + printf("CTS"); + case UART_PPS_DCD: + printf("DCD"); + default: + printf("invalid"); + } + if (sc->sc_pps_mode & UART_PPS_INVERT_PULSE) + printf("-Inverted"); + if (sc->sc_pps_mode & UART_PPS_NARROW_PULSE) + printf("-NarrowPulse"); + printf("\n"); } static int @@ -131,6 +132,55 @@ uart_pps_mode_sysctl(SYSCTL_HANDLER_ARGS } static void +uart_pps_process(struct uart_softc *sc, int ser_sig) +{ + sbintime_t now; + int is_assert, pps_sig; + + /* Which signal is configured as PPS? Early out if none. */ + switch(sc->sc_pps_mode & UART_PPS_SIGNAL_MASK) { + case UART_PPS_CTS: + pps_sig = SER_CTS; + break; + case UART_PPS_DCD: + pps_sig = SER_DCD; + break; + default: + return; + } + + /* Early out if there is no change in the signal configured as PPS. */ + if ((ser_sig & SER_DELTA(pps_sig)) == 0) + return; + + /* + * In narrow-pulse mode we need to synthesize both capture and clear + * events from a single "delta occurred" indication from the uart + * hardware because the pulse width is too narrow to reliably detect + * both edges. However, when the pulse width is close to our interrupt + * processing latency we might intermittantly catch both edges. To + * guard against generating spurious events when that happens, we use a + * separate timer to ensure at least half a second elapses before we + * generate another event. + */ + pps_capture(&sc->sc_pps); + if (sc->sc_pps_mode & UART_PPS_NARROW_PULSE) { + now = getsbinuptime(); + if (now > sc->sc_pps_captime + 500 * SBT_1MS) { + sc->sc_pps_captime = now; + pps_event(&sc->sc_pps, PPS_CAPTUREASSERT); + pps_event(&sc->sc_pps, PPS_CAPTURECLEAR); + } + } else { + is_assert = ser_sig & pps_sig; + if (sc->sc_pps_mode & UART_PPS_INVERT_PULSE) + is_assert = !is_assert; + pps_event(&sc->sc_pps, is_assert ? PPS_CAPTUREASSERT : + PPS_CAPTURECLEAR); + } +} + +static void uart_pps_init(struct uart_softc *sc) { struct sysctl_ctx_list *ctx; @@ -147,23 +197,23 @@ uart_pps_init(struct uart_softc *sc) * for one specific device. */ #ifdef UART_PPS_ON_CTS - sc->sc_pps_mode = PPS_MODE_CTS; + sc->sc_pps_mode = UART_PPS_CTS; #else - sc->sc_pps_mode = PPS_MODE_DCD; + sc->sc_pps_mode = UART_PPS_DCD; #endif TUNABLE_INT_FETCH("hw.uart.pps_mode", &sc->sc_pps_mode); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "pps_mode", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, uart_pps_mode_sysctl, "I", - "pulse capturing mode - 0/1/2 - disabled/CTS/DCD"); + "pulse mode: 0/1/2=disabled/CTS/DCD; " + "add 0x10 to invert, 0x20 for narrow pulse"); if (!uart_pps_mode_valid(sc->sc_pps_mode)) { device_printf(sc->sc_dev, - "Invalid pps_mode %d configured; disabling PPS capture\n", + "Invalid pps_mode 0x%02x configured; disabling PPS capture\n", sc->sc_pps_mode); - sc->sc_pps_mode = PPS_MODE_DISABLED; + sc->sc_pps_mode = UART_PPS_DISABLED; } else if (bootverbose) { - device_printf(sc->sc_dev, "PPS capture mode %d (%s)\n", - sc->sc_pps_mode, uart_pps_mode_name(sc->sc_pps_mode)); + uart_pps_print_mode(sc); } sc->sc_pps.ppscap = PPS_CAPTUREBOTH; @@ -313,23 +363,16 @@ static __inline int uart_intr_sigchg(void *arg) { struct uart_softc *sc = arg; - int new, old, pps_sig, sig; + int new, old, sig; sig = UART_GETSIG(sc); /* - * Time pulse counting support. Note that both CTS and DCD are - * active-low signals. The status bit is high to indicate that - * the signal on the line is low, which corresponds to a PPS - * clear event. + * Time pulse counting support, invoked whenever the PPS parameters are + * currently set to capture either edge of the signal. */ if (sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) { - pps_sig = uart_pps_signal(sc->sc_pps_mode); - if (sig & SER_DELTA(pps_sig)) { - pps_capture(&sc->sc_pps); - pps_event(&sc->sc_pps, (sig & pps_sig) ? - PPS_CAPTURECLEAR : PPS_CAPTUREASSERT); - } + uart_pps_process(sc, sig); } /* Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Tue Jan 12 18:33:53 2016 (r293780) +++ head/sys/dev/uart/uart_dev_ns8250.c Tue Jan 12 18:42:00 2016 (r293781) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #include @@ -401,11 +402,40 @@ static struct ofw_compat_data compat_dat UART_FDT_CLASS_AND_DEVICE(compat_data); #endif -#define SIGCHG(c, i, s, d) \ - if (c) { \ - i |= (i & s) ? s : s | d; \ - } else { \ - i = (i & s) ? (i & ~s) | d : i; \ +/* Use token-pasting to form SER_ and MSR_ named constants. */ +#define SER(sig) SER_##sig +#define SERD(sig) SER_D##sig +#define MSR(sig) MSR_##sig +#define MSRD(sig) MSR_D##sig + +/* + * Detect signal changes using software delta detection. The previous state of + * the signals is in 'var' the new hardware state is in 'msr', and 'sig' is the + * short name (DCD, CTS, etc) of the signal bit being processed; 'var' gets the + * new state of both the signal and the delta bits. + */ +#define SIGCHGSW(var, msr, sig) \ + if ((msr) & MSR(sig)) { \ + if ((var & SER(sig)) == 0) \ + var |= SERD(sig) | SER(sig); \ + } else { \ + if ((var & SER(sig)) != 0) \ + var = SERD(sig) | (var & ~SER(sig)); \ + } + +/* + * Detect signal changes using the hardware msr delta bits. This is currently + * used only when PPS timing information is being captured using the "narrow + * pulse" option. With a narrow PPS pulse the signal may not still be asserted + * by time the interrupt handler is invoked. The hardware will latch the fact + * that it changed in the delta bits. + */ +#define SIGCHGHW(var, msr, sig) \ + if ((msr) & MSRD(sig)) { \ + if (((msr) & MSR(sig)) != 0) \ + var |= SERD(sig) | SER(sig); \ + else \ + var = SERD(sig) | (var & ~SER(sig)); \ } int @@ -532,21 +562,37 @@ ns8250_bus_flush(struct uart_softc *sc, int ns8250_bus_getsig(struct uart_softc *sc) { - uint32_t new, old, sig; + uint32_t old, sig; uint8_t msr; + /* + * The delta bits are reputed to be broken on some hardware, so use + * software delta detection by default. Use the hardware delta bits + * when capturing PPS pulses which are too narrow for software detection + * to see the edges. Hardware delta for RI doesn't work like the + * others, so always use software for it. Other threads may be changing + * other (non-MSR) bits in sc_hwsig, so loop until it can succesfully + * update without other changes happening. Note that the SIGCHGxx() + * macros carefully preserve the delta bits when we have to loop several + * times and a signal transitions between iterations. + */ do { old = sc->sc_hwsig; sig = old; uart_lock(sc->sc_hwmtx); msr = uart_getreg(&sc->sc_bas, REG_MSR); uart_unlock(sc->sc_hwmtx); - SIGCHG(msr & MSR_DSR, sig, SER_DSR, SER_DDSR); - SIGCHG(msr & MSR_CTS, sig, SER_CTS, SER_DCTS); - SIGCHG(msr & MSR_DCD, sig, SER_DCD, SER_DDCD); - SIGCHG(msr & MSR_RI, sig, SER_RI, SER_DRI); - new = sig & ~SER_MASK_DELTA; - } while (!atomic_cmpset_32(&sc->sc_hwsig, old, new)); + if (sc->sc_pps_mode & UART_PPS_NARROW_PULSE) { + SIGCHGHW(sig, msr, DSR); + SIGCHGHW(sig, msr, CTS); + SIGCHGHW(sig, msr, DCD); + } else { + SIGCHGSW(sig, msr, DSR); + SIGCHGSW(sig, msr, CTS); + SIGCHGSW(sig, msr, DCD); + } + SIGCHGSW(sig, msr, RI); + } while (!atomic_cmpset_32(&sc->sc_hwsig, old, sig & ~SER_MASK_DELTA)); return (sig); } @@ -900,12 +946,10 @@ ns8250_bus_setsig(struct uart_softc *sc, old = sc->sc_hwsig; new = old; if (sig & SER_DDTR) { - SIGCHG(sig & SER_DTR, new, SER_DTR, - SER_DDTR); + new = (new & ~SER_DTR) | (sig & (SER_DTR | SER_DDTR)); } if (sig & SER_DRTS) { - SIGCHG(sig & SER_RTS, new, SER_RTS, - SER_DRTS); + new = (new & ~SER_RTS) | (sig & (SER_RTS | SER_DRTS)); } } while (!atomic_cmpset_32(&sc->sc_hwsig, old, new)); uart_lock(sc->sc_hwmtx); Added: head/sys/dev/uart/uart_ppstypes.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_ppstypes.h Tue Jan 12 18:42:00 2016 (r293781) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2015 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_UART_PPSTYPES_H_ +#define _DEV_UART_PPSTYPES_H_ + +/* + * These constants are shared by several drivers including uart and usb_serial. + */ + +#define UART_PPS_SIGNAL_MASK 0x0f +#define UART_PPS_OPTION_MASK 0xf0 + +#define UART_PPS_DISABLED 0x00 +#define UART_PPS_CTS 0x01 +#define UART_PPS_DCD 0x02 + +#define UART_PPS_INVERT_PULSE 0x10 +#define UART_PPS_NARROW_PULSE 0x20 + +#endif /* _DEV_UART_PPSTYPES_H_ */ From owner-svn-src-head@freebsd.org Tue Jan 12 20:43:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38EACA6D9CC for ; Tue, 12 Jan 2016 20:43:24 +0000 (UTC) (envelope-from bounces+73574-9504-svn-src-head=freebsd.org@sendgrid.net) Received: from o3.shared.sendgrid.net (o3.shared.sendgrid.net [208.117.48.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E96F411A1 for ; Tue, 12 Jan 2016 20:43:23 +0000 (UTC) (envelope-from bounces+73574-9504-svn-src-head=freebsd.org@sendgrid.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=subject:to:references:from:mime-version:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=EQtw6vzm/6S0Z/DC3prCRgdWMxo=; b=LiSAobmqKfYbFNitU2 rhxMcZP5P0z8aDjrzdECytagvP49fRDa1vTGAmVvbwBm8a/NzOGg1p+T94pEC8cf 5YG5vcHT3F4y4uBHtgwDyxiCVQoTM2OVeqsJnB7tI7QuQmiDv9D1bhAeobLsmpno pS3Y0znz7ExK8t0qLyheCs99k= Received: by filter0406p1mdw1.sendgrid.net with SMTP id filter0406p1mdw1.12969.5695655C21 2016-01-12 20:43:08.315387997 +0000 UTC Received: from mail.tarsnap.com (ec2-54-86-246-204.compute-1.amazonaws.com [54.86.246.204]) by ismtpd0002p1iad1.sendgrid.net (SG) with ESMTP id xJoKf3_QTGCQiAnOa-LjPQ for ; Tue, 12 Jan 2016 20:43:08.349 +0000 (UTC) Received: (qmail 73628 invoked from network); 12 Jan 2016 20:40:44 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 12 Jan 2016 20:40:44 -0000 Received: (qmail 10528 invoked from network); 12 Jan 2016 20:42:09 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 12 Jan 2016 20:42:09 -0000 Subject: Re: svn commit: r293739 - head/release To: koobs@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601120942.u0C9gMHX024301@repo.freebsd.org> <5694D60D.5050404@FreeBSD.org> From: Colin Percival Message-ID: <56956521.7060107@freebsd.org> Date: Tue, 12 Jan 2016 12:42:09 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <5694D60D.5050404@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SG-EID: EvYvoie/qnEezyq2t4eRKjDm9X7ZKbCMt75WvXA+XNEVfF3HLhUEFu1VsKUR1m0lJSXprbCvuukAPz g1sz4eNfkQd9KPYFZiq6h5Jf2oe1WcH5LCBzFhSHyO4JWkRWN1XG1sRxFfXaPQmT4G4LlWsa72Cs3u KeJCiJ7A9khvQtcpDi6MS8vsR7otaqJDnaSGYqNQF9VFOYMmRDnFkKQdLbfPynNdzY4fo+HZmL/HOb g= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 20:43:24 -0000 On 01/12/16 02:31, Kubilay Kocak wrote: > On 12/01/2016 8:42 PM, Colin Percival wrote: >> Author: cperciva >> Date: Tue Jan 12 09:42:21 2016 >> New Revision: 293739 >> URL: https://svnweb.freebsd.org/changeset/base/293739 >> >> Log: >> Enable "EC2 Enhanced Networking" (aka. SR-IOV networking) when creating >> EC2 images. >> >> X-MFC after: if/when the driver fixes get MFCed > > Is there a Bugzilla issue reference for this (or the head changeset)? The commit which finally got this working was r293338, but my understanding is that there are lots of earlier driver updates too. Approximately all of sys/dev/ixgbe will need to be MFCed, I think. References: https://reviews.freebsd.org/D4788 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202983 -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Tue Jan 12 20:53:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31261A80053; Tue, 12 Jan 2016 20:53:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D82681DAF; Tue, 12 Jan 2016 20:53:58 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0CKrvol060661; Tue, 12 Jan 2016 20:53:57 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0CKrvmB060658; Tue, 12 Jan 2016 20:53:57 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601122053.u0CKrvmB060658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 12 Jan 2016 20:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293783 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 20:53:59 -0000 Author: jilles Date: Tue Jan 12 20:53:57 2016 New Revision: 293783 URL: https://svnweb.freebsd.org/changeset/base/293783 Log: Update futimens/utimensat for MFC to stable/10: * Fix __FreeBSD_version check. * Update history section in man page. An MFC of this commit to stable/10 will allow using the new system calls instead of the fallback. MFC after: 3 days Modified: head/lib/libc/sys/futimens.c head/lib/libc/sys/utimensat.2 head/lib/libc/sys/utimensat.c Modified: head/lib/libc/sys/futimens.c ============================================================================== --- head/lib/libc/sys/futimens.c Tue Jan 12 19:33:43 2016 (r293782) +++ head/lib/libc/sys/futimens.c Tue Jan 12 20:53:57 2016 (r293783) @@ -42,8 +42,11 @@ futimens(int fd, const struct timespec t { struct timeval now, tv[2], *tvp; struct stat sb; + int osreldate; - if (__getosreldate() >= 1100056) + osreldate = __getosreldate(); + if (osreldate >= 1100056 || + (osreldate >= 1002506 && osreldate < 1100000)) return (__sys_futimens(fd, times)); if (times == NULL || (times[0].tv_nsec == UTIME_NOW && Modified: head/lib/libc/sys/utimensat.2 ============================================================================== --- head/lib/libc/sys/utimensat.2 Tue Jan 12 19:33:43 2016 (r293782) +++ head/lib/libc/sys/utimensat.2 Tue Jan 12 20:53:57 2016 (r293783) @@ -31,7 +31,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 23, 2015 +.Dd January 12, 2016 .Dt UTIMENSAT 2 .Os .Sh NAME @@ -289,4 +289,4 @@ The and .Fn utimensat system calls appeared in -.Fx 11.0 . +.Fx 10.3 . Modified: head/lib/libc/sys/utimensat.c ============================================================================== --- head/lib/libc/sys/utimensat.c Tue Jan 12 19:33:43 2016 (r293782) +++ head/lib/libc/sys/utimensat.c Tue Jan 12 20:53:57 2016 (r293783) @@ -42,8 +42,11 @@ utimensat(int fd, const char *path, cons { struct timeval now, tv[2], *tvp; struct stat sb; + int osreldate; - if (__getosreldate() >= 1100056) + osreldate = __getosreldate(); + if (osreldate >= 1100056 || + (osreldate >= 1002506 && osreldate < 1100000)) return (__sys_utimensat(fd, path, times, flag)); if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) { From owner-svn-src-head@freebsd.org Tue Jan 12 21:23:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39222A80C20; Tue, 12 Jan 2016 21:23:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com [IPv6:2a00:1450:4010:c07::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC67F125D; Tue, 12 Jan 2016 21:23:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lf0-x232.google.com with SMTP id c192so243215622lfe.2; Tue, 12 Jan 2016 13:23:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=fegQV3ruXT0yywpVzxHNUcXoY7SF/bSF1daOGNVjykA=; b=vVkhQT9VikhbvZR+jHhSKAzh5gtdFhGq0ThkneSHS8lwoTi4wZzLUqVvVd8N246WNF mbQR+GARKbW1ptnW3pAxx3rMTjEq+x4EYusnX7mY7gbB9fOqa1i1yeQswe+LzQJzmilv w8JbSFizXviT5qTnvaNl5QDdip8A0iP5WeiGnwwll3BFpQJA9igCviiG2onNpr61JxVO VwWOS7P/EJzf23rt9uLohioylMWzfLebzICvoamr07MFt75zbfKTjh3vG3St+UkG+Kft 32hmXjIvjsVnK0njEo7e8kM0fM9Z43Tj0SCccBEdW5XksL7tBk0b495wOsIxZTWPxSky aKMQ== MIME-Version: 1.0 X-Received: by 10.25.16.30 with SMTP id f30mr40627024lfi.21.1452633797733; Tue, 12 Jan 2016 13:23:17 -0800 (PST) Received: by 10.112.160.133 with HTTP; Tue, 12 Jan 2016 13:23:17 -0800 (PST) In-Reply-To: <56956521.7060107@freebsd.org> References: <201601120942.u0C9gMHX024301@repo.freebsd.org> <5694D60D.5050404@FreeBSD.org> <56956521.7060107@freebsd.org> Date: Tue, 12 Jan 2016 13:23:17 -0800 Message-ID: Subject: Re: svn commit: r293739 - head/release From: NGie Cooper To: Colin Percival Cc: "koobs@freebsd.org" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 21:23:20 -0000 On Tue, Jan 12, 2016 at 12:42 PM, Colin Percival wrote: > On 01/12/16 02:31, Kubilay Kocak wrote: >> On 12/01/2016 8:42 PM, Colin Percival wrote: >>> Author: cperciva >>> Date: Tue Jan 12 09:42:21 2016 >>> New Revision: 293739 >>> URL: https://svnweb.freebsd.org/changeset/base/293739 >>> >>> Log: >>> Enable "EC2 Enhanced Networking" (aka. SR-IOV networking) when creating >>> EC2 images. >>> >>> X-MFC after: if/when the driver fixes get MFCed >> >> Is there a Bugzilla issue reference for this (or the head changeset)? > > The commit which finally got this working was r293338, but my understanding > is that there are lots of earlier driver updates too. Approximately all of > sys/dev/ixgbe will need to be MFCed, I think. > > References: > https://reviews.freebsd.org/D4788 > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202983 This also needs to be done in order for the ixgbe/ixv split to be backported: https://reviews.freebsd.org/D4767 (it's a doosey...). Thanks! -NGie From owner-svn-src-head@freebsd.org Tue Jan 12 22:49:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D928AA6D6C6 for ; Tue, 12 Jan 2016 22:49:12 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7680F1EEF for ; Tue, 12 Jan 2016 22:49:12 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22f.google.com with SMTP id f206so344435823wmf.0 for ; Tue, 12 Jan 2016 14:49:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=woks5d2wuFtctd5ODaEB9Mq9qSCD1AmrEirPXRFw3G0=; b=hcQwrvGYOzNL4dIz4IEPrwq+4ToMWPXHQDnmUufyA2w9Ei/EyupbpmKMrICRIr3Ufx F5nJ3mOfL6jbRenmqVIeYb3eV57FhkugUJFrvhJMHOcjvTrcFmNJ+LwGA+ZGaOr9F/O9 JR4KQwbhpo4SXGKJtrJ3U1QdYxu8lU9xXLtSTqdd/k1U9x3uAyCDk0mohNGxULiihL3h 2siQJiJwRRO9vd9wL14gr2/m+s8l+ofwjscXBg+VCH7AldhsyNfJ534NHsf23yOSONzY t1GuBEvESCcaEHvAm1DbOVQ+jhob1ThYp55GEQgHmVeQDWfniKDwSLCfNRNHUcz8Y27Y LPNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=woks5d2wuFtctd5ODaEB9Mq9qSCD1AmrEirPXRFw3G0=; b=i381hm3JggiR636+BRpAvtFDQMNti1fNaIDvqYYowdrghcICMHnMGs/lWCBKnYgOET WeBr8PK7CaxWu6Tw0SnvlWcU5/9G5nOZrLBs0aL4rDfKMe6DqjAtaL9/xZ65aOptv8lw gYdJ8jaB3EF4FYKPx/yPsALlmKVXbZSVzkFCSzt6nzaHwurVX0GONAJMofspPS/1B7R8 sFjPCXYu0Fte6XH8ILRxX6b7asOG26Vnf6XU1fprf86ygBXiVnKQqkn1cLj/Bx++nNPy mzWNHh912A8XXfm+PhbMOL9YNYfgLEBsZxPOZ4zevPvnTl/ztqgk/+0zqXlsYPwRXqaF df0A== X-Gm-Message-State: ALoCoQl1O2IkVgOAai/l82MeYWv6QGEvVUTQffNZtA4rbrCRZ+IJtCzCITK3yW3z053DvX78MlTUtfNJqBefo1RkkFJtSdPghw== X-Received: by 10.28.224.212 with SMTP id x203mr22814590wmg.29.1452638950970; Tue, 12 Jan 2016 14:49:10 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id av8sm51568149wjc.13.2016.01.12.14.49.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jan 2016 14:49:09 -0800 (PST) Subject: Re: svn commit: r293775 - head/sys/boot/uboot/lib To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601121631.u0CGV7v6074494@repo.freebsd.org> From: Steven Hartland Message-ID: <569582F6.4060108@multiplay.co.uk> Date: Tue, 12 Jan 2016 22:49:26 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201601121631.u0CGV7v6074494@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 22:49:13 -0000 I think this breaks arm arches: /usr/home/smh/freebsd/base/head1/sys/boot/uboot/lib/copy.c:103:24: error: use of undeclared identifier 'uintfptr_t' subldr = rounddown2((uintfptr_t)_start, KERN_ALIGN); ^ /usr/home/smh/freebsd/base/head1/sys/boot/uboot/lib/../../../sys/param.h:295:28: note: expanded from macro 'rounddown2' #define rounddown2(x, y) ((x)&(~((y)-1))) /* if y is power of two */ On 12/01/2016 16:31, Ian Lepore wrote: > Author: ian > Date: Tue Jan 12 16:31:07 2016 > New Revision: 293775 > URL: https://svnweb.freebsd.org/changeset/base/293775 > > Log: > Cast using uintfptr_t and eliminate the cast to uint64_t which is uneeded > because rounding down cannot increase the number of bits needed to express > the result. > > I had no idea there was such a thing as uintfptr_t. > > Requested by: bde > > Modified: > head/sys/boot/uboot/lib/copy.c > > Modified: head/sys/boot/uboot/lib/copy.c > ============================================================================== > --- head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:21:34 2016 (r293774) > +++ head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:31:07 2016 (r293775) > @@ -100,7 +100,7 @@ uboot_loadaddr(u_int type, void *data, u > > biggest_block = 0; > biggest_size = 0; > - subldr = rounddown2((uint64_t)(uintptr_t)_start, KERN_ALIGN); > + subldr = rounddown2((uintfptr_t)_start, KERN_ALIGN); > eubldr = roundup2((uint64_t)uboot_heap_end, KERN_ALIGN); > for (i = 0; i < si->mr_no; i++) { > if (si->mr[i].flags != MR_ATTR_DRAM) > From owner-svn-src-head@freebsd.org Wed Jan 13 00:22:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE4D3A6DDC7; Wed, 13 Jan 2016 00:22:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2BE91B76; Wed, 13 Jan 2016 00:22:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D0MCgT029300; Wed, 13 Jan 2016 00:22:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D0MCWu029299; Wed, 13 Jan 2016 00:22:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601130022.u0D0MCWu029299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 13 Jan 2016 00:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293792 - head/sys/boot/uboot/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 00:22:14 -0000 Author: ian Date: Wed Jan 13 00:22:12 2016 New Revision: 293792 URL: https://svnweb.freebsd.org/changeset/base/293792 Log: Go back to using uintptr_t, because code that actually compiles is infinitely less buggy than code that is theoretically correct in some alternate universe. The uintfptr_t type is apparently a freebsd invention, and exists only when compiling the kernel. It's a little hard to say for sure, since it doesn't seem to be documented anywhere except in email advice to unsuspecting and overly-trusting souls, who then get to wear the pointy hat for blindly following advice without investigating or testing it first. Modified: head/sys/boot/uboot/lib/copy.c Modified: head/sys/boot/uboot/lib/copy.c ============================================================================== --- head/sys/boot/uboot/lib/copy.c Tue Jan 12 23:48:39 2016 (r293791) +++ head/sys/boot/uboot/lib/copy.c Wed Jan 13 00:22:12 2016 (r293792) @@ -100,7 +100,7 @@ uboot_loadaddr(u_int type, void *data, u biggest_block = 0; biggest_size = 0; - subldr = rounddown2((uintfptr_t)_start, KERN_ALIGN); + subldr = rounddown2((uintptr_t)_start, KERN_ALIGN); eubldr = roundup2((uint64_t)uboot_heap_end, KERN_ALIGN); for (i = 0; i < si->mr_no; i++) { if (si->mr[i].flags != MR_ATTR_DRAM) From owner-svn-src-head@freebsd.org Wed Jan 13 00:25:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8DA6A6DF3E for ; Wed, 13 Jan 2016 00:25:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD1291D7C for ; Wed, 13 Jan 2016 00:25:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 13 Jan 2016 00:25:54 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0D0PAtC005956; Tue, 12 Jan 2016 17:25:10 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452644710.46848.31.camel@freebsd.org> Subject: Re: svn commit: r293775 - head/sys/boot/uboot/lib From: Ian Lepore To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 12 Jan 2016 17:25:10 -0700 In-Reply-To: <569582F6.4060108@multiplay.co.uk> References: <201601121631.u0CGV7v6074494@repo.freebsd.org> <569582F6.4060108@multiplay.co.uk> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 00:25:19 -0000 On Tue, 2016-01-12 at 22:49 +0000, Steven Hartland wrote: > I think this breaks arm arches: > /usr/home/smh/freebsd/base/head1/sys/boot/uboot/lib/copy.c:103:24: > error: use of undeclared identifier 'uintfptr_t' > subldr = rounddown2((uintfptr_t)_start, KERN_ALIGN); > ^ > /usr/home/smh/freebsd/base/head1/sys/boot/uboot/lib/../../../sys/para > m.h:295:28: > note: expanded from macro 'rounddown2' > #define rounddown2(x, y) ((x)&(~((y)-1))) /* if y is power > of > two */ > Ooops, sorry. Should be fixed now. -- Ian > On 12/01/2016 16:31, Ian Lepore wrote: > > Author: ian > > Date: Tue Jan 12 16:31:07 2016 > > New Revision: 293775 > > URL: https://svnweb.freebsd.org/changeset/base/293775 > > > > Log: > > Cast using uintfptr_t and eliminate the cast to uint64_t which > > is uneeded > > because rounding down cannot increase the number of bits needed > > to express > > the result. > > > > I had no idea there was such a thing as uintfptr_t. > > > > Requested by: bde > > > > Modified: > > head/sys/boot/uboot/lib/copy.c > > > > Modified: head/sys/boot/uboot/lib/copy.c > > =================================================================== > > =========== > > --- head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:21:34 2016 > > (r293774) > > +++ head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:31:07 2016 > > (r293775) > > @@ -100,7 +100,7 @@ uboot_loadaddr(u_int type, void *data, u > > > > biggest_block = 0; > > biggest_size = 0; > > - subldr = rounddown2((uint64_t)(uintptr_t)_start, > > KERN_ALIGN); > > + subldr = rounddown2((uintfptr_t)_start, > > KERN_ALIGN); > > eubldr = roundup2((uint64_t)uboot_heap_end, > > KERN_ALIGN); > > for (i = 0; i < si->mr_no; i++) { > > if (si->mr[i].flags != MR_ATTR_DRAM) > > > > From owner-svn-src-head@freebsd.org Wed Jan 13 00:37:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 082B6A803F4; Wed, 13 Jan 2016 00:37:30 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE929184C; Wed, 13 Jan 2016 00:37:29 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D0bSOL032693; Wed, 13 Jan 2016 00:37:28 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D0bStJ032692; Wed, 13 Jan 2016 00:37:28 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601130037.u0D0bStJ032692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 13 Jan 2016 00:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293796 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 00:37:30 -0000 Author: smh Date: Wed Jan 13 00:37:28 2016 New Revision: 293796 URL: https://svnweb.freebsd.org/changeset/base/293796 Log: Fix typo in libefi.c Fix a typo in libefl.c (removal or L) introduced by r293724 MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/sys/boot/efi/libefi/libefi.c Modified: head/sys/boot/efi/libefi/libefi.c ============================================================================== --- head/sys/boot/efi/libefi/libefi.c Wed Jan 13 00:34:16 2016 (r293795) +++ head/sys/boot/efi/libefi/libefi.c Wed Jan 13 00:37:28 2016 (r293796) @@ -179,7 +179,7 @@ efi_main(EFI_HANDLE image_handle, EFI_SY argv = malloc((argc + 1) * sizeof(CHAR16*)); argc = 0; if (addprog) - argv[argc++] = (CHAR16 *)"loader.efi"; + argv[argc++] = (CHAR16 *)L"loader.efi"; argp = args; while (argp != NULL && *argp != 0) { argp = arg_skipsep(argp); From owner-svn-src-head@freebsd.org Wed Jan 13 00:41:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B5A2A8051A for ; Wed, 13 Jan 2016 00:41:16 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EC531A79 for ; Wed, 13 Jan 2016 00:41:16 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 13 Jan 2016 00:41:45 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0D0f80R005989; Tue, 12 Jan 2016 17:41:08 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452645668.46848.34.camel@freebsd.org> Subject: Re: svn commit: r293724 - in head/sys/boot: arm64/libarm64 common efi/boot1 efi/fdt efi/include efi/include/arm64 efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 i... From: Ian Lepore To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 12 Jan 2016 17:41:08 -0700 In-Reply-To: <201601120217.u0C2HdBC089684@repo.freebsd.org> References: <201601120217.u0C2HdBC089684@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 00:41:16 -0000 On Tue, 2016-01-12 at 02:17 +0000, Steven Hartland wrote: > Author: smh > Date: Tue Jan 12 02:17:39 2016 > New Revision: 293724 > URL: https://svnweb.freebsd.org/changeset/base/293724 > > Log: > Enable warnings in EFI boot code > > Set WARNS if not set for EFI boot code and fix the issues > highlighted by > setting it. > This appears to break arm builds when gcc is the compiler: cc1: warnings being treated as errors In file included from /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../include/efi.h:52, from /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/efi_fdt.c:35: /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../include/efiapi.h:535: warning: function declaration isn't a prototype In file included from /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/efi_fdt.c:39: /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../../common/bootstrap.h:332: warning: redundant redeclaration of 'delay' /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../include/efilib.h:53: warning: previous declaration of 'delay' was here /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../../common/bootstrap.h:336: warning: redundant redeclaration of 'time' /bsdstg/rm92/obj/arm.arm/local/build/staging/freebsd/rm92/src/tmp/usr/include/time.h:154: warning: previous declaration of 'time' was here -- Ian From owner-svn-src-head@freebsd.org Wed Jan 13 00:41:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8429EA80551 for ; Wed, 13 Jan 2016 00:41:27 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BFDD1C04 for ; Wed, 13 Jan 2016 00:41:27 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22e.google.com with SMTP id f206so275630889wmf.0 for ; Tue, 12 Jan 2016 16:41:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=tQc8m8nB5dObgc3WqtJklQ10W/znGGLIRcKmaIarmVA=; b=t825L7X7HvKLF5YIZhn1gt/cjdi1Z1bG/UdliRsIib+rxgKr8ldmij8eafcrDKEtgh LIW8mumbePZ076szpJ3G3msLVT4vWi64YDkvR8JjbvSgweGF/AKbygYMSZVkGYImjvjL Uj7j9wWRP8Trs5QmWqw1ex1AtKcxKKzhc1DC65IMxL8xxweaIrkb0C80Fm2PiG78NQDW PGenDt4p4RF1NlZe5hlFS4eqpNDsyNvWAXcd8H+U1y5xm/CpKaxLlXdqOzz6nKDQoDgu cNdDbw4LwWBm1F1SDYVCuOcbWF8wky4Pa13Rw20bhvGmCXQzdcFSpnuWzitKJHOXzrOs EmgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=tQc8m8nB5dObgc3WqtJklQ10W/znGGLIRcKmaIarmVA=; b=EKDOWjFZsXLpbZoP71jqwHoqvhaQw5RNQGxeYGLGcKm4Nht2psDU1q5cmPlBPbzgLF 912473YKZvT6gj1/Q9J40yyGSWhhafOgO9ZMDEda8l2HbQFkHPpMTSzNqTThoxsJwLTN tu8iv8yQsu6Ni0rrgZlfS6b1gzvw1cTKfJIFycMtPlWuOt2lJqtYIcq1gmv7MosDOdOL ojViR/3jolwbM6pMlnhNNQTvGyLgm5EbqoVLr+yEpV9t7DZ5qKiccqYB0WUyme6WWGes tOHUBrVGBXCfEmxOwGVYixYAcA9KUx6O0UIbnnx5HoDGzXoyhAaLwWpU+J/74+AV4+gg /0FA== X-Gm-Message-State: ALoCoQkpjWay9iVDuKN2W08Rdw5tb/ON3emzDth6FSh61PbXyvpfznTgoC/olhVHSRNyh5TC/xw6Fp2l7zysj94JhaECQkxQRg== X-Received: by 10.194.90.50 with SMTP id bt18mr142501090wjb.118.1452645685029; Tue, 12 Jan 2016 16:41:25 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id da10sm126451046wjb.22.2016.01.12.16.41.23 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jan 2016 16:41:23 -0800 (PST) Subject: Re: svn commit: r293775 - head/sys/boot/uboot/lib To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601121631.u0CGV7v6074494@repo.freebsd.org> <569582F6.4060108@multiplay.co.uk> <1452644710.46848.31.camel@freebsd.org> From: Steven Hartland Message-ID: <56959D45.7070204@multiplay.co.uk> Date: Wed, 13 Jan 2016 00:41:41 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1452644710.46848.31.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 00:41:27 -0000 Was this meant to be a full revert as you now have: subldr = rounddown2((uintptr_t)_start, KERN_ALIGN); vs the original: subldr = rounddown2((uint64_t)(uintptr_t)_start, KERN_ALIGN); i.e. missing the final conversion to uint64_t? On 13/01/2016 00:25, Ian Lepore wrote: > On Tue, 2016-01-12 at 22:49 +0000, Steven Hartland wrote: >> I think this breaks arm arches: >> /usr/home/smh/freebsd/base/head1/sys/boot/uboot/lib/copy.c:103:24: >> error: use of undeclared identifier 'uintfptr_t' >> subldr = rounddown2((uintfptr_t)_start, KERN_ALIGN); >> ^ >> /usr/home/smh/freebsd/base/head1/sys/boot/uboot/lib/../../../sys/para >> m.h:295:28: >> note: expanded from macro 'rounddown2' >> #define rounddown2(x, y) ((x)&(~((y)-1))) /* if y is power >> of >> two */ >> > Ooops, sorry. Should be fixed now. > > -- Ian > >> On 12/01/2016 16:31, Ian Lepore wrote: >>> Author: ian >>> Date: Tue Jan 12 16:31:07 2016 >>> New Revision: 293775 >>> URL: https://svnweb.freebsd.org/changeset/base/293775 >>> >>> Log: >>> Cast using uintfptr_t and eliminate the cast to uint64_t which >>> is uneeded >>> because rounding down cannot increase the number of bits needed >>> to express >>> the result. >>> >>> I had no idea there was such a thing as uintfptr_t. >>> >>> Requested by: bde >>> >>> Modified: >>> head/sys/boot/uboot/lib/copy.c >>> >>> Modified: head/sys/boot/uboot/lib/copy.c >>> =================================================================== >>> =========== >>> --- head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:21:34 2016 >>> (r293774) >>> +++ head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:31:07 2016 >>> (r293775) >>> @@ -100,7 +100,7 @@ uboot_loadaddr(u_int type, void *data, u >>> >>> biggest_block = 0; >>> biggest_size = 0; >>> - subldr = rounddown2((uint64_t)(uintptr_t)_start, >>> KERN_ALIGN); >>> + subldr = rounddown2((uintfptr_t)_start, >>> KERN_ALIGN); >>> eubldr = roundup2((uint64_t)uboot_heap_end, >>> KERN_ALIGN); >>> for (i = 0; i < si->mr_no; i++) { >>> if (si->mr[i].flags != MR_ATTR_DRAM) >>> >> From owner-svn-src-head@freebsd.org Wed Jan 13 00:43:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39E0FA806A7 for ; Wed, 13 Jan 2016 00:43:05 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C43A71EC9 for ; Wed, 13 Jan 2016 00:43:04 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x232.google.com with SMTP id f206so347295323wmf.0 for ; Tue, 12 Jan 2016 16:43:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=xt1b7UbvTSzqEhqSZ/YaHNcM8BLmjf+ugl8aR/ictJk=; b=DYIMGneKVacjnHjaNbvGO3IlzkYK2MeVT58hovN0mwKkyPjJmqU7Q3nLnYlDJICj9q ZQP+qMJm6WjQsgfU4qBkT9f5hdH+JOnygjX07Hw3XFFllrrl/tw6fNeV4PEXFsP5lHrj 0+c5kXr1oTCxtPH8C+Z4KS7P0DKTIEEaGgzG57HB+lTSP0yYm7Kr2Q40a9z/sFUpf9qL QB9Q9DLOC3p6zm52q3iA1sUoSQiHyMaLHJ9jJPqsxkaIRXxHqB8rt/uttJuQMhjiQoTY +P1g3GnkLYQAcUT2HmGFYu1iNuNuZJAmFWlA9/XVGeQNoRo8EkEIA9uQOh+/+/MBF9Yz 7fSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=xt1b7UbvTSzqEhqSZ/YaHNcM8BLmjf+ugl8aR/ictJk=; b=gsUmfNLD7oXWATSuaKlQHjDQDG21emVuiNQEoJqVlS1Hvygfz/wOtymjGy2xxm5YK/ uX73lsVZkmRXW9o3ic6qCKWiZg4SAdvd9OHjaY53dbsf2qIKqW3912ygRnTKp0ytbYkd ibhuMDABlJIl+U963PEvzY9FK89Qf7AwGz7H9B00nCKIZrPaeiz7MEDvEhKwPAPEEYR6 /eLuGn/eR6nl6N+CryyRum3zuuveKJ+gulMQuuIRrgNPYonc3Lt2zCYCdQNNflMXnvh/ CD6NAYZXg2ifwyDcrv6Q8I4VCJs11bvWB3a4cqr17WYfoWC9NVsrE0mBF4IrqaSdew0w 9I9A== X-Gm-Message-State: ALoCoQmw7L8Zv66sFMdI4saFhz0qTACRMNiTErvkEp+hUxh4RNI/FBYDQJ6S2vmMh2gN6vHunO7H+SVWB+KJjkwDDG7hYP+eFw== X-Received: by 10.194.79.201 with SMTP id l9mr160229207wjx.151.1452645783320; Tue, 12 Jan 2016 16:43:03 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id w73sm146177wmw.21.2016.01.12.16.43.02 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jan 2016 16:43:02 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r293724 - in head/sys/boot: arm64/libarm64 common efi/boot1 efi/fdt efi/include efi/include/arm64 efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 i... To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601120217.u0C2HdBC089684@repo.freebsd.org> <1452645668.46848.34.camel@freebsd.org> Message-ID: <56959DA7.9050206@freebsd.org> Date: Wed, 13 Jan 2016 00:43:19 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1452645668.46848.34.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 00:43:05 -0000 On 13/01/2016 00:41, Ian Lepore wrote: > On Tue, 2016-01-12 at 02:17 +0000, Steven Hartland wrote: >> Author: smh >> Date: Tue Jan 12 02:17:39 2016 >> New Revision: 293724 >> URL: https://svnweb.freebsd.org/changeset/base/293724 >> >> Log: >> Enable warnings in EFI boot code >> >> Set WARNS if not set for EFI boot code and fix the issues >> highlighted by >> setting it. >> > This appears to break arm builds when gcc is the compiler: > > cc1: warnings being treated as errors > In file included from /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../include/efi.h:52, > from /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/efi_fdt.c:35: > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../include/efiapi.h:535: warning: function declaration isn't a prototype > In file included from /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/efi_fdt.c:39: > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../../common/bootstrap.h:332: warning: redundant redeclaration of 'delay' > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../include/efilib.h:53: warning: previous declaration of 'delay' was here > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../../common/bootstrap.h:336: warning: redundant redeclaration of 'time' > /bsdstg/rm92/obj/arm.arm/local/build/staging/freebsd/rm92/src/tmp/usr/include/time.h:154: warning: previous declaration of 'time' was here > > -- Ian Passes a full tinderbox so I assume your forcing gcc for some reason? From owner-svn-src-head@freebsd.org Wed Jan 13 00:54:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36A70A80991 for ; Wed, 13 Jan 2016 00:54:05 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18957139A for ; Wed, 13 Jan 2016 00:54:04 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 13 Jan 2016 00:54:40 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0D0s3Hx006025; Tue, 12 Jan 2016 17:54:03 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452646442.46848.37.camel@freebsd.org> Subject: Re: svn commit: r293724 - in head/sys/boot: arm64/libarm64 common efi/boot1 efi/fdt efi/include efi/include/arm64 efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 i... From: Ian Lepore To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 12 Jan 2016 17:54:02 -0700 In-Reply-To: <56959DA7.9050206@freebsd.org> References: <201601120217.u0C2HdBC089684@repo.freebsd.org> <1452645668.46848.34.camel@freebsd.org> <56959DA7.9050206@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 00:54:05 -0000 On Wed, 2016-01-13 at 00:43 +0000, Steven Hartland wrote: > On 13/01/2016 00:41, Ian Lepore wrote: > > On Tue, 2016-01-12 at 02:17 +0000, Steven Hartland wrote: > > > Author: smh > > > Date: Tue Jan 12 02:17:39 2016 > > > New Revision: 293724 > > > URL: https://svnweb.freebsd.org/changeset/base/293724 > > > > > > Log: > > > Enable warnings in EFI boot code > > > > > > Set WARNS if not set for EFI boot code and fix the issues > > > highlighted by > > > setting it. > > > > > This appears to break arm builds when gcc is the compiler: > > > > cc1: warnings being treated as errors > > In file included from > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../include/e > > fi.h:52, > > from > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/efi_fdt.c:35 > > : > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../include/e > > fiapi.h:535: warning: function declaration isn't a prototype > > In file included from > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/efi_fdt.c:39 > > : > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../../common > > /bootstrap.h:332: warning: redundant redeclaration of 'delay' > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../include/e > > filib.h:53: warning: previous declaration of 'delay' was here > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../../common > > /bootstrap.h:336: warning: redundant redeclaration of 'time' > > /bsdstg/rm92/obj/arm.arm/local/build/staging/freebsd/rm92/src/tmp/u > > sr/include/time.h:154: warning: previous declaration of 'time' was > > here > > > > -- Ian > Passes a full tinderbox so I assume your forcing gcc for some reason? For several reasons. The fact that gcc isn't the default compiler doesn't mean that it's okay for code to not compile with gcc; it's still a supported compiler for arm. -- Ian From owner-svn-src-head@freebsd.org Wed Jan 13 00:56:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB6A8A80A37 for ; Wed, 13 Jan 2016 00:56:51 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CE7815AC for ; Wed, 13 Jan 2016 00:56:51 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 13 Jan 2016 00:57:32 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0D0unJr006033; Tue, 12 Jan 2016 17:56:49 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452646609.46848.39.camel@freebsd.org> Subject: Re: svn commit: r293775 - head/sys/boot/uboot/lib From: Ian Lepore To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 12 Jan 2016 17:56:49 -0700 In-Reply-To: <56959D45.7070204@multiplay.co.uk> References: <201601121631.u0CGV7v6074494@repo.freebsd.org> <569582F6.4060108@multiplay.co.uk> <1452644710.46848.31.camel@freebsd.org> <56959D45.7070204@multiplay.co.uk> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 00:56:51 -0000 On Wed, 2016-01-13 at 00:41 +0000, Steven Hartland wrote: > Was this meant to be a full revert as you now have: > > subldr = rounddown2((uintptr_t)_start, KERN_ALIGN); > > vs the original: > > subldr = rounddown2((uint64_t)(uintptr_t)_start, KERN_ALIGN); > > i.e. missing the final conversion to uint64_t? > > The uint64_t cast is still redudant so I didn't add that back. -- Ian > > On 13/01/2016 00:25, Ian Lepore wrote: > > On Tue, 2016-01-12 at 22:49 +0000, Steven Hartland wrote: > > > I think this breaks arm arches: > > > /usr/home/smh/freebsd/base/head1/sys/boot/uboot/lib/copy.c:103:24 > > > : > > > error: use of undeclared identifier 'uintfptr_t' > > > subldr = rounddown2((uintfptr_t)_start, > > > KERN_ALIGN); > > > ^ > > > /usr/home/smh/freebsd/base/head1/sys/boot/uboot/lib/../../../sys/ > > > para > > > m.h:295:28: > > > note: expanded from macro 'rounddown2' > > > #define rounddown2(x, y) ((x)&(~((y)-1))) /* if y is > > > power > > > of > > > two */ > > > > > Ooops, sorry. Should be fixed now. > > > > -- Ian > > > > > On 12/01/2016 16:31, Ian Lepore wrote: > > > > Author: ian > > > > Date: Tue Jan 12 16:31:07 2016 > > > > New Revision: 293775 > > > > URL: https://svnweb.freebsd.org/changeset/base/293775 > > > > > > > > Log: > > > > Cast using uintfptr_t and eliminate the cast to uint64_t > > > > which > > > > is uneeded > > > > because rounding down cannot increase the number of bits > > > > needed > > > > to express > > > > the result. > > > > > > > > I had no idea there was such a thing as uintfptr_t. > > > > > > > > Requested by: bde > > > > > > > > Modified: > > > > head/sys/boot/uboot/lib/copy.c > > > > > > > > Modified: head/sys/boot/uboot/lib/copy.c > > > > =============================================================== > > > > ==== > > > > =========== > > > > --- head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:21:34 > > > > 2016 > > > > (r293774) > > > > +++ head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:31:07 > > > > 2016 > > > > (r293775) > > > > @@ -100,7 +100,7 @@ uboot_loadaddr(u_int type, void *data, u > > > > > > > > biggest_block = 0; > > > > biggest_size = 0; > > > > - subldr = > > > > rounddown2((uint64_t)(uintptr_t)_start, > > > > KERN_ALIGN); > > > > + subldr = rounddown2((uintfptr_t)_start, > > > > KERN_ALIGN); > > > > eubldr = roundup2((uint64_t)uboot_heap_end, > > > > KERN_ALIGN); > > > > for (i = 0; i < si->mr_no; i++) { > > > > if (si->mr[i].flags != MR_ATTR_DRAM) > > > > > > > > > From owner-svn-src-head@freebsd.org Wed Jan 13 01:03:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D68F9A80C88; Wed, 13 Jan 2016 01:03:56 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 829B31AC9; Wed, 13 Jan 2016 01:03:56 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 469B25A9F12; Wed, 13 Jan 2016 01:03:48 +0000 (UTC) Date: Wed, 13 Jan 2016 01:03:48 +0000 From: Brooks Davis To: Steven Hartland Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293775 - head/sys/boot/uboot/lib Message-ID: <20160113010348.GF79262@spindle.one-eyed-alien.net> References: <201601121631.u0CGV7v6074494@repo.freebsd.org> <569582F6.4060108@multiplay.co.uk> <1452644710.46848.31.camel@freebsd.org> <56959D45.7070204@multiplay.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a+b56+3nqLzpiR9O" Content-Disposition: inline In-Reply-To: <56959D45.7070204@multiplay.co.uk> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 01:03:57 -0000 --a+b56+3nqLzpiR9O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 13, 2016 at 12:41:41AM +0000, Steven Hartland wrote: > Was this meant to be a full revert as you now have: >=20 > subldr =3D rounddown2((uintptr_t)_start, KERN_ALIGN); >=20 > vs the original: >=20 > subldr =3D rounddown2((uint64_t)(uintptr_t)_start, KERN_ALIGN); >=20 > i.e. missing the final conversion to uint64_t? The cast through uint64_t isn't allowed by the standard if you want the result to be a function pointer. The implementation of rounddown2() should work fine on an uintptr_t even for fairly radical implementations. -- Brooks >=20 >=20 >=20 > On 13/01/2016 00:25, Ian Lepore wrote: > > On Tue, 2016-01-12 at 22:49 +0000, Steven Hartland wrote: > >> I think this breaks arm arches: > >> /usr/home/smh/freebsd/base/head1/sys/boot/uboot/lib/copy.c:103:24: > >> error: use of undeclared identifier 'uintfptr_t' > >> subldr =3D rounddown2((uintfptr_t)_start, KERN_ALIGN= ); > >> ^ > >> /usr/home/smh/freebsd/base/head1/sys/boot/uboot/lib/../../../sys/para > >> m.h:295:28: > >> note: expanded from macro 'rounddown2' > >> #define rounddown2(x, y) ((x)&(~((y)-1))) /* if y is power > >> of > >> two */ > >> > > Ooops, sorry. Should be fixed now. > > > > -- Ian > > > >> On 12/01/2016 16:31, Ian Lepore wrote: > >>> Author: ian > >>> Date: Tue Jan 12 16:31:07 2016 > >>> New Revision: 293775 > >>> URL: https://svnweb.freebsd.org/changeset/base/293775 > >>> > >>> Log: > >>> Cast using uintfptr_t and eliminate the cast to uint64_t which > >>> is uneeded > >>> because rounding down cannot increase the number of bits needed > >>> to express > >>> the result. > >>> =20 > >>> I had no idea there was such a thing as uintfptr_t. > >>> =20 > >>> Requested by: bde > >>> > >>> Modified: > >>> head/sys/boot/uboot/lib/copy.c > >>> > >>> Modified: head/sys/boot/uboot/lib/copy.c > >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >>> --- head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:21:34 2016=09 > >>> (r293774) > >>> +++ head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:31:07 2016=09 > >>> (r293775) > >>> @@ -100,7 +100,7 @@ uboot_loadaddr(u_int type, void *data, u > >>> =20 > >>> biggest_block =3D 0; > >>> biggest_size =3D 0; > >>> - subldr =3D rounddown2((uint64_t)(uintptr_t)_start, > >>> KERN_ALIGN); > >>> + subldr =3D rounddown2((uintfptr_t)_start, > >>> KERN_ALIGN); > >>> eubldr =3D roundup2((uint64_t)uboot_heap_end, > >>> KERN_ALIGN); > >>> for (i =3D 0; i < si->mr_no; i++) { > >>> if (si->mr[i].flags !=3D MR_ATTR_DRAM) > >>> > >> >=20 >=20 --a+b56+3nqLzpiR9O Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWlaJzAAoJEKzQXbSebgfA12gH/1Tf3ZSe6+pKCDzAPYX3Ab1r yjPhwCvo2bXEw6gWoeNaU+l4uFwGmH+q97RQfdYwadJKZSx6YuG09fwZmBRvregZ QgFD7zGPnXGSWW/zv7bamXwc/u72aMx40YLqzAt0ivyMs3pjQmhyw4ltQ3FYCYet JDDHC7HJHuJ5Sw6Pnk931vq7VzGMnnPll2Y7agVucf7GlSf7zcOIFVzeaBg1aKm8 rf0JZW3NXvVSffQXAD2x9Z/6SVSVeyn+AcstwDUPWs/EWnijMun3G5qq71ZKkr7H Dr/W5jbQ6fL7KDJHnUwapMr7N9lUcJpqmIUZDOMttAQRdzQfNXd5ASv62sHHq1Y= =KySu -----END PGP SIGNATURE----- --a+b56+3nqLzpiR9O-- From owner-svn-src-head@freebsd.org Wed Jan 13 01:05:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF56EA80D30; Wed, 13 Jan 2016 01:05:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com [IPv6:2a00:1450:4010:c04::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BC051C5F; Wed, 13 Jan 2016 01:05:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lb0-x231.google.com with SMTP id x4so25473033lbm.0; Tue, 12 Jan 2016 17:05:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2/lR+G+xXEeyIX0ZfNkDgK8/hhECvRCoODeKPSEvX4k=; b=wDp0rQsjnmfKqQ0nNpBYYs1ks20m+A1HynEsunazacNEv7oAyzMidl2N4s8V5hNtPh k55XeGvLK6/3QsbzGheuqa1kMpZabIgvCTEprVt/QwN+hDqddT6K2ggkMIsUEUxKGZ9k dxF8seElAB8DigA+VSZUQYB1tDxSg0EczVyq1an49EiuG2Dd5m8UOxevYDdEfW9MJx7m C/K0OesrbIbDXTnsfWZKIJpkjW6cdebRkieuSy692CcutxATrMTn8jrvT+8SSkNj0/Ln XQZv4Lc6zz+a1tiWCFCeedBA/OE2BjvwuZjI2/n47/G2epXgEVWZBE0mP+UuOo4bSgti dZXA== MIME-Version: 1.0 X-Received: by 10.112.190.67 with SMTP id go3mr21021911lbc.59.1452647109414; Tue, 12 Jan 2016 17:05:09 -0800 (PST) Received: by 10.112.160.133 with HTTP; Tue, 12 Jan 2016 17:05:09 -0800 (PST) In-Reply-To: <1452646442.46848.37.camel@freebsd.org> References: <201601120217.u0C2HdBC089684@repo.freebsd.org> <1452645668.46848.34.camel@freebsd.org> <56959DA7.9050206@freebsd.org> <1452646442.46848.37.camel@freebsd.org> Date: Tue, 12 Jan 2016 17:05:09 -0800 Message-ID: Subject: Re: svn commit: r293724 - in head/sys/boot: arm64/libarm64 common efi/boot1 efi/fdt efi/include efi/include/arm64 efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 i... From: NGie Cooper To: Ian Lepore Cc: Steven Hartland , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 01:05:12 -0000 On Tue, Jan 12, 2016 at 4:54 PM, Ian Lepore wrote: ... > For several reasons. The fact that gcc isn't the default compiler > doesn't mean that it's okay for code to not compile with gcc; it's > still a supported compiler for arm. Agreed. It also makes things messier when MFCing changes if it doesn't work with gcc. Thanks, -NGie From owner-svn-src-head@freebsd.org Wed Jan 13 01:10:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71D19A6E101; Wed, 13 Jan 2016 01:10:41 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 51BD810FF; Wed, 13 Jan 2016 01:10:41 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [192.168.1.10] (unknown [192.168.1.10]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 59C1AD9B5; Wed, 13 Jan 2016 01:10:40 +0000 (UTC) Subject: Re: svn commit: r293724 - in head/sys/boot: arm64/libarm64 common efi/boot1 efi/fdt efi/include efi/include/arm64 efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 i... To: NGie Cooper , Ian Lepore References: <201601120217.u0C2HdBC089684@repo.freebsd.org> <1452645668.46848.34.camel@freebsd.org> <56959DA7.9050206@freebsd.org> <1452646442.46848.37.camel@freebsd.org> Cc: Steven Hartland , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: <5695A40C.6050306@freebsd.org> Date: Tue, 12 Jan 2016 20:10:36 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 01:10:41 -0000 On 2016-01-12 20:05, NGie Cooper wrote: > On Tue, Jan 12, 2016 at 4:54 PM, Ian Lepore wrote: > ... >> For several reasons. The fact that gcc isn't the default compiler >> doesn't mean that it's okay for code to not compile with gcc; it's >> still a supported compiler for arm. > > Agreed. It also makes things messier when MFCing changes if it doesn't > work with gcc. > Thanks, > -NGie > If it is a supported compiler, maybe we need a tinderbox option that compiles ARM with gcc, to catch cases like this. -- Allan Jude From owner-svn-src-head@freebsd.org Wed Jan 13 01:17:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D1A1A6E390 for ; Wed, 13 Jan 2016 01:17:01 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F5101958 for ; Wed, 13 Jan 2016 01:17:01 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 13 Jan 2016 01:15:40 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0D1Gw7J006134; Tue, 12 Jan 2016 18:16:58 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452647818.46848.46.camel@freebsd.org> Subject: Re: svn commit: r293775 - head/sys/boot/uboot/lib From: Ian Lepore To: Brooks Davis , Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 12 Jan 2016 18:16:58 -0700 In-Reply-To: <20160113010348.GF79262@spindle.one-eyed-alien.net> References: <201601121631.u0CGV7v6074494@repo.freebsd.org> <569582F6.4060108@multiplay.co.uk> <1452644710.46848.31.camel@freebsd.org> <56959D45.7070204@multiplay.co.uk> <20160113010348.GF79262@spindle.one-eyed-alien.net> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 01:17:01 -0000 On Wed, 2016-01-13 at 01:03 +0000, Brooks Davis wrote: > On Wed, Jan 13, 2016 at 12:41:41AM +0000, Steven Hartland wrote: > > Was this meant to be a full revert as you now have: > > > > subldr = rounddown2((uintptr_t)_start, KERN_ALIGN); > > > > vs the original: > > > > subldr = rounddown2((uint64_t)(uintptr_t)_start, KERN_ALIGN); > > > > i.e. missing the final conversion to uint64_t? > > The cast through uint64_t isn't allowed by the standard if you want > the > result to be a function pointer. The implementation of rounddown2() > should work fine on an uintptr_t even for fairly radical > implementations. > > -- Brooks _start is a function pointer, but subldr is uint64_t. The cast isn't needed inside the macro invocation because the round-down calculation can't create a larger result than the size of the types involved. -- Ian From owner-svn-src-head@freebsd.org Wed Jan 13 01:17:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0D5DA6E3F9 for ; Wed, 13 Jan 2016 01:17:42 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FCFF1AC3 for ; Wed, 13 Jan 2016 01:17:42 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x22b.google.com with SMTP id b14so348080313wmb.1 for ; Tue, 12 Jan 2016 17:17:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=nKE2xIPl8gQnsTSn/59o4EVRFbeTq/RmNf/377gimmI=; b=RY03++m+8lPw/W9aRdHd9D8PtYgOiK8uuKMamsYkdaWKbI0yDYNrwK10PeHQ6gmi51 bdjUBQDr38R2tQ6oHs7jiPKierjrXiHOvh8qaW/yqzYq3EhOTIf+beUbQu/w/t65QUh/ lVsgM6Y/KGNfzn3PN5XkNX7hiHMLjN+EKN3ALmNjTsUun/7Hr7iDIpWSaOHOTzuli5gw vcIpHYlha7Jf7wZbpBYwghPY5TQ7ZHL+yCLvJN5joTKMQLKjiv0VgSX+j4VCY/SS/CmU xRS5zHJZ86/V4nnTMxATENkicrGuOtPmADVQlae26dArhTKCFnHNDhQMb+W3285f2bj3 +YAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=nKE2xIPl8gQnsTSn/59o4EVRFbeTq/RmNf/377gimmI=; b=jwniQtBGKNx9Om4NzTatbjK3pbBdpmoipsNxTIiQOXLxDc1Pjuarcv8jbsAcrPVSdr O6Gi5qCAPMvkuPcz22giHWE21L/pU9X+Xa3JkzjeQ1LfRVSaegfVEsgH/fezeXS9W/eE F63lvpqtuhxv0FNu+dmXED1aSSH6hR9YQU3kd1mWRTxnUR2drgnSKTfJKytMvv93wFPp LrYLCmcCe7kia5rte5rZFH3fRyYrxIzgeau930Daguz4NpgS1/L9RVBSrt4oBaZPjldk C+Nb+Hv3+PEoQ2t8mw8QGAix4jW2UM4yFKlPSgF6AJNMYNeXLdhfdSuWmlhT5zp5vTw2 3gvA== X-Gm-Message-State: ALoCoQkmvvhTpZ7TfxW02Y0UXdtucGEle6vhmnDZ++Z0aULEpweb2jVQsIM88rIUDVYh2iQTg8VBKrjhjAMNExjCq7tgGVok1w== X-Received: by 10.28.145.204 with SMTP id t195mr23316142wmd.91.1452647860760; Tue, 12 Jan 2016 17:17:40 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id e2sm13188372wma.1.2016.01.12.17.17.39 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jan 2016 17:17:39 -0800 (PST) Subject: Re: svn commit: r293724 - in head/sys/boot: arm64/libarm64 common efi/boot1 efi/fdt efi/include efi/include/arm64 efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 i... To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601120217.u0C2HdBC089684@repo.freebsd.org> <1452645668.46848.34.camel@freebsd.org> <56959DA7.9050206@freebsd.org> <1452646442.46848.37.camel@freebsd.org> From: Steven Hartland Message-ID: <5695A5C4.9000409@multiplay.co.uk> Date: Wed, 13 Jan 2016 01:17:56 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1452646442.46848.37.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 01:17:42 -0000 On 13/01/2016 00:54, Ian Lepore wrote: > On Wed, 2016-01-13 at 00:43 +0000, Steven Hartland wrote: >> On 13/01/2016 00:41, Ian Lepore wrote: >>> On Tue, 2016-01-12 at 02:17 +0000, Steven Hartland wrote: >>>> Author: smh >>>> Date: Tue Jan 12 02:17:39 2016 >>>> New Revision: 293724 >>>> URL: https://svnweb.freebsd.org/changeset/base/293724 >>>> >>>> Log: >>>> Enable warnings in EFI boot code >>>> >>>> Set WARNS if not set for EFI boot code and fix the issues >>>> highlighted by >>>> setting it. >>>> >>> This appears to break arm builds when gcc is the compiler: >>> >>> cc1: warnings being treated as errors >>> In file included from >>> /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../include/e >>> fi.h:52, >>> from >>> /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/efi_fdt.c:35 >>> : >>> /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../include/e >>> fiapi.h:535: warning: function declaration isn't a prototype >>> In file included from >>> /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/efi_fdt.c:39 >>> : >>> /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../../common >>> /bootstrap.h:332: warning: redundant redeclaration of 'delay' >>> /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../include/e >>> filib.h:53: warning: previous declaration of 'delay' was here >>> /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../../common >>> /bootstrap.h:336: warning: redundant redeclaration of 'time' >>> /bsdstg/rm92/obj/arm.arm/local/build/staging/freebsd/rm92/src/tmp/u >>> sr/include/time.h:154: warning: previous declaration of 'time' was >>> here >>> >>> -- Ian >> Passes a full tinderbox so I assume your forcing gcc for some reason? > For several reasons. The fact that gcc isn't the default compiler > doesn't mean that it's okay for code to not compile with gcc; it's > still a supported compiler for arm. > > -- Ian Not disagreeing with that, was just curious that's all ;-) The warnings you list seem to be detail, typical gcc, specifically: sys/boot/efi/fdt/../include/efiapi.h:535: warning: function declaration isn't a prototype I'm guessing its being picky and wants EFI_RESERVED_SERVICE to have void in there due to no params. Does the following help: Index: sys/boot/efi/fdt/Makefile =================================================================== --- sys/boot/efi/fdt/Makefile (revision 293796) +++ sys/boot/efi/fdt/Makefile (working copy) @@ -7,6 +7,8 @@ LIB= efi_fdt INTERNALLIB= WARNS?= 6 +CWARNFLAGS.gcc+= -Wno-strict-prototypes +CWARNFLAGS.gcc+= -Wno-redundant-decls SRCS= efi_fdt.c @@ -34,4 +36,6 @@ CLEANFILES+= machine .include +CFLAGS+= ${CWARNFLAGS.${COMPILER_TYPE}} + beforedepend ${OBJS}: machine Could you detail detail how you're switching to gcc so I an run a full pass on that too? Regards Steve From owner-svn-src-head@freebsd.org Wed Jan 13 01:23:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77918A6E662 for ; Wed, 13 Jan 2016 01:23:30 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06DA01217 for ; Wed, 13 Jan 2016 01:23:30 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x22e.google.com with SMTP id l65so274272298wmf.1 for ; Tue, 12 Jan 2016 17:23:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=Pv2iUyd8zYbUg5jTqbUdPL2/nXzD/mL2nbkjgxnDuGY=; b=XejkHDkWtzahfysZ17zZOJjfzMwJm20HKfFDbr3hpkKwXvMCzY8yO1nNFkdyw8oXN1 Dfr1xXLzBoTuoJY6a+Y1H0H7GqLNIlDJxQtv3FqkLP7i1HFmyrVaBCPNbz/UjlktXa3G up+bpPDNcZNk9ZcUJXUSVBb0y4ABReQObkDnxTLzpAN2nnEcneam0924U3ER6zcH104M wnz+F3yIgHwqlIA/lqaOj86louO60q4/oCLP5FOwxWG8aDemypdmZ4kqVCGxD8iTSkYx LU/IXLVNUTGAp3erU21gni2h6amX4HZ7CwGs3IDGAVI7QcDytk+1h7GMp9stUFJmtgmE towg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=Pv2iUyd8zYbUg5jTqbUdPL2/nXzD/mL2nbkjgxnDuGY=; b=CKMNvtA2W6BNjk1jjbqQ1pfB1Y7sCnYy/ylrP3amZjzYrSCRRNYLPkYD912Dh7FqxZ gedHS390+wkIIs0Ki6eJwnUPCtyA5C/SNUl56ofqt+Wg2bpb0rqJOJb6vRjYEuWkV3rg wKky7XZaz5IwiR91AwPDBTD5jsnqSpjSoU0/CTbQ1ri285kdtfzu/0I4qZIlPd5aHbip QuwmIkKBs+dggMHJhSeaWFRK1DODiqAex4myQzzaBgAcLEiSYxqwum80L70AfjucKSyi m42gDUFCPaPZI6tCBFt8Gw5Oi4lAMh2LBObNlScwXaMeNF5g5tdu6pne7aIIZ62Clv+V m+Rw== X-Gm-Message-State: ALoCoQksZAcY7/OylsgOD9eXzc31Ph2TTvaVenpu/bB/AGvP+cl1N2JdMsPQe21TyPyJGzHf8ARKhltSv0S73k9ybJcfsmxR4g== X-Received: by 10.28.184.76 with SMTP id i73mr21508519wmf.43.1452648208535; Tue, 12 Jan 2016 17:23:28 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id c26sm19934982wmi.21.2016.01.12.17.23.27 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jan 2016 17:23:27 -0800 (PST) Subject: Re: svn commit: r293724 - in head/sys/boot: arm64/libarm64 common efi/boot1 efi/fdt efi/include efi/include/arm64 efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 i... To: Allan Jude , NGie Cooper , Ian Lepore References: <201601120217.u0C2HdBC089684@repo.freebsd.org> <1452645668.46848.34.camel@freebsd.org> <56959DA7.9050206@freebsd.org> <1452646442.46848.37.camel@freebsd.org> <5695A40C.6050306@freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Steven Hartland Message-ID: <5695A720.3000302@multiplay.co.uk> Date: Wed, 13 Jan 2016 01:23:44 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <5695A40C.6050306@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 01:23:30 -0000 On 13/01/2016 01:10, Allan Jude wrote: > On 2016-01-12 20:05, NGie Cooper wrote: >> On Tue, Jan 12, 2016 at 4:54 PM, Ian Lepore wrote: >> ... >>> For several reasons. The fact that gcc isn't the default compiler >>> doesn't mean that it's okay for code to not compile with gcc; it's >>> still a supported compiler for arm. >> >> Agreed. It also makes things messier when MFCing changes if it doesn't >> work with gcc. >> Thanks, >> -NGie >> > > If it is a supported compiler, maybe we need a tinderbox option that > compiles ARM with gcc, to catch cases like this. > Yer we really should. I explicitly ran tinderbox on these changes in order to ensure all the bases where covered, if there are additional options not run by tinderbox but are supported then we really need add them otherwise we're just assuming everyone knows to manually test additional configurations which is never going to work. Regards Steve From owner-svn-src-head@freebsd.org Wed Jan 13 01:32:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB763A6EA79 for ; Wed, 13 Jan 2016 01:32:20 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A13EF1D34 for ; Wed, 13 Jan 2016 01:32:20 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 13 Jan 2016 01:33:01 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0D1WH0R006182; Tue, 12 Jan 2016 18:32:18 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452648737.46848.50.camel@freebsd.org> Subject: Re: svn commit: r293724 - in head/sys/boot: arm64/libarm64 common efi/boot1 efi/fdt efi/include efi/include/arm64 efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 i... From: Ian Lepore To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 12 Jan 2016 18:32:17 -0700 In-Reply-To: <5695A5C4.9000409@multiplay.co.uk> References: <201601120217.u0C2HdBC089684@repo.freebsd.org> <1452645668.46848.34.camel@freebsd.org> <56959DA7.9050206@freebsd.org> <1452646442.46848.37.camel@freebsd.org> <5695A5C4.9000409@multiplay.co.uk> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 01:32:20 -0000 On Wed, 2016-01-13 at 01:17 +0000, Steven Hartland wrote: > > On 13/01/2016 00:54, Ian Lepore wrote: > > On Wed, 2016-01-13 at 00:43 +0000, Steven Hartland wrote: > > > On 13/01/2016 00:41, Ian Lepore wrote: > > > > On Tue, 2016-01-12 at 02:17 +0000, Steven Hartland wrote: > > > > > Author: smh > > > > > Date: Tue Jan 12 02:17:39 2016 > > > > > New Revision: 293724 > > > > > URL: https://svnweb.freebsd.org/changeset/base/293724 > > > > > > > > > > Log: > > > > > Enable warnings in EFI boot code > > > > > > > > > > Set WARNS if not set for EFI boot code and fix the issues > > > > > highlighted by > > > > > setting it. > > > > > > > > > This appears to break arm builds when gcc is the compiler: > > > > > > > > cc1: warnings being treated as errors > > > > In file included from > > > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../inclu > > > > de/e > > > > fi.h:52, > > > > from > > > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/efi_fdt. > > > > c:35 > > > > : > > > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../inclu > > > > de/e > > > > fiapi.h:535: warning: function declaration isn't a prototype > > > > In file included from > > > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/efi_fdt. > > > > c:39 > > > > : > > > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../../co > > > > mmon > > > > /bootstrap.h:332: warning: redundant redeclaration of 'delay' > > > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../inclu > > > > de/e > > > > filib.h:53: warning: previous declaration of 'delay' was here > > > > /local/build/staging/freebsd/rm92/src/sys/boot/efi/fdt/../../co > > > > mmon > > > > /bootstrap.h:336: warning: redundant redeclaration of 'time' > > > > /bsdstg/rm92/obj/arm.arm/local/build/staging/freebsd/rm92/src/t > > > > mp/u > > > > sr/include/time.h:154: warning: previous declaration of 'time' > > > > was > > > > here > > > > > > > > -- Ian > > > Passes a full tinderbox so I assume your forcing gcc for some > > > reason? > > For several reasons. The fact that gcc isn't the default compiler > > doesn't mean that it's okay for code to not compile with gcc; it's > > still a supported compiler for arm. > > > > -- Ian > Not disagreeing with that, was just curious that's all ;-) > > The warnings you list seem to be detail, typical gcc, specifically: > > sys/boot/efi/fdt/../include/efiapi.h:535: warning: function > declaration isn't a prototype > > I'm guessing its being picky and wants EFI_RESERVED_SERVICE to have > void in there due to no params. > > Does the following help: > > Index: sys/boot/efi/fdt/Makefile > =================================================================== > --- sys/boot/efi/fdt/Makefile (revision 293796) > +++ sys/boot/efi/fdt/Makefile (working copy) > @@ -7,6 +7,8 @@ > LIB= efi_fdt > INTERNALLIB= > WARNS?= 6 > +CWARNFLAGS.gcc+= -Wno-strict-prototypes > +CWARNFLAGS.gcc+= -Wno-redundant-decls > > SRCS= efi_fdt.c > > @@ -34,4 +36,6 @@ CLEANFILES+= machine > > .include > > +CFLAGS+= ${CWARNFLAGS.${COMPILER_TYPE}} > + > beforedepend ${OBJS}: machine > > Could you detail detail how you're switching to gcc so I an run a > full pass on that too? > > Regards > Steve > Yep, but then I had to do this because ef->off is 64 bits even on 32 bit arches, so I got a pointer/int size mismatch warning... Index: common/load_elf.c =================================================================== --- common/load_elf.c (revision 293796) +++ common/load_elf.c (working copy) @@ -886,7 +886,7 @@ __elfN(parse_modmetadata)(struct preloaded_file *f error = __elfN(reloc_ptr)(fp, ef, v, &md, sizeof(md)); if (error == EOPNOTSUPP) { md.md_cval += ef->off; - md.md_data = (void *)((uintptr_t)md.md_data + ef->off); + md.md_data = (void *)(uintptr_t)((uintptr_t)md.md_data + ef->off); } else if (error != 0) return (error); #endif That is just some special kind of ugly. Fixing warnings is supposed to lead to better code, but all this casting isn't better, it's just an unreadable mess. Man I miss the days when C was just a really powerful macro assembler. :) -- Ian From owner-svn-src-head@freebsd.org Wed Jan 13 01:34:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 460B1A6EB34 for ; Wed, 13 Jan 2016 01:34:24 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 270CD1EC7 for ; Wed, 13 Jan 2016 01:34:23 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 13 Jan 2016 01:35:04 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0D1YLTI006188; Tue, 12 Jan 2016 18:34:21 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452648861.46848.52.camel@freebsd.org> Subject: Re: svn commit: r293724 - in head/sys/boot: arm64/libarm64 common efi/boot1 efi/fdt efi/include efi/include/arm64 efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 i... From: Ian Lepore To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 12 Jan 2016 18:34:21 -0700 In-Reply-To: <5695A5C4.9000409@multiplay.co.uk> References: <201601120217.u0C2HdBC089684@repo.freebsd.org> <1452645668.46848.34.camel@freebsd.org> <56959DA7.9050206@freebsd.org> <1452646442.46848.37.camel@freebsd.org> <5695A5C4.9000409@multiplay.co.uk> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 01:34:24 -0000 On Wed, 2016-01-13 at 01:17 +0000, Steven Hartland wrote: > > On 13/01/2016 00:54, Ian Lepore wrote: > > [...] > > Could you detail detail how you're switching to gcc so I an run a > full pass on that too? > > Regards > Steve > > I have this in the make.conf I use for this particular arm build... WITH_GCC=yes WITH_GNUCXX=yes WITH_GCC_BOOTSTRAP=yes WITHOUT_CLANG=yes WITHOUT_CLANG_IS_CC=yes WITHOUT_CLANG_BOOTSTRAP=yes If nothing else, it'll remind you of how fast a buildworld *used* to be. ;) -- Ian From owner-svn-src-head@freebsd.org Wed Jan 13 01:48:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 491C0A6EEF1; Wed, 13 Jan 2016 01:48:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f179.google.com (mail-yk0-f179.google.com [209.85.160.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 089E71510; Wed, 13 Jan 2016 01:48:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yk0-f179.google.com with SMTP id a85so395282609ykb.1; Tue, 12 Jan 2016 17:48:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=Za1vnLyf2v+dwuhUnSjWVzs3Om8Ksphyt9vdcXsgZ9M=; b=M/E968wGtkJRCWVH0uy1Vutk9fGafMa4plpJ/+nhoYwDrYONws/cc+lQ5XF3Ima0XO jkfkA1H2hhjnX0zvFynavSaCtOZmTrOiElC+0BMoU98dinaRr6QLVkY8/ho/dR64MO+X cXFuAbf4APLOsBTlWyzSNa7YHxz5S4g3QYU7SANH98F3fVyNTHY3i9wE6esWhixdKwgT eusaaKYGsLdv2/U4UlPF65NphrOh05MTY3PfSt6EXlB5T8ZL8a/hTm3nZ7QZhgCG5qCD by++ny56dlgb0E4cggjivy0FzbzcEvMcGjk2dI9lmyf/30werp6iJ73nx5UabjzBWA04 afSQ== X-Gm-Message-State: ALoCoQk7JNrrp9MIBL4obmbDi3LPSL+m2Y18a6khgEVzlCsOBJT7K8jDm6edOtnuNPkxtSpOcPg4nld5QYS9ofc7VOznVQijRA== X-Received: by 10.129.80.7 with SMTP id e7mr95048679ywb.329.1452649369418; Tue, 12 Jan 2016 17:42:49 -0800 (PST) Received: from mail-yk0-f169.google.com (mail-yk0-f169.google.com. [209.85.160.169]) by smtp.gmail.com with ESMTPSA id r130sm104178910ywe.49.2016.01.12.17.42.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jan 2016 17:42:49 -0800 (PST) Received: by mail-yk0-f169.google.com with SMTP id x67so473962094ykd.2; Tue, 12 Jan 2016 17:42:48 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.31.67 with SMTP id f64mr97551431ywf.94.1452649368597; Tue, 12 Jan 2016 17:42:48 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.4.69 with HTTP; Tue, 12 Jan 2016 17:42:48 -0800 (PST) In-Reply-To: <1452648737.46848.50.camel@freebsd.org> References: <201601120217.u0C2HdBC089684@repo.freebsd.org> <1452645668.46848.34.camel@freebsd.org> <56959DA7.9050206@freebsd.org> <1452646442.46848.37.camel@freebsd.org> <5695A5C4.9000409@multiplay.co.uk> <1452648737.46848.50.camel@freebsd.org> Date: Tue, 12 Jan 2016 17:42:48 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r293724 - in head/sys/boot: arm64/libarm64 common efi/boot1 efi/fdt efi/include efi/include/arm64 efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 i... From: Conrad Meyer To: Ian Lepore Cc: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 01:48:21 -0000 On Tue, Jan 12, 2016 at 5:32 PM, Ian Lepore wrote: > Yep, but then I had to do this because ef->off is 64 bits even on 32 > bit arches, so I got a pointer/int size mismatch warning... > > Index: common/load_elf.c > =================================================================== > --- common/load_elf.c (revision 293796) > +++ common/load_elf.c (working copy) > @@ -886,7 +886,7 @@ __elfN(parse_modmetadata)(struct preloaded_file *f > error = __elfN(reloc_ptr)(fp, ef, v, &md, sizeof(md)); > if (error == EOPNOTSUPP) { > md.md_cval += ef->off; > - md.md_data = (void *)((uintptr_t)md.md_data + ef->off); > + md.md_data = (void *)(uintptr_t)((uintptr_t)md.md_data + > ef->off); > } else if (error != 0) > return (error); > #endif > > > That is just some special kind of ugly. Yes. You could maybe do: md.md_data = (c_caddr_t)md.md_data + (ptrdiff_t)ef->off; Instead. Yes, the ptrdiff_t will truncate uint64_t on 32-bit pointer platforms, but the result is truncated regardless when it is stored in the md_data pointer. And the result under modulus is equivalent. (You could even change the type of md_data to c_caddr_t from 'const void *' to make it easier to do math on. Then this could just be: md.md_data += (ptrdiff_t)ef->off;) Best, Conrad From owner-svn-src-head@freebsd.org Wed Jan 13 01:49:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85A5CA6EF95; Wed, 13 Jan 2016 01:49:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47107187D; Wed, 13 Jan 2016 01:49:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D1nawk053971; Wed, 13 Jan 2016 01:49:36 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D1nZmI053966; Wed, 13 Jan 2016 01:49:35 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201601130149.u0D1nZmI053966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 13 Jan 2016 01:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293801 - in head: . etc share/examples/ypldap usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 01:49:37 -0000 Author: araujo Date: Wed Jan 13 01:49:35 2016 New Revision: 293801 URL: https://svnweb.freebsd.org/changeset/base/293801 Log: ypldap(8) is a feature ready to be used to translate nis(8) database to ldap(3). This commit, fix a core dump on ypldap(8) related with memory allocation. Also an example of how to set the ypldap.conf(5) properly is added to examples files. A new user _ypldap is required to be able to run ypldap(8) as well as in a chroot mode. Reviewed by: rodrigc (mentor), bjk Approved by: bapt (mentor) Relnotes: Yes Sponsored by: gandi.net Differential Revision: https://reviews.freebsd.org/D4744 Added: head/share/examples/ypldap/ head/share/examples/ypldap/ypldap.conf (contents, props changed) Modified: head/UPDATING head/etc/master.passwd head/usr.sbin/ypldap/yp.c head/usr.sbin/ypldap/ypldap.conf.5 Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Jan 13 01:32:04 2016 (r293800) +++ head/UPDATING Wed Jan 13 01:49:35 2016 (r293801) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160113: + With the addition of ypldap(8), a new _ypldap user is now required + during installworld. "mergemaster -p" can be used to add the user + prior to installworld, as documented in the handbook. + 20151216: The tftp loader (pxeboot) now uses the option root-path directive. As a consequence it no longer looks for a pxeboot.4th file on the tftp Modified: head/etc/master.passwd ============================================================================== --- head/etc/master.passwd Wed Jan 13 01:32:04 2016 (r293800) +++ head/etc/master.passwd Wed Jan 13 01:49:35 2016 (r293801) @@ -22,5 +22,6 @@ uucp:*:66:66::0:0:UUCP pseudo-user:/var/ pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin +_ypldap:*:93:93::0:0:YP Ldap unprivileged user:/var/empty:/usr/sbin/nologin hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin Added: head/share/examples/ypldap/ypldap.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/ypldap/ypldap.conf Wed Jan 13 01:49:35 2016 (r293801) @@ -0,0 +1,40 @@ +$FreeBSD$ +domain "freebsd.org" +interval 60 +provide map "passwd.byname" +provide map "passwd.byuid" +provide map "group.byname" +provide map "group.bygid" +provide map "netid.byname" + +directory "127.0.0.1" { + # directory options + binddn "cn=ldap,dc=freebsd,dc=org" + bindcred "secret" + basedn "dc=freebsd.,dc=org" + # starting point for groups directory search, default to basedn + groupdn "ou=Groups,dc=freebsd,dc=org" + + # passwd maps configuration (RFC 2307 posixAccount object class) + passwd filter "(objectClass=posixAccount)" + + attribute name maps to "uid" + fixed attribute passwd "*" + attribute uid maps to "uidNumber" + attribute gid maps to "gidNumber" + attribute gecos maps to "cn" + attribute home maps to "homeDirectory" + attribute shell maps to "loginShell" + fixed attribute change "0" + fixed attribute expire "0" + fixed attribute class "" + + # group maps configuration (RFC 2307 posixGroup object class) + group filter "(objectClass=posixGroup)" + + attribute groupname maps to "cn" + fixed attribute grouppasswd "*" + attribute groupgid maps to "gidNumber" + # memberUid returns multiple group members + list groupmembers maps to "memberUid" +} Modified: head/usr.sbin/ypldap/yp.c ============================================================================== --- head/usr.sbin/ypldap/yp.c Wed Jan 13 01:32:04 2016 (r293800) +++ head/usr.sbin/ypldap/yp.c Wed Jan 13 01:49:35 2016 (r293801) @@ -83,10 +83,10 @@ void yp_enable_events(void) { int i; - extern fd_set svc_fdset; + extern fd_set svc_fdset; struct yp_event *ye; - for (i = 0; i < getdtablesize(); i++) { + for (i = 0; i < FD_SETSIZE; i++) { if (FD_ISSET(i, &svc_fdset)) { if ((ye = calloc(1, sizeof(*ye))) == NULL) fatal(NULL); Modified: head/usr.sbin/ypldap/ypldap.conf.5 ============================================================================== --- head/usr.sbin/ypldap/ypldap.conf.5 Wed Jan 13 01:32:04 2016 (r293800) +++ head/usr.sbin/ypldap/ypldap.conf.5 Wed Jan 13 01:49:35 2016 (r293801) @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: April 30 2012 $ +.Dd $Mdocdate: January 13 2016 $ .Dt YPLDAP.CONF 5 .Os .Sh NAME @@ -155,6 +155,9 @@ Use the supplied LDAP filter to retrieve .It Pa /etc/ypldap.conf .Xr ypldap 8 configuration file. +.It Pa /usr/share/example/ypldap/ypldap.conf +.Xr ypldap 8 +configuration file example. .El .Sh SEE ALSO .Xr ypbind 8 , From owner-svn-src-head@freebsd.org Wed Jan 13 02:57:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 131C5A80612; Wed, 13 Jan 2016 02:57:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id CC3921D27; Wed, 13 Jan 2016 02:57:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 0757D78506E; Wed, 13 Jan 2016 13:57:13 +1100 (AEDT) Date: Wed, 13 Jan 2016 13:57:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293724 - in head/sys/boot: arm64/libarm64 common efi/boot1 efi/fdt efi/include efi/include/arm64 efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 i... In-Reply-To: <1452648737.46848.50.camel@freebsd.org> Message-ID: <20160113124535.X982@besplex.bde.org> References: <201601120217.u0C2HdBC089684@repo.freebsd.org> <1452645668.46848.34.camel@freebsd.org> <56959DA7.9050206@freebsd.org> <1452646442.46848.37.camel@freebsd.org> <5695A5C4.9000409@multiplay.co.uk> <1452648737.46848.50.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=1VQynKHbpC_Sor_k-nEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 02:57:23 -0000 On Tue, 12 Jan 2016, Ian Lepore wrote: > On Wed, 2016-01-13 at 01:17 +0000, Steven Hartland wrote: >> >> On 13/01/2016 00:54, Ian Lepore wrote: >>> On Wed, 2016-01-13 at 00:43 +0000, Steven Hartland wrote: >>> ... >>>> Passes a full tinderbox so I assume your forcing gcc for some >>>> reason? >>> For several reasons. The fact that gcc isn't the default compiler >>> doesn't mean that it's okay for code to not compile with gcc; it's >>> still a supported compiler for arm. I usually force gcc. >> Not disagreeing with that, was just curious that's all ;-) >> >> The warnings you list seem to be detail, typical gcc, specifically: >> >> sys/boot/efi/fdt/../include/efiapi.h:535: warning: function >> declaration isn't a prototype >> >> I'm guessing its being picky and wants EFI_RESERVED_SERVICE to have >> void in there due to no params. It is not broken, so it is warning about an unprototyped function as requested by -Wstrict-prototypes. >> Does the following help: >> >> Index: sys/boot/efi/fdt/Makefile >> =================================================================== >> --- sys/boot/efi/fdt/Makefile (revision 293796) >> +++ sys/boot/efi/fdt/Makefile (working copy) >> @@ -7,6 +7,8 @@ >> LIB= efi_fdt >> INTERNALLIB= >> WARNS?= 6 >> +CWARNFLAGS.gcc+= -Wno-strict-prototypes >> +CWARNFLAGS.gcc+= -Wno-redundant-decls >> >> SRCS= efi_fdt.c >> This just breaks the warning. >> @@ -34,4 +36,6 @@ CLEANFILES+= machine >> >> .include >> >> +CFLAGS+= ${CWARNFLAGS.${COMPILER_TYPE}} >> + >> beforedepend ${OBJS}: machine >> >> Could you detail detail how you're switching to gcc so I an run a >> full pass on that too? Sometimes I use CC=gccNN, where gccNN is somwhere in $PATH. Sometimes it is a script to select an arch-dependent gcc. This is unlikely to work for makeworld but it works for kernels. > Yep, but then I had to do this because ef->off is 64 bits even on 32 > bit arches, so I got a pointer/int size mismatch warning... gcc detects this error too. > Index: common/load_elf.c > =================================================================== > --- common/load_elf.c (revision 293796) > +++ common/load_elf.c (working copy) > @@ -886,7 +886,7 @@ __elfN(parse_modmetadata)(struct preloaded_file *f > error = __elfN(reloc_ptr)(fp, ef, v, &md, sizeof(md)); > if (error == EOPNOTSUPP) { > md.md_cval += ef->off; > - md.md_data = (void *)((uintptr_t)md.md_data + ef->off); > + md.md_data = (void *)(uintptr_t)((uintptr_t)md.md_data + > ef->off); > } else if (error != 0) > return (error); > #endif > > > That is just some special kind of ugly. Fixing warnings is supposed to > lead to better code, but all this casting isn't better, it's just an > unreadable mess. Man I miss the days when C was just a really powerful > macro assembler. :) This is made extra-ugly by misformatting it. Fixing warnings unfortunately usually leads to worse code, using extra code to break the warning. Here the detected bug is the bogus type for ef->off. Values >= UINT32_MAX in it cannot work in expressions like this. This was only detected accidentally. md_data is a very confusing variable name. It is used nearby in 4 structs band has a different type in each. Sometimes it is uint32_t or uint64_t; sometimes it is void * and sometimes it is char *. Here it is void *. Some of the structs are: - mod_medadata (md is this); type void * - mod_metadata64; type uint64_t - mod_metadata32; type uint32_t - file_metadata; type char [] The prefix is supposed to be unique in context. One is better than none. 'off' in ef has none. The void * type is inconvenient to work with. The nearby md_cval has the same bugs, except it isn't in file_metadata and its type is const char * so you can add an integer to it without casting. The previous round of fixes was to fix a warning about using the gnu extension of adding an integer to a void * without a cast. > + md.md_data = (void *)(uintptr_t)((uintptr_t)md.md_data + > ef->off); I don't see any better quick fix than changing 'off' to vm_offset_t or maybe signed vm_offset_t. It is in a local struct so this seems to be possible. Changing the void * instance of md_data to an integer is harder. md_cval should also be an integer. Bruce From owner-svn-src-head@freebsd.org Wed Jan 13 04:03:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D31CA801ED; Wed, 13 Jan 2016 04:03:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 07B561E04; Wed, 13 Jan 2016 04:03:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 166A3D63709; Wed, 13 Jan 2016 15:03:08 +1100 (AEDT) Date: Wed, 13 Jan 2016 15:03:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293792 - head/sys/boot/uboot/lib In-Reply-To: <201601130022.u0D0MCWu029299@repo.freebsd.org> Message-ID: <20160113142527.U1277@besplex.bde.org> References: <201601130022.u0D0MCWu029299@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R4L+YolX c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=e7gxmwbq5dYOh8Y6tOgA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 04:03:11 -0000 On Wed, 13 Jan 2016, Ian Lepore wrote: > Log: > Go back to using uintptr_t, because code that actually compiles is > infinitely less buggy than code that is theoretically correct in some > alternate universe. > > The uintfptr_t type is apparently a freebsd invention, and exists only when > compiling the kernel. It's a little hard to say for sure, since it doesn't > seem to be documented anywhere except in email advice to unsuspecting and > overly-trusting souls, who then get to wear the pointy hat for blindly > following advice without investigating or testing it first. Oops. It is only declared in outside of the kernel. Only __uintfptr_t is always declared by sys/types.h. Grep shows some style bugs (spelling mismatches) for *uintfptr_t in : X amd64/include/profile.h:typedef u_long uintfptr_t; X arm/include/_types.h:typedef __uint32_t __uintfptr_t; X arm/include/profile.h:typedef u_int uintfptr_t; X arm64/include/_types.h:typedef __uint64_t __uintfptr_t; X arm64/include/profile.h:typedef unsigned long long uintfptr_t; X i386/include/profile.h:typedef u_int uintfptr_t; X mips/include/_types.h:typedef __uint64_t __uintfptr_t; X mips/include/_types.h:typedef __uint32_t __uintfptr_t; X mips/include/profile.h:typedef u_long uintfptr_t; X mips/include/profile.h:typedef u_int uintfptr_t; X powerpc/include/_types.h:typedef __uint64_t __uintfptr_t; X powerpc/include/_types.h:typedef __uint32_t __uintfptr_t; X powerpc/include/profile.h:typedef u_long uintfptr_t; X powerpc/include/profile.h:typedef u_int uintfptr_t; X sparc64/include/_types.h:typedef __uint64_t __uintfptr_t; X sparc64/include/profile.h:typedef u_long uintfptr_t; X x86/include/_types.h:typedef __uint64_t __uintfptr_t; X x86/include/_types.h:typedef __uint32_t __uintfptr_t; All except arm64 are consistently inconsistent in using the correct basic type in but a fixed-width type in . arm64 uses the long long abomination to get a type mismatch (same width, higher rank) in . This was consistent in FreeBSD-4 where __uintfptr_t doesn't exist. uintptr_t was only declared in (and via intentional pollution) so there was no difference for the kernel to confuse you. But must be included. has a reference but no useful documentation in moncontrol(3), and a surprisingly large amount of documentation in sysctl(3) of all places. It seems I didn't enlarge this when I enlarged gmon with much more than uintfptr_t. Bruce From owner-svn-src-head@freebsd.org Wed Jan 13 06:34:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33441A802A9; Wed, 13 Jan 2016 06:34:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBBB519C6; Wed, 13 Jan 2016 06:34:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D6YqNE044263; Wed, 13 Jan 2016 06:34:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D6YpB1044258; Wed, 13 Jan 2016 06:34:51 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601130634.u0D6YpB1044258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 13 Jan 2016 06:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293805 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 06:34:53 -0000 Author: arybchik Date: Wed Jan 13 06:34:51 2016 New Revision: 293805 URL: https://svnweb.freebsd.org/changeset/base/293805 Log: sfxge: rename common hunt NIC methods to ef10 Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4880 Modified: head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/hunt_rx.c head/sys/dev/sfxge/common/hunt_tx.c Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Wed Jan 13 05:32:24 2016 (r293804) +++ head/sys/dev/sfxge/common/efx_nic.c Wed Jan 13 06:34:51 2016 (r293805) @@ -284,18 +284,18 @@ static efx_nic_ops_t __efx_nic_siena_ops #if EFSYS_OPT_HUNTINGTON static efx_nic_ops_t __efx_nic_hunt_ops = { - hunt_nic_probe, /* eno_probe */ - hunt_nic_set_drv_limits, /* eno_set_drv_limits */ - hunt_nic_reset, /* eno_reset */ - hunt_nic_init, /* eno_init */ - hunt_nic_get_vi_pool, /* eno_get_vi_pool */ - hunt_nic_get_bar_region, /* eno_get_bar_region */ + ef10_nic_probe, /* eno_probe */ + ef10_nic_set_drv_limits, /* eno_set_drv_limits */ + ef10_nic_reset, /* eno_reset */ + ef10_nic_init, /* eno_init */ + ef10_nic_get_vi_pool, /* eno_get_vi_pool */ + ef10_nic_get_bar_region, /* eno_get_bar_region */ #if EFSYS_OPT_DIAG ef10_sram_test, /* eno_sram_test */ - hunt_nic_register_test, /* eno_register_test */ + ef10_nic_register_test, /* eno_register_test */ #endif /* EFSYS_OPT_DIAG */ - hunt_nic_fini, /* eno_fini */ - hunt_nic_unprobe, /* eno_unprobe */ + ef10_nic_fini, /* eno_fini */ + ef10_nic_unprobe, /* eno_unprobe */ }; #endif /* EFSYS_OPT_HUNTINGTON */ Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Wed Jan 13 05:32:24 2016 (r293804) +++ head/sys/dev/sfxge/common/hunt_impl.h Wed Jan 13 06:34:51 2016 (r293805) @@ -52,7 +52,7 @@ extern "C" { /* Alignment requirement for value written to RX WPTR: * the WPTR must be aligned to an 8 descriptor boundary */ -#define HUNTINGTON_RX_WPTR_ALIGN 8 +#define EF10_RX_WPTR_ALIGN 8 /* Invalid RSS context handle */ #define EF10_RSS_CONTEXT_INVALID (0xffffffff) @@ -161,48 +161,48 @@ ef10_intr_fini( /* NIC */ extern __checkReturn efx_rc_t -hunt_nic_probe( +ef10_nic_probe( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_nic_set_drv_limits( +ef10_nic_set_drv_limits( __inout efx_nic_t *enp, __in efx_drv_limits_t *edlp); extern __checkReturn efx_rc_t -hunt_nic_get_vi_pool( +ef10_nic_get_vi_pool( __in efx_nic_t *enp, __out uint32_t *vi_countp); extern __checkReturn efx_rc_t -hunt_nic_get_bar_region( +ef10_nic_get_bar_region( __in efx_nic_t *enp, __in efx_nic_region_t region, __out uint32_t *offsetp, __out size_t *sizep); extern __checkReturn efx_rc_t -hunt_nic_reset( +ef10_nic_reset( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_nic_init( +ef10_nic_init( __in efx_nic_t *enp); #if EFSYS_OPT_DIAG extern __checkReturn efx_rc_t -hunt_nic_register_test( +ef10_nic_register_test( __in efx_nic_t *enp); #endif /* EFSYS_OPT_DIAG */ extern void -hunt_nic_fini( +ef10_nic_fini( __in efx_nic_t *enp); extern void -hunt_nic_unprobe( +ef10_nic_unprobe( __in efx_nic_t *enp); @@ -747,7 +747,7 @@ typedef uint32_t efx_piobuf_handle_t; #define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t) -1) extern __checkReturn efx_rc_t -hunt_nic_pio_alloc( +ef10_nic_pio_alloc( __inout efx_nic_t *enp, __out uint32_t *bufnump, __out efx_piobuf_handle_t *handlep, @@ -756,19 +756,19 @@ hunt_nic_pio_alloc( __out size_t *sizep); extern __checkReturn efx_rc_t -hunt_nic_pio_free( +ef10_nic_pio_free( __inout efx_nic_t *enp, __in uint32_t bufnum, __in uint32_t blknum); extern __checkReturn efx_rc_t -hunt_nic_pio_link( +ef10_nic_pio_link( __inout efx_nic_t *enp, __in uint32_t vi_index, __in efx_piobuf_handle_t handle); extern __checkReturn efx_rc_t -hunt_nic_pio_unlink( +ef10_nic_pio_unlink( __inout efx_nic_t *enp, __in uint32_t vi_index); Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Jan 13 05:32:24 2016 (r293804) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Jan 13 06:34:51 2016 (r293805) @@ -50,7 +50,8 @@ efx_mcdi_get_port_assignment( MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN)]; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PORT_ASSIGNMENT; @@ -93,7 +94,8 @@ efx_mcdi_get_port_modes( MC_CMD_GET_PORT_MODES_OUT_LEN)]; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PORT_MODES; @@ -212,7 +214,8 @@ efx_mcdi_get_mac_address_pf( MC_CMD_GET_MAC_ADDRESSES_OUT_LEN)]; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_MAC_ADDRESSES; @@ -269,7 +272,8 @@ efx_mcdi_get_mac_address_vf( MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX)]; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_VPORT_GET_MAC_ADDRESSES; @@ -331,7 +335,8 @@ efx_mcdi_get_clock( MC_CMD_GET_CLOCK_OUT_LEN)]; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_CLOCK; @@ -706,7 +711,7 @@ fail1: } static void -hunt_nic_alloc_piobufs( +ef10_nic_alloc_piobufs( __in efx_nic_t *enp, __in uint32_t max_piobuf_count) { @@ -743,7 +748,7 @@ fail1: static void -hunt_nic_free_piobufs( +ef10_nic_free_piobufs( __in efx_nic_t *enp) { efx_piobuf_handle_t *handlep; @@ -760,7 +765,7 @@ hunt_nic_free_piobufs( /* Sub-allocate a block from a piobuf */ __checkReturn efx_rc_t -hunt_nic_pio_alloc( +ef10_nic_pio_alloc( __inout efx_nic_t *enp, __out uint32_t *bufnump, __out efx_piobuf_handle_t *handlep, @@ -774,7 +779,8 @@ hunt_nic_pio_alloc( uint32_t buf, blk; efx_rc_t rc; - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); EFSYS_ASSERT(bufnump); EFSYS_ASSERT(handlep); EFSYS_ASSERT(blknump); @@ -824,7 +830,7 @@ fail1: /* Free a piobuf sub-allocated block */ __checkReturn efx_rc_t -hunt_nic_pio_free( +ef10_nic_pio_free( __inout efx_nic_t *enp, __in uint32_t bufnum, __in uint32_t blknum) @@ -856,7 +862,7 @@ fail1: } __checkReturn efx_rc_t -hunt_nic_pio_link( +ef10_nic_pio_link( __inout efx_nic_t *enp, __in uint32_t vi_index, __in efx_piobuf_handle_t handle) @@ -865,7 +871,7 @@ hunt_nic_pio_link( } __checkReturn efx_rc_t -hunt_nic_pio_unlink( +ef10_nic_pio_unlink( __inout efx_nic_t *enp, __in uint32_t vi_index) { @@ -873,7 +879,7 @@ hunt_nic_pio_unlink( } static __checkReturn efx_rc_t -hunt_get_datapath_caps( +ef10_get_datapath_caps( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); @@ -964,7 +970,7 @@ static struct { efx_family_t family; uint32_t modes_mask; uint32_t stride; -} __hunt_external_port_mappings[] = { +} __ef10_external_port_mappings[] = { /* Supported modes requiring 1 output per port */ { EFX_FAMILY_HUNTINGTON, @@ -993,7 +999,7 @@ static struct { }; static __checkReturn efx_rc_t -hunt_external_port_mapping( +ef10_external_port_mapping( __in efx_nic_t *enp, __in uint32_t port, __out uint8_t *external_portp) @@ -1013,14 +1019,14 @@ hunt_external_port_mapping( * Infer the internal port -> external port mapping from * the possible port modes for this NIC. */ - for (i = 0; i < EFX_ARRAY_SIZE(__hunt_external_port_mappings); ++i) { - if (__hunt_external_port_mappings[i].family != + for (i = 0; i < EFX_ARRAY_SIZE(__ef10_external_port_mappings); ++i) { + if (__ef10_external_port_mappings[i].family != enp->en_family) continue; - matches = (__hunt_external_port_mappings[i].modes_mask & + matches = (__ef10_external_port_mappings[i].modes_mask & port_modes); if (matches != 0) { - stride = __hunt_external_port_mappings[i].stride; + stride = __ef10_external_port_mappings[i].stride; port_modes &= ~matches; } } @@ -1073,7 +1079,7 @@ hunt_board_cfg( */ emip->emi_port = port + 1; - if ((rc = hunt_external_port_mapping(enp, port, + if ((rc = ef10_external_port_mapping(enp, port, &encp->enc_external_port)) != 0) goto fail2; @@ -1237,7 +1243,7 @@ hunt_board_cfg( } /* Check capabilities of running datapath firmware */ - if ((rc = hunt_get_datapath_caps(enp)) != 0) + if ((rc = ef10_get_datapath_caps(enp)) != 0) goto fail12; /* Alignment for receive packet DMA buffers */ @@ -1245,7 +1251,7 @@ hunt_board_cfg( encp->enc_rx_buf_align_end = 64; /* RX DMA end padding */ /* Alignment for WPTR updates */ - encp->enc_rx_push_align = HUNTINGTON_RX_WPTR_ALIGN; + encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; /* * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use @@ -1339,14 +1345,15 @@ fail1: __checkReturn efx_rc_t -hunt_nic_probe( +ef10_nic_probe( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_drv_cfg_t *edcp = &(enp->en_drv_cfg); efx_rc_t rc; - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); /* Read and clear any assertion state */ if ((rc = efx_mcdi_read_assertion(enp)) != 0) @@ -1426,7 +1433,7 @@ fail1: } __checkReturn efx_rc_t -hunt_nic_set_drv_limits( +ef10_nic_set_drv_limits( __inout efx_nic_t *enp, __in efx_drv_limits_t *edlp) { @@ -1501,7 +1508,7 @@ fail1: __checkReturn efx_rc_t -hunt_nic_reset( +ef10_nic_reset( __in efx_nic_t *enp) { efx_mcdi_req_t req; @@ -1509,7 +1516,7 @@ hunt_nic_reset( MC_CMD_ENTITY_RESET_OUT_LEN)]; efx_rc_t rc; - /* hunt_nic_reset() is called to recover from BADASSERT failures. */ + /* ef10_nic_reset() is called to recover from BADASSERT failures. */ if ((rc = efx_mcdi_read_assertion(enp)) != 0) goto fail1; if ((rc = efx_mcdi_exit_assertion_handler(enp)) != 0) @@ -1548,7 +1555,7 @@ fail1: } __checkReturn efx_rc_t -hunt_nic_init( +ef10_nic_init( __in efx_nic_t *enp) { efx_drv_cfg_t *edcp = &(enp->en_drv_cfg); @@ -1559,14 +1566,15 @@ hunt_nic_init( uint32_t delay_us; efx_rc_t rc; - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); /* Enable reporting of some events (e.g. link change) */ if ((rc = efx_mcdi_log_ctrl(enp)) != 0) goto fail1; /* Allocate (optional) on-chip PIO buffers */ - hunt_nic_alloc_piobufs(enp, edcp->edc_max_piobuf_count); + ef10_nic_alloc_piobufs(enp, edcp->edc_max_piobuf_count); /* * For best performance, PIO writes should use a write-combined @@ -1610,7 +1618,7 @@ hunt_nic_init( if (vi_count < min_vi_count + enp->en_arch.ef10.ena_piobuf_count) { /* Not enough extra VIs to map piobufs */ - hunt_nic_free_piobufs(enp); + ef10_nic_free_piobufs(enp); } enp->en_arch.ef10.ena_pio_write_vi_base = @@ -1700,7 +1708,7 @@ fail3: fail2: EFSYS_PROBE(fail2); - hunt_nic_free_piobufs(enp); + ef10_nic_free_piobufs(enp); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -1709,11 +1717,12 @@ fail1: } __checkReturn efx_rc_t -hunt_nic_get_vi_pool( +ef10_nic_get_vi_pool( __in efx_nic_t *enp, __out uint32_t *vi_countp) { - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); /* * Report VIs that the client driver can use. @@ -1725,7 +1734,7 @@ hunt_nic_get_vi_pool( } __checkReturn efx_rc_t -hunt_nic_get_bar_region( +ef10_nic_get_bar_region( __in efx_nic_t *enp, __in efx_nic_region_t region, __out uint32_t *offsetp, @@ -1733,7 +1742,8 @@ hunt_nic_get_bar_region( { efx_rc_t rc; - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); /* * TODO: Specify host memory mapping alignment and granularity @@ -1767,7 +1777,7 @@ fail1: } void -hunt_nic_fini( +ef10_nic_fini( __in efx_nic_t *enp) { uint32_t i; @@ -1786,14 +1796,14 @@ hunt_nic_fini( } } - hunt_nic_free_piobufs(enp); + ef10_nic_free_piobufs(enp); (void) efx_mcdi_free_vis(enp); enp->en_arch.ef10.ena_vi_count = 0; } void -hunt_nic_unprobe( +ef10_nic_unprobe( __in efx_nic_t *enp) { #if EFSYS_OPT_MON_STATS @@ -1805,7 +1815,7 @@ hunt_nic_unprobe( #if EFSYS_OPT_DIAG __checkReturn efx_rc_t -hunt_nic_register_test( +ef10_nic_register_test( __in efx_nic_t *enp) { efx_rc_t rc; Modified: head/sys/dev/sfxge/common/hunt_rx.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_rx.c Wed Jan 13 05:32:24 2016 (r293804) +++ head/sys/dev/sfxge/common/hunt_rx.c Wed Jan 13 06:34:51 2016 (r293805) @@ -651,7 +651,7 @@ ef10_rx_qpush( efx_dword_t dword; /* Hardware has alignment restriction for WPTR */ - wptr = P2ALIGN(added, HUNTINGTON_RX_WPTR_ALIGN); + wptr = P2ALIGN(added, EF10_RX_WPTR_ALIGN); if (pushed == wptr) return; Modified: head/sys/dev/sfxge/common/hunt_tx.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_tx.c Wed Jan 13 05:32:24 2016 (r293804) +++ head/sys/dev/sfxge/common/hunt_tx.c Wed Jan 13 06:34:51 2016 (r293805) @@ -251,7 +251,7 @@ ef10_tx_qpio_enable( } /* Sub-allocate a PIO block from a piobuf */ - if ((rc = hunt_nic_pio_alloc(enp, + if ((rc = ef10_nic_pio_alloc(enp, &etp->et_pio_bufnum, &handle, &etp->et_pio_blknum, @@ -262,7 +262,7 @@ ef10_tx_qpio_enable( EFSYS_ASSERT3U(etp->et_pio_size, !=, 0); /* Link the piobuf to this TXQ */ - if ((rc = hunt_nic_pio_link(enp, etp->et_index, handle)) != 0) { + if ((rc = ef10_nic_pio_link(enp, etp->et_index, handle)) != 0) { goto fail3; } @@ -283,7 +283,7 @@ ef10_tx_qpio_enable( fail3: EFSYS_PROBE(fail3); - hunt_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum); + ef10_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum); etp->et_pio_size = 0; fail2: EFSYS_PROBE(fail2); @@ -301,10 +301,10 @@ ef10_tx_qpio_disable( if (etp->et_pio_size != 0) { /* Unlink the piobuf from this TXQ */ - hunt_nic_pio_unlink(enp, etp->et_index); + ef10_nic_pio_unlink(enp, etp->et_index); /* Free the sub-allocated PIO block */ - hunt_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum); + ef10_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum); etp->et_pio_size = 0; etp->et_pio_write_offset = 0; } From owner-svn-src-head@freebsd.org Wed Jan 13 06:37:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 192DAA80382; Wed, 13 Jan 2016 06:37:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4ACE1C56; Wed, 13 Jan 2016 06:37:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D6bkiX044525; Wed, 13 Jan 2016 06:37:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D6bk6f044517; Wed, 13 Jan 2016 06:37:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601130637.u0D6bk6f044517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 13 Jan 2016 06:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293806 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 06:37:48 -0000 Author: arybchik Date: Wed Jan 13 06:37:45 2016 New Revision: 293806 URL: https://svnweb.freebsd.org/changeset/base/293806 Log: sfxge: remove unused common code EFSYS_OPT_RX_HDR_SPLIT The EFSYS_OPT_RX_HDR_SPLIT optional feature in the common code implemented the Lookahead Split feature of Windows. This split received packets at a preconfigured byte offset, and delivered the header and payload portions to separate receive queues. Now the common code interface has no callers, so remove it. Note that this should not be confused with the Header Data Split feature of Windows, which splits packets at a header boundary. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4888 Modified: head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_rx.c Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Wed Jan 13 06:34:51 2016 (r293805) +++ head/sys/dev/sfxge/common/efsys.h Wed Jan 13 06:37:45 2016 (r293806) @@ -288,7 +288,6 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_QSTATS 1 #define EFSYS_OPT_FILTER 1 #define EFSYS_OPT_RX_SCATTER 0 -#define EFSYS_OPT_RX_HDR_SPLIT 0 #define EFSYS_OPT_EV_PREFETCH 0 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Jan 13 06:34:51 2016 (r293805) +++ head/sys/dev/sfxge/common/efx.h Wed Jan 13 06:37:45 2016 (r293806) @@ -1817,15 +1817,6 @@ extern void efx_rx_fini( __in efx_nic_t *enp); -#if EFSYS_OPT_RX_HDR_SPLIT - __checkReturn efx_rc_t -efx_rx_hdr_split_enable( - __in efx_nic_t *enp, - __in unsigned int hdr_buf_size, - __in unsigned int pld_buf_size); - -#endif /* EFSYS_OPT_RX_HDR_SPLIT */ - #if EFSYS_OPT_RX_SCATTER __checkReturn efx_rc_t efx_rx_scatter_enable( Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Wed Jan 13 06:34:51 2016 (r293805) +++ head/sys/dev/sfxge/common/efx_check.h Wed Jan 13 06:37:45 2016 (r293806) @@ -347,12 +347,9 @@ # endif #endif /* EFSYS_OPT_QSTATS */ -/* Support receive header split */ -#if EFSYS_OPT_RX_HDR_SPLIT -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "RX_HDR_SPLIT requires FALCON or SIENA or HUNTINGTON or MEDFORD" -# endif +/* Obsolete option */ +#ifdef EFSYS_OPT_RX_HDR_SPLIT +# error "RX_HDR_SPLIT is obsolete and is not supported" #endif /* EFSYS_OPT_RX_HDR_SPLIT */ /* Support receive scaling (RSS) */ Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Wed Jan 13 06:34:51 2016 (r293805) +++ head/sys/dev/sfxge/common/efx_ev.c Wed Jan 13 06:37:45 2016 (r293806) @@ -498,7 +498,7 @@ falconsiena_ev_rx_not_ok( EFX_EV_QSTAT_INCR(eep, EV_RX_FRM_TRUNC); (*flagsp) |= EFX_DISCARD; -#if (EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER) +#if EFSYS_OPT_RX_SCATTER /* * Lookout for payload queue ran dry errors and ignore them. * @@ -513,7 +513,7 @@ falconsiena_ev_rx_not_ok( (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_JUMBO_CONT) == 0) && (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_BYTE_CNT) == 0)) ignore = B_TRUE; -#endif /* EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER */ +#endif /* EFSYS_OPT_RX_SCATTER */ } if (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_ETH_CRC_ERR) != 0) { @@ -574,10 +574,10 @@ falconsiena_ev_rx( uint32_t size; uint32_t label; boolean_t ok; -#if (EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER) +#if EFSYS_OPT_RX_SCATTER boolean_t sop; boolean_t jumbo_cont; -#endif /* EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER */ +#endif /* EFSYS_OPT_RX_SCATTER */ uint32_t hdr_type; boolean_t is_v6; uint16_t flags; @@ -592,10 +592,10 @@ falconsiena_ev_rx( label = EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_Q_LABEL); ok = (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_PKT_OK) != 0); -#if (EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER) +#if EFSYS_OPT_RX_SCATTER sop = (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_SOP) != 0); jumbo_cont = (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_JUMBO_CONT) != 0); -#endif /* EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER */ +#endif /* EFSYS_OPT_RX_SCATTER */ hdr_type = EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_HDR_TYPE); @@ -650,13 +650,13 @@ falconsiena_ev_rx( break; } -#if EFSYS_OPT_RX_SCATTER || EFSYS_OPT_RX_HDR_SPLIT +#if EFSYS_OPT_RX_SCATTER /* Report scatter and header/lookahead split buffer flags */ if (sop) flags |= EFX_PKT_START; if (jumbo_cont) flags |= EFX_PKT_CONT; -#endif /* EFSYS_OPT_RX_SCATTER || EFSYS_OPT_RX_HDR_SPLIT */ +#endif /* EFSYS_OPT_RX_SCATTER */ /* Detect errors included in the FSF_AZ_RX_EV_PKT_OK indication */ if (!ok) { Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Jan 13 06:34:51 2016 (r293805) +++ head/sys/dev/sfxge/common/efx_impl.h Wed Jan 13 06:37:45 2016 (r293806) @@ -157,10 +157,6 @@ typedef struct efx_tx_ops_s { typedef struct efx_rx_ops_s { efx_rc_t (*erxo_init)(efx_nic_t *); void (*erxo_fini)(efx_nic_t *); -#if EFSYS_OPT_RX_HDR_SPLIT - efx_rc_t (*erxo_hdr_split_enable)(efx_nic_t *, unsigned int, - unsigned int); -#endif #if EFSYS_OPT_RX_SCATTER efx_rc_t (*erxo_scatter_enable)(efx_nic_t *, unsigned int); #endif Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Wed Jan 13 06:34:51 2016 (r293805) +++ head/sys/dev/sfxge/common/efx_rx.c Wed Jan 13 06:37:45 2016 (r293806) @@ -48,14 +48,6 @@ static void falconsiena_rx_fini( __in efx_nic_t *enp); -#if EFSYS_OPT_RX_HDR_SPLIT -static __checkReturn efx_rc_t -falconsiena_rx_hdr_split_enable( - __in efx_nic_t *enp, - __in unsigned int hdr_buf_size, - __in unsigned int pld_buf_size); -#endif /* EFSYS_OPT_RX_HDR_SPLIT */ - #if EFSYS_OPT_RX_SCATTER static __checkReturn efx_rc_t falconsiena_rx_scatter_enable( @@ -131,9 +123,6 @@ falconsiena_rx_qdestroy( static efx_rx_ops_t __efx_rx_falcon_ops = { falconsiena_rx_init, /* erxo_init */ falconsiena_rx_fini, /* erxo_fini */ -#if EFSYS_OPT_RX_HDR_SPLIT - falconsiena_rx_hdr_split_enable, /* erxo_hdr_split_enable */ -#endif #if EFSYS_OPT_RX_SCATTER falconsiena_rx_scatter_enable, /* erxo_scatter_enable */ #endif @@ -155,9 +144,6 @@ static efx_rx_ops_t __efx_rx_falcon_ops static efx_rx_ops_t __efx_rx_siena_ops = { falconsiena_rx_init, /* erxo_init */ falconsiena_rx_fini, /* erxo_fini */ -#if EFSYS_OPT_RX_HDR_SPLIT - falconsiena_rx_hdr_split_enable, /* erxo_hdr_split_enable */ -#endif #if EFSYS_OPT_RX_SCATTER falconsiena_rx_scatter_enable, /* erxo_scatter_enable */ #endif @@ -179,9 +165,6 @@ static efx_rx_ops_t __efx_rx_siena_ops = static efx_rx_ops_t __efx_rx_ef10_ops = { ef10_rx_init, /* erxo_init */ ef10_rx_fini, /* erxo_fini */ -#if EFSYS_OPT_RX_HDR_SPLIT - ef10_rx_hdr_split_enable, /* erxo_hdr_split_enable */ -#endif #if EFSYS_OPT_RX_SCATTER ef10_rx_scatter_enable, /* erxo_scatter_enable */ #endif @@ -289,32 +272,6 @@ efx_rx_fini( enp->en_mod_flags &= ~EFX_MOD_RX; } -#if EFSYS_OPT_RX_HDR_SPLIT - __checkReturn efx_rc_t -efx_rx_hdr_split_enable( - __in efx_nic_t *enp, - __in unsigned int hdr_buf_size, - __in unsigned int pld_buf_size) -{ - efx_rx_ops_t *erxop = enp->en_erxop; - efx_rc_t rc; - - EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); - EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); - EFSYS_ASSERT3U(enp->en_family, >=, EFX_FAMILY_SIENA); - - if ((rc = erxop->erxo_hdr_split_enable(enp, hdr_buf_size, - pld_buf_size)) != 0) - goto fail1; - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - return (rc); -} -#endif /* EFSYS_OPT_RX_HDR_SPLIT */ - #if EFSYS_OPT_RX_SCATTER __checkReturn efx_rc_t efx_rx_scatter_enable( @@ -722,60 +679,6 @@ falconsiena_rx_init( return (0); } -#if EFSYS_OPT_RX_HDR_SPLIT -static __checkReturn efx_rc_t -falconsiena_rx_hdr_split_enable( - __in efx_nic_t *enp, - __in unsigned int hdr_buf_size, - __in unsigned int pld_buf_size) -{ - unsigned int nhdr32; - unsigned int npld32; - efx_oword_t oword; - efx_rc_t rc; - - nhdr32 = hdr_buf_size / 32; - if ((nhdr32 == 0) || - (nhdr32 >= (1 << FRF_CZ_RX_HDR_SPLIT_HDR_BUF_SIZE_WIDTH)) || - ((hdr_buf_size % 32) != 0)) { - rc = EINVAL; - goto fail1; - } - - npld32 = pld_buf_size / 32; - if ((npld32 == 0) || - (npld32 >= (1 << FRF_CZ_RX_HDR_SPLIT_PLD_BUF_SIZE_WIDTH)) || - ((pld_buf_size % 32) != 0)) { - rc = EINVAL; - goto fail2; - } - - if (enp->en_rx_qcount > 0) { - rc = EBUSY; - goto fail3; - } - - EFX_BAR_READO(enp, FR_AZ_RX_CFG_REG, &oword); - - EFX_SET_OWORD_FIELD(oword, FRF_CZ_RX_HDR_SPLIT_EN, 1); - EFX_SET_OWORD_FIELD(oword, FRF_CZ_RX_HDR_SPLIT_HDR_BUF_SIZE, nhdr32); - EFX_SET_OWORD_FIELD(oword, FRF_CZ_RX_HDR_SPLIT_PLD_BUF_SIZE, npld32); - - EFX_BAR_WRITEO(enp, FR_AZ_RX_CFG_REG, &oword); - - return (0); - -fail3: - EFSYS_PROBE(fail3); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} -#endif /* EFSYS_OPT_RX_HDR_SPLIT */ - #if EFSYS_OPT_RX_SCATTER static __checkReturn efx_rc_t falconsiena_rx_scatter_enable( @@ -1279,26 +1182,6 @@ falconsiena_rx_qcreate( jumbo = B_FALSE; break; -#if EFSYS_OPT_RX_HDR_SPLIT - case EFX_RXQ_TYPE_SPLIT_HEADER: - if ((enp->en_family < EFX_FAMILY_SIENA) || ((index & 1) != 0)) { - rc = EINVAL; - goto fail4; - } - split = B_TRUE; - jumbo = B_TRUE; - break; - - case EFX_RXQ_TYPE_SPLIT_PAYLOAD: - if ((enp->en_family < EFX_FAMILY_SIENA) || ((index & 1) == 0)) { - rc = EINVAL; - goto fail4; - } - split = B_FALSE; - jumbo = B_TRUE; - break; -#endif /* EFSYS_OPT_RX_HDR_SPLIT */ - #if EFSYS_OPT_RX_SCATTER case EFX_RXQ_TYPE_SCATTER: if (enp->en_family < EFX_FAMILY_SIENA) { Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Wed Jan 13 06:34:51 2016 (r293805) +++ head/sys/dev/sfxge/common/hunt_impl.h Wed Jan 13 06:37:45 2016 (r293806) @@ -845,14 +845,6 @@ extern __checkReturn efx_rc_t ef10_rx_init( __in efx_nic_t *enp); -#if EFSYS_OPT_RX_HDR_SPLIT -extern __checkReturn efx_rc_t -ef10_rx_hdr_split_enable( - __in efx_nic_t *enp, - __in unsigned int hdr_buf_size, - __in unsigned int pld_buf_size); -#endif /* EFSYS_OPT_RX_HDR_SPLIT */ - #if EFSYS_OPT_RX_SCATTER extern __checkReturn efx_rc_t ef10_rx_scatter_enable( Modified: head/sys/dev/sfxge/common/hunt_rx.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_rx.c Wed Jan 13 06:34:51 2016 (r293805) +++ head/sys/dev/sfxge/common/hunt_rx.c Wed Jan 13 06:37:45 2016 (r293806) @@ -466,32 +466,6 @@ ef10_rx_init( return (0); } -#if EFSYS_OPT_RX_HDR_SPLIT - __checkReturn efx_rc_t -ef10_rx_hdr_split_enable( - __in efx_nic_t *enp, - __in unsigned int hdr_buf_size, - __in unsigned int pld_buf_size) -{ - efx_rc_t rc; - - /* FIXME */ - _NOTE(ARGUNUSED(enp, hdr_buf_size, pld_buf_size)) - if (B_FALSE) { - rc = ENOTSUP; - goto fail1; - } - /* FIXME */ - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} -#endif /* EFSYS_OPT_RX_HDR_SPLIT */ - #if EFSYS_OPT_RX_SCATTER __checkReturn efx_rc_t ef10_rx_scatter_enable( From owner-svn-src-head@freebsd.org Wed Jan 13 06:40:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6750CA80442; Wed, 13 Jan 2016 06:40:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27BB61DE5; Wed, 13 Jan 2016 06:40:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D6e1bU044657; Wed, 13 Jan 2016 06:40:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D6e0F4044652; Wed, 13 Jan 2016 06:40:00 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601130640.u0D6e0F4044652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 13 Jan 2016 06:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293807 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 06:40:02 -0000 Author: arybchik Date: Wed Jan 13 06:40:00 2016 New Revision: 293807 URL: https://svnweb.freebsd.org/changeset/base/293807 Log: sfxge: rework RX prefix handling in the common code Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4889 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_rx.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Jan 13 06:37:45 2016 (r293806) +++ head/sys/dev/sfxge/common/efx.h Wed Jan 13 06:40:00 2016 (r293807) @@ -1883,7 +1883,7 @@ efx_rx_scale_key_set( __in_ecount(n) uint8_t *key, __in size_t n); -extern uint32_t +extern __checkReturn uint32_t efx_psuedo_hdr_hash_get( __in efx_nic_t *enp, __in efx_rx_hash_alg_t func, Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Jan 13 06:37:45 2016 (r293806) +++ head/sys/dev/sfxge/common/efx_impl.h Wed Jan 13 06:40:00 2016 (r293807) @@ -166,7 +166,11 @@ typedef struct efx_rx_ops_s { efx_rc_t (*erxo_scale_key_set)(efx_nic_t *, uint8_t *, size_t); efx_rc_t (*erxo_scale_tbl_set)(efx_nic_t *, unsigned int *, size_t); -#endif + uint32_t (*erxo_prefix_hash)(efx_nic_t *, efx_rx_hash_alg_t, + uint8_t *); +#endif /* EFSYS_OPT_RX_SCALE */ + efx_rc_t (*erxo_prefix_pktlen)(efx_nic_t *, uint8_t *, + uint16_t *); void (*erxo_qpost)(efx_rxq_t *, efsys_dma_addr_t *, size_t, unsigned int, unsigned int, unsigned int); Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Wed Jan 13 06:37:45 2016 (r293806) +++ head/sys/dev/sfxge/common/efx_rx.c Wed Jan 13 06:40:00 2016 (r293807) @@ -75,6 +75,18 @@ falconsiena_rx_scale_tbl_set( __in_ecount(n) unsigned int *table, __in size_t n); +static __checkReturn uint32_t +falconsiena_rx_prefix_hash( + __in efx_nic_t *enp, + __in efx_rx_hash_alg_t func, + __in uint8_t *buffer); + +static __checkReturn efx_rc_t +falconsiena_rx_prefix_pktlen( + __in efx_nic_t *enp, + __in uint8_t *buffer, + __out uint16_t *lengthp); + #endif /* EFSYS_OPT_RX_SCALE */ static void @@ -130,7 +142,9 @@ static efx_rx_ops_t __efx_rx_falcon_ops falconsiena_rx_scale_mode_set, /* erxo_scale_mode_set */ falconsiena_rx_scale_key_set, /* erxo_scale_key_set */ falconsiena_rx_scale_tbl_set, /* erxo_scale_tbl_set */ + falconsiena_rx_prefix_hash, /* erxo_prefix_hash */ #endif + falconsiena_rx_prefix_pktlen, /* erxo_prefix_pktlen */ falconsiena_rx_qpost, /* erxo_qpost */ falconsiena_rx_qpush, /* erxo_qpush */ falconsiena_rx_qflush, /* erxo_qflush */ @@ -151,7 +165,9 @@ static efx_rx_ops_t __efx_rx_siena_ops = falconsiena_rx_scale_mode_set, /* erxo_scale_mode_set */ falconsiena_rx_scale_key_set, /* erxo_scale_key_set */ falconsiena_rx_scale_tbl_set, /* erxo_scale_tbl_set */ + falconsiena_rx_prefix_hash, /* erxo_prefix_hash */ #endif + falconsiena_rx_prefix_pktlen, /* erxo_prefix_pktlen */ falconsiena_rx_qpost, /* erxo_qpost */ falconsiena_rx_qpush, /* erxo_qpush */ falconsiena_rx_qflush, /* erxo_qflush */ @@ -172,7 +188,9 @@ static efx_rx_ops_t __efx_rx_ef10_ops = ef10_rx_scale_mode_set, /* erxo_scale_mode_set */ ef10_rx_scale_key_set, /* erxo_scale_key_set */ ef10_rx_scale_tbl_set, /* erxo_scale_tbl_set */ + ef10_rx_prefix_hash, /* erxo_prefix_hash */ #endif + ef10_rx_prefix_pktlen, /* erxo_prefix_pktlen */ ef10_rx_qpost, /* erxo_qpost */ ef10_rx_qpush, /* erxo_qpush */ ef10_rx_qflush, /* erxo_qflush */ @@ -553,92 +571,29 @@ efx_rx_qdestroy( erxop->erxo_qdestroy(erp); } -/* - * Psuedo-header info for Siena/Falcon. - * - * The psuedo-header is a byte array of one of the forms: - * - * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - * XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.TT.TT.TT.TT - * XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.LL.LL - * - * where: - * - * TT.TT.TT.TT is a 32-bit Toeplitz hash - * LL.LL is a 16-bit LFSR hash - * - * Hash values are in network (big-endian) byte order. - * - * - * On EF10 the pseudo-header is laid out as: - * (See also SF-109306-TC section 9) - * - * Toeplitz hash (32 bits, little-endian) - * Out-of-band outer VLAN tag - * (16 bits, big-endian, 0 if the packet did not have an outer VLAN tag) - * Out-of-band inner VLAN tag - * (16 bits, big-endian, 0 if the packet did not have an inner VLAN tag) - * Packet length (16 bits, little-endian, may be 0) - * MAC timestamp (32 bits, little-endian, may be 0) - * VLAN tag - * (16 bits, big-endian, 0 if the packet did not have an outer VLAN tag) - * VLAN tag - * (16 bits, big-endian, 0 if the packet did not have an inner VLAN tag) - */ - __checkReturn efx_rc_t efx_psuedo_hdr_pkt_length_get( __in efx_nic_t *enp, __in uint8_t *buffer, - __out uint16_t *pkt_lengthp) + __out uint16_t *lengthp) { - if (enp->en_family != EFX_FAMILY_HUNTINGTON && - enp->en_family != EFX_FAMILY_MEDFORD) { - EFSYS_ASSERT(0); - return (ENOTSUP); - } - - *pkt_lengthp = buffer[8] | (buffer[9] << 8); + efx_rx_ops_t *erxop = enp->en_erxop; - return (0); + return (erxop->erxo_prefix_pktlen(enp, buffer, lengthp)); } #if EFSYS_OPT_RX_SCALE - -uint32_t + __checkReturn uint32_t efx_psuedo_hdr_hash_get( __in efx_nic_t *enp, __in efx_rx_hash_alg_t func, __in uint8_t *buffer) { - if (func == EFX_RX_HASHALG_TOEPLITZ) { - switch (enp->en_family) { - case EFX_FAMILY_FALCON: - case EFX_FAMILY_SIENA: - return ((buffer[12] << 24) | - (buffer[13] << 16) | - (buffer[14] << 8) | - buffer[15]); - case EFX_FAMILY_HUNTINGTON: - case EFX_FAMILY_MEDFORD: - return (buffer[0] | - (buffer[1] << 8) | - (buffer[2] << 16) | - (buffer[3] << 24)); - default: - EFSYS_ASSERT(0); - return (0); - } - } else if (func == EFX_RX_HASHALG_LFSR) { - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_FALCON || - enp->en_family == EFX_FAMILY_SIENA); - return ((buffer[14] << 8) | buffer[15]); - } else { - EFSYS_ASSERT(0); - return (0); - } -} + efx_rx_ops_t *erxop = enp->en_erxop; + EFSYS_ASSERT3U(enp->en_hash_support, ==, EFX_RX_HASH_AVAILABLE); + return (erxop->erxo_prefix_hash(enp, func, buffer)); +} #endif /* EFSYS_OPT_RX_SCALE */ #if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA @@ -1026,6 +981,58 @@ fail1: } #endif +/* + * Falcon/Siena psuedo-header + * -------------------------- + * + * Receive packets are prefixed by an optional 16 byte pseudo-header. + * The psuedo-header is a byte array of one of the forms: + * + * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + * xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.TT.TT.TT.TT + * xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.LL.LL + * + * where: + * TT.TT.TT.TT Toeplitz hash (32-bit big-endian) + * LL.LL LFSR hash (16-bit big-endian) + */ + +#if EFSYS_OPT_RX_SCALE +static __checkReturn uint32_t +falconsiena_rx_prefix_hash( + __in efx_nic_t *enp, + __in efx_rx_hash_alg_t func, + __in uint8_t *buffer) +{ + switch (func) { + case EFX_RX_HASHALG_TOEPLITZ: + return ((buffer[12] << 24) | + (buffer[13] << 16) | + (buffer[14] << 8) | + buffer[15]); + + case EFX_RX_HASHALG_LFSR: + return ((buffer[14] << 8) | buffer[15]); + + default: + EFSYS_ASSERT(0); + return (0); + } +} +#endif /* EFSYS_OPT_RX_SCALE */ + +static __checkReturn efx_rc_t +falconsiena_rx_prefix_pktlen( + __in efx_nic_t *enp, + __in uint8_t *buffer, + __out uint16_t *lengthp) +{ + /* Not supported by Falcon/Siena hardware */ + EFSYS_ASSERT(0); + return (ENOTSUP); +} + + static void falconsiena_rx_qpost( __in efx_rxq_t *erp, Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Wed Jan 13 06:37:45 2016 (r293806) +++ head/sys/dev/sfxge/common/hunt_impl.h Wed Jan 13 06:40:00 2016 (r293807) @@ -874,6 +874,18 @@ ef10_rx_scale_tbl_set( __in_ecount(n) unsigned int *table, __in size_t n); +extern __checkReturn uint32_t +ef10_rx_prefix_hash( + __in efx_nic_t *enp, + __in efx_rx_hash_alg_t func, + __in uint8_t *buffer); + +extern __checkReturn efx_rc_t +ef10_rx_prefix_pktlen( + __in efx_nic_t *enp, + __in uint8_t *buffer, + __out uint16_t *lengthp); + #endif /* EFSYS_OPT_RX_SCALE */ extern void Modified: head/sys/dev/sfxge/common/hunt_rx.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_rx.c Wed Jan 13 06:37:45 2016 (r293806) +++ head/sys/dev/sfxge/common/hunt_rx.c Wed Jan 13 06:40:00 2016 (r293807) @@ -575,6 +575,65 @@ fail1: } #endif /* EFSYS_OPT_RX_SCALE */ + +/* + * EF10 RX pseudo-header + * --------------------- + * + * Receive packets are prefixed by an (optional) 14 byte pseudo-header: + * + * +00: Toeplitz hash value. + * (32bit little-endian) + * +04: Outer VLAN tag. Zero if the packet did not have an outer VLAN tag. + * (16bit big-endian) + * +06: Inner VLAN tag. Zero if the packet did not have an inner VLAN tag. + * (16bit big-endian) + * +08: Packet Length. Zero if the RX datapath was in cut-through mode. + * (16bit little-endian) + * +10: MAC timestamp. Zero if timestamping is not enabled. + * (32bit little-endian) + * + * See "The RX Pseudo-header" in SF-109306-TC. + */ + + __checkReturn efx_rc_t +ef10_rx_prefix_pktlen( + __in efx_nic_t *enp, + __in uint8_t *buffer, + __out uint16_t *lengthp) +{ + /* + * The RX pseudo-header contains the packet length, excluding the + * pseudo-header. If the hardware receive datapath was operating in + * cut-through mode then the length in the RX pseudo-header will be + * zero, and the packet length must be obtained from the DMA length + * reported in the RX event. + */ + *lengthp = buffer[8] | (buffer[9] << 8); + return (0); +} + +#if EFSYS_OPT_RX_SCALE + __checkReturn uint32_t +ef10_rx_prefix_hash( + __in efx_nic_t *enp, + __in efx_rx_hash_alg_t func, + __in uint8_t *buffer) +{ + switch (func) { + case EFX_RX_HASHALG_TOEPLITZ: + return (buffer[0] | + (buffer[1] << 8) | + (buffer[2] << 16) | + (buffer[3] << 24)); + + default: + EFSYS_ASSERT(0); + return (0); + } +} +#endif /* EFSYS_OPT_RX_SCALE */ + void ef10_rx_qpost( __in efx_rxq_t *erp, From owner-svn-src-head@freebsd.org Wed Jan 13 06:41:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B374DA805A9; Wed, 13 Jan 2016 06:41:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7709D10F9; Wed, 13 Jan 2016 06:41:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D6fdb9044754; Wed, 13 Jan 2016 06:41:39 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D6fdJ5044752; Wed, 13 Jan 2016 06:41:39 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601130641.u0D6fdJ5044752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 13 Jan 2016 06:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293808 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 06:41:40 -0000 Author: arybchik Date: Wed Jan 13 06:41:39 2016 New Revision: 293808 URL: https://svnweb.freebsd.org/changeset/base/293808 Log: sfxge: note VI_SHIFT reported in ALLOC_VIS response Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4892 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/hunt_nic.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Jan 13 06:40:00 2016 (r293807) +++ head/sys/dev/sfxge/common/efx_impl.h Wed Jan 13 06:41:39 2016 (r293808) @@ -672,6 +672,7 @@ struct efx_nic_s { struct { int ena_vi_base; int ena_vi_count; + int ena_vi_shift; #if EFSYS_OPT_VPD caddr_t ena_svpd; size_t ena_svpd_length; Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Jan 13 06:40:00 2016 (r293807) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Jan 13 06:41:39 2016 (r293808) @@ -470,9 +470,9 @@ efx_mcdi_alloc_vis( __in efx_nic_t *enp, __in uint32_t min_vi_count, __in uint32_t max_vi_count, - __out_opt uint32_t *vi_basep, - __out uint32_t *vi_countp) - + __out uint32_t *vi_basep, + __out uint32_t *vi_countp, + __out uint32_t *vi_shiftp) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_ALLOC_VIS_IN_LEN, @@ -506,11 +506,14 @@ efx_mcdi_alloc_vis( goto fail3; } - if (vi_basep != NULL) - *vi_basep = MCDI_OUT_DWORD(req, ALLOC_VIS_OUT_VI_BASE); + *vi_basep = MCDI_OUT_DWORD(req, ALLOC_VIS_OUT_VI_BASE); + *vi_countp = MCDI_OUT_DWORD(req, ALLOC_VIS_OUT_VI_COUNT); - if (vi_countp != NULL) - *vi_countp = MCDI_OUT_DWORD(req, ALLOC_VIS_OUT_VI_COUNT); + /* Report VI_SHIFT if available (always zero for Huntington) */ + if (req.emr_out_length_used < MC_CMD_ALLOC_VIS_EXT_OUT_LEN) + *vi_shiftp = 0; + else + *vi_shiftp = MCDI_OUT_DWORD(req, ALLOC_VIS_EXT_OUT_VI_SHIFT); return (0); @@ -1560,7 +1563,7 @@ ef10_nic_init( { efx_drv_cfg_t *edcp = &(enp->en_drv_cfg); uint32_t min_vi_count, max_vi_count; - uint32_t vi_count, vi_base; + uint32_t vi_count, vi_base, vi_shift; uint32_t i; uint32_t retry; uint32_t delay_us; @@ -1603,7 +1606,7 @@ ef10_nic_init( */ vi_count = 0; if ((rc = efx_mcdi_alloc_vis(enp, min_vi_count, max_vi_count, - &vi_base, &vi_count)) != 0) + &vi_base, &vi_count, &vi_shift)) != 0) goto fail3; EFSYS_PROBE2(vi_alloc, uint32_t, vi_base, uint32_t, vi_count); @@ -1615,6 +1618,7 @@ ef10_nic_init( enp->en_arch.ef10.ena_vi_base = vi_base; enp->en_arch.ef10.ena_vi_count = vi_count; + enp->en_arch.ef10.ena_vi_shift = vi_shift; if (vi_count < min_vi_count + enp->en_arch.ef10.ena_piobuf_count) { /* Not enough extra VIs to map piobufs */ From owner-svn-src-head@freebsd.org Wed Jan 13 06:42:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44CD9A8060D; Wed, 13 Jan 2016 06:42:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 038CB1336; Wed, 13 Jan 2016 06:42:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D6gp8T047389; Wed, 13 Jan 2016 06:42:51 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D6gp5f047387; Wed, 13 Jan 2016 06:42:51 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601130642.u0D6gp5f047387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 13 Jan 2016 06:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293809 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 06:42:53 -0000 Author: arybchik Date: Wed Jan 13 06:42:51 2016 New Revision: 293809 URL: https://svnweb.freebsd.org/changeset/base/293809 Log: sfxge: simplify MCDI request start Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4894 Modified: head/sys/dev/sfxge/common/hunt_mcdi.c head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Wed Jan 13 06:41:39 2016 (r293808) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Wed Jan 13 06:42:51 2016 (r293809) @@ -140,6 +140,48 @@ ef10_mcdi_fini( emip->emi_new_epoch = B_FALSE; } +static void +ef10_mcdi_send_request( + __in efx_nic_t *enp, + __in void *hdrp, + __in size_t hdr_len, + __in void *sdup, + __in size_t sdu_len) +{ + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; + efsys_mem_t *esmp = emtp->emt_dma_mem; + efx_dword_t dword; + unsigned int pos; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); + + /* Write the header */ + for (pos = 0; pos < hdr_len; pos += sizeof (efx_dword_t)) { + dword = *(efx_dword_t *)((uint8_t *)hdrp + pos); + EFSYS_MEM_WRITED(esmp, pos, &dword); + } + + /* Write the payload */ + for (pos = 0; pos < sdu_len; pos += sizeof (efx_dword_t)) { + dword = *(efx_dword_t *)((uint8_t *)sdup + pos); + EFSYS_MEM_WRITED(esmp, hdr_len + pos, &dword); + } + + /* Guarantee ordering of memory (MCDI request) and PIO (MC doorbell) */ + EFSYS_DMA_SYNC_FOR_DEVICE(esmp, 0, hdr_len + sdu_len); + EFSYS_PIO_WRITE_BARRIER(); + + /* Ring the doorbell to post the command DMA address to the MC */ + EFX_POPULATE_DWORD_1(dword, EFX_DWORD_0, + EFSYS_MEM_ADDR(esmp) >> 32); + EFX_BAR_WRITED(enp, ER_DZ_MC_DB_LWRD_REG, &dword, B_FALSE); + + EFX_POPULATE_DWORD_1(dword, EFX_DWORD_0, + EFSYS_MEM_ADDR(esmp) & 0xffffffff); + EFX_BAR_WRITED(enp, ER_DZ_MC_DB_HWRD_REG, &dword, B_FALSE); +} + void ef10_mcdi_request_copyin( __in efx_nic_t *enp, @@ -148,14 +190,13 @@ ef10_mcdi_request_copyin( __in boolean_t ev_cpl, __in boolean_t new_epoch) { +#if EFSYS_OPT_MCDI_LOGGING const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; - efsys_mem_t *esmp = emtp->emt_dma_mem; +#endif /* EFSYS_OPT_MCDI_LOGGING */ efx_mcdi_header_type_t hdr_type; - efx_dword_t dword; efx_dword_t hdr[2]; + size_t hdr_len; unsigned int xflags; - unsigned int pos; - size_t offset; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); @@ -164,13 +205,12 @@ ef10_mcdi_request_copyin( if (ev_cpl) xflags |= MCDI_HEADER_XFLAGS_EVREQ; - offset = 0; - hdr_type = EFX_MCDI_HEADER_TYPE(emrp->emr_cmd, MAX(emrp->emr_in_length, emrp->emr_out_length)); if (hdr_type == EFX_MCDI_HEADER_TYPE_V2) { /* Construct MCDI v2 header */ + hdr_len = sizeof (hdr); EFX_POPULATE_DWORD_8(hdr[0], MCDI_HEADER_CODE, MC_CMD_V2_EXTN, MCDI_HEADER_RESYNC, 1, @@ -180,16 +220,13 @@ ef10_mcdi_request_copyin( MCDI_HEADER_ERROR, 0, MCDI_HEADER_RESPONSE, 0, MCDI_HEADER_XFLAGS, xflags); - EFSYS_MEM_WRITED(esmp, offset, &hdr[0]); - offset += sizeof (efx_dword_t); EFX_POPULATE_DWORD_2(hdr[1], MC_CMD_V2_EXTN_IN_EXTENDED_CMD, emrp->emr_cmd, MC_CMD_V2_EXTN_IN_ACTUAL_LEN, emrp->emr_in_length); - EFSYS_MEM_WRITED(esmp, offset, &hdr[1]); - offset += sizeof (efx_dword_t); } else { /* Construct MCDI v1 header */ + hdr_len = sizeof (hdr[0]); EFX_POPULATE_DWORD_8(hdr[0], MCDI_HEADER_CODE, emrp->emr_cmd, MCDI_HEADER_RESYNC, 1, @@ -199,39 +236,18 @@ ef10_mcdi_request_copyin( MCDI_HEADER_ERROR, 0, MCDI_HEADER_RESPONSE, 0, MCDI_HEADER_XFLAGS, xflags); - EFSYS_MEM_WRITED(esmp, 0, &hdr[0]); - offset += sizeof (efx_dword_t); } #if EFSYS_OPT_MCDI_LOGGING if (emtp->emt_logger != NULL) { emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_REQUEST, - &hdr, offset, + &hdr, hdr_len, emrp->emr_in_buf, emrp->emr_in_length); } #endif /* EFSYS_OPT_MCDI_LOGGING */ - /* Construct the payload */ - for (pos = 0; pos < emrp->emr_in_length; pos += sizeof (efx_dword_t)) { - memcpy(&dword, MCDI_IN(*emrp, efx_dword_t, pos), - MIN(sizeof (dword), emrp->emr_in_length - pos)); - EFSYS_MEM_WRITED(esmp, offset + pos, &dword); - } - - /* Ring the doorbell to post the command DMA address to the MC */ - EFSYS_ASSERT((EFSYS_MEM_ADDR(esmp) & 0xFF) == 0); - - /* Guarantee ordering of memory (MCDI request) and PIO (MC doorbell) */ - EFSYS_DMA_SYNC_FOR_DEVICE(esmp, 0, offset + emrp->emr_in_length); - EFSYS_PIO_WRITE_BARRIER(); - - EFX_POPULATE_DWORD_1(dword, - EFX_DWORD_0, EFSYS_MEM_ADDR(esmp) >> 32); - EFX_BAR_WRITED(enp, ER_DZ_MC_DB_LWRD_REG, &dword, B_FALSE); - - EFX_POPULATE_DWORD_1(dword, - EFX_DWORD_0, EFSYS_MEM_ADDR(esmp) & 0xffffffff); - EFX_BAR_WRITED(enp, ER_DZ_MC_DB_HWRD_REG, &dword, B_FALSE); + ef10_mcdi_send_request(enp, &hdr[0], hdr_len, + emrp->emr_in_buf, emrp->emr_in_length); } void Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Wed Jan 13 06:41:39 2016 (r293808) +++ head/sys/dev/sfxge/common/siena_mcdi.c Wed Jan 13 06:42:51 2016 (r293809) @@ -53,6 +53,43 @@ __FBSDID("$FreeBSD$"); : MC_SMEM_P1_STATUS_OFST >> 2) +static void +siena_mcdi_send_request( + __in efx_nic_t *enp, + __in void *hdrp, + __in size_t hdr_len, + __in void *sdup, + __in size_t sdu_len) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_dword_t dword; + unsigned int pdur; + unsigned int dbr; + unsigned int pos; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); + + EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2); + pdur = SIENA_MCDI_PDU(emip); + dbr = SIENA_MCDI_DOORBELL(emip); + + /* Write the header */ + EFSYS_ASSERT3U(hdr_len, ==, sizeof (efx_dword_t)); + dword = *(efx_dword_t *)hdrp; + EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, pdur, &dword, B_TRUE); + + /* Write the payload */ + for (pos = 0; pos < sdu_len; pos += sizeof (efx_dword_t)) { + dword = *(efx_dword_t *)((uint8_t *)sdup + pos); + EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, + pdur + 1 + (pos >> 2), &dword, B_FALSE); + } + + /* Ring the doorbell */ + EFX_POPULATE_DWORD_1(dword, EFX_DWORD_0, 0xd004be11); + EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, dbr, &dword, B_FALSE); +} + void siena_mcdi_request_copyin( __in efx_nic_t *enp, @@ -64,26 +101,19 @@ siena_mcdi_request_copyin( #if EFSYS_OPT_MCDI_LOGGING const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; #endif - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_dword_t hdr; - efx_dword_t dword; + size_t hdr_len; unsigned int xflags; - unsigned int pdur; - unsigned int dbr; - unsigned int pos; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); _NOTE(ARGUNUSED(new_epoch)) - EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2); - pdur = SIENA_MCDI_PDU(emip); - dbr = SIENA_MCDI_DOORBELL(emip); - xflags = 0; if (ev_cpl) xflags |= MCDI_HEADER_XFLAGS_EVREQ; - /* Construct the header in shared memory */ + /* Construct the header */ + hdr_len = sizeof (hdr); EFX_POPULATE_DWORD_6(hdr, MCDI_HEADER_CODE, emrp->emr_cmd, MCDI_HEADER_RESYNC, 1, @@ -91,7 +121,6 @@ siena_mcdi_request_copyin( MCDI_HEADER_SEQ, seq, MCDI_HEADER_RESPONSE, 0, MCDI_HEADER_XFLAGS, xflags); - EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, pdur, &hdr, B_TRUE); #if EFSYS_OPT_MCDI_LOGGING if (emtp->emt_logger != NULL) { @@ -101,17 +130,8 @@ siena_mcdi_request_copyin( } #endif /* EFSYS_OPT_MCDI_LOGGING */ - /* Construct the payload */ - for (pos = 0; pos < emrp->emr_in_length; pos += sizeof (efx_dword_t)) { - memcpy(&dword, MCDI_IN(*emrp, efx_dword_t, pos), - MIN(sizeof (dword), emrp->emr_in_length - pos)); - EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, - pdur + 1 + (pos >> 2), &dword, B_FALSE); - } - - /* Ring the doorbell */ - EFX_POPULATE_DWORD_1(dword, EFX_DWORD_0, 0xd004be11); - EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, dbr, &dword, B_FALSE); + siena_mcdi_send_request(enp, &hdr, hdr_len, + emrp->emr_in_buf, emrp->emr_in_length); } void From owner-svn-src-head@freebsd.org Wed Jan 13 06:44:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9516CA806A6; Wed, 13 Jan 2016 06:44:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61A7F150E; Wed, 13 Jan 2016 06:44:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D6i6gF047496; Wed, 13 Jan 2016 06:44:06 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D6i58N047490; Wed, 13 Jan 2016 06:44:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601130644.u0D6i58N047490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 13 Jan 2016 06:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293810 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 06:44:07 -0000 Author: arybchik Date: Wed Jan 13 06:44:05 2016 New Revision: 293810 URL: https://svnweb.freebsd.org/changeset/base/293810 Log: sfxge: simplify conversion of NVRAM types to/from partition ids Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4895 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nvram.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_nvram.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Jan 13 06:42:51 2016 (r293809) +++ head/sys/dev/sfxge/common/efx_impl.h Wed Jan 13 06:44:05 2016 (r293810) @@ -492,6 +492,8 @@ typedef struct efx_nvram_ops_s { efx_rc_t (*envo_set_version)(efx_nic_t *, efx_nvram_type_t, uint16_t *); + efx_rc_t (*envo_type_to_partn)(efx_nic_t *, efx_nvram_type_t, + uint32_t *); } efx_nvram_ops_t; #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Wed Jan 13 06:42:51 2016 (r293809) +++ head/sys/dev/sfxge/common/efx_nvram.c Wed Jan 13 06:44:05 2016 (r293810) @@ -53,6 +53,7 @@ static efx_nvram_ops_t __efx_nvram_falco falcon_nvram_write_chunk, /* envo_write_chunk */ falcon_nvram_rw_finish, /* envo_rw_finish */ falcon_nvram_set_version, /* envo_set_version */ + falcon_nvram_type_to_partn, /* envo_type_to_partn */ }; #endif /* EFSYS_OPT_FALCON */ @@ -71,6 +72,7 @@ static efx_nvram_ops_t __efx_nvram_siena siena_nvram_write_chunk, /* envo_write_chunk */ siena_nvram_rw_finish, /* envo_rw_finish */ siena_nvram_set_version, /* envo_set_version */ + siena_nvram_type_to_partn, /* envo_type_to_partn */ }; #endif /* EFSYS_OPT_SIENA */ @@ -89,6 +91,7 @@ static efx_nvram_ops_t __efx_nvram_ef10_ ef10_nvram_write_chunk, /* envo_write_chunk */ ef10_nvram_rw_finish, /* envo_rw_finish */ ef10_nvram_set_version, /* envo_set_version */ + ef10_nvram_type_to_partn, /* envo_type_to_partn */ }; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Wed Jan 13 06:42:51 2016 (r293809) +++ head/sys/dev/sfxge/common/hunt_impl.h Wed Jan 13 06:44:05 2016 (r293810) @@ -466,6 +466,12 @@ ef10_nvram_set_version( __in efx_nvram_type_t type, __in_ecount(4) uint16_t version[4]); +extern __checkReturn efx_rc_t +ef10_nvram_type_to_partn( + __in efx_nic_t *enp, + __in efx_nvram_type_t type, + __out uint32_t *partnp); + #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 13 06:42:51 2016 (r293809) +++ head/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 13 06:44:05 2016 (r293810) @@ -1578,47 +1578,86 @@ static ef10_parttbl_entry_t medford_part {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP} }; -static __checkReturn ef10_parttbl_entry_t * -ef10_parttbl_entry( +static __checkReturn efx_rc_t +ef10_parttbl_get( __in efx_nic_t *enp, - __in efx_nvram_type_t type) + __out ef10_parttbl_entry_t **parttblp, + __out size_t *parttbl_rowsp) { - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - ef10_parttbl_entry_t *entry; - ef10_parttbl_entry_t *parttbl; - size_t parttbl_size = 0; - unsigned int i; - - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - switch (enp->en_family) { case EFX_FAMILY_HUNTINGTON: - parttbl = hunt_parttbl; - parttbl_size = EFX_ARRAY_SIZE(hunt_parttbl); + *parttblp = hunt_parttbl; + *parttbl_rowsp = EFX_ARRAY_SIZE(hunt_parttbl); break; case EFX_FAMILY_MEDFORD: - parttbl = medford_parttbl; - parttbl_size = EFX_ARRAY_SIZE(medford_parttbl); + *parttblp = medford_parttbl; + *parttbl_rowsp = EFX_ARRAY_SIZE(medford_parttbl); break; default: EFSYS_ASSERT(B_FALSE); - goto not_found; + return (EINVAL); } + return (0); +} - if (parttbl != NULL) { - for (i = 0; i < parttbl_size; i++) { - entry = &parttbl[i]; - - if (entry->port == emip->emi_port && - entry->nvtype == type) { - return (entry); + __checkReturn efx_rc_t +ef10_nvram_type_to_partn( + __in efx_nic_t *enp, + __in efx_nvram_type_t type, + __out uint32_t *partnp) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + ef10_parttbl_entry_t *parttbl = NULL; + size_t parttbl_rows = 0; + unsigned int i; + + EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); + EFSYS_ASSERT(partnp != NULL); + + if (ef10_parttbl_get(enp, &parttbl, &parttbl_rows) == 0) { + for (i = 0; i < parttbl_rows; i++) { + ef10_parttbl_entry_t *entry = &parttbl[i]; + + if (entry->nvtype == type && + entry->port == emip->emi_port) { + *partnp = entry->partn; + return (0); } } } -not_found: - return (NULL); + + return (ENOTSUP); +} + + +static __checkReturn efx_rc_t +ef10_nvram_partn_to_type( + __in efx_nic_t *enp, + __in uint32_t partn, + __out efx_nvram_type_t *typep) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + ef10_parttbl_entry_t *parttbl = NULL; + size_t parttbl_rows = 0; + unsigned int i; + + EFSYS_ASSERT(typep != NULL); + + if (ef10_parttbl_get(enp, &parttbl, &parttbl_rows) == 0) { + for (i = 0; i < parttbl_rows; i++) { + ef10_parttbl_entry_t *entry = &parttbl[i]; + + if (entry->partn == partn && + entry->port == emip->emi_port) { + *typep = entry->nvtype; + return (0); + } + } + } + + return (ENOTSUP); } @@ -1628,18 +1667,14 @@ not_found: ef10_nvram_test( __in efx_nic_t *enp) { - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - ef10_parttbl_entry_t *entry; - ef10_parttbl_entry_t *parttbl; - size_t parttbl_size = 0; + efx_nvram_type_t type; unsigned int npartns = 0; uint32_t *partns = NULL; size_t size; unsigned int i; - unsigned int j; efx_rc_t rc; - /* Find supported partitions */ + /* Read available partitions from NVRAM partition map */ size = MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_MAXNUM * sizeof (uint32_t); EFSYS_KMEM_ALLOC(enp->en_esip, size, partns); if (partns == NULL) { @@ -1652,46 +1687,18 @@ ef10_nvram_test( goto fail2; } - /* - * Iterate over the list of supported partition types - * applicable to *this* port - */ - switch (enp->en_family) { - case EFX_FAMILY_HUNTINGTON: - parttbl = hunt_parttbl; - parttbl_size = EFX_ARRAY_SIZE(hunt_parttbl); - break; - - case EFX_FAMILY_MEDFORD: - parttbl = medford_parttbl; - parttbl_size = EFX_ARRAY_SIZE(medford_parttbl); - break; - - default: - EFSYS_ASSERT(B_FALSE); - goto fail3; - } - - for (i = 0; i < parttbl_size; i++) { - entry = &parttbl[i]; - - if (entry->port != emip->emi_port) + for (i = 0; i < npartns; i++) { + /* Check if the partition is supported for this port */ + if ((rc = ef10_nvram_partn_to_type(enp, partns[i], &type)) != 0) continue; - for (j = 0; j < npartns; j++) { - if (entry->partn == partns[j]) { - rc = efx_mcdi_nvram_test(enp, entry->partn); - if (rc != 0) - goto fail4; - } - } + if ((rc = efx_mcdi_nvram_test(enp, partns[i])) != 0) + goto fail3; } EFSYS_KMEM_FREE(enp->en_esip, size, partns); return (0); -fail4: - EFSYS_PROBE(fail3); fail3: EFSYS_PROBE(fail3); fail2: @@ -1710,15 +1717,11 @@ ef10_nvram_size( __in efx_nvram_type_t type, __out size_t *sizep) { - ef10_parttbl_entry_t *entry; uint32_t partn; efx_rc_t rc; - if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - partn = entry->partn; if ((rc = ef10_nvram_partn_size(enp, partn, sizep)) != 0) goto fail2; @@ -1742,15 +1745,11 @@ ef10_nvram_get_version( __out uint32_t *subtypep, __out_ecount(4) uint16_t version[4]) { - ef10_parttbl_entry_t *entry; uint32_t partn; efx_rc_t rc; - if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - partn = entry->partn; /* FIXME: get highest partn version from all ports */ /* FIXME: return partn description if available */ @@ -1775,15 +1774,11 @@ ef10_nvram_rw_start( __in efx_nvram_type_t type, __out size_t *chunk_sizep) { - ef10_parttbl_entry_t *entry; uint32_t partn; efx_rc_t rc; - if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - partn = entry->partn; if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0) goto fail2; @@ -1809,16 +1804,13 @@ ef10_nvram_read_chunk( __out_bcount(size) caddr_t data, __in size_t size) { - ef10_parttbl_entry_t *entry; + uint32_t partn; efx_rc_t rc; - if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - if ((rc = ef10_nvram_partn_read(enp, entry->partn, - offset, data, size)) != 0) + if ((rc = ef10_nvram_partn_read(enp, partn, offset, data, size)) != 0) goto fail2; return (0); @@ -1836,19 +1828,17 @@ ef10_nvram_erase( __in efx_nic_t *enp, __in efx_nvram_type_t type) { - ef10_parttbl_entry_t *entry; + uint32_t partn; size_t size; efx_rc_t rc; - if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - if ((rc = ef10_nvram_partn_size(enp, entry->partn, &size)) != 0) + if ((rc = ef10_nvram_partn_size(enp, partn, &size)) != 0) goto fail2; - if ((rc = ef10_nvram_partn_erase(enp, entry->partn, 0, size)) != 0) + if ((rc = ef10_nvram_partn_erase(enp, partn, 0, size)) != 0) goto fail3; return (0); @@ -1871,16 +1861,13 @@ ef10_nvram_write_chunk( __in_bcount(size) caddr_t data, __in size_t size) { - ef10_parttbl_entry_t *entry; + uint32_t partn; efx_rc_t rc; - if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - if ((rc = ef10_nvram_partn_write(enp, entry->partn, - offset, data, size)) != 0) + if ((rc = ef10_nvram_partn_write(enp, partn, offset, data, size)) != 0) goto fail2; return (0); @@ -1898,10 +1885,11 @@ ef10_nvram_rw_finish( __in efx_nic_t *enp, __in efx_nvram_type_t type) { - ef10_parttbl_entry_t *entry; + uint32_t partn; + efx_rc_t rc; - if ((entry = ef10_parttbl_entry(enp, type)) != NULL) - ef10_nvram_partn_unlock(enp, entry->partn); + if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) == 0) + ef10_nvram_partn_unlock(enp, partn); } __checkReturn efx_rc_t @@ -1910,15 +1898,11 @@ ef10_nvram_set_version( __in efx_nvram_type_t type, __in_ecount(4) uint16_t version[4]) { - ef10_parttbl_entry_t *entry; uint32_t partn; efx_rc_t rc; - if ((entry = ef10_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - partn = entry->partn; if ((rc = ef10_nvram_partn_set_version(enp, partn, version)) != 0) goto fail2; @@ -1927,7 +1911,6 @@ ef10_nvram_set_version( fail2: EFSYS_PROBE(fail2); - fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Wed Jan 13 06:42:51 2016 (r293809) +++ head/sys/dev/sfxge/common/siena_impl.h Wed Jan 13 06:44:05 2016 (r293810) @@ -271,6 +271,12 @@ siena_nvram_set_version( __in efx_nvram_type_t type, __in_ecount(4) uint16_t version[4]); +extern __checkReturn efx_rc_t +siena_nvram_type_to_partn( + __in efx_nic_t *enp, + __in efx_nvram_type_t type, + __out uint32_t *partnp); + #endif /* EFSYS_OPT_NVRAM */ #if EFSYS_OPT_VPD Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Wed Jan 13 06:42:51 2016 (r293809) +++ head/sys/dev/sfxge/common/siena_nvram.c Wed Jan 13 06:44:05 2016 (r293810) @@ -232,27 +232,31 @@ static siena_parttbl_entry_t siena_partt {MC_CMD_NVRAM_TYPE_CPLD, 2, EFX_NVRAM_CPLD}, }; -static __checkReturn siena_parttbl_entry_t * -siena_parttbl_entry( + __checkReturn efx_rc_t +siena_nvram_type_to_partn( __in efx_nic_t *enp, - __in efx_nvram_type_t type) + __in efx_nvram_type_t type, + __out uint32_t *partnp) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - siena_parttbl_entry_t *entry; unsigned int i; EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); + EFSYS_ASSERT(partnp != NULL); for (i = 0; i < EFX_ARRAY_SIZE(siena_parttbl); i++) { - entry = &siena_parttbl[i]; + siena_parttbl_entry_t *entry = &siena_parttbl[i]; - if (entry->port == emip->emi_port && entry->nvtype == type) - return (entry); + if (entry->port == emip->emi_port && entry->nvtype == type) { + *partnp = entry->partn; + return (0); + } } - return (NULL); + return (ENOTSUP); } + #if EFSYS_OPT_DIAG __checkReturn efx_rc_t @@ -296,15 +300,13 @@ siena_nvram_size( __in efx_nvram_type_t type, __out size_t *sizep) { - siena_parttbl_entry_t *entry; + uint32_t partn; efx_rc_t rc; - if ((entry = siena_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - if ((rc = siena_nvram_partn_size(enp, entry->partn, sizep)) != 0) + if ((rc = siena_nvram_partn_size(enp, partn, sizep)) != 0) goto fail2; return (0); @@ -520,11 +522,8 @@ siena_nvram_get_version( unsigned int i; efx_rc_t rc; - if ((entry = siena_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - partn = entry->partn; if ((1 << partn) & ~enp->en_u.siena.enu_partn_mask) { rc = ENOTSUP; @@ -605,15 +604,13 @@ siena_nvram_rw_start( __in efx_nvram_type_t type, __out size_t *chunk_sizep) { - siena_parttbl_entry_t *entry; + uint32_t partn; efx_rc_t rc; - if ((entry = siena_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - if ((rc = siena_nvram_partn_lock(enp, entry->partn)) != 0) + if ((rc = siena_nvram_partn_lock(enp, partn)) != 0) goto fail2; if (chunk_sizep != NULL) @@ -637,16 +634,13 @@ siena_nvram_read_chunk( __out_bcount(size) caddr_t data, __in size_t size) { - siena_parttbl_entry_t *entry; + uint32_t partn; efx_rc_t rc; - if ((entry = siena_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - if ((rc = siena_nvram_partn_read(enp, entry->partn, - offset, data, size)) != 0) + if ((rc = siena_nvram_partn_read(enp, partn, offset, data, size)) != 0) goto fail2; return (0); @@ -664,19 +658,17 @@ siena_nvram_erase( __in efx_nic_t *enp, __in efx_nvram_type_t type) { - siena_parttbl_entry_t *entry; size_t size; + uint32_t partn; efx_rc_t rc; - if ((entry = siena_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - if ((rc = siena_nvram_partn_size(enp, entry->partn, &size)) != 0) + if ((rc = siena_nvram_partn_size(enp, partn, &size)) != 0) goto fail2; - if ((rc = siena_nvram_partn_erase(enp, entry->partn, 0, size)) != 0) + if ((rc = siena_nvram_partn_erase(enp, partn, 0, size)) != 0) goto fail3; return (0); @@ -699,16 +691,13 @@ siena_nvram_write_chunk( __in_bcount(size) caddr_t data, __in size_t size) { - siena_parttbl_entry_t *entry; + uint32_t partn; efx_rc_t rc; - if ((entry = siena_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - if ((rc = siena_nvram_partn_write(enp, entry->partn, - offset, data, size)) != 0) + if ((rc = siena_nvram_partn_write(enp, partn, offset, data, size)) != 0) goto fail2; return (0); @@ -726,10 +715,11 @@ siena_nvram_rw_finish( __in efx_nic_t *enp, __in efx_nvram_type_t type) { - siena_parttbl_entry_t *entry; + uint32_t partn; + efx_rc_t rc; - if ((entry = siena_parttbl_entry(enp, type)) != NULL) - siena_nvram_partn_unlock(enp, entry->partn); + if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) == 0) + siena_nvram_partn_unlock(enp, partn); } __checkReturn efx_rc_t @@ -738,10 +728,11 @@ siena_nvram_set_version( __in efx_nvram_type_t type, __in_ecount(4) uint16_t version[4]) { + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); siena_mc_dynamic_config_hdr_t *dcfg = NULL; - siena_parttbl_entry_t *entry; - unsigned int dcfg_partn; - size_t partn_size; + siena_mc_fw_version_t *fwverp; + uint32_t dcfg_partn, partn; + size_t dcfg_size; unsigned int hdr_length; unsigned int vpd_length; unsigned int vpd_offset; @@ -753,16 +744,14 @@ siena_nvram_set_version( size_t length; efx_rc_t rc; - if ((entry = siena_parttbl_entry(enp, type)) == NULL) { - rc = ENOTSUP; + if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) goto fail1; - } - dcfg_partn = (entry->port == 1) + dcfg_partn = (emip->emi_port == 1) ? MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT0 : MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT1; - if ((rc = siena_nvram_partn_size(enp, dcfg_partn, &partn_size)) != 0) + if ((rc = siena_nvram_partn_size(enp, dcfg_partn, &dcfg_size)) != 0) goto fail2; if ((rc = siena_nvram_partn_lock(enp, dcfg_partn)) != 0) @@ -781,7 +770,7 @@ siena_nvram_set_version( * NOTE: This function will blatt any fields trailing the version * vector, or the VPD chunk. */ - required_hdr_length = SIENA_DYNAMIC_CFG_SIZE(entry->partn + 1); + required_hdr_length = SIENA_DYNAMIC_CFG_SIZE(partn + 1); if (required_hdr_length + vpd_length > length) { rc = ENOSPC; goto fail4; @@ -804,24 +793,20 @@ siena_nvram_set_version( } /* Get the subtype to insert into the fw_subtype array */ - if ((rc = siena_nvram_get_subtype(enp, entry->partn, &subtype)) != 0) + if ((rc = siena_nvram_get_subtype(enp, partn, &subtype)) != 0) goto fail5; /* Fill out the new version */ - EFX_POPULATE_DWORD_1(dcfg->fw_version[entry->partn].fw_subtype, - EFX_DWORD_0, subtype); - EFX_POPULATE_WORD_1(dcfg->fw_version[entry->partn].version_w, - EFX_WORD_0, version[0]); - EFX_POPULATE_WORD_1(dcfg->fw_version[entry->partn].version_x, - EFX_WORD_0, version[1]); - EFX_POPULATE_WORD_1(dcfg->fw_version[entry->partn].version_y, - EFX_WORD_0, version[2]); - EFX_POPULATE_WORD_1(dcfg->fw_version[entry->partn].version_z, - EFX_WORD_0, version[3]); + fwverp = &dcfg->fw_version[partn]; + EFX_POPULATE_DWORD_1(fwverp->fw_subtype, EFX_DWORD_0, subtype); + EFX_POPULATE_WORD_1(fwverp->version_w, EFX_WORD_0, version[0]); + EFX_POPULATE_WORD_1(fwverp->version_x, EFX_WORD_0, version[1]); + EFX_POPULATE_WORD_1(fwverp->version_y, EFX_WORD_0, version[2]); + EFX_POPULATE_WORD_1(fwverp->version_z, EFX_WORD_0, version[3]); /* Update the version count */ - if (nitems < entry->partn + 1) { - nitems = entry->partn + 1; + if (nitems < partn + 1) { + nitems = partn + 1; EFX_POPULATE_DWORD_1(dcfg->num_fw_version_items, EFX_DWORD_0, nitems); } @@ -833,7 +818,7 @@ siena_nvram_set_version( dcfg->csum.eb_u8[0] -= cksum; /* Erase and write the new partition */ - if ((rc = siena_nvram_partn_erase(enp, dcfg_partn, 0, partn_size)) != 0) + if ((rc = siena_nvram_partn_erase(enp, dcfg_partn, 0, dcfg_size)) != 0) goto fail6; /* Write out the new structure to nvram */ From owner-svn-src-head@freebsd.org Wed Jan 13 06:45:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5044CA80729; Wed, 13 Jan 2016 06:45:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 083F2177E; Wed, 13 Jan 2016 06:45:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D6j6L8047580; Wed, 13 Jan 2016 06:45:06 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D6j6If047579; Wed, 13 Jan 2016 06:45:06 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601130645.u0D6j6If047579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 13 Jan 2016 06:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293811 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 06:45:07 -0000 Author: arybchik Date: Wed Jan 13 06:45:05 2016 New Revision: 293811 URL: https://svnweb.freebsd.org/changeset/base/293811 Log: sfxge: support MC_CMD_GET_CAPABILITIES_V2 Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4896 Modified: head/sys/dev/sfxge/common/hunt_nic.c Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Jan 13 06:44:05 2016 (r293810) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Jan 13 06:45:05 2016 (r293811) @@ -426,11 +426,12 @@ fail1: static __checkReturn efx_rc_t efx_mcdi_get_capabilities( __in efx_nic_t *enp, - __out efx_dword_t *flagsp) + __out efx_dword_t *flagsp, + __out efx_dword_t *flags2p) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, - MC_CMD_GET_CAPABILITIES_OUT_LEN)]; + MC_CMD_GET_CAPABILITIES_V2_OUT_LEN)]; efx_rc_t rc; (void) memset(payload, 0, sizeof (payload)); @@ -438,7 +439,7 @@ efx_mcdi_get_capabilities( req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_CAPABILITIES_OUT_LEN; + req.emr_out_length = MC_CMD_GET_CAPABILITIES_V2_OUT_LEN; efx_mcdi_execute(enp, &req); @@ -454,6 +455,12 @@ efx_mcdi_get_capabilities( *flagsp = *MCDI_OUT2(req, efx_dword_t, GET_CAPABILITIES_OUT_FLAGS1); + if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) + EFX_ZERO_DWORD(*flags2p); + else + *flags2p = *MCDI_OUT2(req, efx_dword_t, + GET_CAPABILITIES_V2_OUT_FLAGS2); + return (0); fail2: @@ -887,9 +894,11 @@ ef10_get_datapath_caps( { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_dword_t datapath_capabilities; + efx_dword_t datapath_capabilities_v2; efx_rc_t rc; - if ((rc = efx_mcdi_get_capabilities(enp, &datapath_capabilities)) != 0) + if ((rc = efx_mcdi_get_capabilities(enp, &datapath_capabilities, + &datapath_capabilities_v2)) != 0) goto fail1; /* From owner-svn-src-head@freebsd.org Wed Jan 13 06:47:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47E1BA807D8; Wed, 13 Jan 2016 06:47:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19A27199A; Wed, 13 Jan 2016 06:47:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D6lmY4047706; Wed, 13 Jan 2016 06:47:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D6lmbo047705; Wed, 13 Jan 2016 06:47:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601130647.u0D6lmbo047705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 13 Jan 2016 06:47:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293812 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 06:47:49 -0000 Author: arybchik Date: Wed Jan 13 06:47:47 2016 New Revision: 293812 URL: https://svnweb.freebsd.org/changeset/base/293812 Log: sfxge: add Medford firmware subtypes definitions Pulled firmware_ids.h from firmwaresrc and applied genfwdef script. Submitted by: Richard Houldsworth Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4897 Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_tlv_layout.h Wed Jan 13 06:45:05 2016 (r293811) +++ head/sys/dev/sfxge/common/ef10_tlv_layout.h Wed Jan 13 06:47:47 2016 (r293812) @@ -764,4 +764,20 @@ struct tlv_rx_event_merging_config { #define TLV_RX_EVENT_MERGING_MAX_EVENTS_DEFAULT 7 #define TLV_RX_EVENT_MERGING_TIMEOUT_NS_DEFAULT 8740 +#define TLV_TAG_PCIE_LINK_SETTINGS (0x101f0000) +struct tlv_pcie_link_settings { + uint32_t tag; + uint32_t length; + uint16_t gen; /* Target PCIe generation: 1, 2, 3 */ + uint16_t width; /* Number of lanes */ +}; + +#define TLV_TAG_LICENSE (0x20800000) + +typedef struct tlv_license { + uint32_t tag; + uint32_t length; + uint8_t data[]; +} tlv_license_t; + #endif /* CI_MGMT_TLV_LAYOUT_H */ From owner-svn-src-head@freebsd.org Wed Jan 13 07:11:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0938A8002E; Wed, 13 Jan 2016 07:11:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5416F1513; Wed, 13 Jan 2016 07:11:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D7BhZB056327; Wed, 13 Jan 2016 07:11:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D7BhfI056326; Wed, 13 Jan 2016 07:11:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601130711.u0D7BhfI056326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 13 Jan 2016 07:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293813 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 07:11:44 -0000 Author: arybchik Date: Wed Jan 13 07:11:43 2016 New Revision: 293813 URL: https://svnweb.freebsd.org/changeset/base/293813 Log: sfxge: define FATSOv2 option descriptors Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_regs_ef10.h Modified: head/sys/dev/sfxge/common/efx_regs_ef10.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_ef10.h Wed Jan 13 06:47:47 2016 (r293812) +++ head/sys/dev/sfxge/common/efx_regs_ef10.h Wed Jan 13 07:11:43 2016 (r293813) @@ -429,6 +429,48 @@ extern "C" { #define ESF_DZ_TX_TSO_TCP_SEQNO_WIDTH 32 +/* TX_TSO_FATSO2A_DESC */ +#define ESF_DZ_TX_DESC_IS_OPT_LBN 63 +#define ESF_DZ_TX_DESC_IS_OPT_WIDTH 1 +#define ESF_DZ_TX_OPTION_TYPE_LBN 60 +#define ESF_DZ_TX_OPTION_TYPE_WIDTH 3 +#define ESE_DZ_TX_OPTION_DESC_TSO 7 +#define ESE_DZ_TX_OPTION_DESC_VLAN 6 +#define ESE_DZ_TX_OPTION_DESC_CRC_CSUM 0 +#define ESF_DZ_TX_TSO_OPTION_TYPE_LBN 56 +#define ESF_DZ_TX_TSO_OPTION_TYPE_WIDTH 4 +#define ESE_DZ_TX_TSO_OPTION_DESC_FATSO2B 3 +#define ESE_DZ_TX_TSO_OPTION_DESC_FATSO2A 2 +#define ESE_DZ_TX_TSO_OPTION_DESC_ENCAP 1 +#define ESE_DZ_TX_TSO_OPTION_DESC_NORMAL 0 +#define ESF_DZ_TX_TSO_IP_ID_LBN 32 +#define ESF_DZ_TX_TSO_IP_ID_WIDTH 16 +#define ESF_DZ_TX_TSO_TCP_SEQNO_LBN 0 +#define ESF_DZ_TX_TSO_TCP_SEQNO_WIDTH 32 + + +/* TX_TSO_FATSO2B_DESC */ +#define ESF_DZ_TX_DESC_IS_OPT_LBN 63 +#define ESF_DZ_TX_DESC_IS_OPT_WIDTH 1 +#define ESF_DZ_TX_OPTION_TYPE_LBN 60 +#define ESF_DZ_TX_OPTION_TYPE_WIDTH 3 +#define ESE_DZ_TX_OPTION_DESC_TSO 7 +#define ESE_DZ_TX_OPTION_DESC_VLAN 6 +#define ESE_DZ_TX_OPTION_DESC_CRC_CSUM 0 +#define ESF_DZ_TX_TSO_OPTION_TYPE_LBN 56 +#define ESF_DZ_TX_TSO_OPTION_TYPE_WIDTH 4 +#define ESE_DZ_TX_TSO_OPTION_DESC_FATSO2B 3 +#define ESE_DZ_TX_TSO_OPTION_DESC_FATSO2A 2 +#define ESE_DZ_TX_TSO_OPTION_DESC_ENCAP 1 +#define ESE_DZ_TX_TSO_OPTION_DESC_NORMAL 0 +#define ESF_DZ_TX_TSO_OUTER_IP_ID_LBN 16 +#define ESF_DZ_TX_TSO_OUTER_IP_ID_WIDTH 16 +#define ESF_DZ_TX_TSO_TCP_MSS_LBN 32 +#define ESF_DZ_TX_TSO_TCP_MSS_WIDTH 16 +#define ESF_DZ_TX_TSO_INNER_PE_CSUM_LBN 0 +#define ESF_DZ_TX_TSO_INNER_PE_CSUM_WIDTH 16 + + /* ES_TX_VLAN_DESC */ #define ESF_DZ_TX_DESC_IS_OPT_LBN 63 #define ESF_DZ_TX_DESC_IS_OPT_WIDTH 1 From owner-svn-src-head@freebsd.org Wed Jan 13 07:25:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C72BA804A8; Wed, 13 Jan 2016 07:25:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CA411B39; Wed, 13 Jan 2016 07:25:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D7PuT6059436; Wed, 13 Jan 2016 07:25:56 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D7PqR4059393; Wed, 13 Jan 2016 07:25:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601130725.u0D7PqR4059393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 13 Jan 2016 07:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293814 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 07:25:57 -0000 Author: arybchik Date: Wed Jan 13 07:25:51 2016 New Revision: 293814 URL: https://svnweb.freebsd.org/changeset/base/293814 Log: sfxge: cleanup: simplify EFX header includes Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_bootcfg.c head/sys/dev/sfxge/common/efx_crc32.c head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_hash.c head/sys/dev/sfxge/common/efx_intr.c head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/efx_mon.c head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/efx_phy.c head/sys/dev/sfxge/common/efx_port.c head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/efx_sram.c head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/efx_vpd.c head/sys/dev/sfxge/common/efx_wol.c head/sys/dev/sfxge/common/hunt_ev.c head/sys/dev/sfxge/common/hunt_filter.c head/sys/dev/sfxge/common/hunt_intr.c head/sys/dev/sfxge/common/hunt_mac.c head/sys/dev/sfxge/common/hunt_mcdi.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/hunt_nvram.c head/sys/dev/sfxge/common/hunt_phy.c head/sys/dev/sfxge/common/hunt_rx.c head/sys/dev/sfxge/common/hunt_sram.c head/sys/dev/sfxge/common/hunt_tx.c head/sys/dev/sfxge/common/hunt_vpd.c head/sys/dev/sfxge/common/mcdi_mon.c head/sys/dev/sfxge/common/medford_nic.c head/sys/dev/sfxge/common/siena_mac.c head/sys/dev/sfxge/common/siena_mcdi.c head/sys/dev/sfxge/common/siena_nic.c head/sys/dev/sfxge/common/siena_nvram.c head/sys/dev/sfxge/common/siena_phy.c head/sys/dev/sfxge/common/siena_sram.c head/sys/dev/sfxge/common/siena_vpd.c Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,9 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" #include "efx_impl.h" #if EFSYS_OPT_BOOTCFG Modified: head/sys/dev/sfxge/common/efx_crc32.c ============================================================================== --- head/sys/dev/sfxge/common/efx_crc32.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_crc32.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,9 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" #include "efx_impl.h" /* Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_ev.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,12 +31,11 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" +#if EFSYS_OPT_MON_MCDI #include "mcdi_mon.h" +#endif #if EFSYS_OPT_QSTATS #define EFX_EV_QSTAT_INCR(_eep, _stat) \ Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_filter.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/efx_hash.c ============================================================================== --- head/sys/dev/sfxge/common/efx_hash.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_hash.c Wed Jan 13 07:25:51 2016 (r293814) @@ -42,9 +42,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" #include "efx_impl.h" /* Hash initial value */ Modified: head/sys/dev/sfxge/common/efx_intr.c ============================================================================== --- head/sys/dev/sfxge/common/efx_intr.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_intr.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_mac.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,9 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" #include "efx_impl.h" #if EFSYS_OPT_MAC_FALCON_GMAC Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_mcdi.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,11 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" -#include "efx_regs_mcdi.h" #include "efx_impl.h" #if EFSYS_OPT_MCDI Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_mcdi.h Wed Jan 13 07:25:51 2016 (r293814) @@ -34,7 +34,6 @@ #define _SYS_EFX_MCDI_H #include "efx.h" -#include "efx_regs.h" #include "efx_regs_mcdi.h" #ifdef __cplusplus Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_mon.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" #if EFSYS_OPT_MON_NULL Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_nic.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_nvram.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" #if EFSYS_OPT_NVRAM Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_phy.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" #if EFSYS_OPT_FALCON #include "falcon_nvram.h" Modified: head/sys/dev/sfxge/common/efx_port.c ============================================================================== --- head/sys/dev/sfxge/common/efx_port.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_port.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,9 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" #include "efx_impl.h" __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_rx.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/efx_sram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_sram.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_sram.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_tx.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" #if EFSYS_OPT_QSTATS Modified: head/sys/dev/sfxge/common/efx_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/efx_vpd.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_vpd.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" #if EFSYS_OPT_VPD Modified: head/sys/dev/sfxge/common/efx_wol.c ============================================================================== --- head/sys/dev/sfxge/common/efx_wol.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/efx_wol.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,9 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" #include "efx_impl.h" #if EFSYS_OPT_WOL Modified: head/sys/dev/sfxge/common/hunt_ev.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_ev.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/hunt_ev.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" #if EFSYS_OPT_MON_STATS #include "mcdi_mon.h" Modified: head/sys/dev/sfxge/common/hunt_filter.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_filter.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/hunt_filter.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs_mcdi.h" #include "efx_impl.h" #if EFSYS_OPT_HUNTINGTON Modified: head/sys/dev/sfxge/common/hunt_intr.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_intr.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/hunt_intr.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/hunt_mac.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mac.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/hunt_mac.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,11 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" +#if EFSYS_OPT_MON_MCDI #include "mcdi_mon.h" +#endif #if EFSYS_OPT_HUNTINGTON Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" #if EFSYS_OPT_HUNTINGTON Modified: head/sys/dev/sfxge/common/hunt_phy.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_phy.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/hunt_phy.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/hunt_rx.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_rx.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/hunt_rx.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/hunt_sram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_sram.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/hunt_sram.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/hunt_tx.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_tx.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/hunt_tx.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/hunt_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_vpd.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/hunt_vpd.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/mcdi_mon.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" #include "mcdi_mon.h" Modified: head/sys/dev/sfxge/common/siena_mac.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mac.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/siena_mac.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/siena_mcdi.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/siena_nic.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" #include "mcdi_mon.h" Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/siena_nvram.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" #if EFSYS_OPT_SIENA Modified: head/sys/dev/sfxge/common/siena_phy.c ============================================================================== --- head/sys/dev/sfxge/common/siena_phy.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/siena_phy.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/siena_sram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_sram.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/siena_sram.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: head/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/siena_vpd.c Wed Jan 13 07:11:43 2016 (r293813) +++ head/sys/dev/sfxge/common/siena_vpd.c Wed Jan 13 07:25:51 2016 (r293814) @@ -31,10 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include "efsys.h" #include "efx.h" -#include "efx_types.h" -#include "efx_regs.h" #include "efx_impl.h" #if EFSYS_OPT_VPD From owner-svn-src-head@freebsd.org Wed Jan 13 07:32:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEFA5A80759; Wed, 13 Jan 2016 07:32:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B29AB1F6E; Wed, 13 Jan 2016 07:32:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D7VxZx060289; Wed, 13 Jan 2016 07:31:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D7Vxcb060288; Wed, 13 Jan 2016 07:31:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601130731.u0D7Vxcb060288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 13 Jan 2016 07:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293815 - head/tools/regression/geom_gate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 07:32:01 -0000 Author: ngie Date: Wed Jan 13 07:31:59 2016 New Revision: 293815 URL: https://svnweb.freebsd.org/changeset/base/293815 Log: Add conf.sh file missed in r293621 MFC after: 16 days Sponsored by: EMC / Isilon Storage Division Added: head/tools/regression/geom_gate/conf.sh (contents, props changed) Added: head/tools/regression/geom_gate/conf.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/geom_gate/conf.sh Wed Jan 13 07:31:59 2016 (r293815) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +name="$(mktemp -u gate.XXXXXX)" +class="gate" +base=`basename $0` + +kldstat -q -m g_${class} || kldload geom_${class} || exit 1 + +. `dirname $0`/../geom_subr.sh From owner-svn-src-head@freebsd.org Wed Jan 13 07:33:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5146EA809B6; Wed, 13 Jan 2016 07:33:28 +0000 (UTC) (envelope-from joel@vnode.se) Received: from smtp.vnode.se (smtp.vnode.se [IPv6:2001:67c:40c:e3aa::5]) by mx1.freebsd.org (Postfix) with ESMTP id 1A2461165; Wed, 13 Jan 2016 07:33:27 +0000 (UTC) (envelope-from joel@vnode.se) Received: from ymer.vnode.se (81-234-63-71-no20.tbcn.telia.com [81.234.63.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.vnode.se (Postfix) with ESMTPSA id B66EE29FCC; Wed, 13 Jan 2016 08:33:25 +0100 (CET) Date: Wed, 13 Jan 2016 08:33:25 +0100 From: Joel Dahl To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293720 - head/sys/dev/hyperv/netvsc Message-ID: <20160113073325.GA41048@ymer.vnode.se> Mail-Followup-To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601120141.u0C1fYbC080237@repo.freebsd.org> <20160112075525.GA38087@ymer.vnode.se> <1452609005.46848.11.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1452609005.46848.11.camel@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 07:33:28 -0000 On Tue, Jan 12, 2016 at 07:30:05AM -0700, Ian Lepore wrote: > On Tue, 2016-01-12 at 08:55 +0100, Joel Dahl wrote: > > % finger me@freebsd.org > > [freebsd.org] > > Trying 8.8.178.110... > > Login: me Name: Michael Elbel > > Directory: /home/me Shell: > > /usr/local/bin/bash > > No Mail. > > Mail forwarded to: > > me@consol.de > > # me > > No Plan. > > > > ;-) > > > > Really? You're complaining about the committer using the personal > pronoun that refers to one's self in a context of referring to himself? It was a friendly "complaint". Don't overreact. -- Joel From owner-svn-src-head@freebsd.org Wed Jan 13 07:46:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0ADCA6C405; Wed, 13 Jan 2016 07:46:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 612F81D75; Wed, 13 Jan 2016 07:46:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D7kMLD065793; Wed, 13 Jan 2016 07:46:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D7kLKT065785; Wed, 13 Jan 2016 07:46:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601130746.u0D7kLKT065785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 13 Jan 2016 07:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293817 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 07:46:23 -0000 Author: arybchik Date: Wed Jan 13 07:46:21 2016 New Revision: 293817 URL: https://svnweb.freebsd.org/changeset/base/293817 Log: sfxge: cleanup: prefast fixes in common code Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_mcdi.c head/sys/dev/sfxge/common/hunt_nvram.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Jan 13 07:44:58 2016 (r293816) +++ head/sys/dev/sfxge/common/efx.h Wed Jan 13 07:46:21 2016 (r293817) @@ -2235,14 +2235,14 @@ efx_filter_supported_filters( extern void efx_filter_spec_init_rx( - __inout efx_filter_spec_t *spec, + __out efx_filter_spec_t *spec, __in efx_filter_priority_t priority, __in efx_filter_flag_t flags, __in efx_rxq_t *erp); extern void efx_filter_spec_init_tx( - __inout efx_filter_spec_t *spec, + __out efx_filter_spec_t *spec, __in efx_txq_t *etp); extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Wed Jan 13 07:44:58 2016 (r293816) +++ head/sys/dev/sfxge/common/efx_filter.c Wed Jan 13 07:46:21 2016 (r293817) @@ -292,7 +292,7 @@ fail1: void efx_filter_spec_init_rx( - __inout efx_filter_spec_t *spec, + __out efx_filter_spec_t *spec, __in efx_filter_priority_t priority, __in efx_filter_flag_t flags, __in efx_rxq_t *erp) @@ -311,7 +311,7 @@ efx_filter_spec_init_rx( void efx_filter_spec_init_tx( - __inout efx_filter_spec_t *spec, + __out efx_filter_spec_t *spec, __in efx_txq_t *etp) { EFSYS_ASSERT3P(spec, !=, NULL); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Jan 13 07:44:58 2016 (r293816) +++ head/sys/dev/sfxge/common/efx_impl.h Wed Jan 13 07:46:21 2016 (r293817) @@ -1120,7 +1120,7 @@ efx_vpd_hunk_next( __in size_t size, __out efx_vpd_tag_t *tagp, __out efx_vpd_keyword_t *keyword, - __out_bcount_opt(*paylenp) unsigned int *payloadp, + __out_opt unsigned int *payloadp, __out_opt uint8_t *paylenp, __inout unsigned int *contp); Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Wed Jan 13 07:44:58 2016 (r293816) +++ head/sys/dev/sfxge/common/hunt_impl.h Wed Jan 13 07:46:21 2016 (r293817) @@ -289,10 +289,10 @@ ef10_mcdi_poll_response( extern void ef10_mcdi_read_response( - __in efx_nic_t *enp, - __out void *bufferp, - __in size_t offset, - __in size_t length); + __in efx_nic_t *enp, + __out_bcount(length) void *bufferp, + __in size_t offset, + __in size_t length); extern void ef10_mcdi_request_copyout( Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Wed Jan 13 07:44:58 2016 (r293816) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Wed Jan 13 07:46:21 2016 (r293817) @@ -307,10 +307,10 @@ ef10_mcdi_poll_response( void ef10_mcdi_read_response( - __in efx_nic_t *enp, - __out void *bufferp, - __in size_t offset, - __in size_t length) + __in efx_nic_t *enp, + __out_bcount(length) void *bufferp, + __in size_t offset, + __in size_t length) { const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; efsys_mem_t *esmp = emtp->emt_dma_mem; Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 13 07:44:58 2016 (r293816) +++ head/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 13 07:46:21 2016 (r293817) @@ -240,7 +240,7 @@ fail1: static efx_rc_t tlv_init_cursor( - __in tlv_cursor_t *cursor, + __out tlv_cursor_t *cursor, __in uint32_t *block, __in uint32_t *limit) { @@ -255,7 +255,7 @@ tlv_init_cursor( static efx_rc_t tlv_init_cursor_from_size( - __in tlv_cursor_t *cursor, + __out tlv_cursor_t *cursor, __in uint8_t *block, __in size_t size) { Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Wed Jan 13 07:44:58 2016 (r293816) +++ head/sys/dev/sfxge/common/siena_impl.h Wed Jan 13 07:46:21 2016 (r293817) @@ -127,10 +127,10 @@ siena_mcdi_poll_response( extern void siena_mcdi_read_response( - __in efx_nic_t *enp, - __out void *bufferp, - __in size_t offset, - __in size_t length); + __in efx_nic_t *enp, + __out_bcount(length) void *bufferp, + __in size_t offset, + __in size_t length); extern void siena_mcdi_request_copyout( Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Wed Jan 13 07:44:58 2016 (r293816) +++ head/sys/dev/sfxge/common/siena_mcdi.c Wed Jan 13 07:46:21 2016 (r293817) @@ -216,10 +216,10 @@ siena_mcdi_poll_response( void siena_mcdi_read_response( - __in efx_nic_t *enp, - __out void *bufferp, - __in size_t offset, - __in size_t length) + __in efx_nic_t *enp, + __out_bcount(length) void *bufferp, + __in size_t offset, + __in size_t length) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); unsigned int pdur; From owner-svn-src-head@freebsd.org Wed Jan 13 07:55:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78521A6CC65; Wed, 13 Jan 2016 07:55:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 492AC19EE; Wed, 13 Jan 2016 07:55:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D7tlcf069171; Wed, 13 Jan 2016 07:55:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D7tlow069170; Wed, 13 Jan 2016 07:55:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601130755.u0D7tlow069170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 13 Jan 2016 07:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293818 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 07:55:48 -0000 Author: arybchik Date: Wed Jan 13 07:55:47 2016 New Revision: 293818 URL: https://svnweb.freebsd.org/changeset/base/293818 Log: sfxge: cleanup: fix typo in unused EFX_QWORD_IS_SET64 Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_types.h Modified: head/sys/dev/sfxge/common/efx_types.h ============================================================================== --- head/sys/dev/sfxge/common/efx_types.h Wed Jan 13 07:46:21 2016 (r293817) +++ head/sys/dev/sfxge/common/efx_types.h Wed Jan 13 07:55:47 2016 (r293818) @@ -536,7 +536,7 @@ extern int fix_lint; (_oword).eo_u32[3]) == ~((uint32_t)0)) #define EFX_QWORD_IS_SET64(_qword) \ - (((_qword).eq_u64[0]) == ~((uint32_t)0)) + (((_qword).eq_u64[0]) == ~((uint64_t)0)) #define EFX_QWORD_IS_SET32(_qword) \ (((_qword).eq_u32[0] & \ From owner-svn-src-head@freebsd.org Wed Jan 13 08:09:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67EB5A80537; Wed, 13 Jan 2016 08:09:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3225913B0; Wed, 13 Jan 2016 08:09:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D89TKW072657; Wed, 13 Jan 2016 08:09:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D89Th2072655; Wed, 13 Jan 2016 08:09:29 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601130809.u0D89Th2072655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 13 Jan 2016 08:09:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293819 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 08:09:30 -0000 Author: arybchik Date: Wed Jan 13 08:09:28 2016 New Revision: 293819 URL: https://svnweb.freebsd.org/changeset/base/293819 Log: sfxge: cleanup: fix return code types Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/hunt_nvram.c Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Wed Jan 13 07:55:47 2016 (r293818) +++ head/sys/dev/sfxge/common/efx_mcdi.h Wed Jan 13 08:09:28 2016 (r293819) @@ -54,7 +54,7 @@ struct efx_mcdi_req_s { uint8_t *emr_in_buf; size_t emr_in_length; /* Outputs: retcode, buffer, length, and length used*/ - int emr_rc; + efx_rc_t emr_rc; uint8_t *emr_out_buf; size_t emr_out_length; size_t emr_out_length_used; Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 13 07:55:47 2016 (r293818) +++ head/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 13 08:09:28 2016 (r293819) @@ -1103,7 +1103,7 @@ ef10_nvram_segment_write_tlv( __in boolean_t write) { efx_rc_t rc; - int status; + efx_rc_t status; size_t original_segment_size; size_t modified_segment_size; From owner-svn-src-head@freebsd.org Wed Jan 13 09:14:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 179EBA804EB; Wed, 13 Jan 2016 09:14:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A64711D38; Wed, 13 Jan 2016 09:14:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u0D9EJHY065049 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 13 Jan 2016 11:14:19 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u0D9EJHY065049 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u0D9EILi065048; Wed, 13 Jan 2016 11:14:18 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 13 Jan 2016 11:14:18 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293792 - head/sys/boot/uboot/lib Message-ID: <20160113091418.GD72455@kib.kiev.ua> References: <201601130022.u0D0MCWu029299@repo.freebsd.org> <20160113142527.U1277@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160113142527.U1277@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 09:14:25 -0000 On Wed, Jan 13, 2016 at 03:03:07PM +1100, Bruce Evans wrote: > Oops. It is only declared in outside of the kernel. > Only __uintfptr_t is always declared by sys/types.h. So what is the intended use of the uintfptr_t type ? Looking at the implementation only, I am unable to find a difference with uintptr_t. Even on ia64 it is 64bit, which breaks my hypothesis about f standing for 'function'. From owner-svn-src-head@freebsd.org Wed Jan 13 09:14:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 497E1A8052F; Wed, 13 Jan 2016 09:14:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1ADB1D90; Wed, 13 Jan 2016 09:14:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0D9ETnM093364; Wed, 13 Jan 2016 09:14:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0D9ERvE093343; Wed, 13 Jan 2016 09:14:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601130914.u0D9ERvE093343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 13 Jan 2016 09:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293821 - in head: etc/mtree tests/sys tests/sys/geom tests/sys/geom/class tests/sys/geom/class/concat tests/sys/geom/class/eli tests/sys/geom/class/gate tests/sys/geom/class/mirror tes... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 09:14:30 -0000 Author: ngie Date: Wed Jan 13 09:14:27 2016 New Revision: 293821 URL: https://svnweb.freebsd.org/changeset/base/293821 Log: Integrate tools/regression/geom_{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip} in to the FreeBSD test suite as tests/sys/geom/class/{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip} The tools/regression/geom and tools/regression/geom_part testcases are being left alone because both test sets are both currently broken. The majority of this work was done on ^/user/ngie/more-tests2 . The differences are as follows: - tests/sys/geom/class/Makefile.inc is not present; it was inlined into the class's Makefiles for explicitness. - The testcases officially require root via kyua - The geom_gate(4) tests don't use the pidfile changes proposed in https://reviews.freebsd.org/D4836 . MFC after: 1 month Sponsored by: EMC / Isilon Storage Division Added: head/tests/sys/geom/ head/tests/sys/geom/Makefile - copied unchanged from r293818, user/ngie/more-tests2/tests/sys/geom/Makefile head/tests/sys/geom/class/ head/tests/sys/geom/class/Makefile - copied unchanged from r293818, user/ngie/more-tests2/tests/sys/geom/class/Makefile head/tests/sys/geom/class/concat/ - copied from r293820, head/tools/regression/geom_concat/ head/tests/sys/geom/class/concat/1_test.sh - copied unchanged from r293817, head/tools/regression/geom_concat/test-1.t head/tests/sys/geom/class/concat/2_test.sh - copied unchanged from r293817, head/tools/regression/geom_concat/test-2.t head/tests/sys/geom/class/concat/Makefile - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/concat/Makefile head/tests/sys/geom/class/eli/ - copied from r293820, head/tools/regression/geom_eli/ head/tests/sys/geom/class/eli/Makefile - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/eli/Makefile head/tests/sys/geom/class/eli/attach_d_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/attach-d.t head/tests/sys/geom/class/eli/configure_b_B_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/configure-b-B.t head/tests/sys/geom/class/eli/delkey_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/delkey.t head/tests/sys/geom/class/eli/detach_l_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/detach-l.t head/tests/sys/geom/class/eli/init_B_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/init-B.t head/tests/sys/geom/class/eli/init_J_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/init-J.t head/tests/sys/geom/class/eli/init_a_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/init-a.t head/tests/sys/geom/class/eli/init_i_P_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/init-i-P.t head/tests/sys/geom/class/eli/init_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/init.t head/tests/sys/geom/class/eli/integrity_copy_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/integrity-copy.t head/tests/sys/geom/class/eli/integrity_data_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/integrity-data.t head/tests/sys/geom/class/eli/integrity_hmac_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/integrity-hmac.t head/tests/sys/geom/class/eli/kill_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/kill.t head/tests/sys/geom/class/eli/nokey_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/nokey.t head/tests/sys/geom/class/eli/onetime_a_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/onetime-a.t head/tests/sys/geom/class/eli/onetime_d_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/onetime-d.t head/tests/sys/geom/class/eli/onetime_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/onetime.t head/tests/sys/geom/class/eli/readonly_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/readonly.t head/tests/sys/geom/class/eli/resize_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/resize.t head/tests/sys/geom/class/eli/setkey_test.sh - copied unchanged from r293817, head/tools/regression/geom_eli/setkey.t head/tests/sys/geom/class/gate/ - copied from r293820, head/tools/regression/geom_gate/ head/tests/sys/geom/class/gate/1_test.sh - copied unchanged from r293817, head/tools/regression/geom_gate/test-1.t head/tests/sys/geom/class/gate/2_test.sh - copied unchanged from r293817, head/tools/regression/geom_gate/test-2.t head/tests/sys/geom/class/gate/3_test.sh - copied unchanged from r293817, head/tools/regression/geom_gate/test-3.t head/tests/sys/geom/class/gate/Makefile - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/gate/Makefile head/tests/sys/geom/class/geom_subr.sh - copied unchanged from r293820, head/tools/regression/geom_subr.sh head/tests/sys/geom/class/mirror/ - copied from r293820, head/tools/regression/geom_mirror/ head/tests/sys/geom/class/mirror/1_test.sh - copied unchanged from r293817, head/tools/regression/geom_mirror/test-1.t head/tests/sys/geom/class/mirror/2_test.sh - copied unchanged from r293817, head/tools/regression/geom_mirror/test-2.t head/tests/sys/geom/class/mirror/3_test.sh - copied unchanged from r293817, head/tools/regression/geom_mirror/test-3.t head/tests/sys/geom/class/mirror/4_test.sh - copied unchanged from r293817, head/tools/regression/geom_mirror/test-4.t head/tests/sys/geom/class/mirror/5_test.sh - copied unchanged from r293817, head/tools/regression/geom_mirror/test-5.t head/tests/sys/geom/class/mirror/6_test.sh - copied unchanged from r293817, head/tools/regression/geom_mirror/test-6.t head/tests/sys/geom/class/mirror/7_test.sh - copied unchanged from r293817, head/tools/regression/geom_mirror/test-7.t head/tests/sys/geom/class/mirror/Makefile - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/mirror/Makefile head/tests/sys/geom/class/nop/ - copied from r293820, head/tools/regression/geom_nop/ head/tests/sys/geom/class/nop/1_test.sh - copied unchanged from r293817, head/tools/regression/geom_nop/test-1.t head/tests/sys/geom/class/nop/2_test.sh - copied unchanged from r293817, head/tools/regression/geom_nop/test-2.t head/tests/sys/geom/class/nop/Makefile - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/nop/Makefile head/tests/sys/geom/class/raid3/ - copied from r293820, head/tools/regression/geom_raid3/ head/tests/sys/geom/class/raid3/10_test.sh - copied unchanged from r293817, head/tools/regression/geom_raid3/test-10.t head/tests/sys/geom/class/raid3/11_test.sh - copied unchanged from r293817, head/tools/regression/geom_raid3/test-11.t head/tests/sys/geom/class/raid3/12_test.sh - copied unchanged from r293817, head/tools/regression/geom_raid3/test-12.t head/tests/sys/geom/class/raid3/1_test.sh - copied unchanged from r293817, head/tools/regression/geom_raid3/test-1.t head/tests/sys/geom/class/raid3/2_test.sh - copied unchanged from r293817, head/tools/regression/geom_raid3/test-2.t head/tests/sys/geom/class/raid3/3_test.sh - copied unchanged from r293817, head/tools/regression/geom_raid3/test-3.t head/tests/sys/geom/class/raid3/4_test.sh - copied unchanged from r293817, head/tools/regression/geom_raid3/test-4.t head/tests/sys/geom/class/raid3/5_test.sh - copied unchanged from r293817, head/tools/regression/geom_raid3/test-5.t head/tests/sys/geom/class/raid3/6_test.sh - copied unchanged from r293817, head/tools/regression/geom_raid3/test-6.t head/tests/sys/geom/class/raid3/7_test.sh - copied unchanged from r293817, head/tools/regression/geom_raid3/test-7.t head/tests/sys/geom/class/raid3/8_test.sh - copied unchanged from r293817, head/tools/regression/geom_raid3/test-8.t head/tests/sys/geom/class/raid3/9_test.sh - copied unchanged from r293817, head/tools/regression/geom_raid3/test-9.t head/tests/sys/geom/class/raid3/Makefile - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/raid3/Makefile head/tests/sys/geom/class/shsec/ - copied from r293820, head/tools/regression/geom_shsec/ head/tests/sys/geom/class/shsec/1_test.sh - copied unchanged from r293817, head/tools/regression/geom_shsec/test-1.t head/tests/sys/geom/class/shsec/2_test.sh - copied unchanged from r293817, head/tools/regression/geom_shsec/test-2.t head/tests/sys/geom/class/shsec/Makefile - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/shsec/Makefile head/tests/sys/geom/class/stripe/ - copied from r293820, head/tools/regression/geom_stripe/ head/tests/sys/geom/class/stripe/1_test.sh - copied unchanged from r293817, head/tools/regression/geom_stripe/test-1.t head/tests/sys/geom/class/stripe/2_test.sh - copied unchanged from r293817, head/tools/regression/geom_stripe/test-2.t head/tests/sys/geom/class/stripe/Makefile - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/stripe/Makefile head/tests/sys/geom/class/uzip/ - copied from r293820, head/tools/regression/geom_uzip/ head/tests/sys/geom/class/uzip/1_test.sh - copied, changed from r293817, head/tools/regression/geom_uzip/test-1.t Deleted: head/tests/sys/geom/class/concat/test-1.t head/tests/sys/geom/class/concat/test-2.t head/tests/sys/geom/class/eli/attach-d.t head/tests/sys/geom/class/eli/configure-b-B.t head/tests/sys/geom/class/eli/delkey.t head/tests/sys/geom/class/eli/detach-l.t head/tests/sys/geom/class/eli/init-B.t head/tests/sys/geom/class/eli/init-J.t head/tests/sys/geom/class/eli/init-a.t head/tests/sys/geom/class/eli/init-i-P.t head/tests/sys/geom/class/eli/init.t head/tests/sys/geom/class/eli/integrity-copy.t head/tests/sys/geom/class/eli/integrity-data.t head/tests/sys/geom/class/eli/integrity-hmac.t head/tests/sys/geom/class/eli/kill.t head/tests/sys/geom/class/eli/nokey.t head/tests/sys/geom/class/eli/onetime-a.t head/tests/sys/geom/class/eli/onetime-d.t head/tests/sys/geom/class/eli/onetime.t head/tests/sys/geom/class/eli/readonly.t head/tests/sys/geom/class/eli/resize.t head/tests/sys/geom/class/eli/setkey.t head/tests/sys/geom/class/gate/test-1.t head/tests/sys/geom/class/gate/test-2.t head/tests/sys/geom/class/gate/test-3.t head/tests/sys/geom/class/mirror/test-1.t head/tests/sys/geom/class/mirror/test-2.t head/tests/sys/geom/class/mirror/test-3.t head/tests/sys/geom/class/mirror/test-4.t head/tests/sys/geom/class/mirror/test-5.t head/tests/sys/geom/class/mirror/test-6.t head/tests/sys/geom/class/mirror/test-7.t head/tests/sys/geom/class/nop/test-1.t head/tests/sys/geom/class/nop/test-2.t head/tests/sys/geom/class/raid3/test-1.t head/tests/sys/geom/class/raid3/test-10.t head/tests/sys/geom/class/raid3/test-11.t head/tests/sys/geom/class/raid3/test-12.t head/tests/sys/geom/class/raid3/test-2.t head/tests/sys/geom/class/raid3/test-3.t head/tests/sys/geom/class/raid3/test-4.t head/tests/sys/geom/class/raid3/test-5.t head/tests/sys/geom/class/raid3/test-6.t head/tests/sys/geom/class/raid3/test-7.t head/tests/sys/geom/class/raid3/test-8.t head/tests/sys/geom/class/raid3/test-9.t head/tests/sys/geom/class/shsec/test-1.t head/tests/sys/geom/class/shsec/test-2.t head/tests/sys/geom/class/stripe/test-1.t head/tests/sys/geom/class/stripe/test-2.t head/tests/sys/geom/class/uzip/test-1.t head/tools/regression/geom_concat/ head/tools/regression/geom_eli/ head/tools/regression/geom_gate/ head/tools/regression/geom_mirror/ head/tools/regression/geom_nop/ head/tools/regression/geom_raid3/ head/tools/regression/geom_shsec/ head/tools/regression/geom_stripe/ head/tools/regression/geom_subr.sh head/tools/regression/geom_uzip/ Modified: head/etc/mtree/BSD.tests.dist head/tests/sys/Makefile head/tests/sys/geom/class/uzip/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed Jan 13 08:22:53 2016 (r293820) +++ head/etc/mtree/BSD.tests.dist Wed Jan 13 09:14:27 2016 (r293821) @@ -376,6 +376,32 @@ .. file .. + geom + class + concat + .. + eli + .. + gate + .. + gpt + .. + mirror + .. + nop + .. + raid3 + .. + shsec + .. + stripe + .. + uzip + etalon + .. + .. + .. + .. kern acct .. Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Wed Jan 13 08:22:53 2016 (r293820) +++ head/tests/sys/Makefile Wed Jan 13 09:14:27 2016 (r293821) @@ -8,6 +8,7 @@ TESTS_SUBDIRS+= acl TESTS_SUBDIRS+= aio TESTS_SUBDIRS+= fifo TESTS_SUBDIRS+= file +TESTS_SUBDIRS+= geom TESTS_SUBDIRS+= kern TESTS_SUBDIRS+= kqueue TESTS_SUBDIRS+= mac Copied: head/tests/sys/geom/Makefile (from r293818, user/ngie/more-tests2/tests/sys/geom/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/Makefile Wed Jan 13 09:14:27 2016 (r293821, copy of r293818, user/ngie/more-tests2/tests/sys/geom/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sys/geom + +TESTS_SUBDIRS+= class + +.include Copied: head/tests/sys/geom/class/Makefile (from r293818, user/ngie/more-tests2/tests/sys/geom/class/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/Makefile Wed Jan 13 09:14:27 2016 (r293821, copy of r293818, user/ngie/more-tests2/tests/sys/geom/class/Makefile) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sys/geom/class + +TESTS_SUBDIRS+= concat +TESTS_SUBDIRS+= eli +TESTS_SUBDIRS+= gate +# XXX: might not work due to geom(4) changes; more investigation's needed +#TESTS_SUBDIRS+= gpt +TESTS_SUBDIRS+= mirror +TESTS_SUBDIRS+= nop +TESTS_SUBDIRS+= raid3 +TESTS_SUBDIRS+= shsec +TESTS_SUBDIRS+= stripe +TESTS_SUBDIRS+= uzip + +BINDIR= ${TESTSDIR} + +FILES+= geom_subr.sh + +.include Copied: head/tests/sys/geom/class/concat/1_test.sh (from r293817, head/tools/regression/geom_concat/test-1.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/concat/1_test.sh Wed Jan 13 09:14:27 2016 (r293821, copy of r293817, head/tools/regression/geom_concat/test-1.t) @@ -0,0 +1,23 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo '1..1' + +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 + +gconcat create $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 +devwait + +# Size of created device should be 1MB + 2MB + 3MB. + +size=`diskinfo /dev/concat/${name} | awk '{print $3}'` + +if [ $size -eq 6291456 ]; then + echo "ok - Size is 6291456" +else + echo "not ok - Size is 6291456" +fi Copied: head/tests/sys/geom/class/concat/2_test.sh (from r293817, head/tools/regression/geom_concat/test-2.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/concat/2_test.sh Wed Jan 13 09:14:27 2016 (r293821, copy of r293817, head/tools/regression/geom_concat/test-2.t) @@ -0,0 +1,30 @@ +#!/bin/sh +# $FreeBSD$ + +. `dirname $0`/conf.sh + +echo '1..1' + +tsize=6 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 + +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 + +dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 + +gconcat create $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 +devwait + +dd if=${src} of=/dev/concat/${name} bs=1m count=$tsize >/dev/null 2>&1 +dd if=/dev/concat/${name} of=${dst} bs=1m count=$tsize >/dev/null 2>&1 + +if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then + echo "not ok - md5 checksum comparison" +else + echo "ok - md5 checksum comparison" +fi + +rm -f ${src} ${dst} Copied and modified: head/tests/sys/geom/class/concat/Makefile (from r293818, user/ngie/more-tests2/tests/sys/geom/class/concat/Makefile) ============================================================================== --- user/ngie/more-tests2/tests/sys/geom/class/concat/Makefile Wed Jan 13 07:55:47 2016 (r293818, copy source) +++ head/tests/sys/geom/class/concat/Makefile Wed Jan 13 09:14:27 2016 (r293821) @@ -1,5 +1,7 @@ # $FreeBSD$ +TESTSDIR= ${TESTSBASE}/sys/geom/class/${.CURDIR:T} + TAP_TESTS_SH+= 1_test TAP_TESTS_SH+= 2_test @@ -7,4 +9,8 @@ FILES+= conf.sh FILESNAME_conf.sh= conf.sh FILESDIR= ${TESTSDIR} +.for t in ${TAP_TESTS_SH} +TEST_METADATA.$t+= required_user="root" +.endfor + .include Copied and modified: head/tests/sys/geom/class/eli/Makefile (from r293818, user/ngie/more-tests2/tests/sys/geom/class/eli/Makefile) ============================================================================== --- user/ngie/more-tests2/tests/sys/geom/class/eli/Makefile Wed Jan 13 07:55:47 2016 (r293818, copy source) +++ head/tests/sys/geom/class/eli/Makefile Wed Jan 13 09:14:27 2016 (r293821) @@ -1,5 +1,7 @@ # $FreeBSD$ +TESTSDIR= ${TESTSBASE}/sys/geom/class/${.CURDIR:T} + TAP_TESTS_SH+= attach_d_test TAP_TESTS_SH+= configure_b_B_test TAP_TESTS_SH+= delkey_test @@ -33,4 +35,8 @@ FILES+= conf.sh FILESNAME_conf.sh= conf.sh FILESDIR= ${TESTSDIR} +.for t in ${TAP_TESTS_SH} +TEST_METADATA.$t+= required_user="root" +.endfor + .include Copied: head/tests/sys/geom/class/eli/attach_d_test.sh (from r293817, head/tools/regression/geom_eli/attach-d.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/attach_d_test.sh Wed Jan 13 09:14:27 2016 (r293821, copy of r293817, head/tools/regression/geom_eli/attach-d.t) @@ -0,0 +1,38 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..3" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile md${no} +geli attach -d -p -k $keyfile md${no} +if [ -c /dev/md${no}.eli ]; then + echo "ok 1" +else + echo "not ok 1" +fi +# Be sure it doesn't detach on read. +dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +sleep 1 +if [ -c /dev/md${no}.eli ]; then + echo "ok 2" +else + echo "not ok 2" +fi +true > /dev/md${no}.eli +sleep 1 +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +rm -f $keyfile Copied: head/tests/sys/geom/class/eli/configure_b_B_test.sh (from r293817, head/tools/regression/geom_eli/configure-b-B.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/configure_b_B_test.sh Wed Jan 13 09:14:27 2016 (r293821, copy of r293817, head/tools/regression/geom_eli/configure-b-B.t) @@ -0,0 +1,129 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..17" + +geli init -B none -P -K /dev/null md${no} +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi + +geli dump md${no} | egrep 'flags: 0x0$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +geli init -B none -b -P -K /dev/null md${no} +if [ $? -eq 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +geli dump md${no} | egrep 'flags: 0x2$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +geli configure -B md${no} +if [ $? -eq 0 ]; then + echo "ok 5" +else + echo "not ok 5" +fi + +geli dump md${no} | egrep 'flags: 0x0$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi + +geli configure -b md${no} +if [ $? -eq 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi + +geli dump md${no} | egrep 'flags: 0x2$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi + +geli attach -p -k /dev/null md${no} +if [ $? -eq 0 ]; then + echo "ok 9" +else + echo "not ok 9" +fi + +geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 10" +else + echo "not ok 10" +fi + +geli configure -B md${no} +if [ $? -eq 0 ]; then + echo "ok 11" +else + echo "not ok 11" +fi + +geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null +if [ $? -ne 0 ]; then + echo "ok 12" +else + echo "not ok 12" +fi + +geli dump md${no} | egrep 'flags: 0x0$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 13" +else + echo "not ok 13" +fi + +geli configure -b md${no} +if [ $? -eq 0 ]; then + echo "ok 14" +else + echo "not ok 14" +fi + +geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 15" +else + echo "not ok 15" +fi + +geli dump md${no} | egrep 'flags: 0x2$' >/dev/null +if [ $? -eq 0 ]; then + echo "ok 16" +else + echo "not ok 16" +fi + +geli detach md${no} +if [ $? -eq 0 ]; then + echo "ok 17" +else + echo "not ok 17" +fi Copied: head/tests/sys/geom/class/eli/delkey_test.sh (from r293817, head/tools/regression/geom_eli/delkey.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/delkey_test.sh Wed Jan 13 09:14:27 2016 (r293821, copy of r293817, head/tools/regression/geom_eli/delkey.t) @@ -0,0 +1,140 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +keyfile2=`mktemp $base.XXXXXX` || exit 1 +keyfile3=`mktemp $base.XXXXXX` || exit 1 +keyfile4=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..14" + +dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile3} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile4} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile1 md${no} +geli attach -p -k $keyfile1 md${no} +geli setkey -n 1 -P -K $keyfile2 md${no} + +# Remove key 0 for attached provider. +geli delkey -n 0 md${no} +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi +geli detach md${no} + +# We cannot use keyfile1 anymore. +geli attach -p -k $keyfile1 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 2" +else + echo "not ok 2" +fi + +# Attach with key 1. +geli attach -p -k $keyfile2 md${no} +if [ $? -eq 0 ]; then + echo "ok 3" +else + echo "not ok 3" +fi + +# We cannot remove last key without -f option (for attached provider). +geli delkey -n 1 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +# Remove last key for attached provider. +geli delkey -f -n 1 md${no} +if [ $? -eq 0 ]; then + echo "ok 5" +else + echo "not ok 5" +fi + +# If there are no valid keys, but provider is attached, we can save situation. +geli setkey -n 0 -P -K $keyfile3 md${no} +if [ $? -eq 0 ]; then + echo "ok 6" +else + echo "not ok 6" +fi +geli detach md${no} + +# We cannot use keyfile2 anymore. +geli attach -p -k $keyfile2 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 7" +else + echo "not ok 7" +fi + +# Attach with key 0. +geli attach -p -k $keyfile3 md${no} +if [ $? -eq 0 ]; then + echo "ok 8" +else + echo "not ok 8" +fi + +# Setup key 1. +geli setkey -n 1 -P -K $keyfile4 md${no} +if [ $? -eq 0 ]; then + echo "ok 9" +else + echo "not ok 9" +fi +geli detach md${no} + +# Remove key 1 for detached provider. +geli delkey -n 1 md${no} +if [ $? -eq 0 ]; then + echo "ok 10" +else + echo "not ok 10" +fi + +# We cannot use keyfile4 anymore. +geli attach -p -k $keyfile4 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 11" +else + echo "not ok 11" +fi + +# We cannot remove last key without -f option (for detached provider). +geli delkey -n 0 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 12" +else + echo "not ok 12" +fi + +# Remove last key for detached provider. +geli delkey -f -n 0 md${no} +if [ $? -eq 0 ]; then + echo "ok 13" +else + echo "not ok 13" +fi + +# We cannot use keyfile3 anymore. +geli attach -p -k $keyfile3 md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 14" +else + echo "not ok 14" +fi + +rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 Copied: head/tests/sys/geom/class/eli/detach_l_test.sh (from r293817, head/tools/regression/geom_eli/detach-l.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/detach_l_test.sh Wed Jan 13 09:14:27 2016 (r293821, copy of r293817, head/tools/regression/geom_eli/detach-l.t) @@ -0,0 +1,44 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..4" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -P -K $keyfile md${no} +geli attach -p -k $keyfile md${no} +if [ -c /dev/md${no}.eli ]; then + echo "ok 1" +else + echo "not ok 1" +fi +# Be sure it doesn't detach before 'detach -l'. +dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +sleep 1 +if [ -c /dev/md${no}.eli ]; then + echo "ok 2" +else + echo "not ok 2" +fi +geli detach -l md${no} +if [ -c /dev/md${no}.eli ]; then + echo "ok 3" +else + echo "not ok 3" +fi +dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +sleep 1 +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 4" +else + echo "not ok 4" +fi + +rm -f $keyfile Copied: head/tests/sys/geom/class/eli/init_B_test.sh (from r293817, head/tools/regression/geom_eli/init-B.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/init_B_test.sh Wed Jan 13 09:14:27 2016 (r293821, copy of r293817, head/tools/regression/geom_eli/init-B.t) @@ -0,0 +1,104 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +backupfile=`mktemp $base.XXXXXX` || exit 1 + +echo "1..13" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +mdconfig -a -t malloc -s $sectors -u $no || exit 1 + +# -B none +rm -f /var/backups/md${no}.eli +geli init -B none -P -K $keyfile md${no} 2>/dev/null +if [ ! -f /var/backups/md${no}.eli ]; then + echo "ok 1 - -B none" +else + echo "not ok 1 - -B none" +fi + +# no -B +rm -f /var/backups/md${no}.eli +geli init -P -K $keyfile md${no} >/dev/null 2>&1 +if [ -f /var/backups/md${no}.eli ]; then + echo "ok 2 - no -B" +else + echo "not ok 2 - no -B" +fi +geli clear md${no} +geli attach -p -k $keyfile md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 3 - no -B" +else + echo "not ok 3 - no -B" +fi +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 4 - no -B" +else + echo "not ok 4 - no -B" +fi +geli restore /var/backups/md${no}.eli md${no} +if [ $? -eq 0 ]; then + echo "ok 5 - no -B" +else + echo "not ok 5 - no -B" +fi +geli attach -p -k $keyfile md${no} 2>/dev/null +if [ $? -eq 0 ]; then + echo "ok 6 - no -B" +else + echo "not ok 6 - no -B" +fi +if [ -c /dev/md${no}.eli ]; then + echo "ok 7 - no -B" +else + echo "not ok 7 - no -B" +fi +geli detach md${no} +rm -f /var/backups/md${no}.eli + +# -B file +rm -f $backupfile +geli init -B $backupfile -P -K $keyfile md${no} >/dev/null 2>&1 +if [ -f $backupfile ]; then + echo "ok 8 - -B file" +else + echo "not ok 8 - -B file" +fi +geli clear md${no} +geli attach -p -k $keyfile md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 9 - -B file" +else + echo "not ok 9 - -B file" +fi +if [ ! -c /dev/md${no}.eli ]; then + echo "ok 10 - -B file" +else + echo "not ok 10 - -B file" +fi +geli restore $backupfile md${no} +if [ $? -eq 0 ]; then + echo "ok 11 - -B file" +else + echo "not ok 11 - -B file" +fi +geli attach -p -k $keyfile md${no} 2>/dev/null +if [ $? -eq 0 ]; then + echo "ok 12 - -B file" +else + echo "not ok 12 - -B file" +fi +if [ -c /dev/md${no}.eli ]; then + echo "ok 13 - -B file" +else + echo "not ok 13 - -B file" +fi + +rm -f $backupfile $keyfile Copied: head/tests/sys/geom/class/eli/init_J_test.sh (from r293817, head/tools/regression/geom_eli/init-J.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/init_J_test.sh Wed Jan 13 09:14:27 2016 (r293821, copy of r293817, head/tools/regression/geom_eli/init-J.t) @@ -0,0 +1,126 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile0=`mktemp $base.XXXXXX` || exit 1 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +passfile0=`mktemp $base.XXXXXX` || exit 1 +passfile1=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..150" + +dd if=/dev/random of=${keyfile0} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile0} +dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile1} + +i=1 +for iter in -1 0 64; do + geli init -i ${iter} -B none -J ${passfile0} -P md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -P -K ${keyfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -K ${keyfile0} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${keyfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${passfile0} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${keyfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${keyfile0} -k ${keyfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile0} | geli attach -j ${passfile0} -k - md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile0} | geli attach -j - -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile0} | geli attach -j - -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile1} | geli attach -j ${passfile0} -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile0} | geli attach -j ${passfile0} -j ${passfile1} -k - -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k - md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile0} ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k - md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile0} ${passfile1} | awk '{printf "%s", $0}' | geli attach -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) +done + +rm -f ${keyfile0} ${keyfile1} ${passfile0} ${passfile1} Copied: head/tests/sys/geom/class/eli/init_a_test.sh (from r293817, head/tools/regression/geom_eli/init-a.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/init_a_test.sh Wed Jan 13 09:14:27 2016 (r293821, copy of r293817, head/tools/regression/geom_eli/init-a.t) @@ -0,0 +1,60 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 + +echo "1..1380" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do + for secsize in 512 1024 2048 4096 8192; do + rnd=`mktemp $base.XXXXXX` || exit 1 + mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 + + dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + rm -f $rnd + mdconfig -d -u $no + done + done +done + +rm -f $keyfile Copied: head/tests/sys/geom/class/eli/init_i_P_test.sh (from r293817, head/tools/regression/geom_eli/init-i-P.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/init_i_P_test.sh Wed Jan 13 09:14:27 2016 (r293821, copy of r293817, head/tools/regression/geom_eli/init-i-P.t) @@ -0,0 +1,22 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..1" + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +geli init -B none -i 64 -P -K ${keyfile} md${no} 2>/dev/null +if [ $? -ne 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi + +rm -f $keyfile Copied: head/tests/sys/geom/class/eli/init_test.sh (from r293817, head/tools/regression/geom_eli/init.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/init_test.sh Wed Jan 13 09:14:27 2016 (r293821, copy of r293817, head/tools/regression/geom_eli/init.t) @@ -0,0 +1,65 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 + +echo "1..460" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for secsize in 512 1024 2048 4096 8192; do + rnd=`mktemp $base.XXXXXX` || exit 1 + mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 + + dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + + geli init -B none -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + if [ ${md_rnd} != ${md_edev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + rm -f $rnd + mdconfig -d -u $no + done +done + +rm -f $keyfile Copied: head/tests/sys/geom/class/eli/integrity_copy_test.sh (from r293817, head/tools/regression/geom_eli/integrity-copy.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/integrity_copy_test.sh Wed Jan 13 09:14:27 2016 (r293821, copy of r293817, head/tools/regression/geom_eli/integrity-copy.t) @@ -0,0 +1,99 @@ +#!/bin/sh +# $FreeBSD$ + +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +sector=`mktemp $base.XXXXXX` || exit 1 + +echo "1..5520" + +i=1 +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ + blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ + blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ + blowfish:416 blowfish:448 \ + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do + for secsize in 512 1024 2048 4096 8192; do + #mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 + mdconfig -a -t malloc -s $sectors -u $no || exit 1 + + dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + + dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + # Copy first small sector to the second small sector. + # This should be detected as corruption. + dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 + dd if=${sector} of=/dev/md${no} bs=512 count=1 seek=1 >/dev/null 2>&1 + geli attach -p -k $keyfile md${no} + + dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + ms=`diskinfo /dev/md${no} | awk '{print $3 - 512}'` + ns=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + usecsize=`echo "($ms / $ns) - (($ms / $ns) % 512)" | bc` *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jan 13 09:41:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E73BAA813C4; Wed, 13 Jan 2016 09:41:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id A89FC13A9; Wed, 13 Jan 2016 09:41:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id EFF78104430D; Wed, 13 Jan 2016 20:41:28 +1100 (AEDT) Date: Wed, 13 Jan 2016 20:41:25 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Ian Lepore , Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293724 - in head/sys/boot: arm64/libarm64 common efi/boot1 efi/fdt efi/include efi/include/arm64 efi/libefi efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 i... In-Reply-To: Message-ID: <20160113184722.K1916@besplex.bde.org> References: <201601120217.u0C2HdBC089684@repo.freebsd.org> <1452645668.46848.34.camel@freebsd.org> <56959DA7.9050206@freebsd.org> <1452646442.46848.37.camel@freebsd.org> <5695A5C4.9000409@multiplay.co.uk> <1452648737.46848.50.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=nqCaOlwmo36tRAo_nPwA:9 a=3VOXhXLOVMeRUf-R:21 a=koZxjWdCwNFsTYYP:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 09:41:39 -0000 On Tue, 12 Jan 2016, Conrad Meyer wrote: > On Tue, Jan 12, 2016 at 5:32 PM, Ian Lepore wrote: >> Yep, but then I had to do this because ef->off is 64 bits even on 32 >> bit arches, so I got a pointer/int size mismatch warning... >> >> Index: common/load_elf.c >> =================================================================== >> --- common/load_elf.c (revision 293796) >> +++ common/load_elf.c (working copy) >> @@ -886,7 +886,7 @@ __elfN(parse_modmetadata)(struct preloaded_file *f >> error = __elfN(reloc_ptr)(fp, ef, v, &md, sizeof(md)); >> if (error == EOPNOTSUPP) { >> md.md_cval += ef->off; >> - md.md_data = (void *)((uintptr_t)md.md_data + ef->off); >> + md.md_data = (void *)(uintptr_t)((uintptr_t)md.md_data + >> ef->off); >> } else if (error != 0) >> return (error); >> #endif >> >> That is just some special kind of ugly. > > Yes. You could maybe do: > > md.md_data = (c_caddr_t)md.md_data + (ptrdiff_t)ef->off; This is much worse. caddr_t is an old mistake. It was supposed to be an opaque type representing a core address, whatever that is. But opaque types are even harder to work with. They might be a pointer of any type, an integer of any size, floating point, or a struct... In practice, caddr_t only works for virtual address in flat memory models. vm_offset_t or uintptr_t would be the easiest to work with for that, and void * would be most opaque (intentionally hard to work with). But it is actually char *, and most uses of it are misuses which assume this. c_caddr_t is a newer mistake. It is the opaque type caddr_t peered into to see that it is a pointer and modify that pointer to pointer to const. md_data isn't const here, so using c_caddr_t is wronger than usual. We also need to peer into the type of [c_]caddr_t to know that it can be assigned to the pointer md_data without a cast. A cast would be needed if caddr_t were vm_offset_t or uintptr_t. Of course, it would be foot-shooting to keep using the poorly chosen type void * for md_data. All these addresses and offsets should be integers not quite like vm_addr_t and vm_offset_t in vm (vm_addr_t doesn't exist...). After further peering, we see that this code shouldn't compile, since the extra const in c_caddr_t is incompatible with the plain void * for md_data. md_cval is const nearby, so it needs a const somewhere in casts. Since it is plain const char *, using c_caddr_t would be unnatural for it (but would work because c_caddr_t is const char * obfuscated). > Instead. Yes, the ptrdiff_t will truncate uint64_t on 32-bit pointer > platforms, but the result is truncated regardless when it is stored in > the md_data pointer. And the result under modulus is equivalent. This assumes main things that don't need to be assumed. After casting md_data to a pointer instead of an int, ev->off can be added to it without further casts unless the compiler warns about adding 64-bit offsets to 32-bit pointers. But the code already depends on no warning for the addition in the previous line. So the cast has no good effect. The casts asks for bad effects like truncating the offset to 16 bits on exotic systems. ptrdiff_t is only required to be 16 bits and is not required to actually work even for offsets within a single object. Using it for general memory offsets asks for undefined behaviour but only gets it on normal machines for offsets larger than half of the address space (these overflow). > (You could even change the type of md_data to c_caddr_t from 'const > void *' to make it easier to do math on. Then this could just be: > md.md_data += (ptrdiff_t)ef->off;) You mean 'const char *' to give the same type mismatch as c_caddr_t, or 'char *' to work. Then remove the cast to ptrdiff_t to give simple-looking code that works, but still uses a bogus type for ef->off and a magic type for md_data. The magic mostly occurs later when we pass the user pointer md_data directly to the kernel and cast it to other pointers. The type mistakes are not large enough for c_caddr_t to be used for any of the 4 struct members misnamed md_data. The one here is just the void * one in . void * is correctly for a general kernel pointer. Bruce From owner-svn-src-head@freebsd.org Wed Jan 13 10:50:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CECDDA80C88; Wed, 13 Jan 2016 10:50:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 930471F91; Wed, 13 Jan 2016 10:50:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 9028B25D387C; Wed, 13 Jan 2016 10:49:58 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id E8E5EC77050; Wed, 13 Jan 2016 10:49:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id cp53-C94JyNc; Wed, 13 Jan 2016 10:49:56 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 7625DC76FD1; Wed, 13 Jan 2016 10:49:55 +0000 (UTC) Date: Wed, 13 Jan 2016 10:49:55 +0000 (UTC) From: "Bjoern A. Zeeb" To: Sepherosa Ziehau cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293719 - head/sys/dev/hyperv/netvsc In-Reply-To: <201601120130.u0C1UpvA074721@repo.freebsd.org> Message-ID: References: <201601120130.u0C1UpvA074721@repo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 10:50:02 -0000 On Tue, 12 Jan 2016, Sepherosa Ziehau wrote: > Author: sephe > Date: Tue Jan 12 01:30:51 2016 > New Revision: 293719 > URL: https://svnweb.freebsd.org/changeset/base/293719 > > Log: > hyperv/hn: Implement LRO > > - Implement the LRO using tcp_lro APIs, and LRO is enabled by default. Which are only available if INET or INET6 are compiled into the kernel. Unfortunately this breaks kernel builds that do not include IPv4 or IPv6 support. Can you please put appropriate #if defined(INET6) || defined(INET) in place? > Differential Revision: https://reviews.freebsd.org/D4824 > > Modified: > head/sys/dev/hyperv/netvsc/hv_net_vsc.c > head/sys/dev/hyperv/netvsc/hv_net_vsc.h > head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c hv_netvsc_drv_freebsd.o: In function `netvsc_recv': /scratch/tmp/bz/head.svn/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c:(.text+0x483): undefined reference to `tcp_lro_rx' hv_netvsc_drv_freebsd.o: In function `netvsc_recv_rollup': /scratch/tmp/bz/head.svn/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c:(.text+0x5ce): undefined reference to `tcp_lro_flush' hv_netvsc_drv_freebsd.o: In function `netvsc_attach': /scratch/tmp/bz/head.svn/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c:(.text+0x901): undefined reference to `tcp_lro_init' hv_netvsc_drv_freebsd.o: In function `netvsc_detach': /scratch/tmp/bz/head.svn/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c:(.text+0xca8): undefined reference to `tcp_lro_free' --- kernel --- *** [kernel] Error code 1 bmake: stopped in /storage/head/obj/scratch/tmp/bz/head.svn/sys/LINT-NOIP > head/sys/dev/hyperv/netvsc/hv_rndis.h > head/sys/dev/hyperv/netvsc/hv_rndis_filter.c > head/sys/dev/hyperv/netvsc/hv_rndis_filter.h From owner-svn-src-head@freebsd.org Wed Jan 13 11:58:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F803A804E8; Wed, 13 Jan 2016 11:58:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 2901A1185; Wed, 13 Jan 2016 11:58:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id B16BA1A2C46; Wed, 13 Jan 2016 22:58:36 +1100 (AEDT) Date: Wed, 13 Jan 2016 22:58:35 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293792 - head/sys/boot/uboot/lib In-Reply-To: <20160113091418.GD72455@kib.kiev.ua> Message-ID: <20160113215530.Y2397@besplex.bde.org> References: <201601130022.u0D0MCWu029299@repo.freebsd.org> <20160113142527.U1277@besplex.bde.org> <20160113091418.GD72455@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=ma8Wq6YzU5W2H2qhuqAA:9 a=riDA3dTC9GVwh4WG:21 a=KZbqmv61An97dh1V:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 11:58:39 -0000 On Wed, 13 Jan 2016, Konstantin Belousov wrote: > On Wed, Jan 13, 2016 at 03:03:07PM +1100, Bruce Evans wrote: >> Oops. It is only declared in outside of the kernel. >> Only __uintfptr_t is always declared by sys/types.h. > > So what is the intended use of the uintfptr_t type ? Looking at the > implementation only, I am unable to find a difference with uintptr_t. uintfptr_t is inded for functions. uintptr_t is an optional type that is only required to work for object pointers (only if it is a supported option of course). A similar type is needed for functions. I added uintfptr_t at much the same time that I added uintptr_t in 1998. Actually I added uintptr_t a little earlier under a different name, then changed it to be more like the draft C9x name uintptr_t. Unfortunately, standards haven't caught up with that yet. POSIX now uses various hacks near dlsym(). In the 2001 version it specifies impossible things if the arch is not a vax so that function pointers are too different from data pointers. It gives the bad example of casting dlsym() to a function pointer. dlsym() returns void *. dlopen() doesn't have this design error. It returns a handle. > Even on ia64 it is 64bit, which breaks my hypothesis about f standing > for 'function'. This might be a bug in ia64, but uintfptr_t works on it AFAIK. It is used for profiling. This is hard to test since profiling support is broken (profiling libraries not installed) on pluto. Function pointers have size 64 bits on ia64, so they can be represented in uint64_t's by memcpy()ing them. Casting them might give a different representation. I think ia64 really has fat function pointers but they are represented specially in 64-bit objects. E.g., in a small program, nm says that putchar is at 0x100000640, but when (putchar) is cast to int (*f)(int), the bits in f are 0x1000acbb0 and casting f to uint64_t doesn't change these bits. f is just a pointer to data containing the actual function address and possibly other data. (It points to .opd+16 which contains the same address that nm prints. There seem to be only 64 bits of address and no extra data there too.) binutils has to understand this of course. Profiling too. I think gprof doesn't understand this. It needs raw addresses represented in uintfptr_t with the same encoding that ELF uses. So uintfptr_t is not suitable for representing function pointers after all. It is for raw addresses or a simple encoding of them. Profiling hits record the "program counter". It is not obvious what this is when it might be represented indirectly. I think its raw register value is recorded, and this can only work if its value is a raw virtual address (if not, a table must be looked up to convert to something that gprof understand). Other data must use the same representation or convert to it. Data with C function pointers in it would need conversion. Bruce From owner-svn-src-head@freebsd.org Wed Jan 13 12:01:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43449A80BA4; Wed, 13 Jan 2016 12:01:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 110631784; Wed, 13 Jan 2016 12:01:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DC1T48042144; Wed, 13 Jan 2016 12:01:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DC1T9Q042143; Wed, 13 Jan 2016 12:01:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601131201.u0DC1T9Q042143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 13 Jan 2016 12:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293825 - head/sys/dev/pty X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 12:01:30 -0000 Author: kib Date: Wed Jan 13 12:01:28 2016 New Revision: 293825 URL: https://svnweb.freebsd.org/changeset/base/293825 Log: Switch legacy pty clone handler to use make_dev_s(9). Add MAKEDEV_CHECKNAME flag to the call, this is required to not panic on race between the clone and destructing the closed master. Reported by and discussed with: bde Tested by: pho (as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/dev/pty/pty.c Modified: head/sys/dev/pty/pty.c ============================================================================== --- head/sys/dev/pty/pty.c Wed Jan 13 09:26:44 2016 (r293824) +++ head/sys/dev/pty/pty.c Wed Jan 13 12:01:28 2016 (r293825) @@ -97,6 +97,8 @@ static void pty_clone(void *arg, struct ucred *cr, char *name, int namelen, struct cdev **dev) { + struct make_dev_args mda; + int error; /* Cloning is already satisfied. */ if (*dev != NULL) @@ -117,8 +119,17 @@ pty_clone(void *arg, struct ucred *cr, c return; /* Create the controller device node. */ - *dev = make_dev_credf(MAKEDEV_REF, &ptydev_cdevsw, 0, - NULL, UID_ROOT, GID_WHEEL, 0666, "%s", name); + make_dev_args_init(&mda); + mda.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_REF; + mda.mda_devsw = &ptydev_cdevsw; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_WHEEL; + mda.mda_mode = 0666; + error = make_dev_s(&mda, dev, "%s", name); + if (error != 0) { + printf("pty_clone: failed to create %s: %d\n", name, error); + *dev = NULL; + } } static int From owner-svn-src-head@freebsd.org Wed Jan 13 12:31:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC179A6BA8E; Wed, 13 Jan 2016 12:31:56 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ig0-x236.google.com (mail-ig0-x236.google.com [IPv6:2607:f8b0:4001:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9737A18A8; Wed, 13 Jan 2016 12:31:56 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ig0-x236.google.com with SMTP id z14so166727688igp.0; Wed, 13 Jan 2016 04:31:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=SZyfLWZYeyB2mzrgIO50Hpr4LDBNpub+h7cILBnm3GQ=; b=TGsNlU6dU/kJ/pLeHkTIOFYZUIXREli9uOOEs2UZBavKRw5rJejbXGiNVJynCPes9H yfirtUNONzIjd5mQlA5W8jjOwYZ8g5WRxL7dWec9RNenCAdggboAFz+WR1DOLZ1mZijs uBeIrsWTPKM2kO/sYv6q8uXAA5FSUbi+ET42gpG6vQHKQ77JVoyJ/aF7d0cGB9t8Hz6l 4m/yhXgj5iHwpu4WuqFF8rGWEKub/GynAnhAj2RVF7leT8ujBUqGbYcpHLbhL9kfgOs4 7/UmgO2t1puKiU2VS2KV/SvqRJRUFBajjvM8gdYaNcfDfUUYiaN93+dxwd1MYFKXTSOu p/yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=SZyfLWZYeyB2mzrgIO50Hpr4LDBNpub+h7cILBnm3GQ=; b=nJVIlk9zPYUA1jdP50RsHzQR9MWj2G5X0f8do6VIhe3oyc+o5jDZjasMT5Zs3O01di MbqDY6d9P0euI2jyfr0zKgY+dzhfY/HIdficj2sa5RdsNwQhJiF5B0UW7O4gCQxp5Hv7 gdAj9RazQOqi6CxvwFMm+M+vjQx87eIH+1eGhb4jYH16kvUnQrHAoXhxvcdS73aJ52Ms Ar33ogi3ec2DiW7bUjASYlZQEkl8IpyZXKxysKeJEb3yzyWby+Mt7e6rtcSkg8vcq/mX /oVFteSmPXegECyL24o/l8WQTWdz6D8Q5SQMabz242arIp6a7huNhgpS4Gzj5pZjjBfO sfpQ== X-Gm-Message-State: ALoCoQnoApuaDnF+24agGRKfUzbLI3QeqnA2mzuQQiD7ax939yBuHaheF1mqULdvjlKqdG3x23wlZppF1WyQzDos2lWve2AFIQ== MIME-Version: 1.0 X-Received: by 10.50.143.108 with SMTP id sd12mr600251igb.12.1452688316009; Wed, 13 Jan 2016 04:31:56 -0800 (PST) Sender: sepherosa@gmail.com Received: by 10.107.166.3 with HTTP; Wed, 13 Jan 2016 04:31:55 -0800 (PST) In-Reply-To: References: <201601120130.u0C1UpvA074721@repo.freebsd.org> Date: Wed, 13 Jan 2016 20:31:55 +0800 X-Google-Sender-Auth: 02AytwlSSXSl0LhvVCYfmcp5ylA Message-ID: Subject: Re: svn commit: r293719 - head/sys/dev/hyperv/netvsc From: Sepherosa Ziehau To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 12:31:57 -0000 OH, sure, sorry about that, I will do it now. On Wed, Jan 13, 2016 at 6:49 PM, Bjoern A. Zeeb wrote: > On Tue, 12 Jan 2016, Sepherosa Ziehau wrote: > >> Author: sephe >> Date: Tue Jan 12 01:30:51 2016 >> New Revision: 293719 >> URL: https://svnweb.freebsd.org/changeset/base/293719 >> >> Log: >> hyperv/hn: Implement LRO >> >> - Implement the LRO using tcp_lro APIs, and LRO is enabled by default. > > > Which are only available if INET or INET6 are compiled into the kernel. > Unfortunately this breaks kernel builds that do not include IPv4 or IPv6 > support. > > Can you please put appropriate #if defined(INET6) || defined(INET) in > place? > > > >> Differential Revision: https://reviews.freebsd.org/D4824 >> >> Modified: >> head/sys/dev/hyperv/netvsc/hv_net_vsc.c >> head/sys/dev/hyperv/netvsc/hv_net_vsc.h >> head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c > > > hv_netvsc_drv_freebsd.o: In function `netvsc_recv': > /scratch/tmp/bz/head.svn/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c:(.text+0x483): > undefined reference to `tcp_lro_rx' > hv_netvsc_drv_freebsd.o: In function `netvsc_recv_rollup': > /scratch/tmp/bz/head.svn/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c:(.text+0x5ce): > undefined reference to `tcp_lro_flush' > hv_netvsc_drv_freebsd.o: In function `netvsc_attach': > /scratch/tmp/bz/head.svn/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c:(.text+0x901): > undefined reference to `tcp_lro_init' > hv_netvsc_drv_freebsd.o: In function `netvsc_detach': > /scratch/tmp/bz/head.svn/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c:(.text+0xca8): > undefined reference to `tcp_lro_free' > --- kernel --- > *** [kernel] Error code 1 > bmake: stopped in /storage/head/obj/scratch/tmp/bz/head.svn/sys/LINT-NOIP > > >> head/sys/dev/hyperv/netvsc/hv_rndis.h >> head/sys/dev/hyperv/netvsc/hv_rndis_filter.c >> head/sys/dev/hyperv/netvsc/hv_rndis_filter.h -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Wed Jan 13 12:54:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8887A80372; Wed, 13 Jan 2016 12:54:56 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9176C1593; Wed, 13 Jan 2016 12:54:56 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-io0-x235.google.com with SMTP id 1so369947366ion.1; Wed, 13 Jan 2016 04:54:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=8mU25wTmOOpY8E+1MUUJrnrstu4yABVnlg9iKJ4iBpk=; b=W9/pzqBkEY1U2XnJEmxzC6G1XLIjVCDi1U6dAefJDq6PCocPeUORM6NXRuent/LNcd tx3psIWnG52d5yClpyNqeT1zC4sCpvfCiOXYshzzevP2SGQ+XNkZQwZFpdBvupwKrK7K FZBEJdeL13mV0HCcyx31iEo9vSDNIpI8Tf2Qu2BisVP/wQ7prCZvQz7SrDOUCLS0gois XBUStltBRzZUXrGTp0J7VRov6lsdLB+FalBVwpi1XejCmojoKJtiTnNaHjj5Nxx6Bdza X1NBomAzsKffN8MkHl1vnpW35AQ2x/Iy9SDa74zF+N5GcV+n//LvY8ODmKoXl9YCFuj8 yuog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=8mU25wTmOOpY8E+1MUUJrnrstu4yABVnlg9iKJ4iBpk=; b=bP6vMN3XJUVkBqNanVWyj7+kDcwqFxudBKu7B1Jf4IinbNDkdVLEaFkpfeyyCANeT/ N5ldL7p7HDBBKK4X25LFdrbkB193OnPctPjFyz8mCY56QfOM3EhBzkoCnK3sQwT81IV7 l0f7/gPx972EW0GyocvxbEMzyMJjeBEOA5dQiHW8si663ZqLrzPsvW5T5mhLgY0HNwYa oFNQ0Cl3vevXPSOrVaYe4+46R6t9GwEVJuHf+CPh8uDON3PfgXokNT4J19TTlcxSuT6p hTyGm+O2tsu6Iwl4VFJV7KLN5n9th+6b1Tsm3AhWOHJ+vESrHrKToP8e3D9zlLy2/YsK qhSA== X-Gm-Message-State: ALoCoQneb/iLJUVsahaPlO5D1YqZoxma+reCDhxnNJGrRWNx3UEB2ungIH1hWRYWNv6Eb/4fdmC3sdBNeKEmNy+sA1N/i975Qg== MIME-Version: 1.0 X-Received: by 10.107.7.22 with SMTP id 22mr71752717ioh.17.1452689696006; Wed, 13 Jan 2016 04:54:56 -0800 (PST) Sender: sepherosa@gmail.com Received: by 10.107.166.3 with HTTP; Wed, 13 Jan 2016 04:54:55 -0800 (PST) In-Reply-To: References: <201601120130.u0C1UpvA074721@repo.freebsd.org> Date: Wed, 13 Jan 2016 20:54:55 +0800 X-Google-Sender-Auth: rE1mc-4HzqpSSWjInDtyYycrLfY Message-ID: Subject: Re: svn commit: r293719 - head/sys/dev/hyperv/netvsc From: Sepherosa Ziehau To: "Bjoern A. Zeeb" , Xin LI , Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: multipart/mixed; boundary=001a113f8f3a4cd065052936ade4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 12:54:57 -0000 --001a113f8f3a4cd065052936ade4 Content-Type: text/plain; charset=UTF-8 The breakage is all my fault. Patch is attached. Wait for mentors approval. Thanks, sephe On Wed, Jan 13, 2016 at 6:49 PM, Bjoern A. Zeeb wrote: > On Tue, 12 Jan 2016, Sepherosa Ziehau wrote: > >> Author: sephe >> Date: Tue Jan 12 01:30:51 2016 >> New Revision: 293719 >> URL: https://svnweb.freebsd.org/changeset/base/293719 >> >> Log: >> hyperv/hn: Implement LRO >> >> - Implement the LRO using tcp_lro APIs, and LRO is enabled by default. > > > Which are only available if INET or INET6 are compiled into the kernel. > Unfortunately this breaks kernel builds that do not include IPv4 or IPv6 > support. > > Can you please put appropriate #if defined(INET6) || defined(INET) in > place? > > > >> Differential Revision: https://reviews.freebsd.org/D4824 >> >> Modified: >> head/sys/dev/hyperv/netvsc/hv_net_vsc.c >> head/sys/dev/hyperv/netvsc/hv_net_vsc.h >> head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c > > > hv_netvsc_drv_freebsd.o: In function `netvsc_recv': > /scratch/tmp/bz/head.svn/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c:(.text+0x483): > undefined reference to `tcp_lro_rx' > hv_netvsc_drv_freebsd.o: In function `netvsc_recv_rollup': > /scratch/tmp/bz/head.svn/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c:(.text+0x5ce): > undefined reference to `tcp_lro_flush' > hv_netvsc_drv_freebsd.o: In function `netvsc_attach': > /scratch/tmp/bz/head.svn/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c:(.text+0x901): > undefined reference to `tcp_lro_init' > hv_netvsc_drv_freebsd.o: In function `netvsc_detach': > /scratch/tmp/bz/head.svn/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c:(.text+0xca8): > undefined reference to `tcp_lro_free' > --- kernel --- > *** [kernel] Error code 1 > bmake: stopped in /storage/head/obj/scratch/tmp/bz/head.svn/sys/LINT-NOIP > > >> head/sys/dev/hyperv/netvsc/hv_rndis.h >> head/sys/dev/hyperv/netvsc/hv_rndis_filter.c >> head/sys/dev/hyperv/netvsc/hv_rndis_filter.h -- Tomorrow Will Never Die --001a113f8f3a4cd065052936ade4 Content-Type: text/plain; charset=US-ASCII; name="hn_unbreak_lint_noip.diff" Content-Disposition: attachment; filename="hn_unbreak_lint_noip.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ijctx3sj0 ZGlmZiAtLWdpdCBhL3N5cy9kZXYvaHlwZXJ2L25ldHZzYy9odl9uZXR2c2NfZHJ2X2ZyZWVic2Qu YyBiL3N5cy9kZXYvaHlwZXJ2L25ldHZzYy9odl9uZXR2c2NfZHJ2X2ZyZWVic2QuYwppbmRleCA2 OGY4MjJhLi5mZDIzZGI5IDEwMDY0NAotLS0gYS9zeXMvZGV2L2h5cGVydi9uZXR2c2MvaHZfbmV0 dnNjX2Rydl9mcmVlYnNkLmMKKysrIGIvc3lzL2Rldi9oeXBlcnYvbmV0dnNjL2h2X25ldHZzY19k cnZfZnJlZWJzZC5jCkBAIC0zOTEsMTIgKzM5MSwxNCBAQCBuZXR2c2NfYXR0YWNoKGRldmljZV90 IGRldikKIAkJc2MtPmhuX2NhcnJpZXIgPSAxOwogCX0KIAorI2lmIGRlZmluZWQoSU5FVCkgfHwg ZGVmaW5lZChJTkVUNikKIAl0Y3BfbHJvX2luaXQoJnNjLT5obl9scm8pOwogCS8qIERyaXZlciBw cml2YXRlIExSTyBzZXR0aW5ncyAqLwogCXNjLT5obl9scm8uaWZwID0gaWZwOwogI2lmZGVmIEhO X0xST19ISVdBVAogCXNjLT5obl9scm8ubHJvX2hpd2F0ID0gc2MtPmhuX2xyb19oaXdhdDsKICNl bmRpZgorI2VuZGlmCS8qIElORVQgfHwgSU5FVDYgKi8KIAogCWV0aGVyX2lmYXR0YWNoKGlmcCwg ZGV2aWNlX2luZm8ubWFjX2FkZHIpOwogCkBAIC00NzUsNyArNDc3LDkgQEAgbmV0dnNjX2RldGFj aChkZXZpY2VfdCBkZXYpCiAJaHZfcmZfb25fZGV2aWNlX3JlbW92ZShodl9kZXZpY2UsIEhWX1JG X05WX0RFU1RST1lfQ0hBTk5FTCk7CiAKIAlpZm1lZGlhX3JlbW92ZWFsbCgmc2MtPmhuX21lZGlh KTsKKyNpZiBkZWZpbmVkKElORVQpIHx8IGRlZmluZWQoSU5FVDYpCiAJdGNwX2xyb19mcmVlKCZz Yy0+aG5fbHJvKTsKKyNlbmRpZgogCiAJcmV0dXJuICgwKTsKIH0KQEAgLTEwODMsNiArMTA4Nyw3 IEBAIHNraXA6CiAJaWZfaW5jX2NvdW50ZXIoaWZwLCBJRkNPVU5URVJfSVBBQ0tFVFMsIDEpOwog CiAJaWYgKChpZnAtPmlmX2NhcGVuYWJsZSAmIElGQ0FQX0xSTykgJiYgZG9fbHJvKSB7CisjaWYg ZGVmaW5lZChJTkVUKSB8fCBkZWZpbmVkKElORVQ2KQogCQlzdHJ1Y3QgbHJvX2N0cmwgKmxybyA9 ICZzYy0+aG5fbHJvOwogCiAJCWlmIChscm8tPmxyb19jbnQpIHsKQEAgLTEwOTIsNiArMTA5Nyw3 IEBAIHNraXA6CiAJCQkJcmV0dXJuIDA7CiAJCQl9CiAJCX0KKyNlbmRpZgogCX0KIAogCS8qIFdl J3JlIG5vdCBob2xkaW5nIHRoZSBsb2NrIGhlcmUsIHNvIGRvbid0IHJlbGVhc2UgaXQgKi8KQEAg LTExMDMsNiArMTEwOSw3IEBAIHNraXA6CiB2b2lkCiBuZXR2c2NfcmVjdl9yb2xsdXAoc3RydWN0 IGh2X2RldmljZSAqZGV2aWNlX2N0eCkKIHsKKyNpZiBkZWZpbmVkKElORVQpIHx8IGRlZmluZWQo SU5FVDYpCiAJaG5fc29mdGNfdCAqc2MgPSBkZXZpY2VfZ2V0X3NvZnRjKGRldmljZV9jdHgtPmRl dmljZSk7CiAJc3RydWN0IGxyb19jdHJsICpscm8gPSAmc2MtPmhuX2xybzsKIAlzdHJ1Y3QgbHJv X2VudHJ5ICpxdWV1ZWQ7CkBAIC0xMTExLDYgKzExMTgsNyBAQCBuZXR2c2NfcmVjdl9yb2xsdXAo c3RydWN0IGh2X2RldmljZSAqZGV2aWNlX2N0eCkKIAkJU0xJU1RfUkVNT1ZFX0hFQUQoJmxyby0+ bHJvX2FjdGl2ZSwgbmV4dCk7CiAJCXRjcF9scm9fZmx1c2gobHJvLCBxdWV1ZWQpOwogCX0KKyNl bmRpZgogfQogCiAvKgo= --001a113f8f3a4cd065052936ade4-- From owner-svn-src-head@freebsd.org Wed Jan 13 14:02:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B559AA8199F; Wed, 13 Jan 2016 14:02:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C9FA17E7; Wed, 13 Jan 2016 14:02:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DE27Wu079126; Wed, 13 Jan 2016 14:02:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DE271O079125; Wed, 13 Jan 2016 14:02:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601131402.u0DE271O079125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 13 Jan 2016 14:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293826 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 14:02:08 -0000 Author: kib Date: Wed Jan 13 14:02:07 2016 New Revision: 293826 URL: https://svnweb.freebsd.org/changeset/base/293826 Log: Move the funsetown(9) call from audit_pipe_close() to cdevpriv destructor. As result, close method becomes trivial and removed. Final cdevsw close method might be called without file context (e.g. in vn_open_vnode() if the vnode is reclaimed meantime), which leaves ap_sigio registered for notification, despite cdevpriv destructor frees the memory later. Call destructor instead of doing a cleanup inline, for devfs_set_cdevpriv() failure in open. This adds missed funsetown(9) call and locks ap to satisfy audit_pipe_free() invariants. Reported and tested by: pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/security/audit/audit_pipe.c Modified: head/sys/security/audit/audit_pipe.c ============================================================================== --- head/sys/security/audit/audit_pipe.c Wed Jan 13 12:01:28 2016 (r293825) +++ head/sys/security/audit/audit_pipe.c Wed Jan 13 14:02:07 2016 (r293826) @@ -223,7 +223,6 @@ static struct cdev *audit_pipe_dev; * Special device methods and definition. */ static d_open_t audit_pipe_open; -static d_close_t audit_pipe_close; static d_read_t audit_pipe_read; static d_ioctl_t audit_pipe_ioctl; static d_poll_t audit_pipe_poll; @@ -232,7 +231,6 @@ static d_kqfilter_t audit_pipe_kqfilter; static struct cdevsw audit_pipe_cdevsw = { .d_version = D_VERSION, .d_open = audit_pipe_open, - .d_close = audit_pipe_close, .d_read = audit_pipe_read, .d_ioctl = audit_pipe_ioctl, .d_poll = audit_pipe_poll, @@ -658,6 +656,7 @@ audit_pipe_dtor(void *arg) struct audit_pipe *ap; ap = arg; + funsetown(&ap->ap_sigio); AUDIT_PIPE_LIST_WLOCK(); AUDIT_PIPE_LOCK(ap); audit_pipe_free(ap); @@ -676,33 +675,13 @@ audit_pipe_open(struct cdev *dev, int of int error; ap = audit_pipe_alloc(); - if (ap == NULL) { + if (ap == NULL) return (ENOMEM); - } fsetown(td->td_proc->p_pid, &ap->ap_sigio); error = devfs_set_cdevpriv(ap, audit_pipe_dtor); - if (error != 0) { - AUDIT_PIPE_LIST_WLOCK(); - audit_pipe_free(ap); - AUDIT_PIPE_LIST_WUNLOCK(); - } - return (0); -} - -/* - * Close audit pipe, tear down all records, etc. - */ -static int -audit_pipe_close(struct cdev *dev, int fflag, int devtype, struct thread *td) -{ - struct audit_pipe *ap; - int error; - - error = devfs_get_cdevpriv((void **)&ap); if (error != 0) - return (error); - funsetown(&ap->ap_sigio); - return (0); + audit_pipe_dtor(ap); + return (error); } /* From owner-svn-src-head@freebsd.org Wed Jan 13 14:03:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86C9FA81A22; Wed, 13 Jan 2016 14:03:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 584F319FE; Wed, 13 Jan 2016 14:03:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DE363m079202; Wed, 13 Jan 2016 14:03:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DE369K079200; Wed, 13 Jan 2016 14:03:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601131403.u0DE369K079200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 13 Jan 2016 14:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293827 - in head/sys: fs/devfs sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 14:03:07 -0000 Author: kib Date: Wed Jan 13 14:03:06 2016 New Revision: 293827 URL: https://svnweb.freebsd.org/changeset/base/293827 Log: Make devfs_fpdrop() static. It was not a public KPI, and it has no reason to remain exported for some time. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/sys/conf.h Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Jan 13 14:02:07 2016 (r293826) +++ head/sys/fs/devfs/devfs_vnops.c Wed Jan 13 14:03:06 2016 (r293827) @@ -192,7 +192,7 @@ devfs_destroy_cdevpriv(struct cdev_privd free(p, M_CDEVPDATA); } -void +static void devfs_fpdrop(struct file *fp) { struct cdev_privdata *p; Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Wed Jan 13 14:02:07 2016 (r293826) +++ head/sys/sys/conf.h Wed Jan 13 14:03:06 2016 (r293827) @@ -299,7 +299,6 @@ typedef void d_priv_dtor_t(void *data); int devfs_get_cdevpriv(void **datap); int devfs_set_cdevpriv(void *priv, d_priv_dtor_t *dtr); void devfs_clear_cdevpriv(void); -void devfs_fpdrop(struct file *fp); /* XXX This is not public KPI */ ino_t devfs_alloc_cdp_inode(void); void devfs_free_cdp_inode(ino_t ino); From owner-svn-src-head@freebsd.org Wed Jan 13 14:28:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32AF0A802B1; Wed, 13 Jan 2016 14:28:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFEC41D66; Wed, 13 Jan 2016 14:28:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DESChx086035; Wed, 13 Jan 2016 14:28:12 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DESC0L086034; Wed, 13 Jan 2016 14:28:12 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601131428.u0DESC0L086034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 13 Jan 2016 14:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293828 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 14:28:14 -0000 Author: tuexen Date: Wed Jan 13 14:28:12 2016 New Revision: 293828 URL: https://svnweb.freebsd.org/changeset/base/293828 Log: Store the timer type for logging, because the timer can be freed during processing the timerout. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Jan 13 14:03:06 2016 (r293827) +++ head/sys/netinet/sctputil.c Wed Jan 13 14:28:12 2016 (r293828) @@ -1495,6 +1495,7 @@ sctp_timeout_handler(void *t) #endif int did_output; + int type; tmr = (struct sctp_timer *)t; inp = (struct sctp_inpcb *)tmr->ep; @@ -1563,8 +1564,9 @@ sctp_timeout_handler(void *t) return; } } + type = tmr->type; tmr->stopped_from = 0xa005; - SCTPDBG(SCTP_DEBUG_TIMER1, "Timer type %d goes off\n", tmr->type); + SCTPDBG(SCTP_DEBUG_TIMER1, "Timer type %d goes off\n", type); if (!SCTP_OS_TIMER_ACTIVE(&tmr->timer)) { if (inp) { SCTP_INP_DECR_REF(inp); @@ -1580,7 +1582,7 @@ sctp_timeout_handler(void *t) if (stcb) { SCTP_TCB_LOCK(stcb); atomic_add_int(&stcb->asoc.refcnt, -1); - if ((tmr->type != SCTP_TIMER_TYPE_ASOCKILL) && + if ((type != SCTP_TIMER_TYPE_ASOCKILL) && ((stcb->asoc.state == 0) || (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED))) { SCTP_TCB_UNLOCK(stcb); @@ -1592,7 +1594,7 @@ sctp_timeout_handler(void *t) } } /* record in stopped what t-o occured */ - tmr->stopped_from = tmr->type; + tmr->stopped_from = type; /* mark as being serviced now */ if (SCTP_OS_TIMER_PENDING(&tmr->timer)) { @@ -1610,7 +1612,7 @@ sctp_timeout_handler(void *t) SCTP_OS_TIMER_DEACTIVATE(&tmr->timer); /* call the handler for the appropriate timer type */ - switch (tmr->type) { + switch (type) { case SCTP_TIMER_TYPE_ZERO_COPY: if (inp == NULL) { break; @@ -1894,11 +1896,11 @@ sctp_timeout_handler(void *t) goto out_no_decr; default: SCTPDBG(SCTP_DEBUG_TIMER1, "sctp_timeout_handler:unknown timer %d\n", - tmr->type); + type); break; } #ifdef SCTP_AUDITING_ENABLED - sctp_audit_log(0xF1, (uint8_t) tmr->type); + sctp_audit_log(0xF1, (uint8_t) type); if (inp) sctp_auditing(5, inp, stcb, net); #endif @@ -1921,8 +1923,7 @@ out_decr: SCTP_INP_DECR_REF(inp); } out_no_decr: - SCTPDBG(SCTP_DEBUG_TIMER1, "Timer now complete (type %d)\n", - tmr->type); + SCTPDBG(SCTP_DEBUG_TIMER1, "Timer now complete (type = %d)\n", type); CURVNET_RESTORE(); } From owner-svn-src-head@freebsd.org Wed Jan 13 14:32:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FF47A804E3; Wed, 13 Jan 2016 14:32:50 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53DFF118C; Wed, 13 Jan 2016 14:32:50 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DEWn8Y088659; Wed, 13 Jan 2016 14:32:49 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DEWn2H088657; Wed, 13 Jan 2016 14:32:49 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601131432.u0DEWn2H088657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 13 Jan 2016 14:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293829 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 14:32:50 -0000 Author: melifaro Date: Wed Jan 13 14:32:48 2016 New Revision: 293829 URL: https://svnweb.freebsd.org/changeset/base/293829 Log: Remove RTF_RNH_LOCKED support from rtalloc1_fib(). Last caller using it was eliminated in r293471. Sponsored by: Yandex LLC Modified: head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Wed Jan 13 14:28:12 2016 (r293828) +++ head/sys/net/route.c Wed Jan 13 14:32:48 2016 (r293829) @@ -409,7 +409,6 @@ rtalloc1_fib(struct sockaddr *dst, int r struct rtentry *newrt; struct rt_addrinfo info; int err = 0, msgtype = RTM_MISS; - int needlock; KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum")); rnh = rt_tables_get_rnh(fibnum, dst->sa_family); @@ -420,23 +419,16 @@ rtalloc1_fib(struct sockaddr *dst, int r /* * Look up the address in the table for that Address Family */ - needlock = !(ignflags & RTF_RNH_LOCKED); - if (needlock) - RADIX_NODE_HEAD_RLOCK(rnh); -#ifdef INVARIANTS - else - RADIX_NODE_HEAD_LOCK_ASSERT(rnh); -#endif + RADIX_NODE_HEAD_RLOCK(rnh); rn = rnh->rnh_matchaddr(dst, rnh); if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { newrt = RNTORT(rn); RT_LOCK(newrt); RT_ADDREF(newrt); - if (needlock) - RADIX_NODE_HEAD_RUNLOCK(rnh); - goto done; + RADIX_NODE_HEAD_RUNLOCK(rnh); + return (newrt); - } else if (needlock) + } else RADIX_NODE_HEAD_RUNLOCK(rnh); /* @@ -456,10 +448,7 @@ miss: bzero(&info, sizeof(info)); info.rti_info[RTAX_DST] = dst; rt_missmsg_fib(msgtype, &info, 0, err, fibnum); - } -done: - if (newrt) - RT_LOCK_ASSERT(newrt); + } return (newrt); } Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Wed Jan 13 14:28:12 2016 (r293828) +++ head/sys/net/route.h Wed Jan 13 14:32:48 2016 (r293829) @@ -175,7 +175,7 @@ struct rtentry { /* 0x8000000 and up unassigned */ #define RTF_STICKY 0x10000000 /* always route dst->src */ -#define RTF_RNH_LOCKED 0x40000000 /* radix node head is locked */ +#define RTF_RNH_LOCKED 0x40000000 /* unused */ #define RTF_GWFLAG_COMPAT 0x80000000 /* a compatibility bit for interacting with existing routing apps */ From owner-svn-src-head@freebsd.org Wed Jan 13 14:39:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54C69A8076B; Wed, 13 Jan 2016 14:39:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2833B14DA; Wed, 13 Jan 2016 14:39:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DEdd0b088921; Wed, 13 Jan 2016 14:39:39 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DEddtW088920; Wed, 13 Jan 2016 14:39:39 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601131439.u0DEddtW088920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 13 Jan 2016 14:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293830 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 14:39:40 -0000 Author: ian Date: Wed Jan 13 14:39:39 2016 New Revision: 293830 URL: https://svnweb.freebsd.org/changeset/base/293830 Log: Fix the spelling of fueword* to eliminate compile warnings about mismatched begin/end symbols when the warning level is turned up. Submitted by: Steve Kiernan Modified: head/sys/arm/arm/fusu.S Modified: head/sys/arm/arm/fusu.S ============================================================================== --- head/sys/arm/arm/fusu.S Wed Jan 13 14:32:48 2016 (r293829) +++ head/sys/arm/arm/fusu.S Wed Jan 13 14:39:39 2016 (r293830) @@ -139,8 +139,8 @@ EENTRY_NP(fueword32) mov r0, #0x00000000 str r0, [r2, #PCB_ONFAULT] RET -EEND(fuword32) -END(fuword) +EEND(fueword32) +END(fueword) /* * fusword(caddr_t uaddr); From owner-svn-src-head@freebsd.org Wed Jan 13 14:47:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E50AA80C06; Wed, 13 Jan 2016 14:47:15 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A48C1B15; Wed, 13 Jan 2016 14:47:15 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DElEBF091766; Wed, 13 Jan 2016 14:47:14 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DElEfG091765; Wed, 13 Jan 2016 14:47:14 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601131447.u0DElEfG091765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 13 Jan 2016 14:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293831 - head/release/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 14:47:15 -0000 Author: smh Date: Wed Jan 13 14:47:13 2016 New Revision: 293831 URL: https://svnweb.freebsd.org/changeset/base/293831 Log: Increase efiboot.img size used in ISO creation Due to recent and upcoming changes to add additional functionality to the EFI loader its now bigger than the space allocates for efiboot.img so increase this in line with boot1.efifat. MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/release/amd64/mkisoimages.sh Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Wed Jan 13 14:39:39 2016 (r293830) +++ head/release/amd64/mkisoimages.sh Wed Jan 13 14:47:13 2016 (r293831) @@ -28,7 +28,7 @@ if [ "x$1" = "x-b" ]; then bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot" # Make EFI system partition (should be done with makefs in the future) - dd if=/dev/zero of=efiboot.img bs=4k count=100 + dd if=/dev/zero of=efiboot.img bs=4k count=200 device=`mdconfig -a -t vnode -f efiboot.img` newfs_msdos -F 12 -m 0xf8 /dev/$device mkdir efi From owner-svn-src-head@freebsd.org Wed Jan 13 15:54:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A339AA80304; Wed, 13 Jan 2016 15:54:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58E2018DA; Wed, 13 Jan 2016 15:54:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DFsHXO012514; Wed, 13 Jan 2016 15:54:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DFsH92012512; Wed, 13 Jan 2016 15:54:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601131554.u0DFsH92012512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Jan 2016 15:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293832 - in head: lib/csu/aarch64 libexec/rtld-elf/aarch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 15:54:18 -0000 Author: andrew Date: Wed Jan 13 15:54:17 2016 New Revision: 293832 URL: https://svnweb.freebsd.org/changeset/base/293832 Log: Remove the compat code to handle the kernel passing us an unalinged stackpointer. Userland expects the kernel to pass it an aligned sp and pass a pointer to the arguments in x0. The kernel side was updated in r289502, 3 months ago. Sponsored by: ABT Systems Ltd Modified: head/lib/csu/aarch64/crt1.c head/libexec/rtld-elf/aarch64/rtld_start.S Modified: head/lib/csu/aarch64/crt1.c ============================================================================== --- head/lib/csu/aarch64/crt1.c Wed Jan 13 14:47:13 2016 (r293831) +++ head/lib/csu/aarch64/crt1.c Wed Jan 13 15:54:17 2016 (r293832) @@ -54,11 +54,7 @@ __asm(" .text \n" " .align 0 \n" " .globl _start \n" " _start: \n" -/* TODO: Remove this when the kernel correctly aligns the stack */ -" cbnz x0, 1f \n" /* Are we using a new kernel? */ -" mov x0, sp \n" /* No, load the args from sp */ -" and sp, x0, #~0xf \n" /* And align the stack */ -"1: mov x3, x2 \n" /* cleanup */ +" mov x3, x2 \n" /* cleanup */ " add x1, x0, #8 \n" /* load argv */ " ldr x0, [x0] \n" /* load argc */ " add x2, x1, x0, lsl #3 \n" /* env is after argv */ Modified: head/libexec/rtld-elf/aarch64/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/aarch64/rtld_start.S Wed Jan 13 14:47:13 2016 (r293831) +++ head/libexec/rtld-elf/aarch64/rtld_start.S Wed Jan 13 15:54:17 2016 (r293832) @@ -34,13 +34,7 @@ ENTRY(.rtld_start) mov x19, x0 /* Put ps_strings in a callee-saved register */ mov x20, sp /* And the stack pointer */ - /* Handle the old style stack */ - /* TODO: Remove this when the kernel correctly aligns the stack */ - cbnz x0, 1f - mov x0, sp /* sp points to the args */ - and sp, x0, #~0xf /* Align the stack as needed */ - -1: sub sp, sp, #16 /* Make room for obj_main & exit proc */ + sub sp, sp, #16 /* Make room for obj_main & exit proc */ mov x1, sp /* exit_proc */ add x2, x1, #8 /* obj_main */ From owner-svn-src-head@freebsd.org Wed Jan 13 16:59:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FD2FA81C63; Wed, 13 Jan 2016 16:59:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81421194E; Wed, 13 Jan 2016 16:59:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 126E8B945; Wed, 13 Jan 2016 11:59:53 -0500 (EST) From: John Baldwin To: Jilles Tjoelker Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293783 - head/lib/libc/sys Date: Wed, 13 Jan 2016 08:58:12 -0800 Message-ID: <2902719.QmmqeCdr7g@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201601122053.u0CKrvmB060658@repo.freebsd.org> References: <201601122053.u0CKrvmB060658@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 13 Jan 2016 11:59:53 -0500 (EST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 16:59:54 -0000 On Tuesday, January 12, 2016 08:53:57 PM Jilles Tjoelker wrote: > Author: jilles > Date: Tue Jan 12 20:53:57 2016 > New Revision: 293783 > URL: https://svnweb.freebsd.org/changeset/base/293783 > > Log: > Update futimens/utimensat for MFC to stable/10: > > * Fix __FreeBSD_version check. > * Update history section in man page. > > An MFC of this commit to stable/10 will allow using the new system calls > instead of the fallback. > > MFC after: 3 days Why does futimens.c exist? Given that we do not support forwards compatibility (newer libc on older kernel) only backwards compatibility (older libc on newer kernel), libc should just always call the system call directly. This is what we do for all other system calls and would avoid the issue of the earlier MFC not actually working. Allowing the unsupported 'make installkernel ; make installworld ; reboot' cycle to work across this change doesn't seem worth the effort of maintaining the osreldate checks here. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Jan 13 17:33:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6270BA8081D; Wed, 13 Jan 2016 17:33:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2388B1C69; Wed, 13 Jan 2016 17:33:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DHXppA043754; Wed, 13 Jan 2016 17:33:51 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DHXpW8043752; Wed, 13 Jan 2016 17:33:51 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201601131733.u0DHXpW8043752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 13 Jan 2016 17:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293833 - in head/usr.sbin/rpcbind: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 17:33:52 -0000 Author: asomers Date: Wed Jan 13 17:33:50 2016 New Revision: 293833 URL: https://svnweb.freebsd.org/changeset/base/293833 Log: Fix Coverity warnings regarding r293229 rpcbind/check_bound.c Fix CID1347798, a memory leak in mergeaddr. rpcbind/tests/addrmerge_test.c Fix CID1347800 through CID1347803, memory leaks in ATF tests. They are harmless because each ATF test case runs in its own process, but they are trivial to fix. Fix a few other leaks that Coverity didn't detect, too. Coverity CID: 1347798, 1347800, 1347801, 1347802, 1347803 MFC after: 2 weeks X-MFC-With: 293229 Sponsored by: Spectra Logic Corp Modified: head/usr.sbin/rpcbind/check_bound.c head/usr.sbin/rpcbind/tests/addrmerge_test.c Modified: head/usr.sbin/rpcbind/check_bound.c ============================================================================== --- head/usr.sbin/rpcbind/check_bound.c Wed Jan 13 15:54:17 2016 (r293832) +++ head/usr.sbin/rpcbind/check_bound.c Wed Jan 13 17:33:50 2016 (r293833) @@ -184,18 +184,19 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch dg_data = (struct svc_dg_data*)xprt->xp_p2; if (dg_data != NULL && dg_data->su_srcaddr.buf != NULL) { c_uaddr = taddr2uaddr(fdl->nconf, &dg_data->su_srcaddr); + allocated_uaddr = c_uaddr; } else if (saddr != NULL) { c_uaddr = saddr; } else { c_uaddr = taddr2uaddr(fdl->nconf, svc_getrpccaller(xprt)); - if (c_uaddr == NULL) { - syslog(LOG_ERR, "taddr2uaddr failed for %s", - fdl->nconf->nc_netid); - return (NULL); - } allocated_uaddr = c_uaddr; } + if (c_uaddr == NULL) { + syslog(LOG_ERR, "taddr2uaddr failed for %s", + fdl->nconf->nc_netid); + return (NULL); + } #ifdef ND_DEBUG if (debugging) { Modified: head/usr.sbin/rpcbind/tests/addrmerge_test.c ============================================================================== --- head/usr.sbin/rpcbind/tests/addrmerge_test.c Wed Jan 13 15:54:17 2016 (r293832) +++ head/usr.sbin/rpcbind/tests/addrmerge_test.c Wed Jan 13 17:33:50 2016 (r293833) @@ -435,6 +435,7 @@ ATF_TC_BODY(addrmerge_localhost_only, tc /* We must return localhost if there is nothing better */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("127.0.0.1.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_singlehomed); @@ -450,6 +451,7 @@ ATF_TC_BODY(addrmerge_singlehomed, tc) ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_one_addr_on_each_subnet); @@ -466,6 +468,7 @@ ATF_TC_BODY(addrmerge_one_addr_on_each_s /* We must return the address on the caller's subnet */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); + free(maddr); } @@ -488,6 +491,7 @@ ATF_TC_BODY(addrmerge_one_addr_on_each_s /* We must return the address on the caller's subnet */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_point2point); @@ -505,6 +509,7 @@ ATF_TC_BODY(addrmerge_point2point, tc) /* addrmerge should disprefer P2P interfaces */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.130.3.46", maddr); + free(maddr); } /* Like addrerge_point2point, but getifaddrs returns a different order */ @@ -523,6 +528,7 @@ ATF_TC_BODY(addrmerge_point2point_rev, t /* addrmerge should disprefer P2P interfaces */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.130.3.46", maddr); + free(maddr); } /* @@ -544,6 +550,7 @@ ATF_TC_BODY(addrmerge_bindip, tc) /* We must return the address to which we are bound */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.3.3.46", maddr); + free(maddr); } /* Like addrmerge_bindip, but getifaddrs returns a different order */ @@ -562,6 +569,7 @@ ATF_TC_BODY(addrmerge_bindip_rev, tc) /* We must return the address to which we are bound */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.3.3.46", maddr); + free(maddr); } /* @@ -582,6 +590,7 @@ ATF_TC_BODY(addrmerge_recvdstaddr, tc) /* We must return the address on which the request was received */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr_rev); @@ -598,6 +607,7 @@ ATF_TC_BODY(addrmerge_recvdstaddr_rev, t /* We must return the address on which the request was received */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); + free(maddr); } #ifdef INET6 @@ -614,6 +624,7 @@ ATF_TC_BODY(addrmerge_localhost_only6, t /* We must return localhost if there is nothing better */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("::1.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_singlehomed6); @@ -629,6 +640,7 @@ ATF_TC_BODY(addrmerge_singlehomed6, tc) ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_one_addr_on_each_subnet6); @@ -645,6 +657,7 @@ ATF_TC_BODY(addrmerge_one_addr_on_each_s /* We must return the address on the caller's subnet */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); + free(maddr); } @@ -667,6 +680,7 @@ ATF_TC_BODY(addrmerge_one_addr_on_each_s /* We must return the address on the caller's subnet */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_point2point6); @@ -684,6 +698,7 @@ ATF_TC_BODY(addrmerge_point2point6, tc) /* addrmerge should disprefer P2P interfaces */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8:1::2.3.46", maddr); + free(maddr); } /* Like addrerge_point2point, but getifaddrs returns a different order */ @@ -702,6 +717,7 @@ ATF_TC_BODY(addrmerge_point2point6_rev, /* addrmerge should disprefer P2P interfaces */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8:1::2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_bindip6); @@ -719,6 +735,7 @@ ATF_TC_BODY(addrmerge_bindip6, tc) /* We must return the address to which we are bound */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::3.3.46", maddr); + free(maddr); } /* Like addrerge_bindip, but getifaddrs returns a different order */ @@ -737,6 +754,7 @@ ATF_TC_BODY(addrmerge_bindip6_rev, tc) /* We must return the address to which we are bound */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::3.3.46", maddr); + free(maddr); } /* @@ -761,6 +779,7 @@ ATF_TC_BODY(addrmerge_ipv6_linklocal, tc /* We must return the address to which we are bound */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("fe80::2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_ipv6_linklocal_rev); @@ -781,6 +800,7 @@ ATF_TC_BODY(addrmerge_ipv6_linklocal_rev /* We must return the address to which we are bound */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("fe80::2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr6); @@ -797,6 +817,7 @@ ATF_TC_BODY(addrmerge_recvdstaddr6, tc) /* We must return the address on which the request was received */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr6_rev); @@ -813,6 +834,7 @@ ATF_TC_BODY(addrmerge_recvdstaddr6_rev, /* We must return the address on which the request was received */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); + free(maddr); } #endif /* INET6 */ From owner-svn-src-head@freebsd.org Wed Jan 13 17:59:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DAC8A810E6; Wed, 13 Jan 2016 17:59:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F32861A74; Wed, 13 Jan 2016 17:59:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DHxDK8049799; Wed, 13 Jan 2016 17:59:13 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DHxDHP049798; Wed, 13 Jan 2016 17:59:13 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201601131759.u0DHxDHP049798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 13 Jan 2016 17:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293834 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 17:59:14 -0000 Author: bapt Date: Wed Jan 13 17:59:12 2016 New Revision: 293834 URL: https://svnweb.freebsd.org/changeset/base/293834 Log: Remove some unneeded headers Modified: head/usr.sbin/pkg/config.c Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Wed Jan 13 17:33:50 2016 (r293833) +++ head/usr.sbin/pkg/config.c Wed Jan 13 17:59:12 2016 (r293834) @@ -31,21 +31,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include -#include #include #include -#include #include #include -#include -#include -#include #include -#include #include #include "config.h" From owner-svn-src-head@freebsd.org Wed Jan 13 18:33:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0755DA81D90; Wed, 13 Jan 2016 18:33:14 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D29911D1C; Wed, 13 Jan 2016 18:33:13 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DIXCUQ061267; Wed, 13 Jan 2016 18:33:12 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DIXCF9061264; Wed, 13 Jan 2016 18:33:12 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601131833.u0DIXCF9061264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 13 Jan 2016 18:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293835 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 18:33:14 -0000 Author: smh Date: Wed Jan 13 18:33:12 2016 New Revision: 293835 URL: https://svnweb.freebsd.org/changeset/base/293835 Log: Improve non-interactive forth cmd error reporting Non-interactive forth command errors where silent even for critical issues e.g. failing to load a required kernel module or mfs_root. This resulted in later unexplained and hard to trace errors such as mount root failures. This introduces additional command return codes that are treated appropriately by the non-interactive command processor (bf_command). * CMD_CRIT = print error * CMD_FATAL = panic Also fix minor style(9) issues with command_load return codes. MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/sys/boot/common/bootstrap.h head/sys/boot/common/interp_forth.c head/sys/boot/common/module.c Modified: head/sys/boot/common/bootstrap.h ============================================================================== --- head/sys/boot/common/bootstrap.h Wed Jan 13 17:59:12 2016 (r293834) +++ head/sys/boot/common/bootstrap.h Wed Jan 13 18:33:12 2016 (r293835) @@ -56,7 +56,10 @@ typedef int (bootblk_cmd_t)(int argc, ch extern char *command_errmsg; extern char command_errbuf[]; /* XXX blah, length */ #define CMD_OK 0 -#define CMD_ERROR 1 +#define CMD_WARN 1 +#define CMD_ERROR 2 +#define CMD_CRIT 3 +#define CMD_FATAL 4 /* interp.c */ void interact(const char *rc); Modified: head/sys/boot/common/interp_forth.c ============================================================================== --- head/sys/boot/common/interp_forth.c Wed Jan 13 17:59:12 2016 (r293834) +++ head/sys/boot/common/interp_forth.c Wed Jan 13 18:33:12 2016 (r293835) @@ -138,13 +138,23 @@ bf_command(FICL_VM *vm) } else { result=BF_PARSE; } + + switch (result) { + case CMD_CRIT: + printf("%s\n", command_errmsg); + break; + case CMD_FATAL: + panic("%s\n", command_errmsg); + } + free(line); /* * If there was error during nested ficlExec(), we may no longer have * valid environment to return. Throw all exceptions from here. */ - if (result != 0) + if (result != CMD_OK) vmThrow(vm, result); + /* This is going to be thrown!!! */ stackPushINT(vm->pStack,result); } Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Wed Jan 13 17:59:12 2016 (r293834) +++ head/sys/boot/common/module.c Wed Jan 13 18:33:12 2016 (r293835) @@ -112,7 +112,7 @@ command_load(int argc, char *argv[]) typestr = NULL; if (argc == 1) { command_errmsg = "no filename specified"; - return(CMD_ERROR); + return (CMD_CRIT); } while ((ch = getopt(argc, argv, "kt:")) != -1) { switch(ch) { @@ -126,7 +126,7 @@ command_load(int argc, char *argv[]) case '?': default: /* getopt has already reported an error */ - return(CMD_OK); + return (CMD_OK); } } argv += (optind - 1); @@ -138,33 +138,46 @@ command_load(int argc, char *argv[]) if (dofile) { if ((argc != 2) || (typestr == NULL) || (*typestr == 0)) { command_errmsg = "invalid load type"; - return(CMD_ERROR); + return (CMD_CRIT); } fp = file_findfile(argv[1], typestr); if (fp) { sprintf(command_errbuf, "warning: file '%s' already loaded", argv[1]); - return (CMD_ERROR); + return (CMD_WARN); } - return (file_loadraw(argv[1], typestr, 1) ? CMD_OK : CMD_ERROR); + if (file_loadraw(argv[1], typestr, 1) != NULL) + return (CMD_OK); + + /* Failing to load mfs_root is never going to end well! */ + if (strcmp("mfs_root", typestr) == 0) + return (CMD_FATAL); + + return (CMD_ERROR); } /* * Do we have explicit KLD load ? */ if (dokld || file_havepath(argv[1])) { error = mod_loadkld(argv[1], argc - 2, argv + 2); - if (error == EEXIST) + if (error == EEXIST) { sprintf(command_errbuf, "warning: KLD '%s' already loaded", argv[1]); - return (error == 0 ? CMD_OK : CMD_ERROR); + return (CMD_WARN); + } + + return (error == 0 ? CMD_OK : CMD_CRIT); } /* * Looks like a request for a module. */ error = mod_load(argv[1], NULL, argc - 2, argv + 2); - if (error == EEXIST) + if (error == EEXIST) { sprintf(command_errbuf, "warning: module '%s' already loaded", argv[1]); - return (error == 0 ? CMD_OK : CMD_ERROR); + return (CMD_WARN); + } + + return (error == 0 ? CMD_OK : CMD_CRIT); } COMMAND_SET(load_geli, "load_geli", "load a geli key", command_load_geli); From owner-svn-src-head@freebsd.org Wed Jan 13 19:19:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 545E0A80DE4; Wed, 13 Jan 2016 19:19:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25F921119; Wed, 13 Jan 2016 19:19:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DJJp5E072932; Wed, 13 Jan 2016 19:19:51 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DJJpD0072931; Wed, 13 Jan 2016 19:19:51 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201601131919.u0DJJpD0072931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 13 Jan 2016 19:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293836 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 19:19:52 -0000 Author: jkim Date: Wed Jan 13 19:19:50 2016 New Revision: 293836 URL: https://svnweb.freebsd.org/changeset/base/293836 Log: Remove dead code when the target processor has POPCNT instruction. Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Jan 13 18:33:12 2016 (r293835) +++ head/sys/amd64/amd64/pmap.c Wed Jan 13 19:19:50 2016 (r293836) @@ -3018,11 +3018,14 @@ reserve_pv_entries(pmap_t pmap, int need retry: avail = 0; TAILQ_FOREACH(pc, &pmap->pm_pvchunk, pc_list) { +#ifndef __POPCNT__ if ((cpu_feature2 & CPUID2_POPCNT) == 0) { free = bitcount64(pc->pc_map[0]); free += bitcount64(pc->pc_map[1]); free += bitcount64(pc->pc_map[2]); - } else { + } else +#endif + { free = popcnt_pc_map_elem_pq(pc->pc_map[0]); free += popcnt_pc_map_elem_pq(pc->pc_map[1]); free += popcnt_pc_map_elem_pq(pc->pc_map[2]); From owner-svn-src-head@freebsd.org Wed Jan 13 19:52:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8B11A81AE0; Wed, 13 Jan 2016 19:52:27 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E6FB156C; Wed, 13 Jan 2016 19:52:27 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DJqQUf084562; Wed, 13 Jan 2016 19:52:26 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DJqPga084554; Wed, 13 Jan 2016 19:52:25 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201601131952.u0DJqPga084554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Wed, 13 Jan 2016 19:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293837 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 19:52:28 -0000 Author: dumbbell Date: Wed Jan 13 19:52:25 2016 New Revision: 293837 URL: https://svnweb.freebsd.org/changeset/base/293837 Log: drm/i915: Further reduce the diff with Linux 3.8 There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver. Modified: head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/i915/i915_gem_execbuffer.c head/sys/dev/drm2/i915/i915_gem_gtt.c head/sys/dev/drm2/i915/i915_gem_tiling.c head/sys/dev/drm2/i915/i915_irq.c head/sys/dev/drm2/i915/intel_crt.c head/sys/dev/drm2/i915/intel_display.c head/sys/dev/drm2/i915/intel_overlay.c Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Wed Jan 13 19:19:50 2016 (r293836) +++ head/sys/dev/drm2/i915/i915_gem.c Wed Jan 13 19:52:25 2016 (r293837) @@ -156,7 +156,7 @@ i915_gem_wait_for_error(struct drm_devic int ret; if (!atomic_load_acq_int(&dev_priv->mm.wedged)) - return (0); + return 0; mtx_lock(&dev_priv->error_completion_lock); while (dev_priv->error_completion == 0) { @@ -166,7 +166,7 @@ i915_gem_wait_for_error(struct drm_devic ret = -ERESTARTSYS; if (ret != 0) { mtx_unlock(&dev_priv->error_completion_lock); - return (ret); + return ret; } } mtx_unlock(&dev_priv->error_completion_lock); @@ -1861,26 +1861,30 @@ i915_gem_object_put_pages_range(struct d static void i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj) { - vm_page_t page; - int page_count, i; + int page_count = obj->base.size / PAGE_SIZE; + int i; KASSERT(obj->madv != I915_MADV_PURGED_INTERNAL, ("Purged object")); if (obj->tiling_mode != I915_TILING_NONE) i915_gem_object_save_bit_17_swizzle(obj); + if (obj->madv == I915_MADV_DONTNEED) obj->dirty = 0; - page_count = obj->base.size / PAGE_SIZE; + VM_OBJECT_WLOCK(obj->base.vm_obj); #if GEM_PARANOID_CHECK_GTT i915_gem_assert_pages_not_mapped(obj->base.dev, obj->pages, page_count); #endif for (i = 0; i < page_count; i++) { - page = obj->pages[i]; + vm_page_t page = obj->pages[i]; + if (obj->dirty) vm_page_dirty(page); + if (obj->madv == I915_MADV_WILLNEED) vm_page_reference(page); + vm_page_lock(page); vm_page_unwire(obj->pages[i], PQ_ACTIVE); vm_page_unlock(page); @@ -1888,6 +1892,7 @@ i915_gem_object_put_pages_gtt(struct drm } VM_OBJECT_WUNLOCK(obj->base.vm_obj); obj->dirty = 0; + free(obj->pages, DRM_I915_GEM); obj->pages = NULL; } Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_execbuffer.c Wed Jan 13 19:19:50 2016 (r293836) +++ head/sys/dev/drm2/i915/i915_gem_execbuffer.c Wed Jan 13 19:52:25 2016 (r293837) @@ -411,8 +411,8 @@ i915_gem_execbuffer_relocate_entry(struc reloc->offset += obj->gtt_offset; reloc_page = pmap_mapdev_attr(dev->agp->base + (reloc->offset & ~PAGE_MASK), PAGE_SIZE, PAT_WRITE_COMBINING); - reloc_entry = (uint32_t *)(reloc_page + (reloc->offset & - PAGE_MASK)); + reloc_entry = (uint32_t *) + (reloc_page + (reloc->offset & PAGE_MASK)); *(volatile uint32_t *)reloc_entry = reloc->delta; pmap_unmapdev((vm_offset_t)reloc_page, PAGE_SIZE); } @@ -502,7 +502,7 @@ i915_gem_execbuffer_relocate(struct drm_ struct list_head *objects) { struct drm_i915_gem_object *obj; - int ret, pflags; + int ret = 0, pflags; /* Try to move as many of the relocation targets off the active list * to avoid unnecessary fallbacks to the slow path, as we cannot wait @@ -510,7 +510,6 @@ i915_gem_execbuffer_relocate(struct drm_ */ i915_gem_retire_requests(dev); - ret = 0; /* This is the fast path and we cannot handle a pagefault whilst * holding the device lock lest the user pass in the relocations * contained within a mmaped bo. For in such a case we, the page @@ -952,6 +951,7 @@ validate_exec_list(struct drm_i915_gem_e *map = malloc(count * sizeof(*ma), DRM_I915_GEM, M_WAITOK | M_ZERO); *maplen = malloc(count * sizeof(*maplen), DRM_I915_GEM, M_WAITOK | M_ZERO); + for (i = 0; i < count; i++) { /* First check for malicious input causing overflow */ if (exec[i].relocation_count > Modified: head/sys/dev/drm2/i915/i915_gem_gtt.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_gtt.c Wed Jan 13 19:19:50 2016 (r293836) +++ head/sys/dev/drm2/i915/i915_gem_gtt.c Wed Jan 13 19:52:25 2016 (r293837) @@ -107,21 +107,22 @@ int i915_gem_init_aliasing_ppgtt(struct I915_PPGTT_PT_ENTRIES); ppgtt->pd_offset = (first_pd_entry_in_global_pt) * sizeof(uint32_t); dev_priv->mm.aliasing_ppgtt = ppgtt; - return (0); + + return 0; } -static void -i915_ppgtt_insert_pages(struct i915_hw_ppgtt *ppgtt, unsigned first_entry, - unsigned num_entries, vm_page_t *pages, uint32_t pte_flags) +static void i915_ppgtt_insert_pages(struct i915_hw_ppgtt *ppgtt, + unsigned first_entry, + unsigned num_entries, + vm_page_t *pages, + uint32_t pte_flags) { uint32_t *pt_vaddr, pte; - struct sf_buf *sf; - unsigned act_pd, first_pte; - unsigned last_pte, i; + unsigned act_pd = first_entry / I915_PPGTT_PT_ENTRIES; + unsigned first_pte = first_entry % I915_PPGTT_PT_ENTRIES; + unsigned j, last_pte; vm_paddr_t page_addr; - - act_pd = first_entry / I915_PPGTT_PT_ENTRIES; - first_pte = first_entry % I915_PPGTT_PT_ENTRIES; + struct sf_buf *sf; while (num_entries) { last_pte = first_pte + num_entries; @@ -132,10 +133,10 @@ i915_ppgtt_insert_pages(struct i915_hw_p sf = sf_buf_alloc(ppgtt->pt_pages[act_pd], SFB_CPUPRIVATE); pt_vaddr = (uint32_t *)(uintptr_t)sf_buf_kva(sf); - for (i = first_pte; i < last_pte; i++) { + for (j = first_pte; j < last_pte; j++) { page_addr = VM_PAGE_TO_PHYS(*pages); pte = GEN6_PTE_ADDR_ENCODE(page_addr); - pt_vaddr[i] = pte | pte_flags; + pt_vaddr[j] = pte | pte_flags; pages++; } @@ -194,18 +195,21 @@ void i915_gem_init_ppgtt(struct drm_devi struct intel_ring_buffer *ring; struct i915_hw_ppgtt *ppgtt = dev_priv->mm.aliasing_ppgtt; u_int first_pd_entry_in_global_pt; - vm_paddr_t pt_addr; uint32_t pd_entry; int i; if (!dev_priv->mm.aliasing_ppgtt) return; + first_pd_entry_in_global_pt = 512 * 1024 - I915_PPGTT_PD_ENTRIES; for (i = 0; i < ppgtt->num_pd_entries; i++) { + vm_paddr_t pt_addr; + pt_addr = VM_PAGE_TO_PHYS(ppgtt->pt_pages[i]); pd_entry = GEN6_PDE_ADDR_ENCODE(pt_addr); pd_entry |= GEN6_PDE_VALID; + intel_gtt_write(first_pd_entry_in_global_pt + i, pd_entry); } intel_gtt_read_pte(first_pd_entry_in_global_pt); @@ -217,7 +221,7 @@ void i915_gem_init_ppgtt(struct drm_devi if (INTEL_INFO(dev)->gen == 6) { uint32_t ecochk, gab_ctl, ecobits; - ecobits = I915_READ(GAC_ECO_BITS); + ecobits = I915_READ(GAC_ECO_BITS); I915_WRITE(GAC_ECO_BITS, ecobits | ECOBITS_PPGTT_CACHE64B); gab_ctl = I915_READ(GAB_CTL); @@ -336,9 +340,8 @@ int i915_gem_gtt_prepare_object(struct d return 0; } -void -i915_gem_gtt_bind_object(struct drm_i915_gem_object *obj, - enum i915_cache_level cache_level) +void i915_gem_gtt_bind_object(struct drm_i915_gem_object *obj, + enum i915_cache_level cache_level) { struct drm_device *dev; struct drm_i915_private *dev_priv; @@ -375,15 +378,14 @@ void i915_gem_gtt_finish_object(struct d } int i915_gem_init_global_gtt(struct drm_device *dev, - unsigned long start, - unsigned long mappable_end, - unsigned long end) + unsigned long start, + unsigned long mappable_end, + unsigned long end) { - drm_i915_private_t *dev_priv; + drm_i915_private_t *dev_priv = dev->dev_private; unsigned long mappable; int error; - dev_priv = dev->dev_private; mappable = min(end, mappable_end) - start; /* Substract the guard page ... */ Modified: head/sys/dev/drm2/i915/i915_gem_tiling.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_tiling.c Wed Jan 13 19:19:50 2016 (r293836) +++ head/sys/dev/drm2/i915/i915_gem_tiling.c Wed Jan 13 19:52:25 2016 (r293837) @@ -453,15 +453,15 @@ i915_gem_get_tiling(struct drm_device *d * by the GPU. */ static void -i915_gem_swizzle_page(vm_page_t m) +i915_gem_swizzle_page(vm_page_t page) { char temp[64]; - char *vaddr; struct sf_buf *sf; + char *vaddr; int i; /* XXXKIB sleep */ - sf = sf_buf_alloc(m, SFB_DEFAULT); + sf = sf_buf_alloc(page, SFB_DEFAULT); vaddr = (char *)sf_buf_kva(sf); for (i = 0; i < PAGE_SIZE; i += 128) { Modified: head/sys/dev/drm2/i915/i915_irq.c ============================================================================== --- head/sys/dev/drm2/i915/i915_irq.c Wed Jan 13 19:19:50 2016 (r293836) +++ head/sys/dev/drm2/i915/i915_irq.c Wed Jan 13 19:52:25 2016 (r293837) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include #include #include @@ -770,42 +771,47 @@ i915_error_object_create(struct drm_i915 struct drm_i915_gem_object *src) { struct drm_i915_error_object *dst; - struct sf_buf *sf; - void *d, *s; - int page, page_count; + int i, count; u32 reloc_offset; if (src == NULL || src->pages == NULL) return NULL; - page_count = src->base.size / PAGE_SIZE; + count = src->base.size / PAGE_SIZE; - dst = malloc(sizeof(*dst) + page_count * sizeof(u32 *), DRM_I915_GEM, - M_NOWAIT); + dst = malloc(sizeof(*dst) + count * sizeof(u32 *), DRM_I915_GEM, M_NOWAIT); if (dst == NULL) - return (NULL); + return NULL; reloc_offset = src->gtt_offset; - for (page = 0; page < page_count; page++) { + for (i = 0; i < count; i++) { + void *d; + d = malloc(PAGE_SIZE, DRM_I915_GEM, M_NOWAIT); if (d == NULL) goto unwind; if (reloc_offset < dev_priv->mm.gtt_mappable_end && src->has_global_gtt_mapping) { + void *s; + /* Simply ignore tiling or any overlapping fence. * It's part of the error state, and this hopefully * captures what the GPU read. */ s = pmap_mapdev_attr(src->base.dev->agp->base + - reloc_offset, PAGE_SIZE, PAT_WRITE_COMBINING); + reloc_offset, + PAGE_SIZE, PAT_WRITE_COMBINING); memcpy(d, s, PAGE_SIZE); pmap_unmapdev((vm_offset_t)s, PAGE_SIZE); } else { - drm_clflush_pages(&src->pages[page], 1); + struct sf_buf *sf; + void *s; + + drm_clflush_pages(&src->pages[i], 1); sched_pin(); - sf = sf_buf_alloc(src->pages[page], SFB_CPUPRIVATE | + sf = sf_buf_alloc(src->pages[i], SFB_CPUPRIVATE | SFB_NOWAIT); if (sf != NULL) { s = (void *)(uintptr_t)sf_buf_kva(sf); @@ -817,21 +823,21 @@ i915_error_object_create(struct drm_i915 } sched_unpin(); - drm_clflush_pages(&src->pages[page], 1); + drm_clflush_pages(&src->pages[i], 1); } - dst->pages[page] = d; + dst->pages[i] = d; reloc_offset += PAGE_SIZE; } - dst->page_count = page_count; + dst->page_count = count; dst->gtt_offset = src->gtt_offset; return dst; unwind: - while (page--) - free(dst->pages[page], DRM_I915_GEM); + while (i--) + free(dst->pages[i], DRM_I915_GEM); free(dst, DRM_I915_GEM); return NULL; } @@ -2571,6 +2577,7 @@ void intel_irq_init(struct drm_device *d dev->max_vblank_count = 0xffffffff; /* full 32 bit counter */ dev->driver->get_vblank_counter = gm45_get_vblank_counter; } + if (drm_core_check_feature(dev, DRIVER_MODESET)) dev->driver->get_vblank_timestamp = i915_get_vblank_timestamp; else Modified: head/sys/dev/drm2/i915/intel_crt.c ============================================================================== --- head/sys/dev/drm2/i915/intel_crt.c Wed Jan 13 19:19:50 2016 (r293836) +++ head/sys/dev/drm2/i915/intel_crt.c Wed Jan 13 19:52:25 2016 (r293837) @@ -598,8 +598,7 @@ void intel_crt_init(struct drm_device *d crt = malloc(sizeof(struct intel_crt), DRM_MEM_KMS, M_WAITOK | M_ZERO); - intel_connector = malloc(sizeof(struct intel_connector), DRM_MEM_KMS, - M_WAITOK | M_ZERO); + intel_connector = malloc(sizeof(struct intel_connector), DRM_MEM_KMS, M_WAITOK | M_ZERO); connector = &intel_connector->base; drm_connector_init(dev, &intel_connector->base, Modified: head/sys/dev/drm2/i915/intel_display.c ============================================================================== --- head/sys/dev/drm2/i915/intel_display.c Wed Jan 13 19:19:50 2016 (r293836) +++ head/sys/dev/drm2/i915/intel_display.c Wed Jan 13 19:52:25 2016 (r293837) @@ -1382,9 +1382,8 @@ out_unlock: static u32 intel_sbi_read(struct drm_i915_private *dev_priv, u16 reg) { - u32 value; + u32 value = 0; - value = 0; mtx_lock(&dev_priv->dpio_lock); if (wait_for((I915_READ(SBI_CTL_STAT) & SBI_READY) == 0, 100)) { DRM_ERROR("timeout waiting for SBI to become ready\n"); @@ -1469,7 +1468,7 @@ static void intel_disable_pch_pll(struct /* PCH only available on ILK+ */ KASSERT(dev_priv->info->gen >= 5, ("Wrong device gen")); if (pll == NULL) - return; + return; if (pll->refcount == 0) { DRM_DEBUG_KMS("pll->refcount == 0\n"); @@ -1495,7 +1494,7 @@ static void intel_disable_pch_pll(struct /* Make sure transcoder isn't still depending on us */ assert_transcoder_disabled(dev_priv, intel_crtc->pipe); - + reg = pll->pll_reg; val = I915_READ(reg); val &= ~DPLL_VCO_ENABLE; @@ -1507,7 +1506,7 @@ static void intel_disable_pch_pll(struct } static void intel_enable_transcoder(struct drm_i915_private *dev_priv, - enum pipe pipe) + enum pipe pipe) { int reg; u32 val, pipeconf_val; @@ -1517,7 +1516,8 @@ static void intel_enable_transcoder(stru KASSERT(dev_priv->info->gen >= 5, ("Wrong device gen")); /* Make sure PCH DPLL is enabled */ - assert_pch_pll_enabled(dev_priv, to_intel_crtc(crtc)); + assert_pch_pll_enabled(dev_priv, + to_intel_crtc(crtc)); /* FDI must be feeding us bits for PCH ports */ assert_fdi_tx_enabled(dev_priv, pipe); @@ -1527,9 +1527,11 @@ static void intel_enable_transcoder(stru DRM_ERROR("Attempting to enable transcoder on Haswell with pipe > 0\n"); return; } + reg = TRANSCONF(pipe); val = I915_READ(reg); pipeconf_val = I915_READ(PIPECONF(pipe)); + if (HAS_PCH_IBX(dev_priv->dev)) { /* * make the BPC in transcoder be consistent with @@ -1886,6 +1888,7 @@ static int i9xx_update_plane(struct drm_ DRM_ERROR("Unknown color depth %d\n", fb->bits_per_pixel); return -EINVAL; } + if (INTEL_INFO(dev)->gen >= 4) { if (obj->tiling_mode != I915_TILING_NONE) dspcntr |= DISPPLANE_TILED; @@ -2525,7 +2528,7 @@ static void ivb_manual_fdi_link_train(st POSTING_READ(reg); DELAY(150); - for (i = 0; i < 4; i++ ) { + for (i = 0; i < 4; i++) { reg = FDI_TX_CTL(pipe); temp = I915_READ(reg); temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK; @@ -7132,7 +7135,7 @@ int intel_modeset_vga_set_state(struct d else gmch_ctrl |= INTEL_GMCH_VGA_DISABLE; pci_write_config(bridge_dev, INTEL_GMCH_CTRL, gmch_ctrl, 2); - return (0); + return 0; } struct intel_display_error_state { Modified: head/sys/dev/drm2/i915/intel_overlay.c ============================================================================== --- head/sys/dev/drm2/i915/intel_overlay.c Wed Jan 13 19:19:50 2016 (r293836) +++ head/sys/dev/drm2/i915/intel_overlay.c Wed Jan 13 19:52:25 2016 (r293837) @@ -1138,8 +1138,7 @@ int intel_overlay_put_image(struct drm_d return ret; } - params = malloc(sizeof(struct put_image_params), DRM_I915_GEM, - M_WAITOK | M_ZERO); + params = malloc(sizeof(struct put_image_params), DRM_I915_GEM, M_WAITOK | M_ZERO); drmmode_obj = drm_mode_object_find(dev, put_image_rec->crtc_id, DRM_MODE_OBJECT_CRTC); @@ -1403,8 +1402,7 @@ void intel_setup_overlay(struct drm_devi if (!HAS_OVERLAY(dev)) return; - overlay = malloc(sizeof(struct intel_overlay), DRM_I915_GEM, - M_WAITOK | M_ZERO); + overlay = malloc(sizeof(struct intel_overlay), DRM_I915_GEM, M_WAITOK | M_ZERO); DRM_LOCK(dev); if (dev_priv->overlay != NULL) goto out_free; @@ -1523,16 +1521,15 @@ intel_overlay_capture_error_state(struct memcpy(&error->regs, regs, sizeof(struct overlay_registers)); intel_overlay_unmap_regs(overlay, regs); - return (error); + return error; err: free(error, DRM_I915_GEM); - return (NULL); + return NULL; } void -intel_overlay_print_error_state(struct sbuf *m, - struct intel_overlay_error_state *error) +intel_overlay_print_error_state(struct sbuf *m, struct intel_overlay_error_state *error) { sbuf_printf(m, "Overlay, status: 0x%08x, interrupt: 0x%08x\n", error->dovsta, error->isr); From owner-svn-src-head@freebsd.org Wed Jan 13 20:35:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A021A81CF1; Wed, 13 Jan 2016 20:35:04 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1822C1BF6; Wed, 13 Jan 2016 20:35:04 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DKZ3QU097180; Wed, 13 Jan 2016 20:35:03 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DKZ3F3097178; Wed, 13 Jan 2016 20:35:03 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201601132035.u0DKZ3F3097178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Wed, 13 Jan 2016 20:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293851 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 20:35:04 -0000 Author: dumbbell Date: Wed Jan 13 20:35:02 2016 New Revision: 293851 URL: https://svnweb.freebsd.org/changeset/base/293851 Log: drm: Revert the part of r288653 about M_WAITOK vs M_NOWAIT Using M_NOWAIT could lead to transient failures with ioctls. Suggested by: kib Modified: head/sys/dev/drm2/drm_crtc.c head/sys/dev/drm2/drm_pci.c Modified: head/sys/dev/drm2/drm_crtc.c ============================================================================== --- head/sys/dev/drm2/drm_crtc.c Wed Jan 13 20:16:53 2016 (r293850) +++ head/sys/dev/drm2/drm_crtc.c Wed Jan 13 20:35:02 2016 (r293851) @@ -663,7 +663,7 @@ int drm_plane_init(struct drm_device *de plane->dev = dev; plane->funcs = funcs; plane->format_types = malloc(sizeof(uint32_t) * format_count, - DRM_MEM_KMS, M_NOWAIT); + DRM_MEM_KMS, M_WAITOK); if (!plane->format_types) { DRM_DEBUG_KMS("out of memory when allocating plane\n"); drm_mode_object_put(dev, &plane->base); @@ -1010,7 +1010,7 @@ int drm_mode_group_init(struct drm_devic total_objects += dev->mode_config.num_encoder; group->id_list = malloc(total_objects * sizeof(uint32_t), - DRM_MEM_KMS, M_NOWAIT | M_ZERO); + DRM_MEM_KMS, M_WAITOK | M_ZERO); if (!group->id_list) return -ENOMEM; @@ -1998,7 +1998,7 @@ int drm_mode_setcrtc(struct drm_device * connector_set = malloc(crtc_req->count_connectors * sizeof(struct drm_connector *), - DRM_MEM_KMS, M_NOWAIT); + DRM_MEM_KMS, M_WAITOK); if (!connector_set) { ret = -ENOMEM; goto out; @@ -2523,7 +2523,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_de goto out_err1; } clips = malloc(num_clips * sizeof(*clips), DRM_MEM_KMS, - M_NOWAIT | M_ZERO); + M_WAITOK | M_ZERO); if (!clips) { ret = -ENOMEM; goto out_err1; @@ -2774,13 +2774,13 @@ struct drm_property *drm_property_create int ret; property = malloc(sizeof(struct drm_property), DRM_MEM_KMS, - M_NOWAIT | M_ZERO); + M_WAITOK | M_ZERO); if (!property) return NULL; if (num_values) { property->values = malloc(sizeof(uint64_t)*num_values, DRM_MEM_KMS, - M_NOWAIT | M_ZERO); + M_WAITOK | M_ZERO); if (!property->values) goto fail; } @@ -2908,7 +2908,7 @@ int drm_property_add_enum(struct drm_pro } prop_enum = malloc(sizeof(struct drm_property_enum), DRM_MEM_KMS, - M_NOWAIT | M_ZERO); + M_WAITOK | M_ZERO); if (!prop_enum) return -ENOMEM; @@ -3104,7 +3104,7 @@ static struct drm_property_blob *drm_pro return NULL; blob = malloc(sizeof(struct drm_property_blob)+length, DRM_MEM_KMS, - M_NOWAIT | M_ZERO); + M_WAITOK | M_ZERO); if (!blob) return NULL; @@ -3434,7 +3434,7 @@ int drm_mode_crtc_set_gamma_size(struct crtc->gamma_size = gamma_size; crtc->gamma_store = malloc(gamma_size * sizeof(uint16_t) * 3, - DRM_MEM_KMS, M_NOWAIT | M_ZERO); + DRM_MEM_KMS, M_WAITOK | M_ZERO); if (!crtc->gamma_store) { crtc->gamma_size = 0; return -ENOMEM; @@ -3632,7 +3632,7 @@ int drm_mode_page_flip_ioctl(struct drm_ file_priv->event_space -= sizeof e->event; mtx_unlock(&dev->event_lock); - e = malloc(sizeof *e, DRM_MEM_KMS, M_NOWAIT | M_ZERO); + e = malloc(sizeof *e, DRM_MEM_KMS, M_WAITOK | M_ZERO); if (e == NULL) { mtx_lock(&dev->event_lock); file_priv->event_space += sizeof e->event; Modified: head/sys/dev/drm2/drm_pci.c ============================================================================== --- head/sys/dev/drm2/drm_pci.c Wed Jan 13 20:16:53 2016 (r293850) +++ head/sys/dev/drm2/drm_pci.c Wed Jan 13 20:35:02 2016 (r293851) @@ -225,7 +225,7 @@ int drm_pci_set_unique(struct drm_device master->unique_len = u->unique_len; master->unique_size = u->unique_len + 1; - master->unique = malloc(master->unique_size, DRM_MEM_DRIVER, M_NOWAIT); + master->unique = malloc(master->unique_size, DRM_MEM_DRIVER, M_WAITOK); if (!master->unique) { ret = -ENOMEM; goto err; From owner-svn-src-head@freebsd.org Wed Jan 13 21:34:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32556A813B1; Wed, 13 Jan 2016 21:34:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01A461452; Wed, 13 Jan 2016 21:34:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DLYFCI014525; Wed, 13 Jan 2016 21:34:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DLYFRv014524; Wed, 13 Jan 2016 21:34:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601132134.u0DLYFRv014524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Jan 2016 21:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293852 - head/usr.sbin/kldxref X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 21:34:17 -0000 Author: andrew Date: Wed Jan 13 21:34:15 2016 New Revision: 293852 URL: https://svnweb.freebsd.org/changeset/base/293852 Log: Add support for relocating AArch64 modules to kldxref. This fixes an error message where it fails to read the module as the unrelocated addresses are zero. Sponsored by: ABT Systems Ltd Added: head/usr.sbin/kldxref/ef_aarch64.c - copied, changed from r293737, head/usr.sbin/kldxref/ef_powerpc.c Copied and modified: head/usr.sbin/kldxref/ef_aarch64.c (from r293737, head/usr.sbin/kldxref/ef_powerpc.c) ============================================================================== --- head/usr.sbin/kldxref/ef_powerpc.c Tue Jan 12 09:03:39 2016 (r293737, copy source) +++ head/usr.sbin/kldxref/ef_aarch64.c Wed Jan 13 21:34:15 2016 (r293852) @@ -60,15 +60,18 @@ ef_reloc(struct elf_file *ef, const void rtype = ELF_R_TYPE(rela->r_info); symidx = ELF_R_SYM(rela->r_info); - if ((char *)where < (char *)dest || (char *)where >= (char *)dest + len) + if ((char *)where < (char *)dest || (char *)where >= (char *)dest + len) return (0); switch(rtype) { - case R_PPC_RELATIVE: /* word32 B + A */ + case R_AARCH64_RELATIVE: *where = relbase + addend; break; + case R_AARCH64_ABS64: + break; default: - warnx("unhandled relocation type %d", rtype); + warnx("unhandled relocation type %lu", rtype); + break; } return (0); } From owner-svn-src-head@freebsd.org Wed Jan 13 21:36:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA96AA81479; Wed, 13 Jan 2016 21:36:05 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com [IPv6:2a00:1450:4010:c04::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 721D81732; Wed, 13 Jan 2016 21:36:05 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lb0-x22e.google.com with SMTP id x4so41754091lbm.0; Wed, 13 Jan 2016 13:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=6BHnwbhIg4yeY8c/gRJnV56B7nowEO4wLC1ZWu4bEog=; b=mzzoNSRRnWI4AbVEDdxBxz4mt1LjXr3yStA6KqCbkootVlvnoogzAjLZfkn+Kl60Ol CTR39OMeL6+9dgp+wsTSwnx1MAuZHaCq8p1W/WLCH0faO0dZ5I0gMhyowky1s+7K4MKK j43PW22fx5ujC0cjTP2acm++IoXaMI2m/um75BCEs1rroRVxBs2oWw+O0FB2zOr7BSzq C0T1jgj29QPmoBin2pmw0O1EXEOsNVMnCEZcA0PSJZ5iidbOfe2OggyiZdUndgm7Fadd zlqSbq6mU29R6l++88TdEU4VAMBC+ymPA7h7Tx9gJVHJmyHqqarzsyYkyGJ/QVYgTi+c 5CHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=6BHnwbhIg4yeY8c/gRJnV56B7nowEO4wLC1ZWu4bEog=; b=iYlWluZuJX/iGRjlZ+Qt0TlA9QzW5An6GHlxhLVi3esI5vwYt/30HyI0JhF2aVuD68 T9p7PEc3gkSOAcvNsW6NvzA4rPZJMRALRn9uEND2HzHiHG9mHNSXXeAR9Z0wrqxn5BRN 2c/PhusPZXNO908gq900Ik69ruEmt4DKBOk/rPfcfpfL5RkBIfxyceZTRx+UYEvVBmbG y3wzGl5Hf+7wdlg7zq8Wd5MTMXTL1WZSh7MJvuuSMYSUZ1uyJJm933MyIQSz4oYuhHXO v4huajMfG2Qrbp0ZocsD646qsI9x0BzLBvE9v1FPUq1Mh3Xx6BOa/OPE44V3eJhrNvcU 2fIQ== X-Gm-Message-State: ALoCoQlRpeSyrk4WAYvYS+SUDYjp0wQMHW6TNWKvN7ydQleVAb7Bgdp187YwocDsjFUIcuNCRxWmAfg68E8nPqfYru9+mRQj1A== MIME-Version: 1.0 X-Received: by 10.112.146.67 with SMTP id ta3mr160128lbb.98.1452720962379; Wed, 13 Jan 2016 13:36:02 -0800 (PST) Received: by 10.112.160.133 with HTTP; Wed, 13 Jan 2016 13:36:02 -0800 (PST) In-Reply-To: <201601132134.u0DLYFRv014524@repo.freebsd.org> References: <201601132134.u0DLYFRv014524@repo.freebsd.org> Date: Wed, 13 Jan 2016 13:36:02 -0800 Message-ID: Subject: Re: svn commit: r293852 - head/usr.sbin/kldxref From: NGie Cooper To: Andrew Turner Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Nathan Whitehorn Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 21:36:05 -0000 On Wed, Jan 13, 2016 at 1:34 PM, Andrew Turner wrote: > Author: andrew > Date: Wed Jan 13 21:34:15 2016 > New Revision: 293852 > URL: https://svnweb.freebsd.org/changeset/base/293852 ... > switch(rtype) { > - case R_PPC_RELATIVE: /* word32 B + A */ > + case R_AARCH64_RELATIVE: Does this break powerpc? From owner-svn-src-head@freebsd.org Wed Jan 13 21:39:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C63CBA81570; Wed, 13 Jan 2016 21:39:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id B5BAE1A59; Wed, 13 Jan 2016 21:39:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id ADFC61F4C; Wed, 13 Jan 2016 21:39:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 566751002E; Wed, 13 Jan 2016 21:39:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id C0vxrIWlv4U9; Wed, 13 Jan 2016 21:39:04 +0000 (UTC) Subject: Re: svn commit: r293852 - head/usr.sbin/kldxref DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 9D3B210021 To: NGie Cooper , Andrew Turner References: <201601132134.u0DLYFRv014524@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Nathan Whitehorn From: Bryan Drewery Organization: FreeBSD Message-ID: <5696C3F4.6060608@FreeBSD.org> Date: Wed, 13 Jan 2016 13:39:00 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 21:39:07 -0000 On 1/13/16 1:36 PM, NGie Cooper wrote: > On Wed, Jan 13, 2016 at 1:34 PM, Andrew Turner wrote: >> Author: andrew >> Date: Wed Jan 13 21:34:15 2016 >> New Revision: 293852 >> URL: https://svnweb.freebsd.org/changeset/base/293852 > > ... > >> switch(rtype) { >> - case R_PPC_RELATIVE: /* word32 B + A */ >> + case R_AARCH64_RELATIVE: > > Does this break powerpc? > Added: head/usr.sbin/kldxref/ef_aarch64.c - copied, changed from r293737, head/usr.sbin/kldxref/ef_powerpc.c -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Wed Jan 13 21:41:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BF7CA81833; Wed, 13 Jan 2016 21:41:35 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 4C0DA1D2E; Wed, 13 Jan 2016 21:41:34 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (bcdd4360.skybroadband.com [188.221.67.96]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 26C63D7A17; Wed, 13 Jan 2016 21:41:29 +0000 (UTC) Date: Wed, 13 Jan 2016 21:41:27 +0000 From: Andrew Turner To: NGie Cooper Cc: Andrew Turner , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Nathan Whitehorn Subject: Re: svn commit: r293852 - head/usr.sbin/kldxref Message-ID: <20160113214127.1a73b7b5@zapp> In-Reply-To: References: <201601132134.u0DLYFRv014524@repo.freebsd.org> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 21:41:35 -0000 On Wed, 13 Jan 2016 13:36:02 -0800 NGie Cooper wrote: > On Wed, Jan 13, 2016 at 1:34 PM, Andrew Turner > wrote: > > Author: andrew > > Date: Wed Jan 13 21:34:15 2016 > > New Revision: 293852 > > URL: https://svnweb.freebsd.org/changeset/base/293852 > > ... > > > switch(rtype) { > > - case R_PPC_RELATIVE: /* word32 B + A */ > > + case R_AARCH64_RELATIVE: > > Does this break powerpc? > How? I changed ef_aarch64.c. It was copied from ef_powerpc.c with modifications which you are looking at. Andrew From owner-svn-src-head@freebsd.org Wed Jan 13 21:44:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2C77A8192A; Wed, 13 Jan 2016 21:44:32 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lf0-x233.google.com (mail-lf0-x233.google.com [IPv6:2a00:1450:4010:c07::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5292E1075; Wed, 13 Jan 2016 21:44:32 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lf0-x233.google.com with SMTP id m198so116883510lfm.0; Wed, 13 Jan 2016 13:44:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4qCfR+PjTHYm1pv4KPijLf7A7kmFMEW9ryWuQNCBNco=; b=AK+8Fo0d306SZmn7iC5gl7EwJUkpygaLMh6Pj4HRxbWjF38DozOfqt1tFjdblGSpEb 65pwVnn92sYiKKJObi0ISwPzCg5MG3V03iUid2UPMabDGuBlnnBCRDjX42Zjh7cBhhds dc3pXIsX52WHiGCM3xJOdeaGJu0basbHV+Gkp9jN+ZhuCr9DjbCbxmSDTbH339nfvnlQ 7UEWjXgv1Gto0TMTp/PFZKKk+JcUlgL7T3YTseEdsaN2LLlcLlQS7yI1tSNy3bDZlkB+ VNusnXeI2XQqySb81/744tvesUzt2zpXi2grluu1P1iAjFkUrdxy6+7rvvv2yWz8KJKH ioaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=4qCfR+PjTHYm1pv4KPijLf7A7kmFMEW9ryWuQNCBNco=; b=ak76Vwfrw6n8mhlCfqmjL4PDJkMT5+iILTutRSVgLhxanp/bfsg8tBbr3D/dgnIsvB s7xkBG3DwirxC6kryEI4vbiyzg6I1ZjjNsH3syEg72BZP+tcMV4Ozvcx1057wzCBUwlZ fZCO8VFK33FXXUs6JJv2OB+Hld1UL+OpDr9RupELKJbW8joh+GQ748v3S6O9VZzxnhwD NfhAJlcnLaBv9jT5nedMM0MDh9tQYSgG709qbeSZIrR4ImlPxaMMH+UqpJ0cX4WFfPOM 8mcuOQmc98zec8UmHj/XaWW4lRcagO3OgmbOO8nenKy2dW610F6J9gZUhP8dLWeWhkoZ DuPQ== X-Gm-Message-State: ALoCoQmrWZxwGOfwNFoA3rAb6w+XG+wOdu1RLYoBla/WOSzA3WZ5PNmLN+VLpvQimfje5SriO6+BwSQBliUkQC4Znzb4Ion7jQ== MIME-Version: 1.0 X-Received: by 10.25.208.213 with SMTP id h204mr186103lfg.112.1452721470106; Wed, 13 Jan 2016 13:44:30 -0800 (PST) Received: by 10.112.160.133 with HTTP; Wed, 13 Jan 2016 13:44:30 -0800 (PST) In-Reply-To: <20160113214127.1a73b7b5@zapp> References: <201601132134.u0DLYFRv014524@repo.freebsd.org> <20160113214127.1a73b7b5@zapp> Date: Wed, 13 Jan 2016 13:44:30 -0800 Message-ID: Subject: Re: svn commit: r293852 - head/usr.sbin/kldxref From: NGie Cooper To: Andrew Turner Cc: Andrew Turner , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 21:44:32 -0000 On Wed, Jan 13, 2016 at 1:41 PM, Andrew Turner wrote: > On Wed, 13 Jan 2016 13:36:02 -0800 > NGie Cooper wrote: ... > How? I changed ef_aarch64.c. It was copied from ef_powerpc.c with > modifications which you are looking at. Sorry. Didn't realize that this was an svn copy + modification.. -NGie From owner-svn-src-head@freebsd.org Wed Jan 13 21:47:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F20FA81A34; Wed, 13 Jan 2016 21:47:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 138B2134D; Wed, 13 Jan 2016 21:47:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DLlSME017717; Wed, 13 Jan 2016 21:47:28 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DLlR38017711; Wed, 13 Jan 2016 21:47:27 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201601132147.u0DLlR38017711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 13 Jan 2016 21:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293854 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 21:47:29 -0000 Author: marius Date: Wed Jan 13 21:47:27 2016 New Revision: 293854 URL: https://svnweb.freebsd.org/changeset/base/293854 Log: Given that em(4), lem(4) and igb(4) hardware doesn't require the alignment guarantees provided by m_defrag(9), use m_collapse(9) instead for performance reasons. While at it, sanitize the statistics softc members, i. e. retire unused ones and add SYSCTL nodes missing for actually used ones. Differential Revision: https://reviews.freebsd.org/D4717 Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h head/sys/dev/e1000/if_lem.c head/sys/dev/e1000/if_lem.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Jan 13 21:38:52 2016 (r293853) +++ head/sys/dev/e1000/if_em.c Wed Jan 13 21:47:27 2016 (r293854) @@ -2035,9 +2035,9 @@ retry: if (error == EFBIG && remap) { struct mbuf *m; - m = m_defrag(*m_headp, M_NOWAIT); + m = m_collapse(*m_headp, M_NOWAIT, EM_MAX_SCATTER); if (m == NULL) { - adapter->mbuf_alloc_failed++; + adapter->mbuf_defrag_failed++; m_freem(*m_headp); *m_headp = NULL; return (ENOBUFS); @@ -5493,18 +5493,15 @@ em_add_hw_stats(struct adapter *adapter) char namebuf[QUEUE_NAME_LEN]; /* Driver Statistics */ - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "link_irq", - CTLFLAG_RD, &adapter->link_irq, - "Link MSIX IRQ Handled"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_alloc_fail", - CTLFLAG_RD, &adapter->mbuf_alloc_failed, - "Std mbuf failed"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "cluster_alloc_fail", - CTLFLAG_RD, &adapter->mbuf_cluster_failed, - "Std mbuf cluster failed"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "dropped", CTLFLAG_RD, &adapter->dropped_pkts, "Driver dropped packets"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "link_irq", + CTLFLAG_RD, &adapter->link_irq, + "Link MSIX IRQ Handled"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_defrag_fail", + CTLFLAG_RD, &adapter->mbuf_defrag_failed, + "Defragmenting mbuf chain failed"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_dma_fail", CTLFLAG_RD, &adapter->no_tx_dma_setup, "Driver tx dma failure in xmit"); Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Wed Jan 13 21:38:52 2016 (r293853) +++ head/sys/dev/e1000/if_em.h Wed Jan 13 21:47:27 2016 (r293854) @@ -473,13 +473,12 @@ struct adapter { /* Misc stats maintained by the driver */ unsigned long dropped_pkts; - unsigned long mbuf_alloc_failed; - unsigned long mbuf_cluster_failed; + unsigned long link_irq; + unsigned long mbuf_defrag_failed; + unsigned long no_tx_dma_setup; unsigned long no_tx_map_avail; - unsigned long no_tx_dma_setup; unsigned long rx_overruns; unsigned long watchdog_events; - unsigned long link_irq; struct e1000_hw_stats stats; }; Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Wed Jan 13 21:38:52 2016 (r293853) +++ head/sys/dev/e1000/if_igb.c Wed Jan 13 21:47:27 2016 (r293854) @@ -1835,7 +1835,8 @@ retry: /* Try it again? - one try */ if (remap == TRUE) { remap = FALSE; - m = m_defrag(*m_headp, M_NOWAIT); + m = m_collapse(*m_headp, M_NOWAIT, + IGB_MAX_SCATTER); if (m == NULL) { adapter->mbuf_defrag_failed++; m_freem(*m_headp); @@ -5826,12 +5827,15 @@ igb_add_hw_stats(struct adapter *adapter char namebuf[QUEUE_NAME_LEN]; /* Driver Statistics */ - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "link_irq", - CTLFLAG_RD, &adapter->link_irq, - "Link MSIX IRQ Handled"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "dropped", CTLFLAG_RD, &adapter->dropped_pkts, "Driver dropped packets"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "link_irq", + CTLFLAG_RD, &adapter->link_irq, + "Link MSIX IRQ Handled"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_defrag_fail", + CTLFLAG_RD, &adapter->mbuf_defrag_failed, + "Defragmenting mbuf chain failed"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_dma_fail", CTLFLAG_RD, &adapter->no_tx_dma_setup, "Driver tx dma failure in xmit"); Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Wed Jan 13 21:38:52 2016 (r293853) +++ head/sys/dev/e1000/if_igb.h Wed Jan 13 21:47:27 2016 (r293854) @@ -512,20 +512,19 @@ struct adapter { u8 *mta; /* Misc stats maintained by the driver */ + unsigned long device_control; unsigned long dropped_pkts; + unsigned long eint_mask; + unsigned long int_mask; + unsigned long link_irq; unsigned long mbuf_defrag_failed; - unsigned long mbuf_header_failed; - unsigned long mbuf_packet_failed; unsigned long no_tx_dma_setup; - unsigned long watchdog_events; - unsigned long link_irq; - unsigned long rx_overruns; - unsigned long device_control; - unsigned long rx_control; - unsigned long int_mask; - unsigned long eint_mask; unsigned long packet_buf_alloc_rx; unsigned long packet_buf_alloc_tx; + unsigned long rx_control; + unsigned long rx_overruns; + unsigned long watchdog_events; + /* Used in pf and vf */ void *stats; Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Wed Jan 13 21:38:52 2016 (r293853) +++ head/sys/dev/e1000/if_lem.c Wed Jan 13 21:47:27 2016 (r293854) @@ -1675,9 +1675,9 @@ lem_xmit(struct adapter *adapter, struct if (error == EFBIG) { struct mbuf *m; - m = m_defrag(*m_headp, M_NOWAIT); + m = m_collapse(*m_headp, M_NOWAIT, EM_MAX_SCATTER); if (m == NULL) { - adapter->mbuf_alloc_failed++; + adapter->mbuf_defrag_failed++; m_freem(*m_headp); *m_headp = NULL; return (ENOBUFS); @@ -4526,12 +4526,12 @@ lem_add_hw_stats(struct adapter *adapter struct sysctl_oid_list *stat_list; /* Driver Statistics */ - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_alloc_fail", - CTLFLAG_RD, &adapter->mbuf_alloc_failed, - "Std mbuf failed"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "cluster_alloc_fail", CTLFLAG_RD, &adapter->mbuf_cluster_failed, "Std mbuf cluster failed"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_defrag_fail", + CTLFLAG_RD, &adapter->mbuf_defrag_failed, + "Defragmenting mbuf chain failed"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "dropped", CTLFLAG_RD, &adapter->dropped_pkts, "Driver dropped packets"); Modified: head/sys/dev/e1000/if_lem.h ============================================================================== --- head/sys/dev/e1000/if_lem.h Wed Jan 13 21:38:52 2016 (r293853) +++ head/sys/dev/e1000/if_lem.h Wed Jan 13 21:47:27 2016 (r293854) @@ -417,17 +417,17 @@ struct adapter { /* Misc stats maintained by the driver */ unsigned long dropped_pkts; - unsigned long mbuf_alloc_failed; + unsigned long link_irq; unsigned long mbuf_cluster_failed; + unsigned long mbuf_defrag_failed; unsigned long no_tx_desc_avail1; unsigned long no_tx_desc_avail2; + unsigned long no_tx_dma_setup; unsigned long no_tx_map_avail; - unsigned long no_tx_dma_setup; unsigned long watchdog_events; - unsigned long rx_overruns; unsigned long rx_irq; + unsigned long rx_overruns; unsigned long tx_irq; - unsigned long link_irq; /* 82547 workaround */ uint32_t tx_fifo_size; From owner-svn-src-head@freebsd.org Wed Jan 13 21:49:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2A44A81AD5; Wed, 13 Jan 2016 21:49:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FFD61564; Wed, 13 Jan 2016 21:49:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DLn1eJ017816; Wed, 13 Jan 2016 21:49:01 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DLn1lg017815; Wed, 13 Jan 2016 21:49:01 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201601132149.u0DLn1lg017815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 13 Jan 2016 21:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293855 - head/lib/libc/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 21:49:02 -0000 Author: brooks Date: Wed Jan 13 21:49:01 2016 New Revision: 293855 URL: https://svnweb.freebsd.org/changeset/base/293855 Log: Avoid reading pass the end of the source buffer when it is not NUL terminated. If this buffer is adjacent to an unmapped page or a version of C with bounds checked is used this may result in a crash. PR: 206177 Submitted by: Alexander Cherepanov MFC after: 1 week Modified: head/lib/libc/string/wcsncat.c Modified: head/lib/libc/string/wcsncat.c ============================================================================== --- head/lib/libc/string/wcsncat.c Wed Jan 13 21:47:27 2016 (r293854) +++ head/lib/libc/string/wcsncat.c Wed Jan 13 21:49:01 2016 (r293855) @@ -48,7 +48,7 @@ wcsncat(wchar_t * __restrict s1, const w p++; q = p; r = s2; - while (*r && n) { + while (n && *r) { *q++ = *r++; n--; } From owner-svn-src-head@freebsd.org Wed Jan 13 21:50:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2020DA81B9E; Wed, 13 Jan 2016 21:50:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E82C618AF; Wed, 13 Jan 2016 21:50:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DLo93S017921; Wed, 13 Jan 2016 21:50:09 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DLo9NH017920; Wed, 13 Jan 2016 21:50:09 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201601132150.u0DLo9NH017920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 13 Jan 2016 21:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293856 - head/lib/libc/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 21:50:10 -0000 Author: brooks Date: Wed Jan 13 21:50:08 2016 New Revision: 293856 URL: https://svnweb.freebsd.org/changeset/base/293856 Log: Avoid reading pass the end of the source buffer when it is not NUL terminated. If this buffer is adjacent to an unmapped page or a version of C with bounds checked is used this may result in a crash. PR: 206178 Submitted by: Alexander Cherepanov MFC after: 1 week Modified: head/lib/libc/string/wcslcat.c Modified: head/lib/libc/string/wcslcat.c ============================================================================== --- head/lib/libc/string/wcslcat.c Wed Jan 13 21:49:01 2016 (r293855) +++ head/lib/libc/string/wcslcat.c Wed Jan 13 21:50:08 2016 (r293856) @@ -54,7 +54,7 @@ wcslcat(wchar_t *dst, const wchar_t *src size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ - while (*d != '\0' && n-- != 0) + while (n-- != 0 && *d != '\0') d++; dlen = d - dst; n = siz - dlen; From owner-svn-src-head@freebsd.org Wed Jan 13 21:56:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EEC5A81E69; Wed, 13 Jan 2016 21:56:31 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A70901E13; Wed, 13 Jan 2016 21:56:30 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x236.google.com with SMTP id f206so313914855wmf.0; Wed, 13 Jan 2016 13:56:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=kHUA+OywoD5iz9ijIje9yDzrUTTDp16Cac5B5aDxByE=; b=jtk0wxr8bqBRHgBOZftKyt5piJSxs1MreSFxic0GQJbtEob/2WMhQuRidXzI52SSG7 CLhN8532oduorZkG7q1ts44837sr6Wj7iIypAFH+/nJOAkQL9/qMBd8vW8lCT3wnaD/3 wdIN1oPqNZ6aaMzuvUMFBeWzp7EWjfjfp4amrAkJtIoQJ8SN8QAu3o4ZJGtUDw37nC8X /ndAxnB6LUjauLJUfyCQj+J4IEVg6Kf7EvTyfRIl5U47j5wBZn/GBpS3EGizzxX0/r5c pJndLdHolgQa4UXZU2GAZaLiXVF4GYHMwi5M1quLScaJ4XOn5JpL7IhvFEazhjnnojjj 3ong== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=kHUA+OywoD5iz9ijIje9yDzrUTTDp16Cac5B5aDxByE=; b=H5UpfBhmdWGRs0p54OV6QiSdOL4MFFsYandOh/qZ1Roi/uQOhQsD2uzcpw+S6bz8wa xhHoAYicQF24fd1Lf9RotjHf0kpV9Buj+5KfSqKYjDoklXTn327SyrGrsYJgDQlydkBx IjSe8xzcGt9rTpoOnCRutokddSpXKRopC6V/6gJ4NHTxfnr2KpAD1CJtyBEH9aB9GgWF /+gsiD5HKYrOo5B1KFUSF7HnMdRjJdUqmd3dHWOgOPy0iX87tn/PpdHTK5RG7k6bHVv7 LGjQqO6jiJp0dyjbWVcpzZIu2bL/y2FERBYPEKs5xqGFr6HmOAWIc5NRBYYfkN8lFrTv lOoQ== X-Gm-Message-State: ALoCoQlo7H6TINcEmu/YrAIaNhq+dXzUUyI06HEqJj19kdYaD7FzR55vS+LJgTEPhPWCEBgjzYYzMBrdHBZlZAKFhL2uk04OwQ== X-Received: by 10.194.133.102 with SMTP id pb6mr487263wjb.12.1452722189015; Wed, 13 Jan 2016 13:56:29 -0800 (PST) Received: from brick.home (eud182.neoplus.adsl.tpnet.pl. [83.20.175.182]) by smtp.gmail.com with ESMTPSA id uo9sm3186363wjc.49.2016.01.13.13.56.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jan 2016 13:56:27 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Wed, 13 Jan 2016 22:56:23 +0100 From: Edward Tomasz Napierala To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r286234 - head/sys/boot/common Message-ID: <20160113215623.GA1249@brick.home> Mail-Followup-To: Oliver Pinter , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201508031627.t73GRbTB092225@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 21:56:31 -0000 On 0107T2033, Oliver Pinter wrote: > On Mon, Aug 3, 2015 at 6:27 PM, Edward Tomasz Napierala > wrote: > > Author: trasz > > Date: Mon Aug 3 16:27:36 2015 > > New Revision: 286234 > > URL: https://svnweb.freebsd.org/changeset/base/286234 > > > > Log: > > Fix a problem which made loader(8) load non-kld files twice. > > > > For example, without this patch, the following three lines > > in /boot/loader.conf would result in /boot/root.img being preloaded > > twice, and two md(4) devices - md0 and md1 - being created. > > > > initmd_load="YES" > > initmd_type="md_image" > > initmd_name="/boot/root.img" > > > > Reviewed by: marcel@ > > MFC after: 1 month > > Do you still plan to MFC this commit to 10-STABLE / 10.3? That was the plan, yeah, but I cannot reproduce the problem on 10-STABLE. Can you? From owner-svn-src-head@freebsd.org Wed Jan 13 22:34:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C100A81D8F; Wed, 13 Jan 2016 22:34:57 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEB7D18B2; Wed, 13 Jan 2016 22:34:56 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0DMYtlb033003; Wed, 13 Jan 2016 22:34:55 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0DMYt8L033002; Wed, 13 Jan 2016 22:34:55 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201601132234.u0DMYt8L033002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 13 Jan 2016 22:34:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293858 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 22:34:57 -0000 Author: vangyzen Date: Wed Jan 13 22:34:55 2016 New Revision: 293858 URL: https://svnweb.freebsd.org/changeset/base/293858 Log: libthr: const-ify two variables Make the default umutex and urwlock initializers const, because they can be, and as a microoptimization. MFC after: 5 days Sponsored by: Dell Inc. Modified: head/lib/libthr/thread/thr_umtx.c Modified: head/lib/libthr/thread/thr_umtx.c ============================================================================== --- head/lib/libthr/thread/thr_umtx.c Wed Jan 13 21:56:48 2016 (r293857) +++ head/lib/libthr/thread/thr_umtx.c Wed Jan 13 22:34:55 2016 (r293858) @@ -42,7 +42,7 @@ int _umtx_op_err(void *obj, int op, u_lo void _thr_umutex_init(struct umutex *mtx) { - static struct umutex default_mtx = DEFAULT_UMUTEX; + static const struct umutex default_mtx = DEFAULT_UMUTEX; *mtx = default_mtx; } @@ -50,7 +50,8 @@ _thr_umutex_init(struct umutex *mtx) void _thr_urwlock_init(struct urwlock *rwl) { - static struct urwlock default_rwl = DEFAULT_URWLOCK; + static const struct urwlock default_rwl = DEFAULT_URWLOCK; + *rwl = default_rwl; } From owner-svn-src-head@freebsd.org Wed Jan 13 22:48:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F188A811C1; Wed, 13 Jan 2016 22:48:24 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D8B51ED7; Wed, 13 Jan 2016 22:48:24 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 5BFAAB801F; Wed, 13 Jan 2016 23:48:21 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 4790528494; Wed, 13 Jan 2016 23:48:21 +0100 (CET) Date: Wed, 13 Jan 2016 23:48:21 +0100 From: Jilles Tjoelker To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293783 - head/lib/libc/sys Message-ID: <20160113224821.GA5118@stack.nl> References: <201601122053.u0CKrvmB060658@repo.freebsd.org> <2902719.QmmqeCdr7g@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2902719.QmmqeCdr7g@ralph.baldwin.cx> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 22:48:24 -0000 On Wed, Jan 13, 2016 at 08:58:12AM -0800, John Baldwin wrote: > On Tuesday, January 12, 2016 08:53:57 PM Jilles Tjoelker wrote: > > Author: jilles > > Date: Tue Jan 12 20:53:57 2016 > > New Revision: 293783 > > URL: https://svnweb.freebsd.org/changeset/base/293783 > > Log: > > Update futimens/utimensat for MFC to stable/10: > > * Fix __FreeBSD_version check. > > * Update history section in man page. > > An MFC of this commit to stable/10 will allow using the new system calls > > instead of the fallback. > > MFC after: 3 days > Why does futimens.c exist? Given that we do not support forwards > compatibility (newer libc on older kernel) only backwards > compatibility (older libc on newer kernel), libc should just always > call the system call directly. This is what we do for all other > system calls and would avoid the issue of the earlier MFC not actually > working. Allowing the unsupported 'make installkernel ; make > installworld ; reboot' cycle to work across this change doesn't seem > worth the effort of maintaining the osreldate checks here. It turns out that many people do, in fact, rely on combinations of new userland and slightly older kernel not breaking horribly. For example, portmgr does not update the kernel on package building nodes as often as the -current userland, and users may try older kernels for bisection purposes. When I committed SOCK_CLOEXEC and SOCK_NONBLOCK without compatibility code, years ago, I got many complaints. Therefore, I think compatibility code for old kernels should be added if it is not too onerous (such as here), particularly if an API is added that already exists on other platforms. An example where I think compatibility would be too onerous is reaper (procctl(PROC_REAP_ACQUIRE) and friends). In practice, compatibility code is inconsistently added. Some old examples where it was added are the removal of padding for 64-bit syscall parameters and changes to struct flock (both were removed in r281714). As a result, one or a few major versions later, the compatibility code is unlikely to be useful and should be removed. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Wed Jan 13 23:01:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A34C7A81902 for ; Wed, 13 Jan 2016 23:01:23 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AE861869 for ; Wed, 13 Jan 2016 23:01:23 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22b.google.com with SMTP id f206so395695267wmf.0 for ; Wed, 13 Jan 2016 15:01:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=zcXlFuL/tum0qv7lmP+06xV5xDYNfFn+tWTtsjg4a0A=; b=zhOOCeaz+MRj7NvFDbJ5ep7PSaqTxEaTX8lj2ov2t40XwatRClpbmeKCD2MSWAZ2aC hn0j8japsw4dJm/9nRY1HlFfzJeLOiMripkIaZ8PkLjkSuEvlEGxqS8TGssVIwWM/Hlk lKf56my3CwyGeMbTopxjhKQAlzZHHgKbEV4tq//FEH9tOX0buzrVjFWayFIrnqds4yLx SuDMstLZuyBYshdoTrYjzUyttA8JPQsrTHAoVtp0L7OFs8QxQbhUSciIIe09CjbJ3de9 cyKHhjR9pjqNDAuTrsHPHRTtHDSufeKqLyxkVwFHibnCxUHvn//nYlaqtLBZoXuBbw/3 CIoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=zcXlFuL/tum0qv7lmP+06xV5xDYNfFn+tWTtsjg4a0A=; b=JcUJXJMX5JSfLRTekkVLeeRU2qIZYWtHoS+emIO4acj85FZU4zCncUpeMYZ6yazbp2 jy2qV6Jt16mIzTJpVnOKt4Zm90MMdZB/xHTHpMiUghyToijY8JOADG6PieH34+981sjR W1JNFrlDbJxPFUYaTUviH6fbPwy0G5qnMxtwWTeansHwYSW55wHC1WTh+8EcdaNytgN0 EZNGLSpRny/+W8z8YX9nVm0O0OgjvfkD2Qj0ngTM74WyJjUhs4k7Wefmg0vMw7tZubTa zugtCy0+oOWGPVR7PnKOL1rcLgIac3TEjs9kkTVMV6gEBEk3TLD4vlms3nWUfZ9eyNzH tETQ== X-Gm-Message-State: ALoCoQlGwrwsPrm1MxVLw0SJz+u2A+JTo9rDhkGLUhgDCjOcdxX/fJDVZjRQ3IOudIxmzCoZJPuzyYJbqo1CL2B5fnL98APo540nJQMPynjGEHEBIm3yj+o= MIME-Version: 1.0 X-Received: by 10.194.202.163 with SMTP id kj3mr606177wjc.93.1452726081279; Wed, 13 Jan 2016 15:01:21 -0800 (PST) Received: by 10.194.85.167 with HTTP; Wed, 13 Jan 2016 15:01:21 -0800 (PST) In-Reply-To: <20160113215623.GA1249@brick.home> References: <201508031627.t73GRbTB092225@repo.freebsd.org> <20160113215623.GA1249@brick.home> Date: Thu, 14 Jan 2016 00:01:21 +0100 Message-ID: Subject: Re: svn commit: r286234 - head/sys/boot/common From: Oliver Pinter To: Oliver Pinter , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 23:01:23 -0000 On Wednesday, January 13, 2016, Edward Tomasz Napierala wrote: > On 0107T2033, Oliver Pinter wrote: > > On Mon, Aug 3, 2015 at 6:27 PM, Edward Tomasz Napierala > > > wrote: > > > Author: trasz > > > Date: Mon Aug 3 16:27:36 2015 > > > New Revision: 286234 > > > URL: https://svnweb.freebsd.org/changeset/base/286234 > > > > > > Log: > > > Fix a problem which made loader(8) load non-kld files twice. > > > > > > For example, without this patch, the following three lines > > > in /boot/loader.conf would result in /boot/root.img being preloaded > > > twice, and two md(4) devices - md0 and md1 - being created. > > > > > > initmd_load="YES" > > > initmd_type="md_image" > > > initmd_name="/boot/root.img" > > > > > > Reviewed by: marcel@ > > > MFC after: 1 month > > > > Do you still plan to MFC this commit to 10-STABLE / 10.3? > > That was the plan, yeah, but I cannot reproduce the problem on 10-STABLE. > Can you? > > Not yet tested this scenario, I just remembered to this commit was marked to MFC, but not MFCd. When I have more time, I try to reproduce the issue. From owner-svn-src-head@freebsd.org Thu Jan 14 00:31:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50134A82760; Thu, 14 Jan 2016 00:31:02 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FA8C12D8; Thu, 14 Jan 2016 00:31:02 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E0V1Lo066620; Thu, 14 Jan 2016 00:31:01 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E0V1BR066619; Thu, 14 Jan 2016 00:31:01 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201601140031.u0E0V1BR066619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 14 Jan 2016 00:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293860 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 00:31:02 -0000 Author: vangyzen Date: Thu Jan 14 00:31:00 2016 New Revision: 293860 URL: https://svnweb.freebsd.org/changeset/base/293860 Log: bsdinstall: Suggest the GPT+Active workaround on Dell T5810 The Dell Precision Tower 5810 fails to boot from GPT in Legacy/BIOS mode without the Active flag in the Protective MBR. Suggest the workaround during installation. Since an increasing number of Dell systems exhibit this behavior, I imagine all Dells past a certain date will do so. I would like to suggest the workaround for all Dells with a BIOS date of, say, 2014 or later, but I would need to test a variety of systems before committing such a change. Reviewed by: allanjude, dteske MFC after: 5 days Relnotes: We should probably suggest using GPT+Active on "recent" Dells. Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D4075 Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Thu Jan 14 00:26:31 2016 (r293859) +++ head/usr.sbin/bsdinstall/scripts/auto Thu Jan 14 00:31:00 2016 (r293860) @@ -195,7 +195,7 @@ if f_interactive; then ;; "Dell Inc.") case "$sys_model" in - "Latitude E7440"|"Latitude E7240") + "Latitude E7440"|"Latitude E7240"|"Precision Tower 5810") dialog_workaround "$msg_gpt_active_fix" retval=$? f_dprintf "gpt_active_fix_prompt=[%s]" "$retval" From owner-svn-src-head@freebsd.org Thu Jan 14 00:34:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12213A82885; Thu, 14 Jan 2016 00:34:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1CE21828; Thu, 14 Jan 2016 00:34:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E0YbKu069339; Thu, 14 Jan 2016 00:34:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E0YbBg069338; Thu, 14 Jan 2016 00:34:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201601140034.u0E0YbBg069338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 14 Jan 2016 00:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293861 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 00:34:39 -0000 Author: markj Date: Thu Jan 14 00:34:37 2016 New Revision: 293861 URL: https://svnweb.freebsd.org/changeset/base/293861 Log: Remove a dead local variable, missed in r274565. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Thu Jan 14 00:31:00 2016 (r293860) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Thu Jan 14 00:34:37 2016 (r293861) @@ -283,7 +283,6 @@ static int equiv_su(tdesc_t *stdp, tdesc_t *ttdp, equiv_data_t *ed) { mlist_t *ml1 = stdp->t_members, *ml2 = ttdp->t_members; - mlist_t *olm1 = NULL; while (ml1 && ml2) { if (ml1->ml_offset != ml2->ml_offset || @@ -292,7 +291,6 @@ equiv_su(tdesc_t *stdp, tdesc_t *ttdp, e !equiv_node(ml1->ml_type, ml2->ml_type, ed)) return (0); - olm1 = ml1; ml1 = ml1->ml_next; ml2 = ml2->ml_next; } From owner-svn-src-head@freebsd.org Thu Jan 14 01:32:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 706DAA81D5C; Thu, 14 Jan 2016 01:32:18 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F3D51046; Thu, 14 Jan 2016 01:32:18 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E1WH9J084847; Thu, 14 Jan 2016 01:32:17 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E1WHGw084846; Thu, 14 Jan 2016 01:32:17 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201601140132.u0E1WHGw084846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 14 Jan 2016 01:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293862 - head/share/examples/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 01:32:18 -0000 Author: kevlo Date: Thu Jan 14 01:32:17 2016 New Revision: 293862 URL: https://svnweb.freebsd.org/changeset/base/293862 Log: Suggest setting gateway_enable="YES" instead of sysctl net.inet.ip.forwarding=1 to enable packet forwarding. Reviewed by: glebius Modified: head/share/examples/pf/pf.conf Modified: head/share/examples/pf/pf.conf ============================================================================== --- head/share/examples/pf/pf.conf Thu Jan 14 00:34:37 2016 (r293861) +++ head/share/examples/pf/pf.conf Thu Jan 14 01:32:17 2016 (r293862) @@ -2,8 +2,8 @@ # $OpenBSD: pf.conf,v 1.34 2007/02/24 19:30:59 millert Exp $ # # See pf.conf(5) and /usr/share/examples/pf for syntax and examples. -# Remember to set net.inet.ip.forwarding=1 and/or net.inet6.ip6.forwarding=1 -# in /etc/sysctl.conf if packets are to be forwarded between interfaces. +# Remember to set gateway_enable="YES" and/or ipv6_gateway_enable="YES" +# in /etc/rc.conf if packets are to be forwarded between interfaces. #ext_if="ext0" #int_if="int0" From owner-svn-src-head@freebsd.org Thu Jan 14 01:33:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5BD8A81DF0; Thu, 14 Jan 2016 01:33:17 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A53521236; Thu, 14 Jan 2016 01:33:17 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E1XGde086875; Thu, 14 Jan 2016 01:33:16 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E1XGMF086874; Thu, 14 Jan 2016 01:33:16 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201601140133.u0E1XGMF086874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 14 Jan 2016 01:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293863 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 01:33:17 -0000 Author: kevlo Date: Thu Jan 14 01:33:16 2016 New Revision: 293863 URL: https://svnweb.freebsd.org/changeset/base/293863 Log: - Add the 'restrict' type qualifier to match function prototype. - Remove sys/types.h. Modified: head/lib/libc/sys/stat.2 Modified: head/lib/libc/sys/stat.2 ============================================================================== --- head/lib/libc/sys/stat.2 Thu Jan 14 01:32:17 2016 (r293862) +++ head/lib/libc/sys/stat.2 Thu Jan 14 01:33:16 2016 (r293863) @@ -28,7 +28,7 @@ .\" @(#)stat.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd June 2, 2012 +.Dd January 14, 2016 .Dt STAT 2 .Os .Sh NAME @@ -40,12 +40,11 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/stat.h .Ft int -.Fn stat "const char *path" "struct stat *sb" +.Fn stat "const char * restrict path" "struct stat * restrict sb" .Ft int -.Fn lstat "const char *path" "struct stat *sb" +.Fn lstat "const char * restrict path" "struct stat * restrict sb" .Ft int .Fn fstat "int fd" "struct stat *sb" .Ft int From owner-svn-src-head@freebsd.org Thu Jan 14 01:34:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22757A81E65; Thu, 14 Jan 2016 01:34:43 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD48613A6; Thu, 14 Jan 2016 01:34:42 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E1Yf5w086972; Thu, 14 Jan 2016 01:34:41 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E1YfPI086971; Thu, 14 Jan 2016 01:34:41 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201601140134.u0E1YfPI086971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 14 Jan 2016 01:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293864 - head/usr.bin/numactl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 01:34:43 -0000 Author: vangyzen Date: Thu Jan 14 01:34:41 2016 New Revision: 293864 URL: https://svnweb.freebsd.org/changeset/base/293864 Log: numactl: fix CPU affinity when modifying an existing process or thread numactl was only modifying its own CPU affinity, which is fine when creating a new process, but not very helpful when modifying an existing processes. Reviewed by: adrian Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D4927 Modified: head/usr.bin/numactl/numactl.c Modified: head/usr.bin/numactl/numactl.c ============================================================================== --- head/usr.bin/numactl/numactl.c Thu Jan 14 01:33:16 2016 (r293863) +++ head/usr.bin/numactl/numactl.c Thu Jan 14 01:34:41 2016 (r293864) @@ -133,7 +133,7 @@ usage(void) } static int -set_numa_domain_cpuaffinity(int cpu_domain) +set_numa_domain_cpuaffinity(int cpu_domain, cpuwhich_t which, id_t id) { cpuset_t set; int error; @@ -142,8 +142,8 @@ set_numa_domain_cpuaffinity(int cpu_doma cpu_domain, sizeof(set), &set); if (error != 0) err(1, "cpuset_getaffinity"); - error = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, - sizeof(set), &set); + error = cpuset_setaffinity(CPU_LEVEL_WHICH, which, id, sizeof(set), + &set); if (error != 0) err(1, "cpuset_setaffinity"); @@ -228,7 +228,8 @@ main(int argc, char *argv[]) /* If a CPU domain policy was given, include that too */ if (cpu_domain != -1) - (void) set_numa_domain_cpuaffinity(cpu_domain); + (void) set_numa_domain_cpuaffinity(cpu_domain, + CPU_WHICH_PID, -1); errno = 0; execvp(*argv, argv); @@ -278,7 +279,7 @@ main(int argc, char *argv[]) /* If a CPU domain policy was given, include that too */ if (cpu_domain != -1) - (void) set_numa_domain_cpuaffinity(cpu_domain); + (void) set_numa_domain_cpuaffinity(cpu_domain, which, id); exit(0); } From owner-svn-src-head@freebsd.org Thu Jan 14 01:59:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BCF4A827A4; Thu, 14 Jan 2016 01:59:22 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0ADFC155F; Thu, 14 Jan 2016 01:59:21 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E1xLlF093210; Thu, 14 Jan 2016 01:59:21 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E1xKSu093208; Thu, 14 Jan 2016 01:59:20 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601140159.u0E1xKSu093208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 14 Jan 2016 01:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293868 - head/lib/libdpv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 01:59:22 -0000 Author: dteske Date: Thu Jan 14 01:59:20 2016 New Revision: 293868 URL: https://svnweb.freebsd.org/changeset/base/293868 Log: Default to en_US.ISO8859-1 if no locale MFC after: 3 days X-MFC-to: stable/10 Modified: head/lib/libdpv/dpv.c head/lib/libdpv/dpv.h Modified: head/lib/libdpv/dpv.c ============================================================================== --- head/lib/libdpv/dpv.c Thu Jan 14 01:51:18 2016 (r293867) +++ head/lib/libdpv/dpv.c Thu Jan 14 01:59:20 2016 (r293868) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -482,6 +483,11 @@ dpv(struct dpv_config *config, struct dp /* Reads: label_size pbar_size pprompt aprompt dpv_nfiles */ /* Inits: dheight and dwidth */ + /* Default localeconv(3) settings for dialog(3) status */ + setlocale(LC_NUMERIC, + getenv("LC_ALL") == NULL && getenv("LC_NUMERIC") == NULL ? + LC_NUMERIC_DEFAULT : ""); + if (!debug) { /* Internally create the initial `--gauge' prompt text */ dprompt_recreate(file_list, (struct dpv_file_node *)NULL, 0); Modified: head/lib/libdpv/dpv.h ============================================================================== --- head/lib/libdpv/dpv.h Thu Jan 14 01:51:18 2016 (r293867) +++ head/lib/libdpv/dpv.h Thu Jan 14 01:59:20 2016 (r293868) @@ -38,6 +38,9 @@ #define FALSE 0 #endif +/* localeconv(3) */ +#define LC_NUMERIC_DEFAULT "en_US.ISO8859-1" + /* Data to process */ extern long long dpv_overall_read; From owner-svn-src-head@freebsd.org Thu Jan 14 02:32:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FD07A8011B; Thu, 14 Jan 2016 02:32:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0230313BF; Thu, 14 Jan 2016 02:32:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E2WpNK004559; Thu, 14 Jan 2016 02:32:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E2WpeZ004558; Thu, 14 Jan 2016 02:32:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601140232.u0E2WpeZ004558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 14 Jan 2016 02:32:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293869 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 02:32:52 -0000 Author: sephe Date: Thu Jan 14 02:32:50 2016 New Revision: 293869 URL: https://svnweb.freebsd.org/changeset/base/293869 Log: hyperv/hn: Unbreak LINT-NOIP Reported by: bz Approved by: adrain (mentor) Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jan 14 01:59:20 2016 (r293868) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jan 14 02:32:50 2016 (r293869) @@ -391,12 +391,14 @@ netvsc_attach(device_t dev) sc->hn_carrier = 1; } +#if defined(INET) || defined(INET6) tcp_lro_init(&sc->hn_lro); /* Driver private LRO settings */ sc->hn_lro.ifp = ifp; #ifdef HN_LRO_HIWAT sc->hn_lro.lro_hiwat = sc->hn_lro_hiwat; #endif +#endif /* INET || INET6 */ ether_ifattach(ifp, device_info.mac_addr); @@ -475,7 +477,9 @@ netvsc_detach(device_t dev) hv_rf_on_device_remove(hv_device, HV_RF_NV_DESTROY_CHANNEL); ifmedia_removeall(&sc->hn_media); +#if defined(INET) || defined(INET6) tcp_lro_free(&sc->hn_lro); +#endif return (0); } @@ -1083,6 +1087,7 @@ skip: if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if ((ifp->if_capenable & IFCAP_LRO) && do_lro) { +#if defined(INET) || defined(INET6) struct lro_ctrl *lro = &sc->hn_lro; if (lro->lro_cnt) { @@ -1092,6 +1097,7 @@ skip: return 0; } } +#endif } /* We're not holding the lock here, so don't release it */ @@ -1103,6 +1109,7 @@ skip: void netvsc_recv_rollup(struct hv_device *device_ctx) { +#if defined(INET) || defined(INET6) hn_softc_t *sc = device_get_softc(device_ctx->device); struct lro_ctrl *lro = &sc->hn_lro; struct lro_entry *queued; @@ -1111,6 +1118,7 @@ netvsc_recv_rollup(struct hv_device *dev SLIST_REMOVE_HEAD(&lro->lro_active, next); tcp_lro_flush(lro, queued); } +#endif } /* From owner-svn-src-head@freebsd.org Thu Jan 14 02:50:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9F21A806B3; Thu, 14 Jan 2016 02:50:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93DD61BE8; Thu, 14 Jan 2016 02:50:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E2oD6u007812; Thu, 14 Jan 2016 02:50:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E2oDlY007808; Thu, 14 Jan 2016 02:50:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601140250.u0E2oDlY007808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 14 Jan 2016 02:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293870 - in head/sys: dev/hyperv/vmbus x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 02:50:14 -0000 Author: sephe Date: Thu Jan 14 02:50:13 2016 New Revision: 293870 URL: https://svnweb.freebsd.org/changeset/base/293870 Log: hyperv: use x86 generic code to do the hypervisor detection This is first step to move the generic part of HV code into kernel instead of module, so that it is possible to use hypercall to implement some other paravirtualization code in the kernel. Submitted by: Howard Su Reviewed by: royger, delphij, adrian Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D3072 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/x86/x86/identcpu.c Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Thu Jan 14 02:32:50 2016 (r293869) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Thu Jan 14 02:50:13 2016 (r293870) @@ -251,7 +251,7 @@ hv_vmbus_connect(void) { hv_vmbus_protocal_version = version; if (bootverbose) - printf("VMBUS: Portocal Version: %d.%d\n", + printf("VMBUS: Protocol Version: %d.%d\n", version >> 16, version & 0xFFFF); sema_destroy(&msg_info->wait_sema); Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Thu Jan 14 02:32:50 2016 (r293869) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Thu Jan 14 02:50:13 2016 (r293870) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -55,12 +56,6 @@ __FBSDID("$FreeBSD$"); static u_int hv_get_timecount(struct timecounter *tc); -static inline void do_cpuid_inline(unsigned int op, unsigned int *eax, - unsigned int *ebx, unsigned int *ecx, unsigned int *edx) { - __asm__ __volatile__("cpuid" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), - "=d" (*edx) : "0" (op), "c" (ecx)); -} - /** * Globals */ @@ -86,27 +81,10 @@ hv_get_timecount(struct timecounter *tc) int hv_vmbus_query_hypervisor_presence(void) { - u_int regs[4]; - int hyper_v_detected = 0; - - /* - * When Xen is detected and native Xen PV support is enabled, - * ignore Xen's HyperV emulation. - */ - if (vm_guest == VM_GUEST_XEN) + if (vm_guest != VM_GUEST_HV) return (0); - do_cpuid(1, regs); - if (regs[2] & 0x80000000) { /* if(a hypervisor is detected) */ - /* make sure this really is Hyper-V */ - /* we look at the CPUID info */ - do_cpuid(HV_X64_MSR_GUEST_OS_ID, regs); - hyper_v_detected = - regs[0] >= HV_X64_CPUID_MIN && - regs[0] <= HV_X64_CPUID_MAX && - !memcmp("Microsoft Hv", ®s[1], 12); - } - return (hyper_v_detected); + return (hv_high >= HV_X64_CPUID_MIN && hv_high <= HV_X64_CPUID_MAX); } /** @@ -115,10 +93,7 @@ hv_vmbus_query_hypervisor_presence(void) static int hv_vmbus_get_hypervisor_version(void) { - unsigned int eax; - unsigned int ebx; - unsigned int ecx; - unsigned int edx; + u_int regs[4]; unsigned int maxLeaf; unsigned int op; @@ -127,28 +102,16 @@ hv_vmbus_get_hypervisor_version(void) * Viridian is present * Query id and revision. */ - eax = 0; - ebx = 0; - ecx = 0; - edx = 0; op = HV_CPU_ID_FUNCTION_HV_VENDOR_AND_MAX_FUNCTION; - do_cpuid_inline(op, &eax, &ebx, &ecx, &edx); + do_cpuid(op, regs); - maxLeaf = eax; - eax = 0; - ebx = 0; - ecx = 0; - edx = 0; + maxLeaf = regs[0]; op = HV_CPU_ID_FUNCTION_HV_INTERFACE; - do_cpuid_inline(op, &eax, &ebx, &ecx, &edx); + do_cpuid(op, regs); if (maxLeaf >= HV_CPU_ID_FUNCTION_MS_HV_VERSION) { - eax = 0; - ebx = 0; - ecx = 0; - edx = 0; op = HV_CPU_ID_FUNCTION_MS_HV_VERSION; - do_cpuid_inline(op, &eax, &ebx, &ecx, &edx); + do_cpuid(op, regs); } return (maxLeaf); } Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Jan 14 02:32:50 2016 (r293869) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Jan 14 02:50:13 2016 (r293870) @@ -60,13 +60,15 @@ __FBSDID("$FreeBSD$"); #include "hv_vmbus_priv.h" - -#define VMBUS_IRQ 0x5 +#include +#include "acpi_if.h" static device_t vmbus_devp; static int vmbus_inited; static hv_setup_args setup_args; /* only CPU 0 supported at this time */ +static char *vmbus_ids[] = { "VMBUS", NULL }; + /** * @brief Software interrupt thread routine to handle channel messages from * the hypervisor. @@ -350,25 +352,15 @@ hv_vmbus_child_device_unregister(struct return(ret); } -static void -vmbus_identify(driver_t *driver, device_t parent) -{ - if (!hv_vmbus_query_hypervisor_presence()) - return; - - vm_guest = VM_GUEST_HV; - - BUS_ADD_CHILD(parent, 0, "vmbus", 0); -} - static int vmbus_probe(device_t dev) { - if(bootverbose) - device_printf(dev, "VMBUS: probe\n"); + if (ACPI_ID_PROBE(device_get_parent(dev), dev, vmbus_ids) == NULL || + device_get_unit(dev) != 0) + return (ENXIO); device_set_desc(dev, "Vmbus Devices"); - return (BUS_PROBE_NOWILDCARD); + return (BUS_PROBE_DEFAULT); } #ifdef HYPERV @@ -723,7 +715,6 @@ vmbus_modevent(module_t mod, int what, v static device_method_t vmbus_methods[] = { /** Device interface */ - DEVMETHOD(device_identify, vmbus_identify), DEVMETHOD(device_probe, vmbus_probe), DEVMETHOD(device_attach, vmbus_attach), DEVMETHOD(device_detach, vmbus_detach), @@ -745,8 +736,9 @@ static driver_t vmbus_driver = { driver_ devclass_t vmbus_devclass; -DRIVER_MODULE(vmbus, nexus, vmbus_driver, vmbus_devclass, vmbus_modevent, 0); -MODULE_VERSION(vmbus,1); +DRIVER_MODULE(vmbus, acpi, vmbus_driver, vmbus_devclass, vmbus_modevent, 0); +MODULE_DEPEND(vmbus, acpi, 1, 1, 1); +MODULE_VERSION(vmbus, 1); /* We want to be started after SMP is initialized */ SYSINIT(vmb_init, SI_SUB_SMP + 1, SI_ORDER_FIRST, vmbus_init, NULL); Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Thu Jan 14 02:32:50 2016 (r293869) +++ head/sys/x86/x86/identcpu.c Thu Jan 14 02:50:13 2016 (r293870) @@ -1294,6 +1294,8 @@ identify_hypervisor(void) hv_vendor[12] = '\0'; if (strcmp(hv_vendor, "VMwareVMware") == 0) vm_guest = VM_GUEST_VMWARE; + else if (strcmp(hv_vendor, "Microsoft Hv") == 0) + vm_guest = VM_GUEST_HV; } return; } From owner-svn-src-head@freebsd.org Thu Jan 14 02:55:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA235A8090B; Thu, 14 Jan 2016 02:55:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 995F61F92; Thu, 14 Jan 2016 02:55:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E2tSqw010589; Thu, 14 Jan 2016 02:55:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E2tSEZ010588; Thu, 14 Jan 2016 02:55:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601140255.u0E2tSEZ010588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 14 Jan 2016 02:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293871 - head/sys/dev/hyperv/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 02:55:29 -0000 Author: sephe Date: Thu Jan 14 02:55:28 2016 New Revision: 293871 URL: https://svnweb.freebsd.org/changeset/base/293871 Log: hyperv: remove unused vmbus definitions We don't need them at all. Submitted by: Dexuan Cui Sponsored by: Microsoft OSTC Reviewed by: royger, adrian, delphij Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4595 Modified: head/sys/dev/hyperv/include/hyperv.h Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Thu Jan 14 02:50:13 2016 (r293870) +++ head/sys/dev/hyperv/include/hyperv.h Thu Jan 14 02:55:28 2016 (r293871) @@ -335,11 +335,6 @@ typedef enum { HV_CHANNEL_MESSAGE_INITIATED_CONTACT = 14, HV_CHANNEL_MESSAGE_VERSION_RESPONSE = 15, HV_CHANNEL_MESSAGE_UNLOAD = 16, - -#ifdef HV_VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD - HV_CHANNEL_MESSAGE_VIEW_RANGE_ADD = 17, - HV_CHANNEL_MESSAGE_VIEW_RANGE_REMOVE = 18, -#endif HV_CHANNEL_MESSAGE_COUNT } hv_vmbus_channel_msg_type; From owner-svn-src-head@freebsd.org Thu Jan 14 02:58:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38007A80A0B; Thu, 14 Jan 2016 02:58:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09E791159; Thu, 14 Jan 2016 02:58:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E2wTEd010725; Thu, 14 Jan 2016 02:58:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E2wTJB010724; Thu, 14 Jan 2016 02:58:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201601140258.u0E2wTJB010724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 14 Jan 2016 02:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293872 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 02:58:30 -0000 Author: adrian Date: Thu Jan 14 02:58:28 2016 New Revision: 293872 URL: https://svnweb.freebsd.org/changeset/base/293872 Log: [gpiobus] handle the case of there being a single GPIO pin available. PR: kern/206035 Submitted by: Stanislav Galabov Modified: head/sys/dev/gpio/gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Thu Jan 14 02:55:28 2016 (r293871) +++ head/sys/dev/gpio/gpiobus.c Thu Jan 14 02:58:28 2016 (r293872) @@ -184,7 +184,7 @@ gpiobus_init_softc(device_t dev) if (GPIO_PIN_MAX(sc->sc_dev, &sc->sc_npins) != 0) return (ENXIO); - KASSERT(sc->sc_npins != 0, ("GPIO device with no pins")); + KASSERT(sc->sc_npins >= 0, ("GPIO device with no pins")); /* Pins = GPIO_PIN_MAX() + 1 */ sc->sc_npins++; From owner-svn-src-head@freebsd.org Thu Jan 14 03:05:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFD03A80DBC; Thu, 14 Jan 2016 03:05:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD05E1B3C; Thu, 14 Jan 2016 03:05:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E35Bp3014118; Thu, 14 Jan 2016 03:05:11 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E35BXx014111; Thu, 14 Jan 2016 03:05:11 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601140305.u0E35BXx014111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 14 Jan 2016 03:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293873 - in head/sys: conf dev/hyperv/vmbus modules/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 03:05:13 -0000 Author: sephe Date: Thu Jan 14 03:05:10 2016 New Revision: 293873 URL: https://svnweb.freebsd.org/changeset/base/293873 Log: hyperv: implement an event timer Submitted by: Howard Su Reviewed by: delphij, royger, adrian Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4676 Added: head/sys/dev/hyperv/vmbus/hv_et.c (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/modules/hyperv/vmbus/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Jan 14 02:58:28 2016 (r293872) +++ head/sys/conf/files.amd64 Thu Jan 14 03:05:10 2016 (r293873) @@ -273,6 +273,7 @@ dev/hyperv/vmbus/hv_channel.c optiona dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv dev/hyperv/vmbus/hv_connection.c optional hyperv dev/hyperv/vmbus/hv_hv.c optional hyperv +dev/hyperv/vmbus/hv_et.c optional hyperv dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv dev/nfe/if_nfe.c optional nfe pci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Jan 14 02:58:28 2016 (r293872) +++ head/sys/conf/files.i386 Thu Jan 14 03:05:10 2016 (r293873) @@ -247,6 +247,7 @@ dev/hyperv/vmbus/hv_channel.c optiona dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv dev/hyperv/vmbus/hv_connection.c optional hyperv dev/hyperv/vmbus/hv_hv.c optional hyperv +dev/hyperv/vmbus/hv_et.c optional hyperv dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv dev/ichwd/ichwd.c optional ichwd Added: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/hv_et.c Thu Jan 14 03:05:10 2016 (r293873) @@ -0,0 +1,131 @@ +/*- + * Copyright (c) 2015 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include "hv_vmbus_priv.h" + +#define HV_TIMER_FREQUENCY (10 * 1000 * 1000LL) /* 100ns period */ +#define HV_MAX_DELTA_TICKS 0xffffffffLL +#define HV_MIN_DELTA_TICKS 1LL + +static struct eventtimer et; +static uint64_t periodticks[MAXCPU]; + +static inline uint64_t +sbintime2tick(sbintime_t time) +{ + struct timespec val; + + val = sbttots(time); + return val.tv_sec * HV_TIMER_FREQUENCY + val.tv_nsec / 100; +} + +static int +hv_et_start(struct eventtimer *et, sbintime_t firsttime, sbintime_t periodtime) +{ + union hv_timer_config timer_cfg; + uint64_t current; + + timer_cfg.as_uint64 = 0; + timer_cfg.auto_enable = 1; + timer_cfg.sintx = HV_VMBUS_MESSAGE_SINT; + + periodticks[curcpu] = sbintime2tick(periodtime); + if (firsttime == 0) + firsttime = periodtime; + + current = rdmsr(HV_X64_MSR_TIME_REF_COUNT); + current += sbintime2tick(firsttime); + + wrmsr(HV_X64_MSR_STIMER0_CONFIG, timer_cfg.as_uint64); + wrmsr(HV_X64_MSR_STIMER0_COUNT, current); + + return (0); +} + +static int +hv_et_stop(struct eventtimer *et) +{ + wrmsr(HV_X64_MSR_STIMER0_CONFIG, 0); + wrmsr(HV_X64_MSR_STIMER0_COUNT, 0); + + return (0); +} + +void +hv_et_intr(struct trapframe *frame) +{ + union hv_timer_config timer_cfg; + struct trapframe *oldframe; + struct thread *td; + + if (periodticks[curcpu] != 0) { + uint64_t tick = sbintime2tick(periodticks[curcpu]); + timer_cfg.as_uint64 = rdmsr(HV_X64_MSR_STIMER0_CONFIG); + timer_cfg.enable = 0; + timer_cfg.auto_enable = 1; + timer_cfg.periodic = 1; + periodticks[curcpu] = 0; + + wrmsr(HV_X64_MSR_STIMER0_CONFIG, timer_cfg.as_uint64); + wrmsr(HV_X64_MSR_STIMER0_COUNT, tick); + } + + if (et.et_active) { + td = curthread; + td->td_intr_nesting_level++; + oldframe = td->td_intr_frame; + td->td_intr_frame = frame; + et.et_event_cb(&et, et.et_arg); + td->td_intr_frame = oldframe; + td->td_intr_nesting_level--; + } +} + +void +hv_et_init(void) +{ + et.et_name = "HyperV"; + et.et_flags = ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU | ET_FLAGS_PERIODIC; + et.et_quality = 1000; + et.et_frequency = HV_TIMER_FREQUENCY; + et.et_min_period = (1LL << 32) / HV_TIMER_FREQUENCY; + et.et_max_period = HV_MAX_DELTA_TICKS * ((1LL << 32) / HV_TIMER_FREQUENCY); + et.et_start = hv_et_start; + et.et_stop = hv_et_stop; + et.et_priv = &et; + et_register(&et); +} + Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Thu Jan 14 02:58:28 2016 (r293872) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Thu Jan 14 03:05:10 2016 (r293873) @@ -45,12 +45,6 @@ __FBSDID("$FreeBSD$"); #include "hv_vmbus_priv.h" -#define HV_X64_MSR_GUEST_OS_ID 0x40000000 - -#define HV_X64_CPUID_MIN 0x40000005 -#define HV_X64_CPUID_MAX 0x4000ffff -#define HV_X64_MSR_TIME_REF_COUNT 0x40000020 - #define HV_NANOSECONDS_PER_SEC 1000000000L @@ -218,6 +212,8 @@ hv_vmbus_init(void) hv_vmbus_g_context.hypercall_page = virt_addr; tc_init(&hv_timecounter); /* register virtual timecount */ + + hv_et_init(); return (0); Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Jan 14 02:58:28 2016 (r293872) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Jan 14 03:05:10 2016 (r293873) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -153,7 +154,7 @@ handled: * message to process - an event or a channel message. */ static inline int -hv_vmbus_isr(void *unused) +hv_vmbus_isr(struct trapframe *frame) { int cpu; hv_vmbus_message* msg; @@ -193,11 +194,35 @@ hv_vmbus_isr(void *unused) page_addr = hv_vmbus_g_context.syn_ic_msg_page[cpu]; msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; + /* we call eventtimer process the message */ + if (msg->header.message_type == HV_MESSAGE_TIMER_EXPIRED) { + msg->header.message_type = HV_MESSAGE_TYPE_NONE; + + /* + * Make sure the write to message_type (ie set to + * HV_MESSAGE_TYPE_NONE) happens before we read the + * message_pending and EOMing. Otherwise, the EOMing will + * not deliver any more messages + * since there is no empty slot + */ + wmb(); + + if (msg->header.message_flags.u.message_pending) { + /* + * This will cause message queue rescan to possibly + * deliver another msg from the hypervisor + */ + wrmsr(HV_X64_MSR_EOM, 0); + } + hv_et_intr(frame); + return (FILTER_HANDLED); + } + if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { swi_sched(hv_vmbus_g_context.msg_swintr[cpu], 0); } - return FILTER_HANDLED; + return (FILTER_HANDLED); } #ifdef HV_DEBUG_INTR @@ -227,7 +252,7 @@ hv_vector_handler(struct trapframe *trap hv_intr_count++; #endif - hv_vmbus_isr(NULL); + hv_vmbus_isr(trap_frame); /* * Enable preemption. Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Jan 14 02:58:28 2016 (r293872) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Jan 14 03:05:10 2016 (r293873) @@ -359,11 +359,6 @@ typedef struct { struct sema control_sema; } hv_vmbus_connection; -/* - * Declare the MSR used to identify the guest OS - */ -#define HV_X64_MSR_GUEST_OS_ID 0x40000000 - typedef union { uint64_t as_uint64_t; struct { @@ -380,10 +375,6 @@ typedef union { } u; } hv_vmbus_x64_msr_guest_os_id_contents; -/* - * Declare the MSR used to setup pages used to communicate with the hypervisor - */ -#define HV_X64_MSR_HYPERCALL 0x40000001 typedef union { uint64_t as_uint64_t; @@ -513,6 +504,22 @@ typedef union { } hv_vmbus_synic_sint; /* + * Timer configuration register. + */ +union hv_timer_config { + uint64_t as_uint64; + struct { + uint64_t enable:1; + uint64_t periodic:1; + uint64_t lazy:1; + uint64_t auto_enable:1; + uint64_t reserved_z0:12; + uint64_t sintx:4; + uint64_t reserved_z1:44; + }; +}; + +/* * Define syn_ic control register */ typedef union _hv_vmbus_synic_scontrol { @@ -542,8 +549,21 @@ typedef union { uint32_t flags32[HV_EVENT_FLAGS_DWORD_COUNT]; } hv_vmbus_synic_event_flags; +#define HV_X64_CPUID_MIN (0x40000005) +#define HV_X64_CPUID_MAX (0x4000ffff) + +/* + * Declare the MSR used to identify the guest OS + */ +#define HV_X64_MSR_GUEST_OS_ID (0x40000000) +/* + * Declare the MSR used to setup pages used to communicate with the hypervisor + */ +#define HV_X64_MSR_HYPERCALL (0x40000001) /* MSR used to provide vcpu index */ -#define HV_X64_MSR_VP_INDEX (0x40000002) +#define HV_X64_MSR_VP_INDEX (0x40000002) + +#define HV_X64_MSR_TIME_REF_COUNT (0x40000020) /* * Define synthetic interrupt controller model specific registers @@ -572,6 +592,18 @@ typedef union { #define HV_X64_MSR_SINT15 (0x4000009F) /* + * Synthetic Timer MSRs. Four timers per vcpu. + */ +#define HV_X64_MSR_STIMER0_CONFIG 0x400000B0 +#define HV_X64_MSR_STIMER0_COUNT 0x400000B1 +#define HV_X64_MSR_STIMER1_CONFIG 0x400000B2 +#define HV_X64_MSR_STIMER1_COUNT 0x400000B3 +#define HV_X64_MSR_STIMER2_CONFIG 0x400000B4 +#define HV_X64_MSR_STIMER2_COUNT 0x400000B5 +#define HV_X64_MSR_STIMER3_CONFIG 0x400000B6 +#define HV_X64_MSR_STIMER3_COUNT 0x400000B7 + +/* * Declare the various hypercall operations */ typedef enum { @@ -678,6 +710,11 @@ int hv_vmbus_post_message(void *buffer int hv_vmbus_set_event(hv_vmbus_channel *channel); void hv_vmbus_on_events(void *); +/** + * Event Timer interfaces + */ +void hv_et_init(void); +void hv_et_intr(struct trapframe*); /* * The guest OS needs to register the guest ID with the hypervisor. Modified: head/sys/modules/hyperv/vmbus/Makefile ============================================================================== --- head/sys/modules/hyperv/vmbus/Makefile Thu Jan 14 02:58:28 2016 (r293872) +++ head/sys/modules/hyperv/vmbus/Makefile Thu Jan 14 03:05:10 2016 (r293873) @@ -7,6 +7,7 @@ KMOD= hv_vmbus SRCS= hv_channel.c \ hv_channel_mgmt.c \ hv_connection.c \ + hv_et.c \ hv_hv.c \ hv_ring_buffer.c \ hv_vmbus_drv_freebsd.c \ From owner-svn-src-head@freebsd.org Thu Jan 14 03:11:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BD72A80FE0; Thu, 14 Jan 2016 03:11:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 264001F6B; Thu, 14 Jan 2016 03:11:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E3BaMS014390; Thu, 14 Jan 2016 03:11:36 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E3BaDJ014388; Thu, 14 Jan 2016 03:11:36 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601140311.u0E3BaDJ014388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 14 Jan 2016 03:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293874 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 03:11:37 -0000 Author: sephe Date: Thu Jan 14 03:11:35 2016 New Revision: 293874 URL: https://svnweb.freebsd.org/changeset/base/293874 Log: hyperv: add interrupt counters Submitted by: Howard Su Reviewed by: royger, Dexuan Cui , adrian Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4693 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Thu Jan 14 03:05:10 2016 (r293873) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Thu Jan 14 03:11:35 2016 (r293874) @@ -423,12 +423,6 @@ VmbusProcessChannelEvent(uint32_t relid) // mtx_unlock(&channel->inbound_lock); } -#ifdef HV_DEBUG_INTR -extern uint32_t hv_intr_count; -extern uint32_t hv_vmbus_swintr_event_cpu[MAXCPU]; -extern uint32_t hv_vmbus_intr_cpu[MAXCPU]; -#endif - /** * Handler for events */ @@ -449,17 +443,6 @@ hv_vmbus_on_events(void *arg) KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: " "cpu out of range!")); -#ifdef HV_DEBUG_INTR - int i; - hv_vmbus_swintr_event_cpu[cpu]++; - if (hv_intr_count % 10000 == 0) { - printf("VMBUS: Total interrupt %d\n", hv_intr_count); - for (i = 0; i < mp_ncpus; i++) - printf("VMBUS: hw cpu[%d]: %d, event sw intr cpu[%d]: %d\n", - i, hv_vmbus_intr_cpu[i], i, hv_vmbus_swintr_event_cpu[i]); - } -#endif - if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) || (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) { maxdword = HV_MAX_NUM_CHANNELS_SUPPORTED >> 5; Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Jan 14 03:05:10 2016 (r293873) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Jan 14 03:11:35 2016 (r293874) @@ -225,32 +225,24 @@ hv_vmbus_isr(struct trapframe *frame) return (FILTER_HANDLED); } -#ifdef HV_DEBUG_INTR -uint32_t hv_intr_count = 0; -#endif uint32_t hv_vmbus_swintr_event_cpu[MAXCPU]; -uint32_t hv_vmbus_intr_cpu[MAXCPU]; +u_long *hv_vmbus_intr_cpu[MAXCPU]; void hv_vector_handler(struct trapframe *trap_frame) { -#ifdef HV_DEBUG_INTR int cpu; -#endif /* * Disable preemption. */ critical_enter(); -#ifdef HV_DEBUG_INTR /* * Do a little interrupt counting. */ cpu = PCPU_GET(cpuid); - hv_vmbus_intr_cpu[cpu]++; - hv_intr_count++; -#endif + (*hv_vmbus_intr_cpu[cpu])++; hv_vmbus_isr(trap_frame); @@ -479,6 +471,7 @@ static int vmbus_bus_init(void) { int i, j, n, ret; + char buf[MAXCOMLEN + 1]; if (vmbus_inited) return (0); @@ -515,13 +508,15 @@ vmbus_bus_init(void) setup_args.vector = hv_vmbus_g_context.hv_cb_vector; CPU_FOREACH(j) { - hv_vmbus_intr_cpu[j] = 0; hv_vmbus_swintr_event_cpu[j] = 0; hv_vmbus_g_context.hv_event_intr_event[j] = NULL; hv_vmbus_g_context.hv_msg_intr_event[j] = NULL; hv_vmbus_g_context.event_swintr[j] = NULL; hv_vmbus_g_context.msg_swintr[j] = NULL; + snprintf(buf, sizeof(buf), "cpu%d:hyperv", j); + intrcnt_add(buf, &hv_vmbus_intr_cpu[j]); + for (i = 0; i < 2; i++) setup_args.page_buffers[2 * j + i] = NULL; } From owner-svn-src-head@freebsd.org Thu Jan 14 03:16:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AE9BA6D1EB; Thu, 14 Jan 2016 03:16:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27E121228; Thu, 14 Jan 2016 03:16:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E3GU1r017136; Thu, 14 Jan 2016 03:16:30 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E3GUQ5017134; Thu, 14 Jan 2016 03:16:30 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601140316.u0E3GUQ5017134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 14 Jan 2016 03:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293875 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 03:16:31 -0000 Author: sephe Date: Thu Jan 14 03:16:29 2016 New Revision: 293875 URL: https://svnweb.freebsd.org/changeset/base/293875 Log: hyperv: set receive buffer size according to NVSP protocol version If the NVSP protocol version is not greater than NVSP_PROTOCOL_VERSION_2, then the recv buffer size is 15MB, otherwise the buffer size is 16MB. Submitted by: Hongjiang Zhang Reviewed by: royger, Dexuan Cui , adrian Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4814 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Jan 14 03:11:35 2016 (r293874) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Jan 14 03:16:29 2016 (r293875) @@ -642,6 +642,12 @@ hv_nv_connect_to_vsp(struct hv_device *d /* sema_wait(&NetVscChannel->channel_init_sema); */ /* Post the big receive buffer to NetVSP */ + if (net_dev->nvsp_version <= NVSP_PROTOCOL_VERSION_2) + net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE_LEGACY; + else + net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE; + net_dev->send_buf_size = NETVSC_SEND_BUFFER_SIZE; + ret = hv_nv_init_rx_buffer_with_net_vsp(device); if (ret == 0) ret = hv_nv_init_send_buffer_with_net_vsp(device); @@ -676,9 +682,6 @@ hv_nv_on_device_add(struct hv_device *de goto cleanup; /* Initialize the NetVSC channel extension */ - net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE; - - net_dev->send_buf_size = NETVSC_SEND_BUFFER_SIZE; sema_init(&net_dev->channel_init_sema, 0, "netdev_sema"); Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Jan 14 03:11:35 2016 (r293874) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Jan 14 03:16:29 2016 (r293875) @@ -857,7 +857,7 @@ typedef struct nvsp_msg_ { #define NETVSC_SEND_BUFFER_SIZE (1024*1024*15) /* 15M */ #define NETVSC_SEND_BUFFER_ID 0xface - +#define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY (1024*1024*15) /* 15MB */ #define NETVSC_RECEIVE_BUFFER_SIZE (1024*1024*16) /* 16MB */ #define NETVSC_RECEIVE_BUFFER_ID 0xcafe From owner-svn-src-head@freebsd.org Thu Jan 14 05:02:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59508A822A8; Thu, 14 Jan 2016 05:02:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C8571D1A; Thu, 14 Jan 2016 05:02:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E52XmD048969; Thu, 14 Jan 2016 05:02:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E52XJS048968; Thu, 14 Jan 2016 05:02:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601140502.u0E52XJS048968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 14 Jan 2016 05:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293877 - head/sys/modules/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 05:02:34 -0000 Author: ngie Date: Thu Jan 14 05:02:33 2016 New Revision: 293877 URL: https://svnweb.freebsd.org/changeset/base/293877 Log: Unbreak `make depend` with sys/modules/hyperv/vmbus after r293870 Pointyhat to: sephe Modified: head/sys/modules/hyperv/vmbus/Makefile Modified: head/sys/modules/hyperv/vmbus/Makefile ============================================================================== --- head/sys/modules/hyperv/vmbus/Makefile Thu Jan 14 04:25:29 2016 (r293876) +++ head/sys/modules/hyperv/vmbus/Makefile Thu Jan 14 05:02:33 2016 (r293877) @@ -12,7 +12,7 @@ SRCS= hv_channel.c \ hv_ring_buffer.c \ hv_vmbus_drv_freebsd.c \ hv_vmbus_priv.h -SRCS+= bus_if.h device_if.h +SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/include \ -I${.CURDIR}/../../../dev/hyperv/vmbus \ From owner-svn-src-head@freebsd.org Thu Jan 14 05:19:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E74BA8260E; Thu, 14 Jan 2016 05:19:36 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B48A1268; Thu, 14 Jan 2016 05:19:36 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ig0-x22e.google.com with SMTP id ik10so188635651igb.1; Wed, 13 Jan 2016 21:19:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=DetLIc4I6ZauSSoapQyEQK1dfXavOnuKoK2761+H9lU=; b=AA+nzLic22MDce9KIgBx8NyNQ018I8JJ8QcRNTdz5EncVr2UfNRrgF1rtIwz/+kG2b rw1eKBfbTLbmMXKNafpw1MHhfUTv4WLpeBqYjTMzUUgIj7xSCXuh5NaCMEzKRxoucN8z Z10Wn77/XOX8MM0SMZnCZMBKYbdfGJ5FJUv/k/i3vSQdYoNxy3QVx5Avecm/YfUmhcOA 3PvQxQST7rbUM6252Xcr85Hc8Jy+MYUZlHwEEMEkaS2nexWCCQT1pRnbg6AIs3a0zKfz 7v9odR+raCl8OJq2B+YRL12I6+FYbbYqha1BvbA51puE2S3VXdUtpFPOWRYulNdMpoIa sBfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=DetLIc4I6ZauSSoapQyEQK1dfXavOnuKoK2761+H9lU=; b=FhVtjXQb7YfODnKTz0Xd8f8UJCBJF5zjcGnp+SEoXQB4iJzPy6RAWwExQiLSYHh3Ih 5o24/r6AtdpCHjZwpMhjcMRMQ7lElSdIyP3PhnXe06oxd/HV1f2U+FsILvloVCwRWWdo i6OGd2CtVHlwCJz0xVswGqBt5PXNbryGDCMF1FvjzWlS/QSE19H+p8H9D2gXCG6TJKbS M2MadfRXb/mxcbhpIRbtc4vaMIDeRZYXJl9zisx7/ZkdcF12anHlXaGqFtFeaJjZD1e+ +511U1FJO6JjUn2iaMkVHWjFYzOy2hvGh/SDppKATW30ps+qceKK7li64Xyf2ZIAuIkt M1dw== X-Gm-Message-State: ALoCoQn5sZAmnEna6dg8NXdoaOg+bRe6zcveUa7dKZWt8No2bVFT7VPUcLBtSV26P2NA5BeR7/CYVabrAoPqLdcJtfoKkblenQ== MIME-Version: 1.0 X-Received: by 10.50.109.167 with SMTP id ht7mr28383014igb.38.1452748775603; Wed, 13 Jan 2016 21:19:35 -0800 (PST) Received: by 10.107.166.3 with HTTP; Wed, 13 Jan 2016 21:19:35 -0800 (PST) In-Reply-To: <201601140502.u0E52XJS048968@repo.freebsd.org> References: <201601140502.u0E52XJS048968@repo.freebsd.org> Date: Thu, 14 Jan 2016 13:19:35 +0800 Message-ID: Subject: Re: svn commit: r293877 - head/sys/modules/hyperv/vmbus From: Sepherosa Ziehau To: Garrett Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 05:19:36 -0000 Thanks, I was about to commit the same fix. I think i386 hyperv should be dropped, since it is not supported. On Thu, Jan 14, 2016 at 1:02 PM, Garrett Cooper wrote: > Author: ngie > Date: Thu Jan 14 05:02:33 2016 > New Revision: 293877 > URL: https://svnweb.freebsd.org/changeset/base/293877 > > Log: > Unbreak `make depend` with sys/modules/hyperv/vmbus after r293870 > > Pointyhat to: sephe > > Modified: > head/sys/modules/hyperv/vmbus/Makefile > > Modified: head/sys/modules/hyperv/vmbus/Makefile > ============================================================================== > --- head/sys/modules/hyperv/vmbus/Makefile Thu Jan 14 04:25:29 2016 (r293876) > +++ head/sys/modules/hyperv/vmbus/Makefile Thu Jan 14 05:02:33 2016 (r293877) > @@ -12,7 +12,7 @@ SRCS= hv_channel.c \ > hv_ring_buffer.c \ > hv_vmbus_drv_freebsd.c \ > hv_vmbus_priv.h > -SRCS+= bus_if.h device_if.h > +SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h > > CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/include \ > -I${.CURDIR}/../../../dev/hyperv/vmbus \ > _______________________________________________ > 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-unsubscribe@freebsd.org" -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Thu Jan 14 05:31:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26EBCA82B42; Thu, 14 Jan 2016 05:31:16 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDAFD1A60; Thu, 14 Jan 2016 05:31:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x22f.google.com with SMTP id ho8so109989783pac.2; Wed, 13 Jan 2016 21:31:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=O5pcWjN5IEk7P1md1mRnwb1z5U27zf6cDn6G90r9o6o=; b=UwDleHEv6CHsAx8o0IoJ9Xiwc7j9Yl4ILTEAH9KBcQc/SkmcH72d0kYF/PFuSR08EQ ID90PkdQh5jh++TuDdvdBdgjaUUd9CYtj57IHvrX7/6l3sgXPddzpsLMMNZ9puM2ZjkM 1MTcXzj2nGYonSB1XGubTWtkgNikIvwCwzRB3YHRKmK9WW+lzXXN0h2gDfg11PIbxe4o lakSc06GGKQJWJE5r55LFxh2dWU/oY7TOIUn3uX1pvPGA88G9+sDU2IjMcP73jTAssUe A0ltQxKO15zgwujYEFT5Pqx3ckY1KpHaCsXNk6/egwFRyjCAVuLAK6p6dK5ba87IGpzS lYMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=O5pcWjN5IEk7P1md1mRnwb1z5U27zf6cDn6G90r9o6o=; b=f4bSJ0nv5J8DFlzZViv3O3dzY6cwcbIP9kwarsaxE1KsK0NMU5+tyC/NmKyLF4BxBb zJ+0lznai/KcSX5qz1RewTMEg6QZLiYlKrGMzSANt2tGvI99VB/Y3dxmobck28jX5CuQ X0MWsuV3egoJ8q6cKIAmdJrL4rCZp94riA7nlp56Udbfi6Vp2Lv0zbSV3Icckndgn4Jf fATgnV+FS88SIr1sOYu6+QANxZ3PFB3VZ29TFItl36J0Fe0g16NgbvS6XjxR8k8VI88Q r/wmIj+IbXLJa4zfDg7LBMah0LsO8xzFKj6VnZ8d7J1xLHBTnSUOJC24evEWfCo15G99 tdZA== X-Gm-Message-State: ALoCoQm7QgK6BZz5nToPynfyHWd9AfpE/ik9HvS6gr0x69dwiLsYcNHJPQoG9/kPnL1mX1tq/sIcImT1kZB6Fe/IGIHSIq9iDA== X-Received: by 10.66.255.97 with SMTP id ap1mr3163699pad.135.1452749475388; Wed, 13 Jan 2016 21:31:15 -0800 (PST) Received: from [28.16.2.53] ([172.58.24.60]) by smtp.gmail.com with ESMTPSA id v71sm6128250pfi.91.2016.01.13.21.31.13 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jan 2016 21:31:14 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r293877 - head/sys/modules/hyperv/vmbus From: Garrett Cooper X-Mailer: iPhone Mail (13C75) In-Reply-To: Date: Wed, 13 Jan 2016 21:31:01 -0800 Cc: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <547C0E63-D88C-459C-82AE-39427AA29B8A@gmail.com> References: <201601140502.u0E52XJS048968@repo.freebsd.org> To: Sepherosa Ziehau X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 05:31:16 -0000 > On Jan 13, 2016, at 21:19, Sepherosa Ziehau wrote: > > Thanks, I was about to commit the same fix. I think i386 hyperv > should be dropped, since it is not supported. Probably. I ran into this issue on amd64 though :/.. From owner-svn-src-head@freebsd.org Thu Jan 14 05:34:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19BAFA82C24; Thu, 14 Jan 2016 05:34:35 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D70791D7E; Thu, 14 Jan 2016 05:34:34 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ig0-x22f.google.com with SMTP id h5so122346805igh.0; Wed, 13 Jan 2016 21:34:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=DjqH2jotx5ZvwCbf4/ln2K/Ji+2pky8pIis7SIBMibo=; b=ULjj84MyRAafuijlim3E26HzqyyYZ9xSQ38jvvY/icQwbE8v47aCEc+3MWPUUfmp0Y PuJ+xQ23MYX1BozE5Z+IKRsTx/Jx/QdxmRfshwW1eYDrGT4l/xUlGuybejysmllHSlSa wZFLy7zm7K31GJeZjWKLKl9ohiQJA+p5f1rStos6dMlPGpEJwgtxsjR0MvELwvN8Bxdc dGMZDYgN3+kvKwcOahM7xOXPl45iMRf1a8F/XQTIv1ynT6U5zFCIFmkxYoE7cNA1f596 ZGRBmdXhuuZb2aNBWI8Bl0HanlAt5tBDpjtmxm1c1+Xsy1xRWt4Zb8c9AOe6dYX4wVm6 iEZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=DjqH2jotx5ZvwCbf4/ln2K/Ji+2pky8pIis7SIBMibo=; b=EOaiGL9EBBsWGBRiomjAW9uGdCUS2sDudgplBDAR67U8rI1FuxuE54GWXT/6unkm/M Im2Pnut8z4xDMDd/7+fPOvOzvt1os9ZXwwE2uc5TUPA8vaQ0n2tdmhYTf7kvyRZkz2FH iwRxd4yIMYCHYRyNggECt4vrDEJbnwF8A+/hSMQnx2n2SccMb+DdJplGMAYtIzGW+MOy zYPgj8RCySnlNFMM4wK8Etd/F+GBD9PubUU0W0KmhEaaUnmOsnpOG9b2Ts5EbDOhcYHw ER862U0Qnv6I6v6dpMf3Csm5HErwRo0/IiOehOyFVw+HRXyffy3Z+2zsVYQ2vzoRuu9k wVPA== X-Gm-Message-State: ALoCoQmbb5VSeBhRlObN7yyaDEGaEZSX7M5Se1iQvYkFrF8mbCQZ8AGjGNCzsa85dd9/yoodlh+yLRY05F5FSa/y9b71omTrgQ== MIME-Version: 1.0 X-Received: by 10.50.122.38 with SMTP id lp6mr6061748igb.12.1452749674185; Wed, 13 Jan 2016 21:34:34 -0800 (PST) Received: by 10.107.166.3 with HTTP; Wed, 13 Jan 2016 21:34:34 -0800 (PST) In-Reply-To: <547C0E63-D88C-459C-82AE-39427AA29B8A@gmail.com> References: <201601140502.u0E52XJS048968@repo.freebsd.org> <547C0E63-D88C-459C-82AE-39427AA29B8A@gmail.com> Date: Thu, 14 Jan 2016 13:34:34 +0800 Message-ID: Subject: Re: svn commit: r293877 - head/sys/modules/hyperv/vmbus From: Sepherosa Ziehau To: Garrett Cooper Cc: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 05:34:35 -0000 Hmm, strange, I did build the amd64 before I commit the patch... On Thu, Jan 14, 2016 at 1:31 PM, Garrett Cooper wrote: > >> On Jan 13, 2016, at 21:19, Sepherosa Ziehau wrote: >> >> Thanks, I was about to commit the same fix. I think i386 hyperv >> should be dropped, since it is not supported. > > Probably. I ran into this issue on amd64 though :/.. -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Thu Jan 14 06:09:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A7D8A81471; Thu, 14 Jan 2016 06:09:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AF3D1A93; Thu, 14 Jan 2016 06:09:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x232.google.com with SMTP id uo6so355614228pac.1; Wed, 13 Jan 2016 22:09:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UxNBhDeGojp0YOOsPBNaOQrcrkR14jwTqHvD4repKMY=; b=QT2ms5aJ+YTc4TFe19axVZnl3tmlErFIZ3hKnzbmAdZ/+QEJr92hjQxFRDw3QbbZ+4 IxxNzhktm9FqvvF1TlH8Y0ajmzBpHnixqZK9k8sJeqBqv67b9DXhhpcuEhCCa6qH5DIl P8Vq1A3Q0loqTKBIBkk16Nr0RJ644GsIBE3DutQJV+eqMD5sC6/6cjywr0zmPoBTMNx5 iOqFNLONVF1PTYzelRsIUsbZFIKWLmX/RMHeg35y+pRAVpTpGUnBPPomD2DyBtEy7qjz wTKCLaw2QeMOmap7mMtmga1YBawFhtugmF0yguPJLj9c3C7LEOjLp9Hnd5PGZUjY9pm/ yEiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=UxNBhDeGojp0YOOsPBNaOQrcrkR14jwTqHvD4repKMY=; b=K1bfZ1QQZ2sEmBpCHmVNnPkZiPqRebSDoy95+aoIzpJlpPXCdbRP4VRjHGfnsnlXMg GLZTyRU7yG8xELkcZU0U8sOx3gIsb3S4J3P7cQPvBkG+hR4twFfm2EWwJm5m+I+wKBk8 zBXCnqc5dQm2YFnxpcwJdApwWXBor1kiY8XQzhd8tG/km/YniRce6dAkZYsqQPXpB5Hn RROBcxhCnxnh3f6WPi21Y8/50NZ8FQF7gWqLWYQIbaxWMfjJ0bAs93/q7WWWaqwUo/R9 e9UGGcWpNch3I4j7Gz/uNEll4Gr2Ax1WDEZzVWoJs0AllNRCTq3R0+clgkQYjRJlt0og whfg== X-Gm-Message-State: ALoCoQmm6p9tGp+Y0NDwYO0ir8MWZ+i6dtdXCUaTR3raOdizbHbA7mNwVjTsUuLK1LX3RNIld/MBsOr6YOopZN35iu/d7xBpgA== X-Received: by 10.66.184.15 with SMTP id eq15mr3389444pac.42.1452751742697; Wed, 13 Jan 2016 22:09:02 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:f478:ccdc:ca0f:26df? ([2601:601:800:126d:f478:ccdc:ca0f:26df]) by smtp.gmail.com with ESMTPSA id b9sm6437386pas.31.2016.01.13.22.09.01 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jan 2016 22:09:01 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293877 - head/sys/modules/hyperv/vmbus From: NGie Cooper In-Reply-To: Date: Wed, 13 Jan 2016 22:08:59 -0800 Cc: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4E471DE1-3809-4857-9730-3C91D902D950@gmail.com> References: <201601140502.u0E52XJS048968@repo.freebsd.org> <547C0E63-D88C-459C-82AE-39427AA29B8A@gmail.com> To: Sepherosa Ziehau X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 06:09:03 -0000 > On Jan 13, 2016, at 21:34, Sepherosa Ziehau = wrote: >=20 > Hmm, strange, I did build the amd64 before I commit the patch... Here=E2=80=99s how I reproed it (for future reference). Cheers! -NGie $ svn info | grep 'Relative URL' Relative URL: ^/head $ svn up -r 293876 Updating '.': U sys/modules/hyperv/vmbus/Makefile Updated to revision 293876. $ (set -e; cd sys/modules/hyperv/vmbus/; make cleandir; make obj; make = depend; make all) =E2=80=A6 In file included from = /usr/src/svn/sys/modules/hyperv/vmbus/../../../dev/hyperv/vmbus/hv_vmbus_d= rv_freebsd.c:64: In file included from = /usr/src/svn/sys/modules/hyperv/vmbus/../../../contrib/dev/acpica/include/= acpi.h:56: In file included from = /usr/src/svn/sys/modules/hyperv/vmbus/../../../contrib/dev/acpica/include/= platform/acenv.h:183: = /usr/src/svn/sys/modules/hyperv/vmbus/../../../contrib/dev/acpica/include/= platform/acfreebsd.h:78:10: fatal error: 'opt_acpi.h' file not found #include "opt_acpi.h" ^ 1 error generated. *** Error code 1 Stop. make: stopped in /usr/src/svn/sys/modules/hyperv/vmbus= From owner-svn-src-head@freebsd.org Thu Jan 14 06:38:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 410FCA81E49; Thu, 14 Jan 2016 06:38:00 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08A2B1825; Thu, 14 Jan 2016 06:38:00 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ig0-x233.google.com with SMTP id t15so163550934igr.0; Wed, 13 Jan 2016 22:38:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=AvOdve4F5JQ3LFhXA5a3zBWVDOJfuyLlbyzPH7bgVYk=; b=p9Kk/EEBDsAFc/ADAGfA6vzPYYA/cOIUju+WR81tVC32196V71Y15VNINGjcgW/VoI P1Fo62Lshqi7VwyBBeqThYOIrPbqXO2qY/TUyopyYavrTT6FJVuF9pRbIVyuF0iTURXj oJeF+hry2L1+9rRiFJxlQCjt5As8By02M1L+8JoT77WQvOEULO6T1WNLb/3CVmhp3KQm okPxR6BNYSm2o4BYu6Xmv1szJ2eDPqvOQQLl0HyNCWS5oZyTiRqEW+y9tr8iMoFktnK/ s9jH+WcEAOpydmnwt1/F1EmghLflS7O2b9MgNbmoF++BMtgxqkleOslBwI0N0+bdRX5G rwQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=AvOdve4F5JQ3LFhXA5a3zBWVDOJfuyLlbyzPH7bgVYk=; b=RQeduWGub93RC2qtVL1sqDUohpv/Q0+zmcCPENRZd0SBRhoGrcRA/A+u94uCsJajpq W+UjLsWQqohSxx09kIinM5jARrsxPhPlcHJIsNzFMjKjweLcTNIh7LoWKm0zteVaCYje rze7ocCy6+YJ/KTV8XkfJra5qvALxy6uEA7XW5JGZZYjx4cIO2Hu1/KN3y+qYv8FtzRO YT852oLhABBJE1rlObDJ3sg6aRwaBro0EEj4COQ1TK6j0CfVdpPzqu9Ezj+9xBVcSulG W+PZF9gObhNU8zKoASy5qsjoDh2fyZlpMio0NilOVknObwAUpfIgJSUhfkEOCMmgYnKQ uq+w== X-Gm-Message-State: ALoCoQnt6Q89Ud5XVtZwFQHkiHAobPf7/GWtB179DaMbGvrpR2MhSS5B8Zgn07qIRIHLlAAC35pE2Ag0HVfH8Lj/AfdRUTP/QQ== MIME-Version: 1.0 X-Received: by 10.50.80.76 with SMTP id p12mr3225791igx.12.1452753479422; Wed, 13 Jan 2016 22:37:59 -0800 (PST) Received: by 10.107.166.3 with HTTP; Wed, 13 Jan 2016 22:37:59 -0800 (PST) In-Reply-To: <4E471DE1-3809-4857-9730-3C91D902D950@gmail.com> References: <201601140502.u0E52XJS048968@repo.freebsd.org> <547C0E63-D88C-459C-82AE-39427AA29B8A@gmail.com> <4E471DE1-3809-4857-9730-3C91D902D950@gmail.com> Date: Thu, 14 Jan 2016 14:37:59 +0800 Message-ID: Subject: Re: svn commit: r293877 - head/sys/modules/hyperv/vmbus From: Sepherosa Ziehau To: NGie Cooper Cc: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 06:38:00 -0000 Ah, OK, I see, thanks :) On Thu, Jan 14, 2016 at 2:08 PM, NGie Cooper wrote: > >> On Jan 13, 2016, at 21:34, Sepherosa Ziehau wrote: >> >> Hmm, strange, I did build the amd64 before I commit the patch... > > Here=E2=80=99s how I reproed it (for future reference). > Cheers! > -NGie > > $ svn info | grep 'Relative URL' > Relative URL: ^/head > $ svn up -r 293876 > Updating '.': > U sys/modules/hyperv/vmbus/Makefile > Updated to revision 293876. > $ (set -e; cd sys/modules/hyperv/vmbus/; make cleandir; make obj; make de= pend; make all) > =E2=80=A6 > In file included from /usr/src/svn/sys/modules/hyperv/vmbus/../../../dev/= hyperv/vmbus/hv_vmbus_drv_freebsd.c:64: > In file included from /usr/src/svn/sys/modules/hyperv/vmbus/../../../cont= rib/dev/acpica/include/acpi.h:56: > In file included from /usr/src/svn/sys/modules/hyperv/vmbus/../../../cont= rib/dev/acpica/include/platform/acenv.h:183: > /usr/src/svn/sys/modules/hyperv/vmbus/../../../contrib/dev/acpica/include= /platform/acfreebsd.h:78:10: fatal error: 'opt_acpi.h' file not found > #include "opt_acpi.h" > ^ > 1 error generated. > *** Error code 1 > > Stop. > make: stopped in /usr/src/svn/sys/modules/hyperv/vmbus --=20 Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Thu Jan 14 07:27:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3630A82BFC; Thu, 14 Jan 2016 07:27:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 910141B39; Thu, 14 Jan 2016 07:27:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E7REuw089428; Thu, 14 Jan 2016 07:27:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E7RE6q089427; Thu, 14 Jan 2016 07:27:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601140727.u0E7RE6q089427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 14 Jan 2016 07:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293878 - head/tests/sys/geom/class/gate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 07:27:15 -0000 Author: ngie Date: Thu Jan 14 07:27:14 2016 New Revision: 293878 URL: https://svnweb.freebsd.org/changeset/base/293878 Log: Remove unnecessary kldload logic added to geom_subr.sh in r293028 MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/geom/class/gate/conf.sh Modified: head/tests/sys/geom/class/gate/conf.sh ============================================================================== --- head/tests/sys/geom/class/gate/conf.sh Thu Jan 14 05:02:33 2016 (r293877) +++ head/tests/sys/geom/class/gate/conf.sh Thu Jan 14 07:27:14 2016 (r293878) @@ -5,6 +5,4 @@ name="$(mktemp -u gate.XXXXXX)" class="gate" base=`basename $0` -kldstat -q -m g_${class} || kldload geom_${class} || exit 1 - . `dirname $0`/../geom_subr.sh From owner-svn-src-head@freebsd.org Thu Jan 14 07:27:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F9AFA82C48; Thu, 14 Jan 2016 07:27:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2173F1CBF; Thu, 14 Jan 2016 07:27:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E7Rhxp089487; Thu, 14 Jan 2016 07:27:43 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E7Rhll089486; Thu, 14 Jan 2016 07:27:43 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201601140727.u0E7Rhll089486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 14 Jan 2016 07:27:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293879 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 07:27:44 -0000 Author: ed Date: Thu Jan 14 07:27:42 2016 New Revision: 293879 URL: https://svnweb.freebsd.org/changeset/base/293879 Log: Remove an unneeded assignment of the return value. tdelete() is supposed to return the address of the parent node that has been deleted. We already keep track of this node in the loop between lines 94-107. The GO_LEFT()/GO_RIGHT() macros are used later on as well, so we must make sure not to change it to something else. Modified: head/lib/libc/stdlib/tdelete.c Modified: head/lib/libc/stdlib/tdelete.c ============================================================================== --- head/lib/libc/stdlib/tdelete.c Thu Jan 14 07:27:14 2016 (r293878) +++ head/lib/libc/stdlib/tdelete.c Thu Jan 14 07:27:42 2016 (r293879) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); base = leaf; \ path_init(&path); \ } \ - result = &(*leaf)->key; \ path_taking_right(&path); \ leaf = &(*leaf)->rlink; \ } while (0) From owner-svn-src-head@freebsd.org Thu Jan 14 07:39:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A226EA82F4F; Thu, 14 Jan 2016 07:39:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71E501103; Thu, 14 Jan 2016 07:39:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E7d5jr092459; Thu, 14 Jan 2016 07:39:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E7d5ZY092458; Thu, 14 Jan 2016 07:39:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601140739.u0E7d5ZY092458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 14 Jan 2016 07:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293880 - head/tests/sys/geom/class/gate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 07:39:06 -0000 Author: ngie Date: Thu Jan 14 07:39:05 2016 New Revision: 293880 URL: https://svnweb.freebsd.org/changeset/base/293880 Log: PID file support hasn't been committed for ggated(8) yet. Unbreak running the testcase more than once by restoring the "killall ggated" MFC after: 15 days Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/geom/class/gate/1_test.sh Modified: head/tests/sys/geom/class/gate/1_test.sh ============================================================================== --- head/tests/sys/geom/class/gate/1_test.sh Thu Jan 14 07:27:42 2016 (r293879) +++ head/tests/sys/geom/class/gate/1_test.sh Thu Jan 14 07:39:05 2016 (r293880) @@ -11,7 +11,6 @@ while [ -c /dev/ggate${us} ]; do : $(( us += 1 )) done conf=`mktemp $base.XXXXXX` || exit 1 -pidfile=/var/run/ggated.pid port=33080 work=$(attach_md -t malloc -s 1M) @@ -20,7 +19,7 @@ src=$(attach_md -t malloc -s 1M) test_cleanup() { ggatec destroy -f -u $us - pkill -F $pidfile + killall ggated geom_test_cleanup } trap test_cleanup ABRT EXIT INT TERM From owner-svn-src-head@freebsd.org Thu Jan 14 08:54:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A92AA813BE; Thu, 14 Jan 2016 08:54:46 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E82651D7A; Thu, 14 Jan 2016 08:54:45 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E8siN8016245; Thu, 14 Jan 2016 08:54:44 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E8siuJ016240; Thu, 14 Jan 2016 08:54:44 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601140854.u0E8siuJ016240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 14 Jan 2016 08:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293886 - in head/sys: net netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 08:54:46 -0000 Author: melifaro Date: Thu Jan 14 08:54:44 2016 New Revision: 293886 URL: https://svnweb.freebsd.org/changeset/base/293886 Log: Remove now-unused wrappers for various routing functions. Modified: head/sys/net/route.c head/sys/net/route.h head/sys/netinet/in_rmx.c head/sys/netinet/in_var.h head/sys/netinet/ip_mroute.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Jan 14 08:51:28 2016 (r293885) +++ head/sys/net/route.c Thu Jan 14 08:54:44 2016 (r293886) @@ -343,35 +343,6 @@ sys_setfib(struct thread *td, struct set * Packet routing routines. */ void -rtalloc(struct route *ro) -{ - - rtalloc_ign_fib(ro, 0UL, RT_DEFAULT_FIB); -} - -void -rtalloc_fib(struct route *ro, u_int fibnum) -{ - rtalloc_ign_fib(ro, 0UL, fibnum); -} - -void -rtalloc_ign(struct route *ro, u_long ignore) -{ - struct rtentry *rt; - - if ((rt = ro->ro_rt) != NULL) { - if (rt->rt_ifp != NULL && rt->rt_flags & RTF_UP) - return; - RTFREE(rt); - ro->ro_rt = NULL; - } - ro->ro_rt = rtalloc1_fib(&ro->ro_dst, 1, ignore, RT_DEFAULT_FIB); - if (ro->ro_rt) - RT_UNLOCK(ro->ro_rt); -} - -void rtalloc_ign_fib(struct route *ro, u_long ignore, u_int fibnum) { struct rtentry *rt; @@ -539,17 +510,6 @@ done: * message from the network layer. */ void -rtredirect(struct sockaddr *dst, - struct sockaddr *gateway, - struct sockaddr *netmask, - int flags, - struct sockaddr *src) -{ - - rtredirect_fib(dst, gateway, netmask, flags, src, RT_DEFAULT_FIB); -} - -void rtredirect_fib(struct sockaddr *dst, struct sockaddr *gateway, struct sockaddr *netmask, @@ -673,13 +633,6 @@ out: ifa_free(ifa); } -int -rtioctl(u_long req, caddr_t data) -{ - - return (rtioctl_fib(req, data, RT_DEFAULT_FIB)); -} - /* * Routing table ioctl interface. */ @@ -776,19 +729,6 @@ ifa_ifwithroute(int flags, const struct * all the bits of info needed */ int -rtrequest(int req, - struct sockaddr *dst, - struct sockaddr *gateway, - struct sockaddr *netmask, - int flags, - struct rtentry **ret_nrt) -{ - - return (rtrequest_fib(req, dst, gateway, netmask, flags, ret_nrt, - RT_DEFAULT_FIB)); -} - -int rtrequest_fib(int req, struct sockaddr *dst, struct sockaddr *gateway, Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Thu Jan 14 08:51:28 2016 (r293885) +++ head/sys/net/route.h Thu Jan 14 08:54:44 2016 (r293886) @@ -436,8 +436,6 @@ int rtsock_routemsg(int, struct ifnet *i /* * Note the following locking behavior: * - * rtalloc_ign() and rtalloc() return ro->ro_rt unlocked - * * rtalloc1() returns a locked rtentry * * rtfree() and RTFREE_LOCKED() require a locked rtentry @@ -445,9 +443,7 @@ int rtsock_routemsg(int, struct ifnet *i * RTFREE() uses an unlocked entry. */ -int rt_expunge(struct radix_node_head *, struct rtentry *); void rtfree(struct rtentry *); -int rt_check(struct rtentry **, struct rtentry **, struct sockaddr *); void rt_updatemtu(struct ifnet *); typedef int rt_walktree_f_t(struct rtentry *, void *); @@ -458,15 +454,8 @@ void rt_flushifroutes(struct ifnet *ifp) /* XXX MRT COMPAT VERSIONS THAT SET UNIVERSE to 0 */ /* Thes are used by old code not yet converted to use multiple FIBS */ -void rtalloc_ign(struct route *ro, u_long ignflags); -void rtalloc(struct route *ro); /* XXX deprecated, use rtalloc_ign(ro, 0) */ struct rtentry *rtalloc1(struct sockaddr *, int, u_long); int rtinit(struct ifaddr *, int, int); -int rtioctl(u_long, caddr_t); -void rtredirect(struct sockaddr *, struct sockaddr *, - struct sockaddr *, int, struct sockaddr *); -int rtrequest(int, struct sockaddr *, - struct sockaddr *, struct sockaddr *, int, struct rtentry **); /* XXX MRT NEW VERSIONS THAT USE FIBs * For now the protocol indepedent versions are the same as the AF_INET ones @@ -474,7 +463,6 @@ int rtrequest(int, struct sockaddr *, */ int rt_getifa_fib(struct rt_addrinfo *, u_int fibnum); void rtalloc_ign_fib(struct route *ro, u_long ignflags, u_int fibnum); -void rtalloc_fib(struct route *ro, u_int fibnum); struct rtentry *rtalloc1_fib(struct sockaddr *, int, u_long, u_int); int rtioctl_fib(u_long, caddr_t, u_int); void rtredirect_fib(struct sockaddr *, struct sockaddr *, Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Thu Jan 14 08:51:28 2016 (r293885) +++ head/sys/netinet/in_rmx.c Thu Jan 14 08:54:44 2016 (r293886) @@ -191,12 +191,6 @@ in_rtalloc_ign(struct route *ro, u_long rtalloc_ign_fib(ro, ignflags, fibnum); } -struct rtentry * -in_rtalloc1(struct sockaddr *dst, int report, u_long ignflags, u_int fibnum) -{ - return (rtalloc1_fib(dst, report, ignflags, fibnum)); -} - void in_rtredirect(struct sockaddr *dst, struct sockaddr *gateway, @@ -208,9 +202,3 @@ in_rtredirect(struct sockaddr *dst, rtredirect_fib(dst, gateway, netmask, flags, src, fibnum); } -void -in_rtalloc(struct route *ro, u_int fibnum) -{ - rtalloc_ign_fib(ro, 0UL, fibnum); -} - Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Thu Jan 14 08:51:28 2016 (r293885) +++ head/sys/netinet/in_var.h Thu Jan 14 08:54:44 2016 (r293886) @@ -387,8 +387,6 @@ void in_domifdetach(struct ifnet *, void /* XXX */ void in_rtalloc_ign(struct route *ro, u_long ignflags, u_int fibnum); -void in_rtalloc(struct route *ro, u_int fibnum); -struct rtentry *in_rtalloc1(struct sockaddr *, int, u_long, u_int); void in_rtredirect(struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct sockaddr *, u_int); #endif /* _KERNEL */ Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Thu Jan 14 08:51:28 2016 (r293885) +++ head/sys/netinet/ip_mroute.c Thu Jan 14 08:54:44 2016 (r293886) @@ -538,7 +538,7 @@ X_mrt_ioctl(u_long cmd, caddr_t data, in int error = 0; /* - * Currently the only function calling this ioctl routine is rtioctl(). + * Currently the only function calling this ioctl routine is rtioctl_fib(). * Typically, only root can create the raw socket in order to execute * this ioctl method, however the request might be coming from a prison */ From owner-svn-src-head@freebsd.org Thu Jan 14 08:59:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 614CCA81559; Thu, 14 Jan 2016 08:59:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 285211F45; Thu, 14 Jan 2016 08:59:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E8xdV4016472; Thu, 14 Jan 2016 08:59:39 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E8xcRD016464; Thu, 14 Jan 2016 08:59:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601140859.u0E8xcRD016464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 14 Jan 2016 08:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293887 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 08:59:40 -0000 Author: arybchik Date: Thu Jan 14 08:59:38 2016 New Revision: 293887 URL: https://svnweb.freebsd.org/changeset/base/293887 Log: sfxge: add Medford NIC methods Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4908 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford_impl.h head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Thu Jan 14 08:54:44 2016 (r293886) +++ head/sys/dev/sfxge/common/ef10_impl.h Thu Jan 14 08:59:38 2016 (r293887) @@ -45,6 +45,47 @@ extern "C" { #define EF10_MAX_PIOBUF_NBUFS MEDFORD_PIOBUF_NBUFS #endif +extern __checkReturn efx_rc_t +efx_mcdi_get_port_assignment( + __in efx_nic_t *enp, + __out uint32_t *portp); + +extern __checkReturn efx_rc_t +efx_mcdi_get_port_modes( + __in efx_nic_t *enp, + __out uint32_t *modesp); + +extern __checkReturn efx_rc_t +efx_mcdi_get_mac_address_pf( + __in efx_nic_t *enp, + __out_ecount_opt(6) uint8_t mac_addrp[6]); + +extern __checkReturn efx_rc_t +efx_mcdi_get_mac_address_vf( + __in efx_nic_t *enp, + __out_ecount_opt(6) uint8_t mac_addrp[6]); + +extern __checkReturn efx_rc_t +efx_mcdi_get_clock( + __in efx_nic_t *enp, + __out uint32_t *sys_freqp); + +extern __checkReturn efx_rc_t +efx_mcdi_get_vector_cfg( + __in efx_nic_t *enp, + __out_opt uint32_t *vec_basep, + __out_opt uint32_t *pf_nvecp, + __out_opt uint32_t *vf_nvecp); + +extern __checkReturn efx_rc_t +ef10_get_datapath_caps( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_external_port_mapping( + __in efx_nic_t *enp, + __in uint32_t port, + __out uint8_t *external_portp); #ifdef __cplusplus Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Jan 14 08:54:44 2016 (r293886) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Jan 14 08:59:38 2016 (r293887) @@ -358,6 +358,7 @@ typedef struct efx_intr_s { typedef struct efx_nic_ops_s { efx_rc_t (*eno_probe)(efx_nic_t *); + efx_rc_t (*eno_board_cfg)(efx_nic_t *); efx_rc_t (*eno_set_drv_limits)(efx_nic_t *, efx_drv_limits_t*); efx_rc_t (*eno_reset)(efx_nic_t *); efx_rc_t (*eno_init)(efx_nic_t *); Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Thu Jan 14 08:54:44 2016 (r293886) +++ head/sys/dev/sfxge/common/efx_nic.c Thu Jan 14 08:59:38 2016 (r293887) @@ -244,6 +244,7 @@ fail1: static efx_nic_ops_t __efx_nic_falcon_ops = { falcon_nic_probe, /* eno_probe */ + NULL, /* eno_board_cfg */ NULL, /* eno_set_drv_limits */ falcon_nic_reset, /* eno_reset */ falcon_nic_init, /* eno_init */ @@ -263,6 +264,7 @@ static efx_nic_ops_t __efx_nic_falcon_op static efx_nic_ops_t __efx_nic_siena_ops = { siena_nic_probe, /* eno_probe */ + NULL, /* eno_board_cfg */ NULL, /* eno_set_drv_limits */ siena_nic_reset, /* eno_reset */ siena_nic_init, /* eno_init */ @@ -282,6 +284,7 @@ static efx_nic_ops_t __efx_nic_siena_ops static efx_nic_ops_t __efx_nic_hunt_ops = { ef10_nic_probe, /* eno_probe */ + hunt_board_cfg, /* eno_board_cfg */ ef10_nic_set_drv_limits, /* eno_set_drv_limits */ ef10_nic_reset, /* eno_reset */ ef10_nic_init, /* eno_init */ @@ -297,6 +300,27 @@ static efx_nic_ops_t __efx_nic_hunt_ops #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + +static efx_nic_ops_t __efx_nic_medford_ops = { + ef10_nic_probe, /* eno_probe */ + medford_board_cfg, /* eno_board_cfg */ + ef10_nic_set_drv_limits, /* eno_set_drv_limits */ + ef10_nic_reset, /* eno_reset */ + ef10_nic_init, /* eno_init */ + ef10_nic_get_vi_pool, /* eno_get_vi_pool */ + ef10_nic_get_bar_region, /* eno_get_bar_region */ +#if EFSYS_OPT_DIAG + ef10_sram_test, /* eno_sram_test */ + ef10_nic_register_test, /* eno_register_test */ +#endif /* EFSYS_OPT_DIAG */ + ef10_nic_fini, /* eno_fini */ + ef10_nic_unprobe, /* eno_unprobe */ +}; + +#endif /* EFSYS_OPT_MEDFORD */ + + __checkReturn efx_rc_t efx_nic_create( __in efx_family_t family, @@ -361,6 +385,24 @@ efx_nic_create( break; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + enp->en_enop = (efx_nic_ops_t *)&__efx_nic_medford_ops; + /* + * FW_ASSISTED_TSO ommitted as Medford only supports firmware + * assisted TSO version 2, not the v1 scheme used on Huntington. + */ + enp->en_features = + EFX_FEATURE_IPV6 | + EFX_FEATURE_LINK_EVENTS | + EFX_FEATURE_PERIODIC_MAC_STATS | + EFX_FEATURE_MCDI | + EFX_FEATURE_MAC_HEADER_FILTERS | + EFX_FEATURE_MCDI_DMA | + EFX_FEATURE_PIO_BUFFERS; + break; +#endif /* EFSYS_OPT_MEDFORD */ + default: rc = ENOTSUP; goto fail2; Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Thu Jan 14 08:54:44 2016 (r293886) +++ head/sys/dev/sfxge/common/hunt_impl.h Thu Jan 14 08:59:38 2016 (r293887) @@ -54,6 +54,13 @@ extern "C" { */ #define EF10_RX_WPTR_ALIGN 8 +/* + * Max byte offset into the packet the TCP header must start for the hardware + * to be able to parse the packet correctly. + * FIXME: Move to ef10_impl.h when it is included in all driver builds. + */ +#define EF10_TCP_HEADER_OFFSET_LIMIT 208 + /* Invalid RSS context handle */ #define EF10_RSS_CONTEXT_INVALID (0xffffffff) @@ -165,6 +172,10 @@ ef10_nic_probe( __in efx_nic_t *enp); extern __checkReturn efx_rc_t +hunt_board_cfg( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t ef10_nic_set_drv_limits( __inout efx_nic_t *enp, __in efx_drv_limits_t *edlp); Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Thu Jan 14 08:54:44 2016 (r293886) +++ head/sys/dev/sfxge/common/hunt_nic.c Thu Jan 14 08:59:38 2016 (r293887) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include "ef10_tlv_layout.h" -static __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_mcdi_get_port_assignment( __in efx_nic_t *enp, __out uint32_t *portp) @@ -85,7 +85,7 @@ fail1: return (rc); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_mcdi_get_port_modes( __in efx_nic_t *enp, __out uint32_t *modesp) @@ -205,7 +205,7 @@ fail1: return (rc); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_mcdi_get_mac_address_pf( __in efx_nic_t *enp, __out_ecount_opt(6) uint8_t mac_addrp[6]) @@ -263,7 +263,7 @@ fail1: return (rc); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_mcdi_get_mac_address_vf( __in efx_nic_t *enp, __out_ecount_opt(6) uint8_t mac_addrp[6]) @@ -326,7 +326,7 @@ fail1: return (rc); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_mcdi_get_clock( __in efx_nic_t *enp, __out uint32_t *sys_freqp) @@ -376,7 +376,7 @@ fail1: return (rc); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_mcdi_get_vector_cfg( __in efx_nic_t *enp, __out_opt uint32_t *vec_basep, @@ -889,7 +889,7 @@ ef10_nic_pio_unlink( return (efx_mcdi_unlink_piobuf(enp, vi_index)); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t ef10_get_datapath_caps( __in efx_nic_t *enp) { @@ -992,6 +992,13 @@ static struct { (1 << TLV_PORT_MODE_10G_10G_10G_10G), 1 }, + { + EFX_FAMILY_MEDFORD, + (1 << TLV_PORT_MODE_10G) | + (1 << TLV_PORT_MODE_10G_10G) | + (1 << TLV_PORT_MODE_10G_10G_10G_10G), + 1 + }, /* Supported modes requiring 2 outputs per port */ { EFX_FAMILY_HUNTINGTON, @@ -1000,18 +1007,25 @@ static struct { (1 << TLV_PORT_MODE_40G_10G_10G) | (1 << TLV_PORT_MODE_10G_10G_40G), 2 - } - /* - * NOTE: Medford modes will require 4 outputs per port: - * TLV_PORT_MODE_10G_10G_10G_10G_Q - * TLV_PORT_MODE_10G_10G_10G_10G_Q2 - * The Q2 mode routes outputs to external port 2. Support for this - * will require a new field specifying the number to add after - * scaling by stride. This is fixed at 1 currently. - */ + }, + { + EFX_FAMILY_MEDFORD, + (1 << TLV_PORT_MODE_40G) | + (1 << TLV_PORT_MODE_40G_40G) | + (1 << TLV_PORT_MODE_40G_10G_10G) | + (1 << TLV_PORT_MODE_10G_10G_40G), + 2 + }, + /* Supported modes requiring 4 outputs per port */ + { + EFX_FAMILY_MEDFORD, + (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q) | + (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q2), + 4 + }, }; -static __checkReturn efx_rc_t + __checkReturn efx_rc_t ef10_external_port_mapping( __in efx_nic_t *enp, __in uint32_t port, @@ -1064,7 +1078,7 @@ fail1: return (rc); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t hunt_board_cfg( __in efx_nic_t *enp) { @@ -1320,7 +1334,7 @@ hunt_board_cfg( * Maximum number of bytes into the frame the TCP header can start for * firmware assisted TSO to work. */ - encp->enc_tx_tso_tcp_header_offset_limit = 208; + encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; return (0); @@ -1361,6 +1375,7 @@ fail1: ef10_nic_probe( __in efx_nic_t *enp) { + efx_nic_ops_t *enop = enp->en_enop; efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_drv_cfg_t *edcp = &(enp->en_drv_cfg); efx_rc_t rc; @@ -1380,7 +1395,7 @@ ef10_nic_probe( if ((rc = efx_mcdi_drv_attach(enp, B_TRUE)) != 0) goto fail3; - if ((rc = hunt_board_cfg(enp)) != 0) + if ((rc = enop->eno_board_cfg(enp)) != 0) if (rc != EACCES) goto fail4; Modified: head/sys/dev/sfxge/common/medford_impl.h ============================================================================== --- head/sys/dev/sfxge/common/medford_impl.h Thu Jan 14 08:54:44 2016 (r293886) +++ head/sys/dev/sfxge/common/medford_impl.h Thu Jan 14 08:59:38 2016 (r293887) @@ -37,7 +37,29 @@ extern "C" { #endif +/* Alignment requirement for value written to RX WPTR: + * the WPTR must be aligned to an 8 descriptor boundary + * + * FIXME: Is this the same on Medford as Huntington? + */ +#define MEDFORD_RX_WPTR_ALIGN 8 + + + +#ifndef ER_EZ_TX_PIOBUF_SIZE +#define ER_EZ_TX_PIOBUF_SIZE 4096 +#endif + + #define MEDFORD_PIOBUF_NBUFS (16) +#define MEDFORD_PIOBUF_SIZE (ER_EZ_TX_PIOBUF_SIZE) + +#define MEDFORD_MIN_PIO_ALLOC_SIZE (MEDFORD_PIOBUF_SIZE / 32) + + +extern __checkReturn efx_rc_t +medford_board_cfg( + __in efx_nic_t *enp); #ifdef __cplusplus Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Thu Jan 14 08:54:44 2016 (r293886) +++ head/sys/dev/sfxge/common/medford_nic.c Thu Jan 14 08:59:38 2016 (r293887) @@ -39,7 +39,205 @@ __FBSDID("$FreeBSD$"); #include "ef10_tlv_layout.h" + __checkReturn efx_rc_t +medford_board_cfg( + __in efx_nic_t *enp) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + uint8_t mac_addr[6] = { 0 }; + uint32_t board_type = 0; + hunt_link_state_t hls; + efx_port_t *epp = &(enp->en_port); + uint32_t port; + uint32_t pf; + uint32_t vf; + uint32_t mask; + uint32_t flags; + uint32_t sysclk; + uint32_t base, nvec; + efx_rc_t rc; + /* + * FIXME: Likely to be incomplete and incorrect. + * Parts of this should be shared with Huntington. + */ + if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0) + goto fail1; + + /* + * NOTE: The MCDI protocol numbers ports from zero. + * The common code MCDI interface numbers ports from one. + */ + emip->emi_port = port + 1; + + if ((rc = ef10_external_port_mapping(enp, port, + &encp->enc_external_port)) != 0) + goto fail2; + + /* + * Get PCIe function number from firmware (used for + * per-function privilege and dynamic config info). + * - PCIe PF: pf = PF number, vf = 0xffff. + * - PCIe VF: pf = parent PF, vf = VF number. + */ + if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0) + goto fail3; + + encp->enc_pf = pf; + encp->enc_vf = vf; + + /* MAC address for this function */ + if (EFX_PCI_FUNCTION_IS_PF(encp)) { + rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); + if ((rc == 0) && (mac_addr[0] & 0x02)) { + /* + * If the static config does not include a global MAC + * address pool then the board may return a locally + * administered MAC address (this should only happen on + * incorrectly programmed boards). + */ + rc = EINVAL; + } + } else { + rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); + } + if (rc != 0) + goto fail4; + + EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); + + /* Board configuration */ + rc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL); + if (rc != 0) { + /* Unprivileged functions may not be able to read board cfg */ + if (rc == EACCES) + board_type = 0; + else + goto fail5; + } + + encp->enc_board_type = board_type; + encp->enc_clk_mult = 1; /* not used for Medford */ + + /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ + if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) + goto fail6; + + /* Obtain the default PHY advertised capabilities */ + if ((rc = hunt_phy_get_link(enp, &hls)) != 0) + goto fail7; + epp->ep_default_adv_cap_mask = hls.hls_adv_cap_mask; + epp->ep_adv_cap_mask = hls.hls_adv_cap_mask; + + if (EFX_PCI_FUNCTION_IS_VF(encp)) { + /* + * Interrupt testing does not work for VFs. See bug50084. + * FIXME: Does this still apply to Medford? + */ + encp->enc_bug41750_workaround = B_TRUE; + } + + /* Chained multicast is always enabled on Medford */ + encp->enc_bug26807_workaround = B_TRUE; + + /* Get sysclk frequency (in MHz). */ + if ((rc = efx_mcdi_get_clock(enp, &sysclk)) != 0) + goto fail8; + + /* + * The timer quantum is 1536 sysclk cycles, documented for the + * EV_TMR_VAL field of EV_TIMER_TBL. Scale for MHz and ns units. + */ + encp->enc_evq_timer_quantum_ns = 1536000UL / sysclk; /* 1536 cycles */ + encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns << + FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000; + + /* Check capabilities of running datapath firmware */ + if ((rc = ef10_get_datapath_caps(enp)) != 0) + goto fail9; + + /* Alignment for receive packet DMA buffers */ + encp->enc_rx_buf_align_start = 1; + + /* FIXME: RX DMA end padding is configurable on Medford */ + encp->enc_rx_buf_align_end = 64; + + /* Alignment for WPTR updates */ + encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + + /* + * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use + * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available + * resources (allocated to this PCIe function), which is zero until + * after we have allocated VIs. + */ + encp->enc_evq_limit = 1024; + encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; + encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; + + encp->enc_buftbl_limit = 0xFFFFFFFF; + + encp->enc_piobuf_limit = MEDFORD_PIOBUF_NBUFS; + encp->enc_piobuf_size = MEDFORD_PIOBUF_SIZE; + encp->enc_piobuf_min_alloc_size = MEDFORD_MIN_PIO_ALLOC_SIZE; + + /* + * Get the current privilege mask. Note that this may be modified + * dynamically, so this value is informational only. DO NOT use + * the privilege mask to check for sufficient privileges, as that + * can result in time-of-check/time-of-use bugs. + */ + if ((rc = efx_mcdi_privilege_mask(enp, pf, vf, &mask)) != 0) + goto fail10; + + encp->enc_privilege_mask = mask; + + /* Get interrupt vector limits */ + if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { + if (EFX_PCI_FUNCTION_IS_PF(encp)) + goto fail11; + + /* Ignore error (cannot query vector limits from a VF). */ + base = 0; + nvec = 1024; + } + encp->enc_intr_vec_base = base; + encp->enc_intr_limit = nvec; + + /* + * Maximum number of bytes into the frame the TCP header can start for + * firmware assisted TSO to work. + */ + encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; + + return (0); + +fail11: + EFSYS_PROBE(fail11); +fail10: + EFSYS_PROBE(fail10); +fail9: + EFSYS_PROBE(fail9); +fail8: + EFSYS_PROBE(fail8); +fail7: + EFSYS_PROBE(fail7); +fail6: + EFSYS_PROBE(fail6); +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} #endif /* EFSYS_OPT_MEDFORD */ From owner-svn-src-head@freebsd.org Thu Jan 14 09:00:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7B1EA818F4; Thu, 14 Jan 2016 09:00:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 779201176; Thu, 14 Jan 2016 09:00:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E90aCk016588; Thu, 14 Jan 2016 09:00:36 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E90ZNq016582; Thu, 14 Jan 2016 09:00:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601140900.u0E90ZNq016582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 14 Jan 2016 09:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293888 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:00:37 -0000 Author: arybchik Date: Thu Jan 14 09:00:35 2016 New Revision: 293888 URL: https://svnweb.freebsd.org/changeset/base/293888 Log: sfxge: rework MCDI start request Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4909 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_mcdi.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Jan 14 08:59:38 2016 (r293887) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Jan 14 09:00:35 2016 (r293888) @@ -457,8 +457,8 @@ falconsiena_filter_tbl_clear( typedef struct efx_mcdi_ops_s { efx_rc_t (*emco_init)(efx_nic_t *, const efx_mcdi_transport_t *); - void (*emco_request_copyin)(efx_nic_t *, efx_mcdi_req_t *, - unsigned int, boolean_t, boolean_t); + void (*emco_send_request)(efx_nic_t *, void *, size_t, + void *, size_t); void (*emco_request_copyout)(efx_nic_t *, efx_mcdi_req_t *); efx_rc_t (*emco_poll_reboot)(efx_nic_t *); boolean_t (*emco_poll_response)(efx_nic_t *); Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Thu Jan 14 08:59:38 2016 (r293887) +++ head/sys/dev/sfxge/common/efx_mcdi.c Thu Jan 14 09:00:35 2016 (r293888) @@ -36,12 +36,32 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_MCDI +/* + * There are three versions of the MCDI interface: + * - MCDIv0: Siena BootROM. Transport uses MCDIv1 headers. + * - MCDIv1: Siena firmware and Huntington BootROM. + * - MCDIv2: EF10 firmware (Huntington/Medford) and Medford BootROM. + * Transport uses MCDIv2 headers. + * + * MCDIv2 Header NOT_EPOCH flag + * ---------------------------- + * A new epoch begins at initial startup or after an MC reboot, and defines when + * the MC should reject stale MCDI requests. + * + * The first MCDI request sent by the host should contain NOT_EPOCH=0, and all + * subsequent requests (until the next MC reboot) should contain NOT_EPOCH=1. + * + * After rebooting the MC will fail all requests with NOT_EPOCH=1 by writing a + * response with ERROR=1 and DATALEN=0 until a request is seen with NOT_EPOCH=0. + */ + + #if EFSYS_OPT_SIENA static efx_mcdi_ops_t __efx_mcdi_siena_ops = { siena_mcdi_init, /* emco_init */ - siena_mcdi_request_copyin, /* emco_request_copyin */ + siena_mcdi_send_request, /* emco_send_request */ siena_mcdi_request_copyout, /* emco_request_copyout */ siena_mcdi_poll_reboot, /* emco_poll_reboot */ siena_mcdi_poll_response, /* emco_poll_response */ @@ -56,7 +76,7 @@ static efx_mcdi_ops_t __efx_mcdi_siena_o static efx_mcdi_ops_t __efx_mcdi_ef10_ops = { ef10_mcdi_init, /* emco_init */ - ef10_mcdi_request_copyin, /* emco_request_copyin */ + ef10_mcdi_send_request, /* emco_send_request */ ef10_mcdi_request_copyout, /* emco_request_copyout */ ef10_mcdi_poll_reboot, /* emco_poll_reboot */ ef10_mcdi_poll_response, /* emco_poll_response */ @@ -179,16 +199,16 @@ efx_mcdi_new_epoch( } static void -efx_mcdi_request_copyin( +efx_mcdi_send_request( __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp, - __in unsigned int seq, - __in boolean_t ev_cpl, - __in boolean_t new_epoch) + __in void *hdrp, + __in size_t hdr_len, + __in void *sdup, + __in size_t sdu_len) { efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; - emcop->emco_request_copyin(enp, emrp, seq, ev_cpl, new_epoch); + emcop->emco_send_request(enp, hdrp, hdr_len, sdup, sdu_len); } static void @@ -241,8 +261,15 @@ efx_mcdi_request_start( __in efx_mcdi_req_t *emrp, __in boolean_t ev_cpl) { +#if EFSYS_OPT_MCDI_LOGGING + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; +#endif efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_dword_t hdr[2]; + size_t hdr_len; + unsigned int max_version; unsigned int seq; + unsigned int xflags; boolean_t new_epoch; int state; @@ -269,9 +296,60 @@ efx_mcdi_request_start( emip->emi_poll_cnt = 0; seq = emip->emi_seq++ & EFX_MASK32(MCDI_HEADER_SEQ); new_epoch = emip->emi_new_epoch; + max_version = emip->emi_max_version; EFSYS_UNLOCK(enp->en_eslp, state); - efx_mcdi_request_copyin(enp, emrp, seq, ev_cpl, new_epoch); + xflags = 0; + if (ev_cpl) + xflags |= MCDI_HEADER_XFLAGS_EVREQ; + + /* + * Huntington firmware supports MCDIv2, but the Huntington BootROM only + * supports MCDIv1. Use MCDIv1 headers for MCDIv1 commands where + * possible to support this. + */ + if ((max_version >= 2) && + ((emrp->emr_cmd > MC_CMD_CMD_SPACE_ESCAPE_7) || + (emrp->emr_in_length > MCDI_CTL_SDU_LEN_MAX_V1))) { + /* Construct MCDI v2 header */ + hdr_len = sizeof (hdr); + EFX_POPULATE_DWORD_8(hdr[0], + MCDI_HEADER_CODE, MC_CMD_V2_EXTN, + MCDI_HEADER_RESYNC, 1, + MCDI_HEADER_DATALEN, 0, + MCDI_HEADER_SEQ, seq, + MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1, + MCDI_HEADER_ERROR, 0, + MCDI_HEADER_RESPONSE, 0, + MCDI_HEADER_XFLAGS, xflags); + + EFX_POPULATE_DWORD_2(hdr[1], + MC_CMD_V2_EXTN_IN_EXTENDED_CMD, emrp->emr_cmd, + MC_CMD_V2_EXTN_IN_ACTUAL_LEN, emrp->emr_in_length); + } else { + /* Construct MCDI v1 header */ + hdr_len = sizeof (hdr[0]); + EFX_POPULATE_DWORD_8(hdr[0], + MCDI_HEADER_CODE, emrp->emr_cmd, + MCDI_HEADER_RESYNC, 1, + MCDI_HEADER_DATALEN, emrp->emr_in_length, + MCDI_HEADER_SEQ, seq, + MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1, + MCDI_HEADER_ERROR, 0, + MCDI_HEADER_RESPONSE, 0, + MCDI_HEADER_XFLAGS, xflags); + } + +#if EFSYS_OPT_MCDI_LOGGING + if (emtp->emt_logger != NULL) { + emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_REQUEST, + &hdr, hdr_len, + emrp->emr_in_buf, emrp->emr_in_length); + } +#endif /* EFSYS_OPT_MCDI_LOGGING */ + + efx_mcdi_send_request(enp, &hdr[0], hdr_len, + emrp->emr_in_buf, emrp->emr_in_length); } Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Thu Jan 14 08:59:38 2016 (r293887) +++ head/sys/dev/sfxge/common/hunt_impl.h Thu Jan 14 09:00:35 2016 (r293888) @@ -287,12 +287,12 @@ ef10_mcdi_fini( __in efx_nic_t *enp); extern void -ef10_mcdi_request_copyin( +ef10_mcdi_send_request( __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp, - __in unsigned int seq, - __in boolean_t ev_cpl, - __in boolean_t new_epoch); + __in void *hdrp, + __in size_t hdr_len, + __in void *sdup, + __in size_t sdu_len); extern __checkReturn boolean_t ef10_mcdi_poll_response( Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Thu Jan 14 08:59:38 2016 (r293887) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Thu Jan 14 09:00:35 2016 (r293888) @@ -43,37 +43,6 @@ __FBSDID("$FreeBSD$"); #error "WITH_MCDI_V2 required for EF10 MCDIv2 commands." #endif -typedef enum efx_mcdi_header_type_e { - EFX_MCDI_HEADER_TYPE_V1, /* MCDIv0 (BootROM), MCDIv1 commands */ - EFX_MCDI_HEADER_TYPE_V2, /* MCDIv2 commands */ -} efx_mcdi_header_type_t; - -/* - * Return the header format to use for sending an MCDI request. - * - * An MCDIv1 (Siena compatible) command should use MCDIv2 encapsulation if the - * request input buffer or response output buffer are too large for the MCDIv1 - * format. An MCDIv2 command must always be sent using MCDIv2 encapsulation. - */ -#define EFX_MCDI_HEADER_TYPE(_cmd, _length) \ - ((((_cmd) & ~EFX_MASK32(MCDI_HEADER_CODE)) || \ - ((_length) & ~EFX_MASK32(MCDI_HEADER_DATALEN))) ? \ - EFX_MCDI_HEADER_TYPE_V2 : EFX_MCDI_HEADER_TYPE_V1) - - -/* - * MCDI Header NOT_EPOCH flag - * ========================== - * A new epoch begins at initial startup or after an MC reboot, and defines when - * the MC should reject stale MCDI requests. - * - * The first MCDI request sent by the host should contain NOT_EPOCH=0, and all - * subsequent requests (until the next MC reboot) should contain NOT_EPOCH=1. - * - * After rebooting the MC will fail all requests with NOT_EPOCH=1 by writing a - * response with ERROR=1 and DATALEN=0 until a request is seen with NOT_EPOCH=0. - */ - __checkReturn efx_rc_t ef10_mcdi_init( @@ -139,7 +108,7 @@ ef10_mcdi_fini( emip->emi_new_epoch = B_FALSE; } -static void + void ef10_mcdi_send_request( __in efx_nic_t *enp, __in void *hdrp, @@ -182,74 +151,6 @@ ef10_mcdi_send_request( } void -ef10_mcdi_request_copyin( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp, - __in unsigned int seq, - __in boolean_t ev_cpl, - __in boolean_t new_epoch) -{ -#if EFSYS_OPT_MCDI_LOGGING - const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; -#endif /* EFSYS_OPT_MCDI_LOGGING */ - efx_mcdi_header_type_t hdr_type; - efx_dword_t hdr[2]; - size_t hdr_len; - unsigned int xflags; - - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); - - xflags = 0; - if (ev_cpl) - xflags |= MCDI_HEADER_XFLAGS_EVREQ; - - hdr_type = EFX_MCDI_HEADER_TYPE(emrp->emr_cmd, - MAX(emrp->emr_in_length, emrp->emr_out_length)); - - if (hdr_type == EFX_MCDI_HEADER_TYPE_V2) { - /* Construct MCDI v2 header */ - hdr_len = sizeof (hdr); - EFX_POPULATE_DWORD_8(hdr[0], - MCDI_HEADER_CODE, MC_CMD_V2_EXTN, - MCDI_HEADER_RESYNC, 1, - MCDI_HEADER_DATALEN, 0, - MCDI_HEADER_SEQ, seq, - MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1, - MCDI_HEADER_ERROR, 0, - MCDI_HEADER_RESPONSE, 0, - MCDI_HEADER_XFLAGS, xflags); - - EFX_POPULATE_DWORD_2(hdr[1], - MC_CMD_V2_EXTN_IN_EXTENDED_CMD, emrp->emr_cmd, - MC_CMD_V2_EXTN_IN_ACTUAL_LEN, emrp->emr_in_length); - } else { - /* Construct MCDI v1 header */ - hdr_len = sizeof (hdr[0]); - EFX_POPULATE_DWORD_8(hdr[0], - MCDI_HEADER_CODE, emrp->emr_cmd, - MCDI_HEADER_RESYNC, 1, - MCDI_HEADER_DATALEN, emrp->emr_in_length, - MCDI_HEADER_SEQ, seq, - MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1, - MCDI_HEADER_ERROR, 0, - MCDI_HEADER_RESPONSE, 0, - MCDI_HEADER_XFLAGS, xflags); - } - -#if EFSYS_OPT_MCDI_LOGGING - if (emtp->emt_logger != NULL) { - emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_REQUEST, - &hdr, hdr_len, - emrp->emr_in_buf, emrp->emr_in_length); - } -#endif /* EFSYS_OPT_MCDI_LOGGING */ - - ef10_mcdi_send_request(enp, &hdr[0], hdr_len, - emrp->emr_in_buf, emrp->emr_in_length); -} - - void ef10_mcdi_request_copyout( __in efx_nic_t *enp, __in efx_mcdi_req_t *emrp) Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Thu Jan 14 08:59:38 2016 (r293887) +++ head/sys/dev/sfxge/common/siena_impl.h Thu Jan 14 09:00:35 2016 (r293888) @@ -114,12 +114,12 @@ siena_mcdi_init( __in const efx_mcdi_transport_t *mtp); extern void -siena_mcdi_request_copyin( +siena_mcdi_send_request( __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp, - __in unsigned int seq, - __in boolean_t ev_cpl, - __in boolean_t new_epoch); + __in void *hdrp, + __in size_t hdr_len, + __in void *sdup, + __in size_t sdu_len); extern __checkReturn boolean_t siena_mcdi_poll_response( Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Thu Jan 14 08:59:38 2016 (r293887) +++ head/sys/dev/sfxge/common/siena_mcdi.c Thu Jan 14 09:00:35 2016 (r293888) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); : MC_SMEM_P1_STATUS_OFST >> 2) -static void + void siena_mcdi_send_request( __in efx_nic_t *enp, __in void *hdrp, @@ -90,50 +90,6 @@ siena_mcdi_send_request( } void -siena_mcdi_request_copyin( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp, - __in unsigned int seq, - __in boolean_t ev_cpl, - __in boolean_t new_epoch) -{ -#if EFSYS_OPT_MCDI_LOGGING - const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; -#endif - efx_dword_t hdr; - size_t hdr_len; - unsigned int xflags; - - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); - _NOTE(ARGUNUSED(new_epoch)) - - xflags = 0; - if (ev_cpl) - xflags |= MCDI_HEADER_XFLAGS_EVREQ; - - /* Construct the header */ - hdr_len = sizeof (hdr); - EFX_POPULATE_DWORD_6(hdr, - MCDI_HEADER_CODE, emrp->emr_cmd, - MCDI_HEADER_RESYNC, 1, - MCDI_HEADER_DATALEN, emrp->emr_in_length, - MCDI_HEADER_SEQ, seq, - MCDI_HEADER_RESPONSE, 0, - MCDI_HEADER_XFLAGS, xflags); - -#if EFSYS_OPT_MCDI_LOGGING - if (emtp->emt_logger != NULL) { - emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_REQUEST, - &hdr, sizeof (hdr), - emrp->emr_in_buf, emrp->emr_in_length); - } -#endif /* EFSYS_OPT_MCDI_LOGGING */ - - siena_mcdi_send_request(enp, &hdr, hdr_len, - emrp->emr_in_buf, emrp->emr_in_length); -} - - void siena_mcdi_request_copyout( __in efx_nic_t *enp, __in efx_mcdi_req_t *emrp) From owner-svn-src-head@freebsd.org Thu Jan 14 09:01:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 524DBA81A37; Thu, 14 Jan 2016 09:01:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14A6614CD; Thu, 14 Jan 2016 09:01:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E91six019226; Thu, 14 Jan 2016 09:01:54 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E91rXd019220; Thu, 14 Jan 2016 09:01:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601140901.u0E91rXd019220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 14 Jan 2016 09:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293889 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:01:55 -0000 Author: arybchik Date: Thu Jan 14 09:01:53 2016 New Revision: 293889 URL: https://svnweb.freebsd.org/changeset/base/293889 Log: sfxge: convert nvram size method to use partition id Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4910 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nvram.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_nvram.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Jan 14 09:00:35 2016 (r293888) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Jan 14 09:01:53 2016 (r293889) @@ -480,7 +480,6 @@ typedef struct efx_nvram_ops_s { #if EFSYS_OPT_DIAG efx_rc_t (*envo_test)(efx_nic_t *); #endif /* EFSYS_OPT_DIAG */ - efx_rc_t (*envo_size)(efx_nic_t *, efx_nvram_type_t, size_t *); efx_rc_t (*envo_get_version)(efx_nic_t *, efx_nvram_type_t, uint32_t *, uint16_t *); efx_rc_t (*envo_rw_start)(efx_nic_t *, efx_nvram_type_t, size_t *); @@ -495,6 +494,7 @@ typedef struct efx_nvram_ops_s { efx_rc_t (*envo_type_to_partn)(efx_nic_t *, efx_nvram_type_t, uint32_t *); + efx_rc_t (*envo_partn_size)(efx_nic_t *, uint32_t, size_t *); } efx_nvram_ops_t; #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Thu Jan 14 09:00:35 2016 (r293888) +++ head/sys/dev/sfxge/common/efx_nvram.c Thu Jan 14 09:01:53 2016 (r293889) @@ -42,7 +42,6 @@ static efx_nvram_ops_t __efx_nvram_falco #if EFSYS_OPT_DIAG falcon_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ - falcon_nvram_size, /* envo_size */ falcon_nvram_get_version, /* envo_get_version */ falcon_nvram_rw_start, /* envo_rw_start */ falcon_nvram_read_chunk, /* envo_read_chunk */ @@ -51,6 +50,7 @@ static efx_nvram_ops_t __efx_nvram_falco falcon_nvram_rw_finish, /* envo_rw_finish */ falcon_nvram_set_version, /* envo_set_version */ falcon_nvram_type_to_partn, /* envo_type_to_partn */ + falcon_nvram_partn_size, /* envo_partn_size */ }; #endif /* EFSYS_OPT_FALCON */ @@ -61,7 +61,6 @@ static efx_nvram_ops_t __efx_nvram_siena #if EFSYS_OPT_DIAG siena_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ - siena_nvram_size, /* envo_size */ siena_nvram_get_version, /* envo_get_version */ siena_nvram_rw_start, /* envo_rw_start */ siena_nvram_read_chunk, /* envo_read_chunk */ @@ -70,6 +69,7 @@ static efx_nvram_ops_t __efx_nvram_siena siena_nvram_rw_finish, /* envo_rw_finish */ siena_nvram_set_version, /* envo_set_version */ siena_nvram_type_to_partn, /* envo_type_to_partn */ + siena_nvram_partn_size, /* envo_partn_size */ }; #endif /* EFSYS_OPT_SIENA */ @@ -80,7 +80,6 @@ static efx_nvram_ops_t __efx_nvram_ef10_ #if EFSYS_OPT_DIAG ef10_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ - ef10_nvram_size, /* envo_size */ ef10_nvram_get_version, /* envo_get_version */ ef10_nvram_rw_start, /* envo_rw_start */ ef10_nvram_read_chunk, /* envo_read_chunk */ @@ -89,6 +88,7 @@ static efx_nvram_ops_t __efx_nvram_ef10_ ef10_nvram_rw_finish, /* envo_rw_finish */ ef10_nvram_set_version, /* envo_set_version */ ef10_nvram_type_to_partn, /* envo_type_to_partn */ + ef10_nvram_partn_size, /* envo_partn_size */ }; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ @@ -178,6 +178,7 @@ efx_nvram_size( __out size_t *sizep) { efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -185,13 +186,19 @@ efx_nvram_size( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_size(enp, type, sizep)) != 0) + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + if ((rc = envop->envo_partn_size(enp, partn, sizep)) != 0) + goto fail2; + return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); + *sizep = 0; return (rc); } Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Thu Jan 14 09:00:35 2016 (r293888) +++ head/sys/dev/sfxge/common/hunt_impl.h Thu Jan 14 09:01:53 2016 (r293889) @@ -370,12 +370,6 @@ ef10_nvram_partn_write_segment_tlv( __in boolean_t all_segments); extern __checkReturn efx_rc_t -ef10_nvram_partn_size( - __in efx_nic_t *enp, - __in uint32_t partn, - __out size_t *sizep); - -extern __checkReturn efx_rc_t ef10_nvram_partn_lock( __in efx_nic_t *enp, __in uint32_t partn); @@ -421,12 +415,6 @@ ef10_nvram_test( #endif /* EFSYS_OPT_DIAG */ extern __checkReturn efx_rc_t -ef10_nvram_size( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out size_t *sizep); - -extern __checkReturn efx_rc_t ef10_nvram_get_version( __in efx_nic_t *enp, __in efx_nvram_type_t type, @@ -483,6 +471,12 @@ ef10_nvram_type_to_partn( __in efx_nvram_type_t type, __out uint32_t *partnp); +extern __checkReturn efx_rc_t +ef10_nvram_partn_size( + __in efx_nic_t *enp, + __in uint32_t partn, + __out size_t *sizep); + #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Thu Jan 14 09:00:35 2016 (r293888) +++ head/sys/dev/sfxge/common/hunt_nvram.c Thu Jan 14 09:01:53 2016 (r293889) @@ -1709,33 +1709,6 @@ fail1: #endif /* EFSYS_OPT_DIAG */ __checkReturn efx_rc_t -ef10_nvram_size( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out size_t *sizep) -{ - uint32_t partn; - efx_rc_t rc; - - if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - - if ((rc = ef10_nvram_partn_size(enp, partn, sizep)) != 0) - goto fail2; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - *sizep = 0; - - return (rc); -} - - __checkReturn efx_rc_t ef10_nvram_get_version( __in efx_nic_t *enp, __in efx_nvram_type_t type, Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Thu Jan 14 09:00:35 2016 (r293888) +++ head/sys/dev/sfxge/common/siena_impl.h Thu Jan 14 09:01:53 2016 (r293889) @@ -156,12 +156,6 @@ siena_mcdi_feature_supported( #if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD extern __checkReturn efx_rc_t -siena_nvram_partn_size( - __in efx_nic_t *enp, - __in uint32_t partn, - __out size_t *sizep); - -extern __checkReturn efx_rc_t siena_nvram_partn_lock( __in efx_nic_t *enp, __in uint32_t partn); @@ -215,12 +209,6 @@ siena_nvram_test( #endif /* EFSYS_OPT_DIAG */ extern __checkReturn efx_rc_t -siena_nvram_size( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out size_t *sizep); - -extern __checkReturn efx_rc_t siena_nvram_get_subtype( __in efx_nic_t *enp, __in uint32_t partn, @@ -277,6 +265,12 @@ siena_nvram_type_to_partn( __in efx_nvram_type_t type, __out uint32_t *partnp); +extern __checkReturn efx_rc_t +siena_nvram_partn_size( + __in efx_nic_t *enp, + __in uint32_t partn, + __out size_t *sizep); + #endif /* EFSYS_OPT_NVRAM */ #if EFSYS_OPT_VPD Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Thu Jan 14 09:00:35 2016 (r293888) +++ head/sys/dev/sfxge/common/siena_nvram.c Thu Jan 14 09:01:53 2016 (r293889) @@ -291,32 +291,6 @@ fail1: #endif /* EFSYS_OPT_DIAG */ - __checkReturn efx_rc_t -siena_nvram_size( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out size_t *sizep) -{ - uint32_t partn; - efx_rc_t rc; - - if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - - if ((rc = siena_nvram_partn_size(enp, partn, sizep)) != 0) - goto fail2; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - *sizep = 0; - - return (rc); -} #define SIENA_DYNAMIC_CFG_SIZE(_nitems) \ (sizeof (siena_mc_dynamic_config_hdr_t) + ((_nitems) * \ From owner-svn-src-head@freebsd.org Thu Jan 14 09:03:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 827B5A81BF9; Thu, 14 Jan 2016 09:03:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 518811878; Thu, 14 Jan 2016 09:03:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E9339i019317; Thu, 14 Jan 2016 09:03:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E933R8019315; Thu, 14 Jan 2016 09:03:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601140903.u0E933R8019315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 14 Jan 2016 09:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293890 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:03:04 -0000 Author: arybchik Date: Thu Jan 14 09:03:02 2016 New Revision: 293890 URL: https://svnweb.freebsd.org/changeset/base/293890 Log: sfxge: rx_prefix_pktlen methods do not require EFSYS_OPT_RX_SCALE Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4911 Modified: head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/hunt_impl.h Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Thu Jan 14 09:01:53 2016 (r293889) +++ head/sys/dev/sfxge/common/efx_rx.c Thu Jan 14 09:03:02 2016 (r293890) @@ -78,14 +78,14 @@ falconsiena_rx_prefix_hash( __in efx_rx_hash_alg_t func, __in uint8_t *buffer); +#endif /* EFSYS_OPT_RX_SCALE */ + static __checkReturn efx_rc_t falconsiena_rx_prefix_pktlen( __in efx_nic_t *enp, __in uint8_t *buffer, __out uint16_t *lengthp); -#endif /* EFSYS_OPT_RX_SCALE */ - static void falconsiena_rx_qpost( __in efx_rxq_t *erp, Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Thu Jan 14 09:01:53 2016 (r293889) +++ head/sys/dev/sfxge/common/hunt_impl.h Thu Jan 14 09:03:02 2016 (r293890) @@ -891,14 +891,14 @@ ef10_rx_prefix_hash( __in efx_rx_hash_alg_t func, __in uint8_t *buffer); +#endif /* EFSYS_OPT_RX_SCALE */ + extern __checkReturn efx_rc_t ef10_rx_prefix_pktlen( __in efx_nic_t *enp, __in uint8_t *buffer, __out uint16_t *lengthp); -#endif /* EFSYS_OPT_RX_SCALE */ - extern void ef10_rx_qpost( __in efx_rxq_t *erp, From owner-svn-src-head@freebsd.org Thu Jan 14 09:05:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C5F7A81CD0; Thu, 14 Jan 2016 09:05:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 634F11A61; Thu, 14 Jan 2016 09:05:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E95qVs019473; Thu, 14 Jan 2016 09:05:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E95pin019463; Thu, 14 Jan 2016 09:05:51 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601140905.u0E95pin019463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 14 Jan 2016 09:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293891 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:05:53 -0000 Author: arybchik Date: Thu Jan 14 09:05:51 2016 New Revision: 293891 URL: https://svnweb.freebsd.org/changeset/base/293891 Log: sfxge: support FATSOv2 in common code Sponsored by: Solarflare Communications, Inc. Reviewed by: gnn MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4912 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/hunt_tx.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Jan 14 09:03:02 2016 (r293890) +++ head/sys/dev/sfxge/common/efx.h Thu Jan 14 09:05:51 2016 (r293891) @@ -1071,6 +1071,7 @@ efx_bist_stop( #define EFX_FEATURE_TX_SRC_FILTERS 0x00000400 #define EFX_FEATURE_PIO_BUFFERS 0x00000800 #define EFX_FEATURE_FW_ASSISTED_TSO 0x00001000 +#define EFX_FEATURE_FW_ASSISTED_TSO_V2 0x00002000 typedef struct efx_nic_cfg_s { uint32_t enc_board_type; @@ -1152,6 +1153,7 @@ typedef struct efx_nic_cfg_s { */ uint32_t enc_tx_tso_tcp_header_offset_limit; boolean_t enc_fw_assisted_tso_enabled; + boolean_t enc_fw_assisted_tso_v2_enabled; boolean_t enc_hw_tx_insert_vlan_enabled; /* Datapath firmware vadapter/vport/vswitch support */ boolean_t enc_datapath_cap_evb; @@ -2002,6 +2004,7 @@ efx_tx_fini( #define EFX_TXQ_CKSUM_IPV4 0x0001 #define EFX_TXQ_CKSUM_TCPUDP 0x0002 +#define EFX_TXQ_FATSOV2 0x0004 extern __checkReturn efx_rc_t efx_tx_qcreate( @@ -2089,6 +2092,21 @@ efx_tx_qdesc_tso_create( __in uint8_t tcp_flags, __out efx_desc_t *edp); +/* Number of FATSOv2 option descriptors */ +#define EFX_TX_FATSOV2_OPT_NDESCS 2 + +/* Maximum number of DMA segments per TSO packet (not superframe) */ +#define EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX 24 + +extern void +efx_tx_qdesc_tso2_create( + __in efx_txq_t *etp, + __in uint16_t ipv4_id, + __in uint32_t tcp_seq, + __in uint16_t tcp_mss, + __out_ecount(count) efx_desc_t *edp, + __in int count); + extern void efx_tx_qdesc_vlantci_create( __in efx_txq_t *etp, Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Jan 14 09:03:02 2016 (r293890) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Jan 14 09:05:51 2016 (r293891) @@ -146,6 +146,9 @@ typedef struct efx_tx_ops_s { void (*etxo_qdesc_tso_create)(efx_txq_t *, uint16_t, uint32_t, uint8_t, efx_desc_t *); + void (*etxo_qdesc_tso2_create)(efx_txq_t *, uint16_t, + uint32_t, uint16_t, + efx_desc_t *, int); void (*etxo_qdesc_vlantci_create)(efx_txq_t *, uint16_t, efx_desc_t *); #if EFSYS_OPT_QSTATS Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Thu Jan 14 09:03:02 2016 (r293890) +++ head/sys/dev/sfxge/common/efx_nic.c Thu Jan 14 09:05:51 2016 (r293891) @@ -381,7 +381,8 @@ efx_nic_create( EFX_FEATURE_MAC_HEADER_FILTERS | EFX_FEATURE_MCDI_DMA | EFX_FEATURE_PIO_BUFFERS | - EFX_FEATURE_FW_ASSISTED_TSO; + EFX_FEATURE_FW_ASSISTED_TSO | + EFX_FEATURE_FW_ASSISTED_TSO_V2; break; #endif /* EFSYS_OPT_HUNTINGTON */ Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Thu Jan 14 09:03:02 2016 (r293890) +++ head/sys/dev/sfxge/common/efx_tx.c Thu Jan 14 09:05:51 2016 (r293891) @@ -142,6 +142,7 @@ static efx_tx_ops_t __efx_tx_falcon_ops falconsiena_tx_qdesc_post, /* etxo_qdesc_post */ falconsiena_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ NULL, /* etxo_qdesc_tso_create */ + NULL, /* etxo_qdesc_tso2_create */ NULL, /* etxo_qdesc_vlantci_create */ #if EFSYS_OPT_QSTATS falconsiena_tx_qstats_update, /* etxo_qstats_update */ @@ -167,6 +168,7 @@ static efx_tx_ops_t __efx_tx_siena_ops = falconsiena_tx_qdesc_post, /* etxo_qdesc_post */ falconsiena_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ NULL, /* etxo_qdesc_tso_create */ + NULL, /* etxo_qdesc_tso2_create */ NULL, /* etxo_qdesc_vlantci_create */ #if EFSYS_OPT_QSTATS falconsiena_tx_qstats_update, /* etxo_qstats_update */ @@ -192,6 +194,7 @@ static efx_tx_ops_t __efx_tx_hunt_ops = ef10_tx_qdesc_post, /* etxo_qdesc_post */ ef10_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ hunt_tx_qdesc_tso_create, /* etxo_qdesc_tso_create */ + ef10_tx_qdesc_tso2_create, /* etxo_qdesc_tso2_create */ ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ #if EFSYS_OPT_QSTATS ef10_tx_qstats_update, /* etxo_qstats_update */ @@ -217,6 +220,7 @@ static efx_tx_ops_t __efx_tx_medford_ops ef10_tx_qdesc_post, /* etxo_qdesc_post */ ef10_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ NULL, /* etxo_qdesc_tso_create */ + ef10_tx_qdesc_tso2_create, /* etxo_qdesc_tso2_create */ ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ #if EFSYS_OPT_QSTATS ef10_tx_qstats_update, /* etxo_qstats_update */ @@ -641,6 +645,24 @@ efx_tx_qdesc_tso_create( } void +efx_tx_qdesc_tso2_create( + __in efx_txq_t *etp, + __in uint16_t ipv4_id, + __in uint32_t tcp_seq, + __in uint16_t mss, + __out_ecount(count) efx_desc_t *edp, + __in int count) +{ + efx_nic_t *enp = etp->et_enp; + efx_tx_ops_t *etxop = enp->en_etxop; + + EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); + EFSYS_ASSERT(etxop->etxo_qdesc_tso2_create != NULL); + + etxop->etxo_qdesc_tso2_create(etp, ipv4_id, tcp_seq, mss, edp, count); +} + + void efx_tx_qdesc_vlantci_create( __in efx_txq_t *etp, __in uint16_t tci, Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Thu Jan 14 09:03:02 2016 (r293890) +++ head/sys/dev/sfxge/common/hunt_impl.h Thu Jan 14 09:05:51 2016 (r293891) @@ -701,6 +701,15 @@ hunt_tx_qdesc_tso_create( __out efx_desc_t *edp); extern void +ef10_tx_qdesc_tso2_create( + __in efx_txq_t *etp, + __in uint16_t ipv4_id, + __in uint32_t tcp_seq, + __in uint16_t tcp_mss, + __out_ecount(count) efx_desc_t *edp, + __in int count); + +extern void ef10_tx_qdesc_vlantci_create( __in efx_txq_t *etp, __in uint16_t vlan_tci, Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Thu Jan 14 09:03:02 2016 (r293890) +++ head/sys/dev/sfxge/common/hunt_nic.c Thu Jan 14 09:05:51 2016 (r293891) @@ -920,6 +920,13 @@ ef10_get_datapath_caps( else encp->enc_fw_assisted_tso_enabled = B_FALSE; + /* Check if the firmware supports FATSOv2 */ + if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities_v2, + GET_CAPABILITIES_V2_OUT_TX_TSO_V2) == 1) + encp->enc_fw_assisted_tso_v2_enabled = B_TRUE; + else + encp->enc_fw_assisted_tso_v2_enabled = B_FALSE; + /* Check if the firmware has vadapter/vport/vswitch support */ if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, GET_CAPABILITIES_OUT_EVB) == 1) Modified: head/sys/dev/sfxge/common/hunt_tx.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_tx.c Thu Jan 14 09:03:02 2016 (r293890) +++ head/sys/dev/sfxge/common/hunt_tx.c Thu Jan 14 09:05:51 2016 (r293891) @@ -87,12 +87,13 @@ efx_mcdi_init_txq( MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label); MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance); - MCDI_IN_POPULATE_DWORD_6(req, INIT_TXQ_IN_FLAGS, + MCDI_IN_POPULATE_DWORD_7(req, INIT_TXQ_IN_FLAGS, INIT_TXQ_IN_FLAG_BUFF_MODE, 0, INIT_TXQ_IN_FLAG_IP_CSUM_DIS, (flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1, INIT_TXQ_IN_FLAG_TCP_CSUM_DIS, (flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1, + INIT_TXQ_EXT_IN_FLAG_TSOV2_EN, (flags & EFX_TXQ_FATSOV2) ? 1 : 0, INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0, INIT_TXQ_IN_CRC_MODE, 0, INIT_TXQ_IN_FLAG_TIMESTAMP, 0); @@ -589,6 +590,38 @@ hunt_tx_qdesc_tso_create( } void +ef10_tx_qdesc_tso2_create( + __in efx_txq_t *etp, + __in uint16_t ipv4_id, + __in uint32_t tcp_seq, + __in uint16_t tcp_mss, + __out_ecount(count) efx_desc_t *edp, + __in int count) +{ + EFSYS_PROBE4(tx_desc_tso2_create, unsigned int, etp->et_index, + uint16_t, ipv4_id, uint32_t, tcp_seq, + uint16_t, tcp_mss); + + EFSYS_ASSERT(count >= EFX_TX_FATSOV2_OPT_NDESCS); + + EFX_POPULATE_QWORD_5(edp[0].ed_eq, + ESF_DZ_TX_DESC_IS_OPT, 1, + ESF_DZ_TX_OPTION_TYPE, + ESE_DZ_TX_OPTION_DESC_TSO, + ESF_DZ_TX_TSO_OPTION_TYPE, + ESE_DZ_TX_TSO_OPTION_DESC_FATSO2A, + ESF_DZ_TX_TSO_IP_ID, ipv4_id, + ESF_DZ_TX_TSO_TCP_SEQNO, tcp_seq); + EFX_POPULATE_QWORD_4(edp[1].ed_eq, + ESF_DZ_TX_DESC_IS_OPT, 1, + ESF_DZ_TX_OPTION_TYPE, + ESE_DZ_TX_OPTION_DESC_TSO, + ESF_DZ_TX_TSO_OPTION_TYPE, + ESE_DZ_TX_TSO_OPTION_DESC_FATSO2B, + ESF_DZ_TX_TSO_TCP_MSS, tcp_mss); +} + + void ef10_tx_qdesc_vlantci_create( __in efx_txq_t *etp, __in uint16_t tci, Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Jan 14 09:03:02 2016 (r293890) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Jan 14 09:05:51 2016 (r293891) @@ -169,6 +169,7 @@ siena_board_cfg( encp->enc_hw_tx_insert_vlan_enabled = B_FALSE; encp->enc_fw_assisted_tso_enabled = B_FALSE; + encp->enc_fw_assisted_tso_v2_enabled = B_FALSE; encp->enc_allow_set_mac_with_installed_filters = B_TRUE; return (0); From owner-svn-src-head@freebsd.org Thu Jan 14 09:07:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 104B8A81DCA; Thu, 14 Jan 2016 09:07:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4FBA1C81; Thu, 14 Jan 2016 09:07:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E97etC019576; Thu, 14 Jan 2016 09:07:40 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E97eqL019575; Thu, 14 Jan 2016 09:07:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601140907.u0E97eqL019575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 14 Jan 2016 09:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293892 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:07:42 -0000 Author: arybchik Date: Thu Jan 14 09:07:40 2016 New Revision: 293892 URL: https://svnweb.freebsd.org/changeset/base/293892 Log: sfxge: use correct register definitions for setting interrupt moderation on Medford The only value which has changed is the number of rows (ER_DZ_EVQ_TMR_REG_ROWS is 2048 vs 1024 for FR_BZ_TIMER_COMMAND_REGP0_ROWS) but that isn't used, so this shouldn't change behaviour. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4913 Modified: head/sys/dev/sfxge/common/hunt_ev.c Modified: head/sys/dev/sfxge/common/hunt_ev.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_ev.c Thu Jan 14 09:05:51 2016 (r293891) +++ head/sys/dev/sfxge/common/hunt_ev.c Thu Jan 14 09:07:40 2016 (r293892) @@ -444,9 +444,9 @@ ef10_ev_qmoderate( eep->ee_index, &dword, 0); } else { EFX_POPULATE_DWORD_2(dword, - FRF_CZ_TC_TIMER_MODE, mode, - FRF_CZ_TC_TIMER_VAL, timer_val); - EFX_BAR_TBL_WRITED(enp, FR_BZ_TIMER_COMMAND_REGP0, + ERF_DZ_TC_TIMER_MODE, mode, + ERF_DZ_TC_TIMER_VAL, timer_val); + EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_TMR_REG, eep->ee_index, &dword, 0); } From owner-svn-src-head@freebsd.org Thu Jan 14 09:11:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C6B0A81FF2; Thu, 14 Jan 2016 09:11:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07AE91147; Thu, 14 Jan 2016 09:11:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E9BLJb019878; Thu, 14 Jan 2016 09:11:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E9BKpr019875; Thu, 14 Jan 2016 09:11:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601140911.u0E9BKpr019875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 14 Jan 2016 09:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293895 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:11:22 -0000 Author: arybchik Date: Thu Jan 14 09:11:20 2016 New Revision: 293895 URL: https://svnweb.freebsd.org/changeset/base/293895 Log: sfxge: fix common code VPD iterator and duplicate tag verification Fix efx_vpd_hunk_next() which has -- since its inception -- failed to correctly iterate over the tags and keywords contained in the VPD data. Only the first tag or keyword would be returned and the next call with *contp == 1 would walk to the end of the data and finish. This was spotted when fixing up errors spotted by Prefast code analysis (which neglected to set all of the out parameters in all successful cases) Also fix efx_vpd_verify() on Siena and EF10 which (as a side effect of correctly iterating over all the tags and keywords) was failing as it detected that both the static VPD and dynamic VPD storage contained an RV keyword in the VPD-R tag. This is intentional as the static VPD and dynamic VPD are stored separately (firmware merges their contents and computes a new RV keyword checksum for the data readable from the VPD capability in PCIe configuration space). Submitted by: Andrew Lee Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4915 Modified: head/sys/dev/sfxge/common/efx_vpd.c head/sys/dev/sfxge/common/hunt_vpd.c head/sys/dev/sfxge/common/siena_vpd.c Modified: head/sys/dev/sfxge/common/efx_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/efx_vpd.c Thu Jan 14 09:11:16 2016 (r293894) +++ head/sys/dev/sfxge/common/efx_vpd.c Thu Jan 14 09:11:20 2016 (r293895) @@ -669,7 +669,7 @@ efx_vpd_hunk_next( __in size_t size, __out efx_vpd_tag_t *tagp, __out efx_vpd_keyword_t *keywordp, - __out_bcount_opt(*paylenp) unsigned int *payloadp, + __out_opt unsigned int *payloadp, __out_opt uint8_t *paylenp, __inout unsigned int *contp) { @@ -689,12 +689,18 @@ efx_vpd_hunk_next( if ((rc = efx_vpd_next_tag(data, size, &offset, &tag, &taglen)) != 0) goto fail1; - if (tag == EFX_VPD_END) + + if (tag == EFX_VPD_END) { + keyword = 0; + paylen = 0; + index = 0; break; + } if (tag == EFX_VPD_ID) { - if (index == *contp) { + if (index++ == *contp) { EFSYS_ASSERT3U(taglen, <, 0x100); + keyword = 0; paylen = (uint8_t)MIN(taglen, 0xff); goto done; @@ -705,7 +711,7 @@ efx_vpd_hunk_next( taglen, pos, &keyword, &keylen)) != 0) goto fail2; - if (index == *contp) { + if (index++ == *contp) { offset += pos + 3; paylen = keylen; @@ -717,9 +723,6 @@ efx_vpd_hunk_next( offset += taglen; } - *contp = 0; - return (0); - done: *tagp = tag; *keywordp = keyword; @@ -728,7 +731,7 @@ done: if (paylenp != NULL) *paylenp = paylen; - ++(*contp); + *contp = index; return (0); fail2: Modified: head/sys/dev/sfxge/common/hunt_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_vpd.c Thu Jan 14 09:11:16 2016 (r293894) +++ head/sys/dev/sfxge/common/hunt_vpd.c Thu Jan 14 09:11:20 2016 (r293895) @@ -210,6 +210,13 @@ ef10_vpd_verify( if (dcont == 0) break; + /* + * Skip the RV keyword. It should be present in both the static + * and dynamic cfg sectors. + */ + if (dtag == EFX_VPD_RO && dkey == EFX_VPD_KEYWORD('R', 'V')) + continue; + scont = 0; _NOTE(CONSTANTCONDITION) while (1) { Modified: head/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/siena_vpd.c Thu Jan 14 09:11:16 2016 (r293894) +++ head/sys/dev/sfxge/common/siena_vpd.c Thu Jan 14 09:11:20 2016 (r293895) @@ -326,6 +326,13 @@ siena_vpd_verify( if (dcont == 0) break; + /* + * Skip the RV keyword. It should be present in both the static + * and dynamic cfg sectors. + */ + if (dtag == EFX_VPD_RO && dkey == EFX_VPD_KEYWORD('R', 'V')) + continue; + scont = 0; _NOTE(CONSTANTCONDITION) while (1) { From owner-svn-src-head@freebsd.org Thu Jan 14 09:12:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44828A6D30A; Thu, 14 Jan 2016 09:12:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1544F1AAA; Thu, 14 Jan 2016 09:12:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E9CfdY022738; Thu, 14 Jan 2016 09:12:41 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E9CfXR022737; Thu, 14 Jan 2016 09:12:41 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601140912.u0E9CfXR022737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 14 Jan 2016 09:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293899 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:12:42 -0000 Author: arybchik Date: Thu Jan 14 09:12:40 2016 New Revision: 293899 URL: https://svnweb.freebsd.org/changeset/base/293899 Log: sfxge: cleanup: adjust efx_mcdi_get_port_modes() comment for clarity Fix an explanatory comment which did not explain very well. Submitted by: Richard Houldsworth Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4916 Modified: head/sys/dev/sfxge/common/hunt_nic.c Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Thu Jan 14 09:11:48 2016 (r293898) +++ head/sys/dev/sfxge/common/hunt_nic.c Thu Jan 14 09:12:40 2016 (r293899) @@ -112,7 +112,10 @@ efx_mcdi_get_port_modes( goto fail1; } - /* Accept pre-Medford size (8 bytes - no CurrentMode field) */ + /* + * Require only Modes and DefaultMode fields. + * (CurrentMode field was added for Medford) + */ if (req.emr_out_length_used < MC_CMD_GET_PORT_MODES_OUT_CURRENT_MODE_OFST) { rc = EMSGSIZE; From owner-svn-src-head@freebsd.org Thu Jan 14 09:14:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03FA8A6D417; Thu, 14 Jan 2016 09:14:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B93011C83; Thu, 14 Jan 2016 09:14:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E9EeAt022849; Thu, 14 Jan 2016 09:14:40 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E9Ee4L022846; Thu, 14 Jan 2016 09:14:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601140914.u0E9Ee4L022846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 14 Jan 2016 09:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293900 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:14:42 -0000 Author: arybchik Date: Thu Jan 14 09:14:40 2016 New Revision: 293900 URL: https://svnweb.freebsd.org/changeset/base/293900 Log: sfxge: add table entries for License NVRAM partition Submitted by: Richard Houldsworth Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4917 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/hunt_nvram.c head/sys/dev/sfxge/common/siena_nvram.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Jan 14 09:12:40 2016 (r293899) +++ head/sys/dev/sfxge/common/efx.h Thu Jan 14 09:14:40 2016 (r293900) @@ -1317,6 +1317,7 @@ typedef enum efx_nvram_type_e { EFX_NVRAM_CPLD, EFX_NVRAM_FPGA_BACKUP, EFX_NVRAM_DYNAMIC_CFG, + EFX_NVRAM_LICENSE, EFX_NVRAM_NTYPES, } efx_nvram_type_t; Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Thu Jan 14 09:12:40 2016 (r293899) +++ head/sys/dev/sfxge/common/hunt_nvram.c Thu Jan 14 09:14:40 2016 (r293900) @@ -1541,7 +1541,11 @@ static ef10_parttbl_entry_t hunt_parttbl {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 1, EFX_NVRAM_FPGA_BACKUP}, {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 2, EFX_NVRAM_FPGA_BACKUP}, {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 3, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP} + {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP}, + {NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE} }; static ef10_parttbl_entry_t medford_parttbl[] = { @@ -1572,7 +1576,11 @@ static ef10_parttbl_entry_t medford_part {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 1, EFX_NVRAM_FPGA_BACKUP}, {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 2, EFX_NVRAM_FPGA_BACKUP}, {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 3, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP} + {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP}, + {NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE} }; static __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Thu Jan 14 09:12:40 2016 (r293899) +++ head/sys/dev/sfxge/common/siena_nvram.c Thu Jan 14 09:14:40 2016 (r293900) @@ -227,6 +227,8 @@ static siena_parttbl_entry_t siena_partt {MC_CMD_NVRAM_TYPE_FC_FW, 2, EFX_NVRAM_FCFW}, {MC_CMD_NVRAM_TYPE_CPLD, 1, EFX_NVRAM_CPLD}, {MC_CMD_NVRAM_TYPE_CPLD, 2, EFX_NVRAM_CPLD}, + {MC_CMD_NVRAM_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE}, + {MC_CMD_NVRAM_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE} }; __checkReturn efx_rc_t From owner-svn-src-head@freebsd.org Thu Jan 14 09:19:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 274E4A6D5F2; Thu, 14 Jan 2016 09:19:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7B211EE4; Thu, 14 Jan 2016 09:19:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E9JSV8023117; Thu, 14 Jan 2016 09:19:28 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E9JSwU023109; Thu, 14 Jan 2016 09:19:28 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601140919.u0E9JSwU023109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 14 Jan 2016 09:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293901 - in head/sys: conf dev/sfxge/common modules/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:19:30 -0000 Author: arybchik Date: Thu Jan 14 09:19:28 2016 New Revision: 293901 URL: https://svnweb.freebsd.org/changeset/base/293901 Log: sfxge: add accessors for license-related MCDI calls to common code Add support for Huntington MCDI licensing interface to common code. Ported from Linux net driver IOCTL functions with restructuring for initial support for V3 licensing API. Submitted by: Richard Houldsworth Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4918 Added: head/sys/dev/sfxge/common/efx_lic.c (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c head/sys/modules/sfxge/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Jan 14 09:14:40 2016 (r293900) +++ head/sys/conf/files.amd64 Thu Jan 14 09:19:28 2016 (r293901) @@ -317,6 +317,7 @@ dev/sfxge/common/efx_ev.c optional sfxge dev/sfxge/common/efx_filter.c optional sfxge pci dev/sfxge/common/efx_hash.c optional sfxge pci dev/sfxge/common/efx_intr.c optional sfxge pci +dev/sfxge/common/efx_lic.c optional sfxge pci dev/sfxge/common/efx_mac.c optional sfxge pci dev/sfxge/common/efx_mcdi.c optional sfxge pci dev/sfxge/common/efx_mon.c optional sfxge pci Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Thu Jan 14 09:14:40 2016 (r293900) +++ head/sys/dev/sfxge/common/efsys.h Thu Jan 14 09:19:28 2016 (r293901) @@ -293,6 +293,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_DECODE_INTR_FATAL 1 +#define EFSYS_OPT_LICENSING 0 + /* ID */ typedef struct __efsys_identifier_s efsys_identifier_t; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Jan 14 09:14:40 2016 (r293900) +++ head/sys/dev/sfxge/common/efx.h Thu Jan 14 09:19:28 2016 (r293901) @@ -2310,6 +2310,57 @@ efx_hash_bytes( __in size_t length, __in uint32_t init); +#if EFSYS_OPT_LICENSING + +/* LICENSING */ + +typedef struct efx_key_stats_s { + uint32_t eks_valid; + uint32_t eks_invalid; + uint32_t eks_blacklisted; + uint32_t eks_unverifiable; + uint32_t eks_wrong_node; + uint32_t eks_licensed_apps_lo; + uint32_t eks_licensed_apps_hi; + uint32_t eks_licensed_features_lo; + uint32_t eks_licensed_features_hi; +} efx_key_stats_t; + +extern __checkReturn efx_rc_t +efx_lic_init( + __in efx_nic_t *enp); + +extern void +efx_lic_fini( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +efx_lic_update_licenses( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +efx_lic_get_key_stats( + __in efx_nic_t *enp, + __out efx_key_stats_t *ksp); + +extern __checkReturn efx_rc_t +efx_lic_app_state( + __in efx_nic_t *enp, + __in uint64_t app_id, + __out boolean_t *licensedp); + +extern __checkReturn efx_rc_t +efx_lic_get_id( + __in efx_nic_t *enp, + __in size_t buffer_size, + __out uint32_t *typep, + __out size_t *lengthp, + __out_opt uint8_t *bufferp); + + +#endif /* EFSYS_OPT_LICENSING */ + + #ifdef __cplusplus } Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Thu Jan 14 09:14:40 2016 (r293900) +++ head/sys/dev/sfxge/common/efx_check.h Thu Jan 14 09:19:28 2016 (r293901) @@ -401,4 +401,15 @@ # endif #endif /* EFSYS_OPT_BIST */ +/* Support MCDI licensing API */ +#if EFSYS_OPT_LICENSING +# if !EFSYS_OPT_MCDI +# error "LICENSING requires MCDI" +# endif +# if !EFSYS_HAS_UINT64 +# error "LICENSING requires UINT64" +# endif +#endif /* EFSYS_OPT_LICENSING */ + + #endif /* _SYS_EFX_CHECK_H */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Jan 14 09:14:40 2016 (r293900) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Jan 14 09:19:28 2016 (r293901) @@ -84,6 +84,7 @@ extern "C" { #define EFX_MOD_WOL 0x00000800 #define EFX_MOD_FILTER 0x00001000 #define EFX_MOD_PKTFILTER 0x00002000 +#define EFX_MOD_LIC 0x00004000 #define EFX_RESET_MAC 0x00000001 #define EFX_RESET_PHY 0x00000002 @@ -591,6 +592,18 @@ efx_mcdi_nvram_test( #endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */ +#if EFSYS_OPT_LICENSING + +typedef struct efx_lic_ops_s { + efx_rc_t (*elo_update_licenses)(efx_nic_t *); + efx_rc_t (*elo_get_key_stats)(efx_nic_t *, efx_key_stats_t *); + efx_rc_t (*elo_app_state)(efx_nic_t *, uint64_t, boolean_t *); + efx_rc_t (*elo_get_id)(efx_nic_t *, size_t, uint32_t *, + size_t *, uint8_t *); +} efx_lic_ops_t; + +#endif + typedef struct efx_drv_cfg_s { uint32_t edc_min_vi_count; uint32_t edc_max_vi_count; @@ -640,6 +653,9 @@ struct efx_nic_s { uint32_t en_rss_context; #endif /* EFSYS_OPT_RX_SCALE */ uint32_t en_vport_id; +#if EFSYS_OPT_LICENSING + efx_lic_ops_t *en_elop; +#endif union { #if EFSYS_OPT_FALCON struct { Added: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/efx_lic.c Thu Jan 14 09:19:28 2016 (r293901) @@ -0,0 +1,792 @@ +/*- + * Copyright (c) 2009-2015 Solarflare Communications Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of the FreeBSD Project. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "efx.h" +#include "efx_impl.h" + +#if EFSYS_OPT_LICENSING + +#if EFSYS_OPT_SIENA + +static __checkReturn efx_rc_t +efx_mcdi_fc_license_update_license( + __in efx_nic_t *enp); + +static __checkReturn efx_rc_t +efx_mcdi_fc_license_get_key_stats( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp); + +static efx_lic_ops_t __efx_lic_v1_ops = { + efx_mcdi_fc_license_update_license, /* elo_update_licenses */ + efx_mcdi_fc_license_get_key_stats, /* elo_get_key_stats */ + NULL, /* elo_app_state */ + NULL, /* elo_get_id */ +}; + +#endif /* EFSYS_OPT_SIENA */ + +#if EFSYS_OPT_HUNTINGTON + +static __checkReturn efx_rc_t +efx_mcdi_licensing_update_licenses( + __in efx_nic_t *enp); + +static __checkReturn efx_rc_t +efx_mcdi_licensing_get_key_stats( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp); + +static __checkReturn efx_rc_t +efx_mcdi_licensed_app_state( + __in efx_nic_t *enp, + __in uint64_t app_id, + __out boolean_t *licensedp); + +static efx_lic_ops_t __efx_lic_v2_ops = { + efx_mcdi_licensing_update_licenses, /* elo_update_licenses */ + efx_mcdi_licensing_get_key_stats, /* elo_get_key_stats */ + efx_mcdi_licensed_app_state, /* elo_app_state */ + NULL, /* elo_get_id */ +}; + +#endif /* EFSYS_OPT_HUNTINGTON */ + +#if EFSYS_OPT_MEDFORD + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_update_licenses( + __in efx_nic_t *enp); + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_report_license( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp); + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_app_state( + __in efx_nic_t *enp, + __in uint64_t app_id, + __out boolean_t *licensedp); + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_get_id( + __in efx_nic_t *enp, + __in size_t buffer_size, + __out uint32_t *typep, + __out size_t *lengthp, + __out_bcount_part_opt(buffer_size, *lengthp) + uint8_t *bufferp); + +static efx_lic_ops_t __efx_lic_v3_ops = { + efx_mcdi_licensing_v3_update_licenses, /* elo_update_licenses */ + efx_mcdi_licensing_v3_report_license, /* elo_get_key_stats */ + efx_mcdi_licensing_v3_app_state, /* elo_app_state */ + efx_mcdi_licensing_v3_get_id, /* elo_get_id */ +}; + +#endif /* EFSYS_OPT_MEDFORD */ + + +/* V1 Licensing - used in Siena Modena only */ + +#if EFSYS_OPT_SIENA + +static __checkReturn efx_rc_t +efx_mcdi_fc_license_update_license( + __in efx_nic_t *enp) +{ + efx_mcdi_req_t req; + uint8_t payload[MC_CMD_FC_IN_LICENSE_LEN]; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_FC_OP_LICENSE; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_FC_IN_LICENSE_LEN; + req.emr_out_buf = payload; + req.emr_out_length = 0; + + MCDI_IN_SET_DWORD(req, FC_IN_LICENSE_OP, + MC_CMD_FC_IN_LICENSE_UPDATE_LICENSE); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used != 0) { + rc = EIO; + goto fail2; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +efx_mcdi_fc_license_get_key_stats( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_FC_IN_LICENSE_LEN, + MC_CMD_FC_OUT_LICENSE_LEN)]; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_FC_OP_LICENSE; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_FC_IN_LICENSE_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_FC_OUT_LICENSE_LEN; + + MCDI_IN_SET_DWORD(req, FC_IN_LICENSE_OP, + MC_CMD_FC_IN_LICENSE_GET_KEY_STATS); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_FC_OUT_LICENSE_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + eksp->eks_valid = + MCDI_OUT_DWORD(req, FC_OUT_LICENSE_VALID_KEYS); + eksp->eks_invalid = + MCDI_OUT_DWORD(req, FC_OUT_LICENSE_INVALID_KEYS); + eksp->eks_blacklisted = + MCDI_OUT_DWORD(req, FC_OUT_LICENSE_BLACKLISTED_KEYS); + eksp->eks_unverifiable = 0; + eksp->eks_wrong_node = 0; + eksp->eks_licensed_apps_lo = 0; + eksp->eks_licensed_apps_hi = 0; + eksp->eks_licensed_features_lo = 0; + eksp->eks_licensed_features_hi = 0; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +#endif /* EFSYS_OPT_SIENA */ + +/* V2 Licensing - used by Huntington family only. See SF-113611-TC */ + +#if EFSYS_OPT_HUNTINGTON + +static __checkReturn efx_rc_t +efx_mcdi_licensed_app_state( + __in efx_nic_t *enp, + __in uint64_t app_id, + __out boolean_t *licensedp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_LICENSED_APP_STATE_IN_LEN, + MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN)]; + uint32_t app_state; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + + /* V2 licensing supports 32bit app id only */ + if ((app_id >> 32) != 0) { + rc = EINVAL; + goto fail1; + } + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_LICENSED_APP_STATE; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_LICENSED_APP_STATE_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN; + + MCDI_IN_SET_DWORD(req, GET_LICENSED_APP_STATE_IN_APP_ID, + app_id & 0xffffffff); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail2; + } + + if (req.emr_out_length_used < MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN) { + rc = EMSGSIZE; + goto fail3; + } + + app_state = (MCDI_OUT_DWORD(req, GET_LICENSED_APP_STATE_OUT_STATE)); + if (app_state != MC_CMD_GET_LICENSED_APP_STATE_OUT_NOT_LICENSED) { + *licensedp = B_TRUE; + } else { + *licensedp = B_FALSE; + } + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +efx_mcdi_licensing_update_licenses( + __in efx_nic_t *enp) +{ + efx_mcdi_req_t req; + uint8_t payload[MC_CMD_LICENSING_IN_LEN]; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_LICENSING; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_LICENSING_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = 0; + + MCDI_IN_SET_DWORD(req, LICENSING_IN_OP, + MC_CMD_LICENSING_IN_OP_UPDATE_LICENSE); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used != 0) { + rc = EIO; + goto fail2; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +efx_mcdi_licensing_get_key_stats( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_LICENSING_IN_LEN, + MC_CMD_LICENSING_OUT_LEN)]; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_LICENSING; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_LICENSING_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_LICENSING_OUT_LEN; + + MCDI_IN_SET_DWORD(req, LICENSING_IN_OP, + MC_CMD_LICENSING_IN_OP_GET_KEY_STATS); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_LICENSING_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + eksp->eks_valid = + MCDI_OUT_DWORD(req, LICENSING_OUT_VALID_APP_KEYS); + eksp->eks_invalid = + MCDI_OUT_DWORD(req, LICENSING_OUT_INVALID_APP_KEYS); + eksp->eks_blacklisted = + MCDI_OUT_DWORD(req, LICENSING_OUT_BLACKLISTED_APP_KEYS); + eksp->eks_unverifiable = + MCDI_OUT_DWORD(req, LICENSING_OUT_UNVERIFIABLE_APP_KEYS); + eksp->eks_wrong_node = + MCDI_OUT_DWORD(req, LICENSING_OUT_WRONG_NODE_APP_KEYS); + eksp->eks_licensed_apps_lo = 0; + eksp->eks_licensed_apps_hi = 0; + eksp->eks_licensed_features_lo = 0; + eksp->eks_licensed_features_hi = 0; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +#endif /* EFSYS_OPT_HUNTINGTON */ + +/* V3 Licensing - used starting from Medford family. See SF-114884-SW */ + +#if EFSYS_OPT_MEDFORD + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_update_licenses( + __in efx_nic_t *enp) +{ + efx_mcdi_req_t req; + uint8_t payload[MC_CMD_LICENSING_V3_IN_LEN]; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_LICENSING_V3; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_LICENSING_V3_IN_LEN; + req.emr_out_buf = NULL; + req.emr_out_length = 0; + + MCDI_IN_SET_DWORD(req, LICENSING_V3_IN_OP, + MC_CMD_LICENSING_V3_IN_OP_UPDATE_LICENSE); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_report_license( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_LICENSING_V3_IN_LEN, + MC_CMD_LICENSING_V3_OUT_LEN)]; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_LICENSING_V3; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_LICENSING_V3_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_LICENSING_V3_OUT_LEN; + + MCDI_IN_SET_DWORD(req, LICENSING_V3_IN_OP, + MC_CMD_LICENSING_V3_IN_OP_REPORT_LICENSE); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_LICENSING_V3_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + eksp->eks_valid = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_VALID_KEYS); + eksp->eks_invalid = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_INVALID_KEYS); + eksp->eks_blacklisted = 0; + eksp->eks_unverifiable = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_UNVERIFIABLE_KEYS); + eksp->eks_wrong_node = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_WRONG_NODE_KEYS); + eksp->eks_licensed_apps_lo = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_LICENSED_APPS_LO); + eksp->eks_licensed_apps_hi = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_LICENSED_APPS_HI); + eksp->eks_licensed_features_lo = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_LICENSED_FEATURES_LO); + eksp->eks_licensed_features_hi = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_LICENSED_FEATURES_HI); + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_app_state( + __in efx_nic_t *enp, + __in uint64_t app_id, + __out boolean_t *licensedp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN, + MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN)]; + uint32_t app_state; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_LICENSED_V3_APP_STATE; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN; + + MCDI_IN_SET_DWORD(req, GET_LICENSED_V3_APP_STATE_IN_APP_ID_LO, + app_id & 0xffffffff); + MCDI_IN_SET_DWORD(req, GET_LICENSED_V3_APP_STATE_IN_APP_ID_HI, + app_id >> 32); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + app_state = (MCDI_OUT_DWORD(req, GET_LICENSED_V3_APP_STATE_OUT_STATE)); + if (app_state != MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_NOT_LICENSED) { + *licensedp = B_TRUE; + } else { + *licensedp = B_FALSE; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_get_id( + __in efx_nic_t *enp, + __in size_t buffer_size, + __out uint32_t *typep, + __out size_t *lengthp, + __out_bcount_part_opt(buffer_size, *lengthp) + uint8_t *bufferp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_LICENSING_GET_ID_V3_IN_LEN, + MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN)]; + efx_rc_t rc; + + req.emr_cmd = MC_CMD_LICENSING_GET_ID_V3; + + if (bufferp == NULL) { + /* Request id type and length only */ + req.emr_in_buf = bufferp; + req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN; + req.emr_out_buf = bufferp; + req.emr_out_length = MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN; + (void) memset(payload, 0, sizeof (payload)); + } else { + /* Request full buffer */ + req.emr_in_buf = bufferp; + req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN; + req.emr_out_buf = bufferp; + req.emr_out_length = MIN(buffer_size, MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN); + (void) memset(bufferp, 0, req.emr_out_length); + } + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN) { + rc = EMSGSIZE; + goto fail2; + } + + *typep = MCDI_OUT_DWORD(req, LICENSING_GET_ID_V3_OUT_LICENSE_TYPE); + *lengthp = MCDI_OUT_DWORD(req, LICENSING_GET_ID_V3_OUT_LICENSE_ID_LENGTH); + + if (bufferp == NULL) { + /* modify length requirements to indicate to caller the extra buffering + ** needed to read the complete output. + */ + *lengthp += MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN; + } else { + /* Shift ID down to start of buffer */ + memmove(bufferp, + bufferp+MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST, + *lengthp); + memset(bufferp+(*lengthp), 0, MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST); + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + +#endif /* EFSYS_OPT_MEDFORD */ + + __checkReturn efx_rc_t +efx_lic_init( + __in efx_nic_t *enp) +{ + efx_lic_ops_t *elop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); + EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_LIC)); + + switch (enp->en_family) { + +#if EFSYS_OPT_SIENA + case EFX_FAMILY_SIENA: + elop = (efx_lic_ops_t *)&__efx_lic_v1_ops; + break; +#endif /* EFSYS_OPT_SIENA */ + +#if EFSYS_OPT_HUNTINGTON + case EFX_FAMILY_HUNTINGTON: + elop = (efx_lic_ops_t *)&__efx_lic_v2_ops; + break; +#endif /* EFSYS_OPT_HUNTINGTON */ + +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + elop = (efx_lic_ops_t *)&__efx_lic_v3_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ + + default: + EFSYS_ASSERT(0); + rc = ENOTSUP; + goto fail1; + } + + enp->en_elop = elop; + enp->en_mod_flags |= EFX_MOD_LIC; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + void +efx_lic_fini( + __in efx_nic_t *enp) +{ + efx_lic_ops_t *elop = enp->en_elop; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + enp->en_elop = NULL; + enp->en_mod_flags &= ~EFX_MOD_LIC; +} + + + __checkReturn efx_rc_t +efx_lic_update_licenses( + __in efx_nic_t *enp) +{ + efx_lic_ops_t *elop = enp->en_elop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + if ((rc = elop->elo_update_licenses(enp)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_lic_get_key_stats( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp) +{ + efx_lic_ops_t *elop = enp->en_elop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + if ((rc = elop->elo_get_key_stats(enp, eksp)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_lic_app_state( + __in efx_nic_t *enp, + __in uint64_t app_id, + __out boolean_t *licensedp) +{ + efx_lic_ops_t *elop = enp->en_elop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + if (elop->elo_app_state == NULL) { + rc = ENOTSUP; + goto fail1; + } + if ((rc = elop->elo_app_state(enp, app_id, licensedp)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_lic_get_id( + __in efx_nic_t *enp, + __in size_t buffer_size, + __out uint32_t *typep, + __out size_t *lengthp, + __out_opt uint8_t *bufferp + ) +{ + efx_lic_ops_t *elop = enp->en_elop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + if (elop->elo_get_id == NULL) { + rc = ENOTSUP; + goto fail1; + } + + if ((rc = elop->elo_get_id(enp, buffer_size, typep, + lengthp, bufferp)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +#endif /* EFSYS_OPT_LICENSING */ Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Thu Jan 14 09:14:40 2016 (r293900) +++ head/sys/dev/sfxge/common/efx_nic.c Thu Jan 14 09:19:28 2016 (r293901) @@ -708,8 +708,9 @@ efx_nic_reset( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_PROBE); /* - * All modules except the MCDI, PROBE, NVRAM, VPD, MON (which we - * do not reset here) must have been shut down or never initialized. + * All modules except the MCDI, PROBE, NVRAM, VPD, MON, LIC + * (which we do not reset here) must have been shut down or never + * initialized. * * A rule of thumb here is: If the controller or MC reboots, is *any* * state lost. If it's lost and needs reapplying, then the module @@ -717,7 +718,7 @@ efx_nic_reset( */ mod_flags = enp->en_mod_flags; mod_flags &= ~(EFX_MOD_MCDI | EFX_MOD_PROBE | EFX_MOD_NVRAM | - EFX_MOD_VPD | EFX_MOD_MON); + EFX_MOD_VPD | EFX_MOD_MON | EFX_MOD_LIC); EFSYS_ASSERT3U(mod_flags, ==, 0); if (mod_flags != 0) { rc = EINVAL; Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Thu Jan 14 09:14:40 2016 (r293900) +++ head/sys/modules/sfxge/Makefile Thu Jan 14 09:19:28 2016 (r293901) @@ -14,7 +14,7 @@ SRCS+= sfxge_port.c sfxge_rx.c sfxge_tx. SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h sfxge_version.h .PATH: ${.CURDIR}/../../dev/sfxge/common -SRCS+= efx_bootcfg.c efx_crc32.c efx_ev.c efx_intr.c efx_mac.c +SRCS+= efx_bootcfg.c efx_crc32.c efx_ev.c efx_intr.c efx_lic.c efx_mac.c SRCS+= efx_mcdi.c efx_mon.c efx_nic.c SRCS+= efx_nvram.c efx_phy.c efx_port.c efx_rx.c efx_sram.c efx_tx.c SRCS+= efx_vpd.c efx_wol.c efx_filter.c efx_hash.c From owner-svn-src-head@freebsd.org Thu Jan 14 09:20:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD49AA6D684; Thu, 14 Jan 2016 09:20:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC3A910A6; Thu, 14 Jan 2016 09:20:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E9KP88023207; Thu, 14 Jan 2016 09:20:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E9KPPF023206; Thu, 14 Jan 2016 09:20:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601140920.u0E9KPPF023206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 14 Jan 2016 09:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293902 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:20:27 -0000 Author: arybchik Date: Thu Jan 14 09:20:25 2016 New Revision: 293902 URL: https://svnweb.freebsd.org/changeset/base/293902 Log: sfxge: cleanup: quieten efx_mcdi_read_resonse_header error reporting The "mcdi_err_arg" probe still reports results of failed MCDI commands, unless the caller invoked efx_mcdi_execute_quiet(). Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4919 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Thu Jan 14 09:19:28 2016 (r293901) +++ head/sys/dev/sfxge/common/efx_mcdi.c Thu Jan 14 09:20:25 2016 (r293902) @@ -462,15 +462,8 @@ efx_mcdi_read_response_header( return; fail3: - if (!emrp->emr_quiet) - EFSYS_PROBE(fail3); fail2: - if (!emrp->emr_quiet) - EFSYS_PROBE(fail2); fail1: - if (!emrp->emr_quiet) - EFSYS_PROBE1(fail1, efx_rc_t, rc); - emrp->emr_rc = rc; emrp->emr_out_length_used = 0; } From owner-svn-src-head@freebsd.org Thu Jan 14 09:22:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DB64A6D7FF; Thu, 14 Jan 2016 09:22:03 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CB7C1433; Thu, 14 Jan 2016 09:22:03 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0E9M2tl025149; Thu, 14 Jan 2016 09:22:02 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0E9M1rV025146; Thu, 14 Jan 2016 09:22:01 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601140922.u0E9M1rV025146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 14 Jan 2016 09:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293903 - in head/sys/boot: arm/uboot efi/fdt efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:22:03 -0000 Author: smh Date: Thu Jan 14 09:22:01 2016 New Revision: 293903 URL: https://svnweb.freebsd.org/changeset/base/293903 Log: Fix GCC warnings causing build failure after r293724 Disable some compiler warnings for GCC (non-standard compiler) fixing build failures introduced by r293724, which enabled WARNS in the EFI boot code, when compiling with none standard compiler (GCC). Raised by: ian MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/efi/fdt/Makefile head/sys/boot/efi/libefi/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Thu Jan 14 09:20:25 2016 (r293902) +++ head/sys/boot/arm/uboot/Makefile Thu Jan 14 09:22:01 2016 (r293903) @@ -8,6 +8,8 @@ NEWVERSWHAT= "U-Boot loader" ${MACHINE_A BINDIR?= /boot INSTALLFLAGS= -b WARNS?= 1 +CWARNFLAGS.gcc+= -Wno-int-to-pointer-cast + # Address at which ubldr will be loaded. # This varies for different boards and SOCs. UBLDR_LOADADDR?= 0x1000000 Modified: head/sys/boot/efi/fdt/Makefile ============================================================================== --- head/sys/boot/efi/fdt/Makefile Thu Jan 14 09:20:25 2016 (r293902) +++ head/sys/boot/efi/fdt/Makefile Thu Jan 14 09:22:01 2016 (r293903) @@ -7,6 +7,8 @@ LIB= efi_fdt INTERNALLIB= WARNS?= 6 +CWARNFLAGS.gcc+= -Wno-strict-prototypes +CWARNFLAGS.gcc+= -Wno-redundant-decls SRCS= efi_fdt.c Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Thu Jan 14 09:20:25 2016 (r293902) +++ head/sys/boot/efi/libefi/Makefile Thu Jan 14 09:22:01 2016 (r293903) @@ -3,6 +3,7 @@ LIB= efi INTERNALLIB= WARNS?= 2 +CWARNFLAGS.gcc+= -Wno-attributes SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c From owner-svn-src-head@freebsd.org Thu Jan 14 09:27:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98564A6D953; Thu, 14 Jan 2016 09:27:56 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-oi0-x22d.google.com (mail-oi0-x22d.google.com [IPv6:2607:f8b0:4003:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5734617A6; Thu, 14 Jan 2016 09:27:56 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-oi0-x22d.google.com with SMTP id k206so111922476oia.1; Thu, 14 Jan 2016 01:27:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=K2pNrjPwUoYq8ez1oQ3eTVTLNu7fbQoT/4vys/MHR5Q=; b=G3MddVMd2EQ0QpJxmu54yooeRhkjhF9bCh+fTZQkaGRYBDNk5HM0DYPmVDL7V6SOze FjogHXuAYDyUydemlRn/X9IkW3PDZnjy52c2xY8HqCwq8zqv6z0Gj7tPdGvnUpLXmHcJ 0gWv8qWDRaTOsThw3We6mfJp5j4byB1+l1uIaCTYpheDjqzH9qhud4dOdBgiXeXJ0aSS W+ku5x2TQdxk1AvzC8V3M3DPXfK4xJEs/ahg/Kl69PIaX2dz0AuFkphGXda0M5spRWXN U4y5F0E4FVw2orvdtmD96C/qNCYozD2LQF7ngu3YBo7AYreFiocqKIWXEMQy6OzSrNFj eouQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=K2pNrjPwUoYq8ez1oQ3eTVTLNu7fbQoT/4vys/MHR5Q=; b=RopUPeOSHs4VpukNuNd6apEGSbJbB3aQmeIKlJKoMpK8WeC7zw0sVVTMvRgqj1nI9y O6KpsBTMK7N78QBkUBBcFjZnAZfh94HsvvJI8LQJVAsP6UBmkuHM3BQVW4idPW8O14s5 PzeNewCmHWLnU+BabY+ja/M5TUfJt2tTv9DF6PU+C+RCl2VtVf545uvFNylm/MB3WgFP sv1lsgQrm+9AKJF1wUtVHAfGz1IYj9ukrzHc/tQGZvscj+3dpL4wmPMx2g1hotR1on4j Icc7VKEs9Pa9k5bIpVzfTC5ls7zi0xPansF+d05w8yCHHbLQ8tH5AdQAiEC+iBD4TzbE oz9g== X-Gm-Message-State: ALoCoQn3ENFQf5j60FPS2hqkIEJsKO0bjF/+98prduAF+ZcR3bUEboCUdO+g10x7Xxusgwk/OjTXIqGETd9FdKatcH/x14cyLw== X-Received: by 10.202.197.82 with SMTP id v79mr2013628oif.60.1452763675609; Thu, 14 Jan 2016 01:27:55 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:f478:ccdc:ca0f:26df? ([2601:601:800:126d:f478:ccdc:ca0f:26df]) by smtp.gmail.com with ESMTPSA id y9sm3110066obg.4.2016.01.14.01.27.53 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jan 2016 01:27:54 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293903 - in head/sys/boot: arm/uboot efi/fdt efi/libefi From: NGie Cooper In-Reply-To: <201601140922.u0E9M1rV025146@repo.freebsd.org> Date: Thu, 14 Jan 2016 01:27:51 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201601140922.u0E9M1rV025146@repo.freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:27:56 -0000 > On Jan 14, 2016, at 01:22, Steven Hartland wrote: >=20 > Author: smh > Date: Thu Jan 14 09:22:01 2016 > New Revision: 293903 > URL: https://svnweb.freebsd.org/changeset/base/293903 >=20 > Log: > Fix GCC warnings causing build failure after r293724 >=20 > Disable some compiler warnings for GCC (non-standard compiler) fixing > build failures introduced by r293724, which enabled WARNS in the EFI = boot > code, when compiling with none standard compiler (GCC). Disabling warnings is wrong. Here=E2=80=99s how arm could be fixed: $ svn diff sys/boot/ Index: sys/boot/common/bootstrap.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/boot/common/bootstrap.h (revision 293877) +++ sys/boot/common/bootstrap.h (working copy) @@ -32,6 +32,7 @@ #include #include #include +#include =20 /* * Generic device specifier; architecture-dependant=20 @@ -332,12 +333,8 @@ extern struct arch_switch archsw; =20 /* This must be provided by the MD code, but should it be in the = archsw? */ -void delay(int delay); - void dev_cleanup(void); =20 -time_t time(time_t *tloc); - #ifndef CTASSERT /* Allow lint to override */ #define CTASSERT(x) _CTASSERT(x, __LINE__) #define _CTASSERT(x, y) __CTASSERT(x, y) Index: sys/boot/efi/include/efiapi.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/boot/efi/include/efiapi.h (revision 293877) +++ sys/boot/efi/include/efiapi.h (working copy) @@ -532,6 +532,7 @@ typedef EFI_STATUS (EFIAPI *EFI_RESERVED_SERVICE) ( + VOID ); =20 typedef amd64 is a bit trickier: /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/efigop.h:75: = warning: 'ms_abi' attribute directive ignored I didn=E2=80=99t dig into why this is happening [yet], other than there = maybe being MS extensions involved? Thanks, -NGie= From owner-svn-src-head@freebsd.org Thu Jan 14 09:46:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15EF9A80096 for ; Thu, 14 Jan 2016 09:46:16 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A975A116B for ; Thu, 14 Jan 2016 09:46:15 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x230.google.com with SMTP id b14so420040165wmb.1 for ; Thu, 14 Jan 2016 01:46:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=eIwBR28lDYcB+FV0fc2NYn8w3wQT1r3VlgDTEyKTsz8=; b=Tv9A/euF12JMTNswLiFVPkih3xvg/Z5ZZvAn3erY/EJPMStxryLwmHX8qMamy1rpt+ iCp0yipw2xeKipga5WJq7unU3HHitag4QF5ZfSCz0G1BwzTV6xY0VacKugzpLOr7NNXh meQ+ybCAzRPmlpzSpzt4O6XeXz0lum4s5PhVvdc79DEcLSLND0knF5duunTo+B54lwty UyIN0D1BBK3I+4Ygpyizvo8ykLpm7OVYqKJ+vulntIbzgCbXveDnThpDwmlsHez59oSt olfaLgcM350mqZOQu8U/O8fe+j8sn3rmiL20a+EaNVsCooRu9aKiT3gLOiwHDHNz5Uqd gvdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=eIwBR28lDYcB+FV0fc2NYn8w3wQT1r3VlgDTEyKTsz8=; b=WtBN10/WdiMsySvnfmkzD0LE/DlODhLIOKMzKM2WJmiheQrVY1M2xiXnhVarz2BLJg OXXsmNzLj1JdM+Tw9J8ttO/0z0rvk06zzvt/5khardyM2vCQi5Fy7lbclvdikKR/2qB8 x8qF8t5aZTvp75tRIn74BgrxrM0g5zUL4RmRIT2ukRUtR30iZC/Jw9AYWN1td59EZvj4 zs62Sk2fjnFJiTkPSNVEqMeQ1REeuZhu7PVk1P8rQd8VVEOr0aktMf+1e3SWD4KLS8Mu efd/svjSJcT+ZhXNRcO73tT1q3LIH59uvbpLEjDzPscHDjtM1i4Yrwazca63NlqirAqr eGHg== X-Gm-Message-State: AG10YOR+z37qKalBctHyOhLCxyl+gImuRpYLVtlhq6fhickC58/q353EJxKWZa65PJQVvCzz X-Received: by 10.194.188.100 with SMTP id fz4mr862243wjc.126.1452764773361; Thu, 14 Jan 2016 01:46:13 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id z127sm26105926wme.2.2016.01.14.01.46.11 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jan 2016 01:46:12 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r293903 - in head/sys/boot: arm/uboot efi/fdt efi/libefi To: NGie Cooper References: <201601140922.u0E9M1rV025146@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <56976E76.3000604@freebsd.org> Date: Thu, 14 Jan 2016 09:46:30 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:46:16 -0000 On 14/01/2016 09:27, NGie Cooper wrote: >> On Jan 14, 2016, at 01:22, Steven Hartland wrote: >> >> Author: smh >> Date: Thu Jan 14 09:22:01 2016 >> New Revision: 293903 >> URL: https://svnweb.freebsd.org/changeset/base/293903 >> >> Log: >> Fix GCC warnings causing build failure after r293724 >> >> Disable some compiler warnings for GCC (non-standard compiler) fixing >> build failures introduced by r293724, which enabled WARNS in the EFI boot >> code, when compiling with none standard compiler (GCC). > Disabling warnings is wrong. Here’s how arm could be fixed: > > $ svn diff sys/boot/ > Index: sys/boot/common/bootstrap.h > =================================================================== > --- sys/boot/common/bootstrap.h (revision 293877) > +++ sys/boot/common/bootstrap.h (working copy) > @@ -32,6 +32,7 @@ > #include > #include > #include > +#include > > /* > * Generic device specifier; architecture-dependant > @@ -332,12 +333,8 @@ > extern struct arch_switch archsw; > > /* This must be provided by the MD code, but should it be in the archsw? */ > -void delay(int delay); > - > void dev_cleanup(void); > > -time_t time(time_t *tloc); > - > #ifndef CTASSERT /* Allow lint to override */ > #define CTASSERT(x) _CTASSERT(x, __LINE__) > #define _CTASSERT(x, y) __CTASSERT(x, y) > Index: sys/boot/efi/include/efiapi.h > =================================================================== > --- sys/boot/efi/include/efiapi.h (revision 293877) > +++ sys/boot/efi/include/efiapi.h (working copy) > @@ -532,6 +532,7 @@ > typedef > EFI_STATUS > (EFIAPI *EFI_RESERVED_SERVICE) ( > + VOID > ); > > typedef > > amd64 is a bit trickier: > > /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/efigop.h:75: warning: 'ms_abi' attribute directive ignored > > I didn’t dig into why this is happening [yet], other than there maybe being MS extensions involved? > Thanks for that Garret, as Ian confirmed this change fixed his immediate issue I went with it, after confirming with a full GCC tinderbox of course. I agree your changes are more correct, however I don't have an build resource ATM, so if you have time / resources to confirm they work correctly with a full CLANG and GCC tinderbox please feel LMK and I'll get it committed :) If you don't get chance before the end of the week, I'll have build resource available and will look to test then, hope this is OK? Regards Steve From owner-svn-src-head@freebsd.org Thu Jan 14 09:47:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC0A6A8018E; Thu, 14 Jan 2016 09:47:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ob0-x236.google.com (mail-ob0-x236.google.com [IPv6:2607:f8b0:4003:c01::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B095A13C5; Thu, 14 Jan 2016 09:47:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ob0-x236.google.com with SMTP id ba1so488710379obb.3; Thu, 14 Jan 2016 01:47:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=lhlFJ89z+I4BuIBNLmiEgmZZe73RzVAL6sUc+7BKzso=; b=yPLvBvcHa042QRkvK/mJ5DVw+aYeUI9nlabiTzLWEjMh0xArAFqP60zk4FXJuBc2c8 8pjRouY6ez7h2B9Lpg6+cr0/27zgDeF6Or0nPi4gw2u49DOVX6AXMXaSQd43Mueq3SBA nlJkwhwAVt638qKHjfnFVSfv53ZL0Be1dS2jWtWLk+qWRYL8Up7iPcVJfPY5iGQCp1AC Hza8p/rxjn3MS5KlucfuOSoFNlL8qNktd2Ls3ooxcq/6TRr5mbH1PQXiWFm3bsOi5Ubv vDzykglwp1yAks22exUbGpgozmmopANwmIIjLNXKuM2lx8aR4cl2hC5Q9kFzTfW8Mw/q gRJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=lhlFJ89z+I4BuIBNLmiEgmZZe73RzVAL6sUc+7BKzso=; b=EzbOZGX3osk3bwkeAITW5e5dYB9BgpuHWLc84j8hJFsQY8qmyAjjHcCN+aRM5D/p8i 62jBt9uuIGVYkV5v75Pjx6GJtdHUNyV4ydtki/uPHqmClbP+4VOQ8Q6roFJVf1LC9osG atH38WSXWWginocxTQf/quzv2STZu6oYi5aFQ9AIjADY4r/RBl3JF5/Pp8VEDgCZG8gE SE0HR72tsWOXfrLuIPeotDOUHj6F7XGH1PDqZknob6/dAzxQ+3lbQD2rjvGo1KUJUok5 1evE93+QPTxNb8hNmTRpXsH+LV0YsOfcIGTU2gp+QAkWDzMykNJlCMthA2U00Zj1ttbZ aDRQ== X-Gm-Message-State: ALoCoQkxlP6kMg3PYUrDlEp+1g48rYwdNvYQ5GpLureRLwc4SD04bJSF8rF5yD55GuQumy+g9fwbMtrdDuyll/ryonNCO281Xg== X-Received: by 10.182.242.4 with SMTP id wm4mr2249086obc.85.1452764873993; Thu, 14 Jan 2016 01:47:53 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:f478:ccdc:ca0f:26df? ([2601:601:800:126d:f478:ccdc:ca0f:26df]) by smtp.gmail.com with ESMTPSA id w143sm3113332oiw.16.2016.01.14.01.47.52 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jan 2016 01:47:52 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293903 - in head/sys/boot: arm/uboot efi/fdt efi/libefi From: NGie Cooper In-Reply-To: Date: Thu, 14 Jan 2016 01:47:50 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9A7534C4-0A2C-4DAC-981A-09868F1723DA@gmail.com> References: <201601140922.u0E9M1rV025146@repo.freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:47:55 -0000 > On Jan 14, 2016, at 01:27, NGie Cooper wrote: >=20 >=20 >> On Jan 14, 2016, at 01:22, Steven Hartland wrote: >>=20 >> Author: smh >> Date: Thu Jan 14 09:22:01 2016 >> New Revision: 293903 >> URL: https://svnweb.freebsd.org/changeset/base/293903 >>=20 >> Log: >> Fix GCC warnings causing build failure after r293724 >>=20 >> Disable some compiler warnings for GCC (non-standard compiler) fixing >> build failures introduced by r293724, which enabled WARNS in the EFI = boot >> code, when compiling with none standard compiler (GCC). >=20 > Disabling warnings is wrong. Here=E2=80=99s how arm could be fixed: >=20 > $ svn diff sys/boot/ > Index: sys/boot/common/bootstrap.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/boot/common/bootstrap.h (revision 293877) > +++ sys/boot/common/bootstrap.h (working copy) > @@ -32,6 +32,7 @@ > #include > #include > #include > +#include >=20 > /* > * Generic device specifier; architecture-dependant=20 > @@ -332,12 +333,8 @@ > extern struct arch_switch archsw; >=20 > /* This must be provided by the MD code, but should it be in the = archsw? */ > -void delay(int delay); > - > void dev_cleanup(void); >=20 > -time_t time(time_t *tloc); > - > #ifndef CTASSERT /* Allow lint to override */ > #define CTASSERT(x) _CTASSERT(x, __LINE__) > #define _CTASSERT(x, y) __CTASSERT(x, y) > Index: sys/boot/efi/include/efiapi.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/boot/efi/include/efiapi.h (revision 293877) > +++ sys/boot/efi/include/efiapi.h (working copy) > @@ -532,6 +532,7 @@ > typedef > EFI_STATUS > (EFIAPI *EFI_RESERVED_SERVICE) ( > + VOID > ); >=20 > typedef >=20 > amd64 is a bit trickier: >=20 > /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/efigop.h:75: = warning: 'ms_abi' attribute directive ignored >=20 > I didn=E2=80=99t dig into why this is happening [yet], other than = there maybe being MS extensions involved? >=20 > Thanks, > -NGie This might fix amd64: Index: = /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/amd64/efibind.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/amd64/efibind.h = (revision 293877) +++ /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/amd64/efibind.h = (working copy) @@ -160,8 +160,10 @@ // =20 #ifdef __amd64__ +#if defined(__clang__) && (__clang_major__ >=3D 3 && __clang_minor__ >=3D= 5) #define EFIAPI __attribute__((ms_abi)) #endif +#endif =20 #ifndef EFIAPI // Forces EFI calling conventions = reguardless of compiler options=20 #ifdef _MSC_EXTENSIONS From owner-svn-src-head@freebsd.org Thu Jan 14 09:58:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E13ADA80673 for ; Thu, 14 Jan 2016 09:58:29 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 805161AF3 for ; Thu, 14 Jan 2016 09:58:29 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x235.google.com with SMTP id l65so333666022wmf.1 for ; Thu, 14 Jan 2016 01:58:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=fR216apaZOyHWW+fqryXEWNnqod7dqCK+YkcrlcuaVE=; b=D797hZ74n1unU0q5Fq+xMyNhAvE5iRIP9FPPfJiuhpD2ib9V86tazB73ULf365FKxM ntqmJ1/nPh3s/PFudvw7vvTEm84d28jvHAirkoWn5+34AxFOm+FjHtd/BKHGQgjfO+aw N+g2d2GUT6fP9A9TfDUq0R49070JFIpqeNi+VQPih/cfylfkuJVSIyShgMlH8Fbcmm0J L2DBuInsgDan9+FZScc38hjBhnX83IS77+pwFW7NGAUYSI9k+mhXm4OB8HVE/rpoxNd0 Xe2rsBXxXlbnWMzbEkVZ1KjCqqLwT7QuZP9qUBW+rm2cF2T6DPCZwRaVEIDsQ/zVoxQQ GPbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=fR216apaZOyHWW+fqryXEWNnqod7dqCK+YkcrlcuaVE=; b=btprb3F1dPKBoBfdMsY2ePW6v9Gf5T1qDNWXyBS85NcN02AfVJpu06BhwvVSEWfI89 i1Huz1Bq+SdATdJg+uINyNovpQbCzQAq7cDnoj8q9et+auz1u6qIlO+PY0/hhb9Y/wYs WoN/5PebQzg5yb2bzTu3aPabKJ4/03G6Mz0txUZF7418+6ap04wsuqS9WXt++Lrrrdig 938kqMEwznbD/Kc6CdswJIAxAB/e3qQ5oxbanFMOjDNLq/zX5ImuQRLFy1RPpQT1Vnyr x2okq0iQFGWF7cr1OpcThZN8phtMMwdlm10o+jWN/p9zgrIRm+t77O1pw4dI9y6ccSkQ WC0A== X-Gm-Message-State: ALoCoQl8qjTS7QbgISTBGWkNVaItjLJ614BCvr0ewy8Ky67CU3JOp+U4fqB9mUjAPzGgOr7Nh7SEvWRkDnuRAPzBXHmQ1I8OuQ== X-Received: by 10.194.92.8 with SMTP id ci8mr3027296wjb.33.1452765507926; Thu, 14 Jan 2016 01:58:27 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id l67sm26026386wmf.11.2016.01.14.01.58.26 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jan 2016 01:58:27 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r293903 - in head/sys/boot: arm/uboot efi/fdt efi/libefi To: NGie Cooper References: <201601140922.u0E9M1rV025146@repo.freebsd.org> <9A7534C4-0A2C-4DAC-981A-09868F1723DA@gmail.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <56977155.3040507@freebsd.org> Date: Thu, 14 Jan 2016 09:58:45 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <9A7534C4-0A2C-4DAC-981A-09868F1723DA@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 09:58:30 -0000 On 14/01/2016 09:47, NGie Cooper wrote: >> On Jan 14, 2016, at 01:27, NGie Cooper wrote: >> >> >>> On Jan 14, 2016, at 01:22, Steven Hartland wrote: >>> >>> Author: smh >>> Date: Thu Jan 14 09:22:01 2016 >>> New Revision: 293903 >>> URL: https://svnweb.freebsd.org/changeset/base/293903 >>> >>> Log: >>> Fix GCC warnings causing build failure after r293724 >>> >>> Disable some compiler warnings for GCC (non-standard compiler) fixing >>> build failures introduced by r293724, which enabled WARNS in the EFI boot >>> code, when compiling with none standard compiler (GCC). >> Disabling warnings is wrong. Here’s how arm could be fixed: >> >> $ svn diff sys/boot/ >> Index: sys/boot/common/bootstrap.h >> =================================================================== >> --- sys/boot/common/bootstrap.h (revision 293877) >> +++ sys/boot/common/bootstrap.h (working copy) >> @@ -32,6 +32,7 @@ >> #include >> #include >> #include >> +#include >> >> /* >> * Generic device specifier; architecture-dependant >> @@ -332,12 +333,8 @@ >> extern struct arch_switch archsw; >> >> /* This must be provided by the MD code, but should it be in the archsw? */ >> -void delay(int delay); >> - >> void dev_cleanup(void); >> >> -time_t time(time_t *tloc); >> - >> #ifndef CTASSERT /* Allow lint to override */ >> #define CTASSERT(x) _CTASSERT(x, __LINE__) >> #define _CTASSERT(x, y) __CTASSERT(x, y) >> Index: sys/boot/efi/include/efiapi.h >> =================================================================== >> --- sys/boot/efi/include/efiapi.h (revision 293877) >> +++ sys/boot/efi/include/efiapi.h (working copy) >> @@ -532,6 +532,7 @@ >> typedef >> EFI_STATUS >> (EFIAPI *EFI_RESERVED_SERVICE) ( >> + VOID >> ); >> >> typedef >> >> amd64 is a bit trickier: >> >> /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/efigop.h:75: warning: 'ms_abi' attribute directive ignored >> >> I didn’t dig into why this is happening [yet], other than there maybe being MS extensions involved? >> >> Thanks, >> -NGie > This might fix amd64: > > Index: /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/amd64/efibind.h > =================================================================== > --- /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/amd64/efibind.h (revision 293877) > +++ /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/amd64/efibind.h (working copy) > @@ -160,8 +160,10 @@ > // > > #ifdef __amd64__ > +#if defined(__clang__) && (__clang_major__ >= 3 && __clang_minor__ >= 5) > #define EFIAPI __attribute__((ms_abi)) > #endif > +#endif > > #ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options > #ifdef _MSC_EXTENSIONS > Other implementations I've seen for this only define that when it's compiling with MS VCC, so that might be the more correct fix? From owner-svn-src-head@freebsd.org Thu Jan 14 10:09:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FB39A819AF; Thu, 14 Jan 2016 10:09:07 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA53D1CC4; Thu, 14 Jan 2016 10:09:06 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EA95XS037647; Thu, 14 Jan 2016 10:09:05 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EA95xM037646; Thu, 14 Jan 2016 10:09:05 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601141009.u0EA95xM037646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 14 Jan 2016 10:09:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293905 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 10:09:07 -0000 Author: smh Date: Thu Jan 14 10:09:05 2016 New Revision: 293905 URL: https://svnweb.freebsd.org/changeset/base/293905 Log: Allow file specific user-specified flag overrides Allow user-specified warning flag overrides for specific files under bsd.sys.mk, in the same way kern.mk does. This will to be used by future commits. MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Thu Jan 14 10:08:58 2016 (r293904) +++ head/share/mk/bsd.sys.mk Thu Jan 14 10:09:05 2016 (r293905) @@ -164,10 +164,11 @@ SSP_CFLAGS?= -fstack-protector CFLAGS+= ${SSP_CFLAGS} .endif # SSP && !ARM && !MIPS -# Allow user-specified additional warning flags, plus compiler specific flag overrides. -# Unless we've overriden this... +# Allow user-specified additional warning flags, plus compiler and file +# specific flag overrides, unless we've overriden this... .if ${MK_WARNS} != "no" CFLAGS+= ${CWARNFLAGS} ${CWARNFLAGS.${COMPILER_TYPE}} +CFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} .endif CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} From owner-svn-src-head@freebsd.org Thu Jan 14 10:11:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E049A81D6B; Thu, 14 Jan 2016 10:11:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EAF4145A; Thu, 14 Jan 2016 10:11:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EABAhb038285; Thu, 14 Jan 2016 10:11:10 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EABAtg038284; Thu, 14 Jan 2016 10:11:10 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601141011.u0EABAtg038284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 14 Jan 2016 10:11:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293906 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 10:11:12 -0000 Author: glebius Date: Thu Jan 14 10:11:10 2016 New Revision: 293906 URL: https://svnweb.freebsd.org/changeset/base/293906 Log: Verify the packet length in sctp6_input(). The sctp6_ctlinput() function does not properly check the length of the packet it receives from the ICMP6 input routine. This means that an attacker can craft a packet that will cause a kernel panic. When the kernel receives an ICMP6 error message with one of the types/codes it handles, it calls icmp6_notify_error() to deliver it to the upper-level protocol. icmp6_notify_error() cycles through the extension headers (if any) to find the protocol number of the first non-extension header. It does NOT verify the length of the non-extension header. It passes information about the packet (including the actual packet) to the upper-level protocol's pr_ctlinput function. In the case of SCTP for IPv6, icmp6_notify_error() calls sctp6_ctlinput(). sctp6_ctlinput() assumes that the incoming packet contains a sufficiently-long SCTP header and calls m_copydata() to extract a copy of that header. In turn, m_copydata() assumes that the caller has already verified that the offset and length parameters are correct. If they are incorrect, it will dereference a NULL pointer and cause a kernel panic. In short, no one is sufficiently verifying the input, and the result is a kernel panic. Submitted by: jtl Security: SA-16:01.sctp Modified: head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Thu Jan 14 10:09:05 2016 (r293905) +++ head/sys/netinet6/sctp6_usrreq.c Thu Jan 14 10:11:10 2016 (r293906) @@ -379,7 +379,6 @@ sctp6_ctlinput(int cmd, struct sockaddr * XXX: We assume that when IPV6 is non NULL, M and OFF are * valid. */ - /* check if we can safely examine src and dst ports */ struct sctp_inpcb *inp = NULL; struct sctp_tcb *stcb = NULL; struct sctp_nets *net = NULL; @@ -388,6 +387,10 @@ sctp6_ctlinput(int cmd, struct sockaddr if (ip6cp->ip6c_m == NULL) return; + /* Check if we can safely examine the SCTP header. */ + if (ip6cp->ip6c_m->m_pkthdr.len < ip6cp->ip6c_off + sizeof(sh)) + return; + bzero(&sh, sizeof(sh)); bzero(&final, sizeof(final)); inp = NULL; From owner-svn-src-head@freebsd.org Thu Jan 14 10:13:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4CDCA826DC; Thu, 14 Jan 2016 10:13:45 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id A4E141CE2; Thu, 14 Jan 2016 10:13:45 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (bcdd4360.skybroadband.com [188.221.67.96]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 9ED85D7A17; Thu, 14 Jan 2016 10:13:44 +0000 (UTC) Date: Thu, 14 Jan 2016 10:13:43 +0000 From: Andrew Turner To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293903 - in head/sys/boot: arm/uboot efi/fdt efi/libefi Message-ID: <20160114101343.70e73d01@zapp> In-Reply-To: <201601140922.u0E9M1rV025146@repo.freebsd.org> References: <201601140922.u0E9M1rV025146@repo.freebsd.org> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/XbyyDAsBdNwk+1EzeNlt40n" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 10:13:45 -0000 --MP_/XbyyDAsBdNwk+1EzeNlt40n Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Thu, 14 Jan 2016 09:22:01 +0000 (UTC) Steven Hartland wrote: > Author: smh > Date: Thu Jan 14 09:22:01 2016 > New Revision: 293903 > URL: https://svnweb.freebsd.org/changeset/base/293903 > > Log: > Fix GCC warnings causing build failure after r293724 > > Disable some compiler warnings for GCC (non-standard compiler) > fixing build failures introduced by r293724, which enabled WARNS in > the EFI boot code, when compiling with none standard compiler (GCC). > > Raised by: ian > MFC after: 2 weeks > X-MFC-With: r293268 > Sponsored by: Multiplay The attached would be a better (however untested) solution. Given we don't build boot1.efi or loader.efi with gcc it extends this to all the EFI code. Andrew --MP_/XbyyDAsBdNwk+1EzeNlt40n Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=efi_no_gcc.diff Index: sys/boot/efi/Makefile =================================================================== --- sys/boot/efi/Makefile (revision 293737) +++ sys/boot/efi/Makefile (working copy) @@ -2,6 +2,9 @@ .include +# In-tree GCC does not support __attribute__((ms_abi)). +.if ${COMPILER_TYPE} != "gcc" + SUBDIR= libefi .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" @@ -16,4 +19,6 @@ SUBDIR+= loader boot1 .endif +.endif # ${COMPILER_TYPE} != "gcc" + .include Index: sys/boot/efi/boot1/Makefile =================================================================== --- sys/boot/efi/boot1/Makefile (revision 293737) +++ sys/boot/efi/boot1/Makefile (working copy) @@ -4,9 +4,6 @@ .include -# In-tree GCC does not support __attribute__((ms_abi)). -.if ${COMPILER_TYPE} != "gcc" - MK_SSP= no PROG= boot1.sym @@ -96,8 +93,6 @@ CLEANFILES= boot1.efi boot1.efifat -.endif # ${COMPILER_TYPE} != "gcc" - .include beforedepend ${OBJS}: machine Index: sys/boot/efi/loader/Makefile =================================================================== --- sys/boot/efi/loader/Makefile (revision 293737) +++ sys/boot/efi/loader/Makefile (working copy) @@ -4,9 +4,6 @@ .include -# In-tree GCC does not support __attribute__((ms_abi)). -.if ${COMPILER_TYPE} != "gcc" - MK_SSP= no PROG= loader.sym @@ -113,8 +110,6 @@ ${LDSCRIPT} LDADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSTAND} -.endif # ${COMPILER_TYPE} != "gcc" - .include beforedepend ${OBJS}: machine --MP_/XbyyDAsBdNwk+1EzeNlt40n-- From owner-svn-src-head@freebsd.org Thu Jan 14 10:14:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FB65A827A0; Thu, 14 Jan 2016 10:14:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 292A21E65; Thu, 14 Jan 2016 10:14:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EADx4W040356; Thu, 14 Jan 2016 10:13:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EADwXU040352; Thu, 14 Jan 2016 10:13:58 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601141013.u0EADwXU040352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 14 Jan 2016 10:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293907 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 10:14:00 -0000 Author: glebius Date: Thu Jan 14 10:13:58 2016 New Revision: 293907 URL: https://svnweb.freebsd.org/changeset/base/293907 Log: Change linux get_robust_list system call to match actual linux one. The set_robust_list system call request the kernel to record the head of the list of robust futexes owned by the calling thread. The head argument is the list head to record. The get_robust_list system call should return the head of the robust list of the thread whose thread id is specified in pid argument. The list head should be stored in the location pointed to by head argument. In contrast, our implemenattion of get_robust_list system call copies the known portion of memory pointed by recorded in set_robust_list system call pointer to the head of the robust list to the location pointed by head argument. So, it is possible for a local attacker to read portions of kernel memory, which may result in a privilege escalation. Submitted by: mjg Security: SA-16:03.linux Modified: head/sys/amd64/linux/syscalls.master head/sys/amd64/linux32/syscalls.master head/sys/compat/linux/linux_futex.c head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux/syscalls.master ============================================================================== --- head/sys/amd64/linux/syscalls.master Thu Jan 14 10:11:10 2016 (r293906) +++ head/sys/amd64/linux/syscalls.master Thu Jan 14 10:13:58 2016 (r293907) @@ -461,8 +461,8 @@ 272 AUE_NULL STD { int linux_unshare(void); } 273 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ l_size_t len); } -274 AUE_NULL STD { int linux_get_robust_list(l_int pid, struct linux_robust_list_head *head, \ - l_size_t *len); } +274 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ + struct linux_robust_list_head **head, l_size_t *len); } 275 AUE_NULL STD { int linux_splice(void); } 276 AUE_NULL STD { int linux_tee(void); } 277 AUE_NULL STD { int linux_sync_file_range(void); } Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Thu Jan 14 10:11:10 2016 (r293906) +++ head/sys/amd64/linux32/syscalls.master Thu Jan 14 10:13:58 2016 (r293907) @@ -520,8 +520,8 @@ ; linux 2.6.17: 311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ l_size_t len); } -312 AUE_NULL STD { int linux_get_robust_list(l_int pid, struct linux_robust_list_head *head, \ - l_size_t *len); } +312 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ + struct linux_robust_list_head **head, l_size_t *len); } 313 AUE_NULL STD { int linux_splice(void); } 314 AUE_NULL STD { int linux_sync_file_range(void); } 315 AUE_NULL STD { int linux_tee(void); } Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Thu Jan 14 10:11:10 2016 (r293906) +++ head/sys/compat/linux/linux_futex.c Thu Jan 14 10:13:58 2016 (r293907) @@ -1131,7 +1131,7 @@ linux_get_robust_list(struct thread *td, return (EFAULT); } - error = copyout(head, args->head, sizeof(struct linux_robust_list_head)); + error = copyout(&head, args->head, sizeof(head)); if (error) { LIN_SDT_PROBE1(futex, linux_get_robust_list, copyout_error, error); Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Thu Jan 14 10:11:10 2016 (r293906) +++ head/sys/i386/linux/syscalls.master Thu Jan 14 10:13:58 2016 (r293907) @@ -528,8 +528,8 @@ ; linux 2.6.17: 311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ l_size_t len); } -312 AUE_NULL STD { int linux_get_robust_list(l_int pid, struct linux_robust_list_head **head, \ - l_size_t *len); } +312 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ + struct linux_robust_list_head **head, l_size_t *len); } 313 AUE_NULL STD { int linux_splice(void); } 314 AUE_NULL STD { int linux_sync_file_range(void); } 315 AUE_NULL STD { int linux_tee(void); } From owner-svn-src-head@freebsd.org Thu Jan 14 10:15:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57968A82B55; Thu, 14 Jan 2016 10:15:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 187BA1179; Thu, 14 Jan 2016 10:15:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EAFNuN040464; Thu, 14 Jan 2016 10:15:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EAFL31040450; Thu, 14 Jan 2016 10:15:21 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601141015.u0EAFL31040450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 14 Jan 2016 10:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293908 - in head/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 10:15:24 -0000 Author: glebius Date: Thu Jan 14 10:15:21 2016 New Revision: 293908 URL: https://svnweb.freebsd.org/changeset/base/293908 Log: Regen after r293907. Modified: head/sys/amd64/linux/linux_proto.h head/sys/amd64/linux/linux_syscall.h head/sys/amd64/linux/linux_syscalls.c head/sys/amd64/linux/linux_sysent.c head/sys/amd64/linux/linux_systrace_args.c head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_syscalls.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_syscall.h head/sys/i386/linux/linux_syscalls.c head/sys/i386/linux/linux_sysent.c Modified: head/sys/amd64/linux/linux_proto.h ============================================================================== --- head/sys/amd64/linux/linux_proto.h Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/amd64/linux/linux_proto.h Thu Jan 14 10:15:21 2016 (r293908) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 289769 2015-10-22 21:28:20Z jhb + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius */ #ifndef _LINUX_SYSPROTO_H_ @@ -966,7 +966,7 @@ struct linux_set_robust_list_args { }; struct linux_get_robust_list_args { char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)]; - char head_l_[PADL_(struct linux_robust_list_head *)]; struct linux_robust_list_head * head; char head_r_[PADR_(struct linux_robust_list_head *)]; + char head_l_[PADL_(struct linux_robust_list_head **)]; struct linux_robust_list_head ** head; char head_r_[PADR_(struct linux_robust_list_head **)]; char len_l_[PADL_(l_size_t *)]; l_size_t * len; char len_r_[PADR_(l_size_t *)]; }; struct linux_splice_args { Modified: head/sys/amd64/linux/linux_syscall.h ============================================================================== --- head/sys/amd64/linux/linux_syscall.h Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/amd64/linux/linux_syscall.h Thu Jan 14 10:15:21 2016 (r293908) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 289769 2015-10-22 21:28:20Z jhb + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius */ #define LINUX_SYS_read 0 Modified: head/sys/amd64/linux/linux_syscalls.c ============================================================================== --- head/sys/amd64/linux/linux_syscalls.c Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/amd64/linux/linux_syscalls.c Thu Jan 14 10:15:21 2016 (r293908) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 289769 2015-10-22 21:28:20Z jhb + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius */ const char *linux_syscallnames[] = { Modified: head/sys/amd64/linux/linux_sysent.c ============================================================================== --- head/sys/amd64/linux/linux_sysent.c Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/amd64/linux/linux_sysent.c Thu Jan 14 10:15:21 2016 (r293908) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 289769 2015-10-22 21:28:20Z jhb + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius */ #include Modified: head/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- head/sys/amd64/linux/linux_systrace_args.c Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/amd64/linux/linux_systrace_args.c Thu Jan 14 10:15:21 2016 (r293908) @@ -2020,7 +2020,7 @@ systrace_args(int sysnum, void *params, case 274: { struct linux_get_robust_list_args *p = params; iarg[0] = p->pid; /* l_int */ - uarg[1] = (intptr_t) p->head; /* struct linux_robust_list_head * */ + uarg[1] = (intptr_t) p->head; /* struct linux_robust_list_head ** */ uarg[2] = (intptr_t) p->len; /* l_size_t * */ *n_args = 3; break; @@ -5347,7 +5347,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 1: - p = "struct linux_robust_list_head *"; + p = "struct linux_robust_list_head **"; break; case 2: p = "l_size_t *"; Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/amd64/linux32/linux32_proto.h Thu Jan 14 10:15:21 2016 (r293908) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 289769 2015-10-22 21:28:20Z jhb + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 293907 2016-01-14 10:13:58Z glebius */ #ifndef _LINUX32_SYSPROTO_H_ @@ -1023,7 +1023,7 @@ struct linux_set_robust_list_args { }; struct linux_get_robust_list_args { char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)]; - char head_l_[PADL_(struct linux_robust_list_head *)]; struct linux_robust_list_head * head; char head_r_[PADR_(struct linux_robust_list_head *)]; + char head_l_[PADL_(struct linux_robust_list_head **)]; struct linux_robust_list_head ** head; char head_r_[PADR_(struct linux_robust_list_head **)]; char len_l_[PADL_(l_size_t *)]; l_size_t * len; char len_r_[PADR_(l_size_t *)]; }; struct linux_splice_args { Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/amd64/linux32/linux32_syscall.h Thu Jan 14 10:15:21 2016 (r293908) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 289769 2015-10-22 21:28:20Z jhb + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 293907 2016-01-14 10:13:58Z glebius */ #define LINUX32_SYS_linux_exit 1 Modified: head/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- head/sys/amd64/linux32/linux32_syscalls.c Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/amd64/linux32/linux32_syscalls.c Thu Jan 14 10:15:21 2016 (r293908) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 289769 2015-10-22 21:28:20Z jhb + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 293907 2016-01-14 10:13:58Z glebius */ const char *linux32_syscallnames[] = { Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/amd64/linux32/linux32_sysent.c Thu Jan 14 10:15:21 2016 (r293908) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 289769 2015-10-22 21:28:20Z jhb + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 293907 2016-01-14 10:13:58Z glebius */ #include "opt_compat.h" Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/amd64/linux32/linux32_systrace_args.c Thu Jan 14 10:15:21 2016 (r293908) @@ -2122,7 +2122,7 @@ systrace_args(int sysnum, void *params, case 312: { struct linux_get_robust_list_args *p = params; iarg[0] = p->pid; /* l_int */ - uarg[1] = (intptr_t) p->head; /* struct linux_robust_list_head * */ + uarg[1] = (intptr_t) p->head; /* struct linux_robust_list_head ** */ uarg[2] = (intptr_t) p->len; /* l_size_t * */ *n_args = 3; break; @@ -5551,7 +5551,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 1: - p = "struct linux_robust_list_head *"; + p = "struct linux_robust_list_head **"; break; case 2: p = "l_size_t *"; Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/i386/linux/linux_proto.h Thu Jan 14 10:15:21 2016 (r293908) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 283492 2015-05-24 18:08:01Z dchagin + * created from FreeBSD: head/sys/i386/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius */ #ifndef _LINUX_SYSPROTO_H_ Modified: head/sys/i386/linux/linux_syscall.h ============================================================================== --- head/sys/i386/linux/linux_syscall.h Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/i386/linux/linux_syscall.h Thu Jan 14 10:15:21 2016 (r293908) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 283492 2015-05-24 18:08:01Z dchagin + * created from FreeBSD: head/sys/i386/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius */ #define LINUX_SYS_linux_exit 1 Modified: head/sys/i386/linux/linux_syscalls.c ============================================================================== --- head/sys/i386/linux/linux_syscalls.c Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/i386/linux/linux_syscalls.c Thu Jan 14 10:15:21 2016 (r293908) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 283492 2015-05-24 18:08:01Z dchagin + * created from FreeBSD: head/sys/i386/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius */ const char *linux_syscallnames[] = { Modified: head/sys/i386/linux/linux_sysent.c ============================================================================== --- head/sys/i386/linux/linux_sysent.c Thu Jan 14 10:13:58 2016 (r293907) +++ head/sys/i386/linux/linux_sysent.c Thu Jan 14 10:15:21 2016 (r293908) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 283492 2015-05-24 18:08:01Z dchagin + * created from FreeBSD: head/sys/i386/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius */ #include From owner-svn-src-head@freebsd.org Thu Jan 14 10:16:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF9D3A82D8F for ; Thu, 14 Jan 2016 10:16:21 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56C581454 for ; Thu, 14 Jan 2016 10:16:21 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x235.google.com with SMTP id f206so337041147wmf.0 for ; Thu, 14 Jan 2016 02:16:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=NG8Tvht+JlnjMmvfxjAwEagX+bKd41lINDysYqPYEGk=; b=QQx8QY/utZa8efXV4cktCVI4we/CNnH8M5SlU6ZT3lIEsD1A9IgzJqyg+2uiavIcbk zIXL1wGPvswPI/zclxA6xolaU8+cEEbHG5IXHMcolgp1qXoUFFxaUbmTCHFFnIBvnnQO rfhKqQzWoFN3HkoyNPC0qr4xUmq/+3yTgUeX+qUgF2vQ2Z+vF6mD8NHl18jX/cdziB8q sZsJ2NlX7s03JAhAk05wJVkEnBnwPyHUZxHFaPvq05R0gxmd2H5LFUZg091r8HH/IEMd JgSqiJQDsI2XqR8UnGTvpO0McEY1edx3WxocYnu2Wr4nuhNUIc3aW65NcdlXwuy/GFfw CMLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=NG8Tvht+JlnjMmvfxjAwEagX+bKd41lINDysYqPYEGk=; b=EsMiSqgw7nN3CnoanI/BCCf2oBtI5b5sr0XyA759bYKCAWkgu+HC29xo/bVhsDIgEu EEc4R5BfS4cYiXjQrwBtUG+GGEa7kLDbCcSzs9lJUfKmg2VXpZgJZQnmop+KjkiSdhNz 6MYv0oAyNUb0G333bVvSGb0fVfNGlBHU6FwHiQxWfXRyTS/KVF3lz3vOR0Wq+04LF06h JMwa9gFokmIA9IZKfZ27UUKe6H2WWWSWtdW0XOxcJTAEXLyW6+9yoDbnx+eWKzsFbA/G 5AKqpnJ2rqGgq5jix3znWITbCRSPbjVM1K5nqrsu0w2WQv0Tv08hj6Y561CUffbWpleK X+dg== X-Gm-Message-State: ALoCoQm62YoSzZ7DNTgx7tn/B9U4bwDWm9Gsyv26MSp1EWRi3JNXOE8MVcylAmfm1mMzrDEQEySYR83wYS51qtwbq+Lzew16MA== X-Received: by 10.28.68.68 with SMTP id r65mr4067567wma.95.1452766579894; Thu, 14 Jan 2016 02:16:19 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id k130sm6607074wmg.6.2016.01.14.02.16.18 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jan 2016 02:16:18 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r293903 - in head/sys/boot: arm/uboot efi/fdt efi/libefi To: Andrew Turner References: <201601140922.u0E9M1rV025146@repo.freebsd.org> <20160114101343.70e73d01@zapp> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <56977585.4020100@freebsd.org> Date: Thu, 14 Jan 2016 10:16:37 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160114101343.70e73d01@zapp> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 10:16:21 -0000 On 14/01/2016 10:13, Andrew Turner wrote: > On Thu, 14 Jan 2016 09:22:01 +0000 (UTC) > Steven Hartland wrote: > >> Author: smh >> Date: Thu Jan 14 09:22:01 2016 >> New Revision: 293903 >> URL: https://svnweb.freebsd.org/changeset/base/293903 >> >> Log: >> Fix GCC warnings causing build failure after r293724 >> >> Disable some compiler warnings for GCC (non-standard compiler) >> fixing build failures introduced by r293724, which enabled WARNS in >> the EFI boot code, when compiling with none standard compiler (GCC). >> >> Raised by: ian >> MFC after: 2 weeks >> X-MFC-With: r293268 >> Sponsored by: Multiplay > The attached would be a better (however untested) solution. Given we > don't build boot1.efi or loader.efi with gcc it extends this to all the > EFI code. > > Andrew Not sure I like that idea as it would prevent people using EFI from having a working system if they also choose GCC. From owner-svn-src-head@freebsd.org Thu Jan 14 10:16:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B9E5A82DE3; Thu, 14 Jan 2016 10:16:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D27EE14ED; Thu, 14 Jan 2016 10:16:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EAGPCq040545; Thu, 14 Jan 2016 10:16:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EAGP8v040542; Thu, 14 Jan 2016 10:16:25 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601141016.u0EAGP8v040542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 14 Jan 2016 10:16:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293909 - in head/sys: compat/linux kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 10:16:27 -0000 Author: glebius Date: Thu Jan 14 10:16:25 2016 New Revision: 293909 URL: https://svnweb.freebsd.org/changeset/base/293909 Log: Call crextend() before copying old credentials to the new credentials and replace crcopysafe by crcopy as crcopysafe is is not intended to be safe in a threaded environment, it drops PROC_LOCK() in while() that can lead to unexpected results, such as overwrite kernel memory. In my POV crcopysafe() needs special attention. For now I do not see any problems with this function, but who knows. Submitted by: dchagin Found by: trinity Security: SA-16:04.linux Modified: head/sys/compat/linux/linux_misc.c head/sys/kern/kern_prot.c head/sys/sys/ucred.h Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Thu Jan 14 10:15:21 2016 (r293908) +++ head/sys/compat/linux/linux_misc.c Thu Jan 14 10:16:25 2016 (r293909) @@ -1304,9 +1304,11 @@ linux_setgroups(struct thread *td, struc if (error) goto out; newcred = crget(); + crextend(newcred, ngrp + 1); p = td->td_proc; PROC_LOCK(p); - oldcred = crcopysafe(p, newcred); + oldcred = p->p_ucred; + crcopy(newcred, oldcred); /* * cr_groups[0] holds egid. Setting the whole set from Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Thu Jan 14 10:15:21 2016 (r293908) +++ head/sys/kern/kern_prot.c Thu Jan 14 10:16:25 2016 (r293909) @@ -88,7 +88,6 @@ static MALLOC_DEFINE(M_CRED, "cred", "cr SYSCTL_NODE(_security, OID_AUTO, bsd, CTLFLAG_RW, 0, "BSD security policy"); -static void crextend(struct ucred *cr, int n); static void crsetgroups_locked(struct ucred *cr, int ngrp, gid_t *groups); @@ -1997,7 +1996,7 @@ crcopysafe(struct proc *p, struct ucred /* * Extend the passed in credential to hold n items. */ -static void +void crextend(struct ucred *cr, int n) { int cnt; Modified: head/sys/sys/ucred.h ============================================================================== --- head/sys/sys/ucred.h Thu Jan 14 10:15:21 2016 (r293908) +++ head/sys/sys/ucred.h Thu Jan 14 10:16:25 2016 (r293909) @@ -105,6 +105,7 @@ void change_svuid(struct ucred *newcred, void crcopy(struct ucred *dest, struct ucred *src); struct ucred *crcopysafe(struct proc *p, struct ucred *cr); struct ucred *crdup(struct ucred *cr); +void crextend(struct ucred *cr, int n); void proc_set_cred_init(struct proc *p, struct ucred *cr); struct ucred *proc_set_cred(struct proc *p, struct ucred *cr); void crfree(struct ucred *cr); From owner-svn-src-head@freebsd.org Thu Jan 14 10:22:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2E13A81CFC; Thu, 14 Jan 2016 10:22:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F451100A; Thu, 14 Jan 2016 10:22:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EAMjZN043239; Thu, 14 Jan 2016 10:22:45 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EAMjoR043238; Thu, 14 Jan 2016 10:22:45 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601141022.u0EAMjoR043238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 14 Jan 2016 10:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293910 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 10:22:46 -0000 Author: glebius Date: Thu Jan 14 10:22:45 2016 New Revision: 293910 URL: https://svnweb.freebsd.org/changeset/base/293910 Log: There is a bug in tcp_output()'s implementation of the TCP_SIGNATURE (RFC 2385/TCP-MD5) kernel option. If a tcpcb has TF_NOOPT flag, then tcp_addoptions() is not called, and to.to_signature is an uninitialized stack variable. The value is later used as write offset, which leads to writing to random address. Submitted by: rstone, jtl Security: SA-16:05.tcp Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Jan 14 10:16:25 2016 (r293909) +++ head/sys/netinet/tcp_output.c Thu Jan 14 10:22:45 2016 (r293910) @@ -752,8 +752,8 @@ send: * segments. Options for SYN-ACK segments are handled in TCP * syncache. */ + to.to_flags = 0; if ((tp->t_flags & TF_NOOPT) == 0) { - to.to_flags = 0; /* Maximum segment size. */ if (flags & TH_SYN) { tp->snd_nxt = tp->iss; @@ -1233,7 +1233,7 @@ send: tp->snd_up = tp->snd_una; /* drag it along */ #ifdef TCP_SIGNATURE - if (tp->t_flags & TF_SIGNATURE) { + if (to.to_flags & TOF_SIGNATURE) { int sigoff = to.to_signature - opt; tcp_signature_compute(m, 0, len, optlen, (u_char *)(th + 1) + sigoff, IPSEC_DIR_OUTBOUND); @@ -1713,6 +1713,7 @@ tcp_addoptions(struct tcpopt *to, u_char bcopy((u_char *)&to->to_tsecr, optp, sizeof(to->to_tsecr)); optp += sizeof(to->to_tsecr); break; +#ifdef TCP_SIGNATURE case TOF_SIGNATURE: { int siglen = TCPOLEN_SIGNATURE - 2; @@ -1731,6 +1732,7 @@ tcp_addoptions(struct tcpopt *to, u_char *optp++ = 0; break; } +#endif case TOF_SACK: { int sackblks = 0; From owner-svn-src-head@freebsd.org Thu Jan 14 10:25:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAD70A81F12; Thu, 14 Jan 2016 10:25:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 876761443; Thu, 14 Jan 2016 10:25:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EAPIpx043373; Thu, 14 Jan 2016 10:25:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EAPI8V043372; Thu, 14 Jan 2016 10:25:18 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601141025.u0EAPI8V043372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 14 Jan 2016 10:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293911 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 10:25:19 -0000 Author: glebius Date: Thu Jan 14 10:25:18 2016 New Revision: 293911 URL: https://svnweb.freebsd.org/changeset/base/293911 Log: Install /etc/snmpd.config with 0600 permissions. Noticed by: Pierre Kim Security: SA-16:06.snmpd Pointy hat to: glebius in 2005 Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu Jan 14 10:22:45 2016 (r293910) +++ head/etc/Makefile Thu Jan 14 10:25:18 2016 (r293911) @@ -82,10 +82,6 @@ BIN1+= apmd.conf BIN1+= auto_master .endif -.if ${MK_BSNMP} != "no" -BIN1+= snmpd.config -.endif - .if ${MK_FREEBSD_UPDATE} != "no" BIN1+= freebsd-update.conf .endif @@ -219,6 +215,11 @@ distribution: ${BIN2} ${DESTDIR}/etc; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; +.if ${MK_BSNMP} != "no" + cd ${.CURDIR}; \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ + snmpd.config ${DESTDIR}/etc; +.endif .if ${MK_AT} == "no" sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab .endif From owner-svn-src-head@freebsd.org Thu Jan 14 10:25:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85D66A81F58; Thu, 14 Jan 2016 10:25:27 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 5661A15F0; Thu, 14 Jan 2016 10:25:27 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (bcdd4360.skybroadband.com [188.221.67.96]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 6212DD7A17; Thu, 14 Jan 2016 10:24:57 +0000 (UTC) Date: Thu, 14 Jan 2016 10:24:56 +0000 From: Andrew Turner To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293903 - in head/sys/boot: arm/uboot efi/fdt efi/libefi Message-ID: <20160114102456.13921bcf@zapp> In-Reply-To: <56977585.4020100@freebsd.org> References: <201601140922.u0E9M1rV025146@repo.freebsd.org> <20160114101343.70e73d01@zapp> <56977585.4020100@freebsd.org> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 10:25:27 -0000 On Thu, 14 Jan 2016 10:16:37 +0000 Steven Hartland wrote: > On 14/01/2016 10:13, Andrew Turner wrote: > > On Thu, 14 Jan 2016 09:22:01 +0000 (UTC) > > Steven Hartland wrote: > > > >> Author: smh > >> Date: Thu Jan 14 09:22:01 2016 > >> New Revision: 293903 > >> URL: https://svnweb.freebsd.org/changeset/base/293903 > >> > >> Log: > >> Fix GCC warnings causing build failure after r293724 > >> > >> Disable some compiler warnings for GCC (non-standard compiler) > >> fixing build failures introduced by r293724, which enabled WARNS in > >> the EFI boot code, when compiling with none standard compiler > >> (GCC). > >> Raised by: ian > >> MFC after: 2 weeks > >> X-MFC-With: r293268 > >> Sponsored by: Multiplay > > The attached would be a better (however untested) solution. Given we > > don't build boot1.efi or loader.efi with gcc it extends this to all > > the EFI code. > > > > Andrew > Not sure I like that idea as it would prevent people using EFI from > having a working system if they also choose GCC. > They already don't have loader.efi or boot1.efi with gcc, how will this patch break their existing system? Andrew From owner-svn-src-head@freebsd.org Thu Jan 14 10:34:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF71CA82322 for ; Thu, 14 Jan 2016 10:34:23 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 746DB1BA6 for ; Thu, 14 Jan 2016 10:34:23 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x22f.google.com with SMTP id b14so422667066wmb.1 for ; Thu, 14 Jan 2016 02:34:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=LFEwp2lX59TCiLix3JqR+wfwQd+D8xhKcQsvFzoBxh0=; b=yeWp7bCrosXS2oB1oud96evwbHKlP8ZjnC+9a81sP0NtlxyzF6n7bQibyNBS7Eb+58 cufCl8hJLrMfEJ4EcECcymMLja/otE+l8pt4LlsTGPTbgOZ+M7KkcK0Z6VL6pDMF4vFz RYes5RV7Kq6/EofJT5yi7bN59Lg3JkAgIrmBVawxOc8jRo4yEJNZLEmkZwQFfvtLsQlc 5w6RMLfAdDEUUyCtWbemAEj6JP+Lb0WLkqR+jzDl3JOCgoKey6VKraAfmiaUO/ZBgzvK IRO2A4UWwzWLPa4KREM4I6tNB9mgBdE8lZ9ELDnEzFOE+BOsN8cB/VPXDUFojI4TJYon /zRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=LFEwp2lX59TCiLix3JqR+wfwQd+D8xhKcQsvFzoBxh0=; b=VJi1Z/QED01xLsO3TQuJajDhS6uLxzHILnDVE5XVkA9DUYy2GkN4+WliVPkg+6V5UB 4EJhwVYVFGrXXcUAmBEi/c5tAzdy0iUocX1kjQ6I8o8a+Momdgp3zloSBjIv7N3qJWgR JwWQiLnizBoJnblLpo7wVa7mEunwg7nUhnFaOJg3QL1ZLBfqTHVNLQHsUQfJ2nvXjAy6 Ic/ExvW/YSmtz4mnvszRH45x6iwbBqhAGktUCk6l1MeZDTLRBXwR9XSxi8hVbJW9+7jf 5Hthh3ZlMgU0qXVKADsp5TWzUKAQ2ynHFrVqdkoiJLuaRhzaos2dq2gTjrZ5xTyvWLbd ihJg== X-Gm-Message-State: ALoCoQkfUkEDGYLWXccMLyXwhXIxI+aNSbyNtnpZ7mseWprrj7eR6+c/vTJ2+ngukrdgBu9mppBdCHcmH8Fr9zbHUNTwsEtHeQ== X-Received: by 10.194.114.164 with SMTP id jh4mr3160181wjb.153.1452767661956; Thu, 14 Jan 2016 02:34:21 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id q75sm26312207wmd.6.2016.01.14.02.34.20 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jan 2016 02:34:20 -0800 (PST) Subject: Re: svn commit: r293903 - in head/sys/boot: arm/uboot efi/fdt efi/libefi To: Andrew Turner References: <201601140922.u0E9M1rV025146@repo.freebsd.org> <20160114101343.70e73d01@zapp> <56977585.4020100@freebsd.org> <20160114102456.13921bcf@zapp> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Steven Hartland Message-ID: <569779BF.6060500@multiplay.co.uk> Date: Thu, 14 Jan 2016 10:34:39 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160114102456.13921bcf@zapp> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 10:34:24 -0000 On 14/01/2016 10:24, Andrew Turner wrote: > On Thu, 14 Jan 2016 10:16:37 +0000 > Steven Hartland wrote: > >> On 14/01/2016 10:13, Andrew Turner wrote: >>> On Thu, 14 Jan 2016 09:22:01 +0000 (UTC) >>> Steven Hartland wrote: >>> >>>> Author: smh >>>> Date: Thu Jan 14 09:22:01 2016 >>>> New Revision: 293903 >>>> URL: https://svnweb.freebsd.org/changeset/base/293903 >>>> >>>> Log: >>>> Fix GCC warnings causing build failure after r293724 >>>> >>>> Disable some compiler warnings for GCC (non-standard compiler) >>>> fixing build failures introduced by r293724, which enabled WARNS in >>>> the EFI boot code, when compiling with none standard compiler >>>> (GCC). >>>> Raised by: ian >>>> MFC after: 2 weeks >>>> X-MFC-With: r293268 >>>> Sponsored by: Multiplay >>> The attached would be a better (however untested) solution. Given we >>> don't build boot1.efi or loader.efi with gcc it extends this to all >>> the EFI code. >>> >>> Andrew >> Not sure I like that idea as it would prevent people using EFI from >> having a working system if they also choose GCC. >> > They already don't have loader.efi or boot1.efi with gcc, how will this > patch break their existing system? > > Andrew Ahh I see what you mean. I see there's some discussion about this on IRC, if you can reply to this thread and let me know the conclusion, in case I miss it, I'll make the relevant changes :) Regards Steve From owner-svn-src-head@freebsd.org Thu Jan 14 11:25:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28B0DA818DB; Thu, 14 Jan 2016 11:25:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA0B51941; Thu, 14 Jan 2016 11:25:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EBPSoI063246; Thu, 14 Jan 2016 11:25:28 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EBPSxk063245; Thu, 14 Jan 2016 11:25:28 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601141125.u0EBPSxk063245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 14 Jan 2016 11:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293913 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 11:25:30 -0000 Author: tuexen Date: Thu Jan 14 11:25:28 2016 New Revision: 293913 URL: https://svnweb.freebsd.org/changeset/base/293913 Log: Fail the SCTP_GET_ASSOC_NUMBER and SCTP_GET_ASSOC_ID_LIST socket options for 1-to-1 style sockets as specified in RFC 6458. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Thu Jan 14 11:11:46 2016 (r293912) +++ head/sys/netinet/sctp_usrreq.c Thu Jan 14 11:25:28 2016 (r293913) @@ -1883,8 +1883,15 @@ flags_out: uint32_t *value, cnt; SCTP_CHECK_AND_CAST(value, optval, uint32_t, *optsize); - cnt = 0; SCTP_INP_RLOCK(inp); + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { + /* Can't do this for a 1-1 socket */ + error = EINVAL; + SCTP_INP_RUNLOCK(inp); + break; + } + cnt = 0; LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { cnt++; } @@ -1899,9 +1906,16 @@ flags_out: unsigned int at, limit; SCTP_CHECK_AND_CAST(ids, optval, struct sctp_assoc_ids, *optsize); + SCTP_INP_RLOCK(inp); + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { + /* Can't do this for a 1-1 socket */ + error = EINVAL; + SCTP_INP_RUNLOCK(inp); + break; + } at = 0; limit = (*optsize - sizeof(uint32_t)) / sizeof(sctp_assoc_t); - SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { if (at < limit) { ids->gaids_assoc_id[at++] = sctp_get_associd(stcb); From owner-svn-src-head@freebsd.org Thu Jan 14 13:14:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A86ACA82A67; Thu, 14 Jan 2016 13:14:13 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C39617C5; Thu, 14 Jan 2016 13:14:13 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EDECHu099111; Thu, 14 Jan 2016 13:14:12 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EDECtD099110; Thu, 14 Jan 2016 13:14:12 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601141314.u0EDECtD099110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 14 Jan 2016 13:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293914 - head/sys/netgraph/netflow X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 13:14:13 -0000 Author: melifaro Date: Thu Jan 14 13:14:12 2016 New Revision: 293914 URL: https://svnweb.freebsd.org/changeset/base/293914 Log: Make ng_netflow(9) use new routing KPI. Netflow module is supposed to store (along with fields like gateway address and interface index) matched netmask for each record. This (currently) requires returning individual route entries, instead of optimized next-hop structure. Given that, use control-plane rib_lookup_info() function to avoid accessing rtentries directly. While rib_lookup_info() might be slower, than fibX_lookup() flavours, it is more scalable than rtalloc1_fib(), because rtentry mutex is not acquired. Modified: head/sys/netgraph/netflow/netflow.c Modified: head/sys/netgraph/netflow/netflow.c ============================================================================== --- head/sys/netgraph/netflow/netflow.c Thu Jan 14 11:25:28 2016 (r293913) +++ head/sys/netgraph/netflow/netflow.c Thu Jan 14 13:14:12 2016 (r293914) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -307,8 +308,9 @@ hash_insert(priv_p priv, struct flow_has int plen, uint8_t flags, uint8_t tcp_flags) { struct flow_entry *fle; - struct sockaddr_in sin; - struct rtentry *rt; + struct sockaddr_in sin, sin_mask; + struct sockaddr_dl rt_gateway; + struct rt_addrinfo info; mtx_assert(&hsh->mtx, MA_OWNED); @@ -339,23 +341,30 @@ hash_insert(priv_p priv, struct flow_has sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = AF_INET; sin.sin_addr = fle->f.r.r_dst; - rt = rtalloc1_fib((struct sockaddr *)&sin, 0, 0, r->fib); - if (rt != NULL) { - fle->f.fle_o_ifx = rt->rt_ifp->if_index; - if (rt->rt_flags & RTF_GATEWAY && - rt->rt_gateway->sa_family == AF_INET) + rt_gateway.sdl_len = sizeof(rt_gateway); + sin_mask.sin_len = sizeof(struct sockaddr_in); + bzero(&info, sizeof(info)); + + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&rt_gateway; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&sin_mask; + + if (rib_lookup_info(r->fib, (struct sockaddr *)&sin, NHR_REF, 0, + &info) == 0) { + fle->f.fle_o_ifx = info.rti_ifp->if_index; + + if (info.rti_flags & RTF_GATEWAY && + rt_gateway.sdl_family == AF_INET) fle->f.next_hop = - ((struct sockaddr_in *)(rt->rt_gateway))->sin_addr; + ((struct sockaddr_in *)&rt_gateway)->sin_addr; - if (rt_mask(rt)) - fle->f.dst_mask = - bitcount32(((struct sockaddr_in *)rt_mask(rt))->sin_addr.s_addr); - else if (rt->rt_flags & RTF_HOST) + if (info.rti_addrs & RTA_NETMASK) + fle->f.dst_mask = bitcount32(sin_mask.sin_addr.s_addr); + else if (info.rti_flags & RTF_HOST) /* Give up. We can't determine mask :( */ fle->f.dst_mask = 32; - RTFREE_LOCKED(rt); + rib_free_info(&info); } } @@ -365,16 +374,20 @@ hash_insert(priv_p priv, struct flow_has sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = AF_INET; sin.sin_addr = fle->f.r.r_src; - rt = rtalloc1_fib((struct sockaddr *)&sin, 0, 0, r->fib); - if (rt != NULL) { - if (rt_mask(rt)) + + sin_mask.sin_len = sizeof(struct sockaddr_in); + bzero(&info, sizeof(info)); + + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&sin_mask; + + if (rib_lookup_info(r->fib, (struct sockaddr *)&sin, 0, 0, + &info) == 0) { + if (info.rti_addrs & RTA_NETMASK) fle->f.src_mask = - bitcount32(((struct sockaddr_in *)rt_mask(rt))->sin_addr.s_addr); - else if (rt->rt_flags & RTF_HOST) + bitcount32(sin_mask.sin_addr.s_addr); + else if (info.rti_flags & RTF_HOST) /* Give up. We can't determine mask :( */ fle->f.src_mask = 32; - - RTFREE_LOCKED(rt); } } @@ -390,14 +403,14 @@ hash_insert(priv_p priv, struct flow_has bitcount32((x).__u6_addr.__u6_addr32[1]) + \ bitcount32((x).__u6_addr.__u6_addr32[2]) + \ bitcount32((x).__u6_addr.__u6_addr32[3]) -#define RT_MASK6(x) (ipv6_masklen(((struct sockaddr_in6 *)rt_mask(x))->sin6_addr)) static int hash6_insert(priv_p priv, struct flow_hash_entry *hsh6, struct flow6_rec *r, int plen, uint8_t flags, uint8_t tcp_flags) { struct flow6_entry *fle6; - struct sockaddr_in6 sin6; - struct rtentry *rt; + struct sockaddr_in6 sin6, sin6_mask; + struct sockaddr_dl rt_gateway; + struct rt_addrinfo info; mtx_assert(&hsh6->mtx, MA_OWNED); @@ -430,22 +443,29 @@ hash6_insert(priv_p priv, struct flow_ha sin6.sin6_family = AF_INET6; sin6.sin6_addr = r->dst.r_dst6; - rt = rtalloc1_fib((struct sockaddr *)&sin6, 0, 0, r->fib); - - if (rt != NULL) { - fle6->f.fle_o_ifx = rt->rt_ifp->if_index; + rt_gateway.sdl_len = sizeof(rt_gateway); + sin6_mask.sin6_len = sizeof(struct sockaddr_in6); + bzero(&info, sizeof(info)); + + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&rt_gateway; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&sin6_mask; + + if (rib_lookup_info(r->fib, (struct sockaddr *)&sin6, NHR_REF, + 0, &info) == 0) { + fle6->f.fle_o_ifx = info.rti_ifp->if_index; - if (rt->rt_flags & RTF_GATEWAY && - rt->rt_gateway->sa_family == AF_INET6) + if (info.rti_flags & RTF_GATEWAY && + rt_gateway.sdl_family == AF_INET6) fle6->f.n.next_hop6 = - ((struct sockaddr_in6 *)(rt->rt_gateway))->sin6_addr; + ((struct sockaddr_in6 *)&rt_gateway)->sin6_addr; - if (rt_mask(rt)) - fle6->f.dst_mask = RT_MASK6(rt); + if (info.rti_addrs & RTA_NETMASK) + fle6->f.dst_mask = + ipv6_masklen(sin6_mask.sin6_addr); else fle6->f.dst_mask = 128; - RTFREE_LOCKED(rt); + rib_free_info(&info); } } @@ -456,15 +476,18 @@ hash6_insert(priv_p priv, struct flow_ha sin6.sin6_family = AF_INET6; sin6.sin6_addr = r->src.r_src6; - rt = rtalloc1_fib((struct sockaddr *)&sin6, 0, 0, r->fib); + sin6_mask.sin6_len = sizeof(struct sockaddr_in6); + bzero(&info, sizeof(info)); - if (rt != NULL) { - if (rt_mask(rt)) - fle6->f.src_mask = RT_MASK6(rt); + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&sin6_mask; + + if (rib_lookup_info(r->fib, (struct sockaddr *)&sin6, 0, 0, + &info) == 0) { + if (info.rti_addrs & RTA_NETMASK) + fle6->f.src_mask = + ipv6_masklen(sin6_mask.sin6_addr); else fle6->f.src_mask = 128; - - RTFREE_LOCKED(rt); } } @@ -474,7 +497,6 @@ hash6_insert(priv_p priv, struct flow_ha return (0); } #undef ipv6_masklen -#undef RT_MASK6 #endif From owner-svn-src-head@freebsd.org Thu Jan 14 15:49:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D302A82F5A; Thu, 14 Jan 2016 15:49:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 164A617A7; Thu, 14 Jan 2016 15:49:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EFnOIs050091; Thu, 14 Jan 2016 15:49:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EFnOog050090; Thu, 14 Jan 2016 15:49:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601141549.u0EFnOog050090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 Jan 2016 15:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293977 - head/usr.sbin/boot0cfg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 15:49:26 -0000 Author: jhb Date: Thu Jan 14 15:49:24 2016 New Revision: 293977 URL: https://svnweb.freebsd.org/changeset/base/293977 Log: Adjust previous fix to conform to the existing style in this file. Modified: head/usr.sbin/boot0cfg/boot0cfg.c Modified: head/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.c Thu Jan 14 15:49:15 2016 (r293976) +++ head/usr.sbin/boot0cfg/boot0cfg.c Thu Jan 14 15:49:24 2016 (r293977) @@ -336,8 +336,7 @@ read_mbr(const char *disk, u_int8_t **mb close(fd); return (mbr_size); } - *mbr = malloc(sizeof(buf)); - if (*mbr == NULL) + if ((*mbr = malloc(sizeof(buf))) == NULL) errx(1, "%s: unable to allocate MBR buffer", disk); memcpy(*mbr, buf, sizeof(buf)); close(fd); From owner-svn-src-head@freebsd.org Thu Jan 14 15:51:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 023E0A8317E; Thu, 14 Jan 2016 15:51:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1C711D54; Thu, 14 Jan 2016 15:51:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EFpDBH052098; Thu, 14 Jan 2016 15:51:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EFpDTf052097; Thu, 14 Jan 2016 15:51:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601141551.u0EFpDTf052097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 Jan 2016 15:51:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293979 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 15:51:15 -0000 Author: jhb Date: Thu Jan 14 15:51:13 2016 New Revision: 293979 URL: https://svnweb.freebsd.org/changeset/base/293979 Log: Fix building with GCC since PAGE_MASK is signed on i386. Reviewed by: ngie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4772 Modified: head/lib/libkvm/kvm_i386.h Modified: head/lib/libkvm/kvm_i386.h ============================================================================== --- head/lib/libkvm/kvm_i386.h Thu Jan 14 15:50:13 2016 (r293978) +++ head/lib/libkvm/kvm_i386.h Thu Jan 14 15:51:13 2016 (r293979) @@ -70,7 +70,7 @@ _Static_assert(NBPDR == I386_NBPDR, "NBP _Static_assert(PG_V == I386_PG_V, "PG_V mismatch"); _Static_assert(PG_PS == I386_PG_PS, "PG_PS mismatch"); -_Static_assert(PG_FRAME == I386_PG_FRAME, "PG_FRAME mismatch"); +_Static_assert((u_int)PG_FRAME == I386_PG_FRAME, "PG_FRAME mismatch"); _Static_assert(PG_PS_FRAME == I386_PG_PS_FRAME, "PG_PS_FRAME mismatch"); #endif From owner-svn-src-head@freebsd.org Thu Jan 14 16:23:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BC48A82778; Thu, 14 Jan 2016 16:23:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1B251E5F; Thu, 14 Jan 2016 16:23:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EGN76d063432; Thu, 14 Jan 2016 16:23:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EGN7me063431; Thu, 14 Jan 2016 16:23:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601141623.u0EGN7me063431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Jan 2016 16:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294011 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 16:23:09 -0000 Author: imp Date: Thu Jan 14 16:23:07 2016 New Revision: 294011 URL: https://svnweb.freebsd.org/changeset/base/294011 Log: Document how to enter the debugger here. I'm sure there's some better canonical place, and the nit-pickers are welcome to move this information there with a cross reference. Differential Review: https://reviews.freebsd.org/D4860 Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Thu Jan 14 16:21:58 2016 (r294010) +++ head/share/man/man4/ddb.4 Thu Jan 14 16:23:07 2016 (r294011) @@ -1435,6 +1435,47 @@ The NMI allows one to break into the deb diagnose problems. Other bus' bridge chipsets may be able to generate NMI using bus specific methods. +There are many PCI and PCIe add-in cards which can generate NMI for +debugging. +Modern systems typically use IMPI to generate signals to enter the +debugger. +The +.Dv devel/ipmitool +port can be used to send the +.Cd chassis power diag +command which delivers an NMI to the processor. +.Pp +For serial consoles, you can break to the debugger by sending a BREAK +condition on the serial line if +.Cd options BREAK_TO_DEBUGGER +is specified in the kernel. +Most terminal emulation programs can send a break sequence with a +special key sequence or via a menu item. +However, in some setups, sending the break can be difficult to arrange +or happens spuriously, so if the kernel contains +.Cd options ALT_BREAK_TO_DEBUGGER +then the sequence of CR TILDE CTRL-B enters the debugger; +CR TILDE CTRL-P causes a panic instead of entering the +debugger; and +CR TILDE CTRL-R causes an immediate reboot. +In all the above sequences, CR is a Carriage Return and is usually +sent by hitting the Enter or Return key. +TILDE is the ASCII tilde character (~). +CTRL-x is Control x created by hitting the control key and then x +and then releasing both. +.Pp +The break to debugger behavior may also be enabled by setting the +.Xr sysctl 8 +.Dv debug.kdb.break_to_debugger +to 1. +The alt break to debugger behavior may also be enabled by setting the +.Xr sysctl 8 +.Dv debug.kdb.alt_break_to_debugger +to 1. +The debugger may be entered by setting the +.Xr sysctl 8 +.Dv debug.kdb.enter +to 1. .Sh FILES Header files mentioned in this manual page can be found below .Pa /usr/include From owner-svn-src-head@freebsd.org Thu Jan 14 16:31:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E992FA82E66; Thu, 14 Jan 2016 16:31:01 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B52B81074; Thu, 14 Jan 2016 16:31:01 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EGV078064229; Thu, 14 Jan 2016 16:31:00 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EGV0IN064228; Thu, 14 Jan 2016 16:31:00 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601141631.u0EGV0IN064228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 14 Jan 2016 16:31:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294020 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 16:31:02 -0000 Author: melifaro Date: Thu Jan 14 16:31:00 2016 New Revision: 294020 URL: https://svnweb.freebsd.org/changeset/base/294020 Log: Fix panic in IP redirect. Panic was introduced in r293466. Found by: Yamagi Burmeister > Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Jan 14 16:30:37 2016 (r294019) +++ head/sys/net/route.c Thu Jan 14 16:31:00 2016 (r294020) @@ -576,8 +576,8 @@ rtredirect_fib(struct sockaddr *dst, * Create new route, rather than smashing route to net. */ create: - RTFREE(rt); - rt = NULL; + if (rt != NULL) + RTFREE_LOCKED(rt); flags |= RTF_DYNAMIC; bzero((caddr_t)&info, sizeof(info)); From owner-svn-src-head@freebsd.org Thu Jan 14 16:46:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17F2DA8151E; Thu, 14 Jan 2016 16:46:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E69F81D00; Thu, 14 Jan 2016 16:46:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1A687B93C; Thu, 14 Jan 2016 11:46:08 -0500 (EST) From: John Baldwin To: NGie Cooper Cc: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293903 - in head/sys/boot: arm/uboot efi/fdt efi/libefi Date: Thu, 14 Jan 2016 07:55 -0800 Message-ID: <8690606.xvPx6EyIfQ@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201601140922.u0E9M1rV025146@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 14 Jan 2016 11:46:08 -0500 (EST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 16:46:10 -0000 On Thursday, January 14, 2016 01:27:51 AM NGie Cooper wrote: >=20 > > On Jan 14, 2016, at 01:22, Steven Hartland wrote:= > >=20 > > Author: smh > > Date: Thu Jan 14 09:22:01 2016 > > New Revision: 293903 > > URL: https://svnweb.freebsd.org/changeset/base/293903 > >=20 > > Log: > > Fix GCC warnings causing build failure after r293724 > >=20 > > Disable some compiler warnings for GCC (non-standard compiler) fix= ing > > build failures introduced by r293724, which enabled WARNS in the E= FI boot > > code, when compiling with none standard compiler (GCC). >=20 > Disabling warnings is wrong. Here=E2=80=99s how arm could be fixed: >=20 > $ svn diff sys/boot/ > Index: sys/boot/common/bootstrap.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/boot/common/bootstrap.h (revision 293877) > +++ sys/boot/common/bootstrap.h (working copy) > @@ -32,6 +32,7 @@ > #include > #include > #include > +#include > =20 > /* > * Generic device specifier; architecture-dependant=20 > @@ -332,12 +333,8 @@ > extern struct arch_switch archsw; > =20 > /* This must be provided by the MD code, but should it be in the arc= hsw? */ > -void delay(int delay); > - The comment seems to be related to delay() so it should perhaps go as w= ell? --=20 John Baldwin From owner-svn-src-head@freebsd.org Thu Jan 14 16:51:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A699DA816B5 for ; Thu, 14 Jan 2016 16:51:07 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F64C1016 for ; Thu, 14 Jan 2016 16:51:06 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x22d.google.com with SMTP id u188so356470459wmu.1 for ; Thu, 14 Jan 2016 08:51:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=qc/6cO+nvQ2gIKQnlr3ErMRRD+NSuQ9mS9O5tw8wsis=; b=D/M/IXlBmuZx4HxBZvT/oMytZ/yA8WXR23wDFomgs9DBtQX2RFtszqq8Km0bZV+qem O++SV9nRf3AyJt+CNKvAtY5vlSsnYW6AbF9g9OusFRLvX6i0V0ktoILQbRRY9B1PMPLM cA0Feg24/Pdyl3O5TbNF18wU13xWeXYi0mbyjACLgBIVxEgUtBOFY3ZCEEqtA6XVviyd 76hPsFPjKrgaa8ufWgghTIvvJkaeMLVgrwtrc8EsLoHbZI2wUuDjHCFurq5U8t+abYkF 4lM0wZe3YKAnIg7fdG+bh4l5LC1tJ1CYSblsKUiER5kPksBgh0/rRXiIGuFHfh4TmH5d 8HfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=qc/6cO+nvQ2gIKQnlr3ErMRRD+NSuQ9mS9O5tw8wsis=; b=LNVcQyzj+0XjYepaqaEDLVTdgrgcsMLj9dbeoCJqqX52Q41b3YdfjrIKNodxJmSe8W 7J6RuZ7gFdsl2y2IHXrTtpwganR8TyLqKkG8iwMU8Yi2UnGwSBj7AcodibNtvKq1R2C7 eF+dYkfIyUAD1PHZzs9OLFWy8XJS+rge8/3RdbheT/jbJZ0scUxQNd1D85UGjYA0a+XZ WksgYtIIj2GX0brjpM3Qs520xgyUqbLoaWMasI11uqT1nic8qR+w4DKBHnYDSHv/Kr7q XN17qGnj9KhZ4iav8A79SWUvcWrtLgJd3osXu5PEdtiD30mhbnyWF0X9weEyDRddwBYC OhaQ== X-Gm-Message-State: ALoCoQn+ZpbbvF8xfnvGE23s+723TYpobJhQHkPdiJE6VUyk5vt8+VqDliK3VX5zjyJesSVOm9dmIHxKcA6ffhxq/RqjboZFuA== X-Received: by 10.194.184.210 with SMTP id ew18mr5068171wjc.79.1452790265248; Thu, 14 Jan 2016 08:51:05 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id lh1sm6836149wjb.20.2016.01.14.08.51.03 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jan 2016 08:51:03 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r293903 - in head/sys/boot: arm/uboot efi/fdt efi/libefi To: John Baldwin , NGie Cooper References: <201601140922.u0E9M1rV025146@repo.freebsd.org> <8690606.xvPx6EyIfQ@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <5697D20A.9050309@freebsd.org> Date: Thu, 14 Jan 2016 16:51:22 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <8690606.xvPx6EyIfQ@ralph.baldwin.cx> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 16:51:07 -0000 On 14/01/2016 15:55, John Baldwin wrote: > On Thursday, January 14, 2016 01:27:51 AM NGie Cooper wrote: >>> On Jan 14, 2016, at 01:22, Steven Hartland wrote: >>> >>> Author: smh >>> Date: Thu Jan 14 09:22:01 2016 >>> New Revision: 293903 >>> URL: https://svnweb.freebsd.org/changeset/base/293903 >>> >>> Log: >>> Fix GCC warnings causing build failure after r293724 >>> >>> Disable some compiler warnings for GCC (non-standard compiler) fixing >>> build failures introduced by r293724, which enabled WARNS in the EFI boot >>> code, when compiling with none standard compiler (GCC). >> Disabling warnings is wrong. Here’s how arm could be fixed: >> >> $ svn diff sys/boot/ >> Index: sys/boot/common/bootstrap.h >> =================================================================== >> --- sys/boot/common/bootstrap.h (revision 293877) >> +++ sys/boot/common/bootstrap.h (working copy) >> @@ -32,6 +32,7 @@ >> #include >> #include >> #include >> +#include >> >> /* >> * Generic device specifier; architecture-dependant >> @@ -332,12 +333,8 @@ >> extern struct arch_switch archsw; >> >> /* This must be provided by the MD code, but should it be in the archsw? */ >> -void delay(int delay); >> - > The comment seems to be related to delay() so it should perhaps go as well? > delay is actually provided by libefi but nothing else in sys/boot, so I cant see why this was ever needed, possibly a hang over? From owner-svn-src-head@freebsd.org Thu Jan 14 16:53:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BF55A81882; Thu, 14 Jan 2016 16:53:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 615BE1319; Thu, 14 Jan 2016 16:53:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EGrH8v072851; Thu, 14 Jan 2016 16:53:17 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EGrHPu072850; Thu, 14 Jan 2016 16:53:17 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201601141653.u0EGrHPu072850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 14 Jan 2016 16:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294021 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 16:53:18 -0000 Author: trasz Date: Thu Jan 14 16:53:17 2016 New Revision: 294021 URL: https://svnweb.freebsd.org/changeset/base/294021 Log: Fix the code to retry mount attempt in mountcritlocal if there are any root mount holds. The previous one used a wrong conditional - the "err=$?" assignment resets "$?" to 0. Submitted by: jilles@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/etc/rc.d/mountcritlocal Modified: head/etc/rc.d/mountcritlocal ============================================================================== --- head/etc/rc.d/mountcritlocal Thu Jan 14 16:31:00 2016 (r294020) +++ head/etc/rc.d/mountcritlocal Thu Jan 14 16:53:17 2016 (r294021) @@ -44,7 +44,7 @@ mountcritlocal_start() # and retry. mount -a -t ${mount_excludes} err=$? - if [ $? -ne 0 ]; then + if [ ${err} -ne 0 ]; then echo echo 'Mounting /etc/fstab filesystems failed,' \ 'will retry after root mount hold release' From owner-svn-src-head@freebsd.org Thu Jan 14 16:53:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0298A818B4 for ; Thu, 14 Jan 2016 16:53:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x22b.google.com (mail-qg0-x22b.google.com [IPv6:2607:f8b0:400d:c04::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92E4B143C for ; Thu, 14 Jan 2016 16:53:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x22b.google.com with SMTP id b35so357190724qge.0 for ; Thu, 14 Jan 2016 08:53:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=5vF2hpi/x5UqewDGVVb70JWvKuwlENolq6yPBppKAbY=; b=n4gfMv+5+t2Z2GveMj2F7QfEfXSaoBUkgTtAaTzXFU5zPy/EkZWZ7oimURIBiZukPj NxFD94qCrWWP9x0w1EBHFFnAK/zU1wYlC/DABgkKYb6c8256XB1vwGbB1y4i3PVaylB/ M5EcP1RV4xXRFdCBOs4/NmlOZTV0NevTqq+4hTRUZWTrXmqQ8Lb6PJxS0m7ZvrrnOJwG n9bgvMflG7LBrTGlyHvjtt2M2V8OoS+ppzyouaKUb3ypCcLUyCAnuNdsC2Ce+Guuau1u GG+C68r3dc42DVnuBENUYjIOTU++qr+q13DHjx1POl53mFB5EgwXMg7kEcjeMCtNnee8 O11g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=5vF2hpi/x5UqewDGVVb70JWvKuwlENolq6yPBppKAbY=; b=b6jBt5r7ZgF0tlzx5CiDSs9fzqlXm4u8mqC8WlWpL/G2+Ylj/71VehUMCbO59G3nn+ 6Cg3qk5IKMSQq49dJb2H5o8/xhOWkcjtHQ8u+8Gc+YMJR4MHnyV2WLKSudtTiFRQnBXp szUDnukZZg8FTNicC8MzX41QkxxLiqk7W/OnnHVXss8HGtewgVZndSiYj1Uq52RMcSZN ZFNPihUyjZnRcfu+U7PxBn4L5GirOtaeqg8CU/kdVZ9rtK/dDLCRBAuzkQzC4GcThGDu A3FdMi2WQVwuNbA5xKVpJF5+rDW/TaxEHjgH8B+DFt1ZaOcVPdl04h2lgT7ToeGI3Cpi r9Mw== X-Gm-Message-State: ALoCoQn8+8k31EiG+evkBnPpGi0O0gLKfKvPHTMz4xkFDXKJx8n3HnepD+woYKxs5WfEfZj4Y0YACMD9aADzCgMiMF/WLXlx5Q== MIME-Version: 1.0 X-Received: by 10.140.93.77 with SMTP id c71mr7250394qge.46.1452790403574; Thu, 14 Jan 2016 08:53:23 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.30.166 with HTTP; Thu, 14 Jan 2016 08:53:23 -0800 (PST) X-Originating-IP: [69.53.245.12] In-Reply-To: <9A7534C4-0A2C-4DAC-981A-09868F1723DA@gmail.com> References: <201601140922.u0E9M1rV025146@repo.freebsd.org> <9A7534C4-0A2C-4DAC-981A-09868F1723DA@gmail.com> Date: Thu, 14 Jan 2016 09:53:23 -0700 X-Google-Sender-Auth: OlFx1-9vKEgQ-wvl1tXA3-PkxH4 Message-ID: Subject: Re: svn commit: r293903 - in head/sys/boot: arm/uboot efi/fdt efi/libefi From: Warner Losh To: NGie Cooper Cc: Steven Hartland , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 16:53:25 -0000 On Thu, Jan 14, 2016 at 2:47 AM, NGie Cooper wrote: > > > On Jan 14, 2016, at 01:27, NGie Cooper wrote: > > > > > >> On Jan 14, 2016, at 01:22, Steven Hartland wrote: > >> > >> Author: smh > >> Date: Thu Jan 14 09:22:01 2016 > >> New Revision: 293903 > >> URL: https://svnweb.freebsd.org/changeset/base/293903 > >> > >> Log: > >> Fix GCC warnings causing build failure after r293724 > >> > >> Disable some compiler warnings for GCC (non-standard compiler) fixing > >> build failures introduced by r293724, which enabled WARNS in the EFI > boot > >> code, when compiling with none standard compiler (GCC). > > > > Disabling warnings is wrong. Here=E2=80=99s how arm could be fixed: > > > > $ svn diff sys/boot/ > > Index: sys/boot/common/bootstrap.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- sys/boot/common/bootstrap.h (revision 293877) > > +++ sys/boot/common/bootstrap.h (working copy) > > @@ -32,6 +32,7 @@ > > #include > > #include > > #include > > +#include > > > > /* > > * Generic device specifier; architecture-dependant > > @@ -332,12 +333,8 @@ > > extern struct arch_switch archsw; > > > > /* This must be provided by the MD code, but should it be in the archsw= ? > */ > > -void delay(int delay); > > - > > void dev_cleanup(void); > > > > -time_t time(time_t *tloc); > > - > > #ifndef CTASSERT /* Allow lint to override */ > > #define CTASSERT(x) _CTASSERT(x, __LINE__) > > #define _CTASSERT(x, y) __CTASSERT(x, y) > > Index: sys/boot/efi/include/efiapi.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- sys/boot/efi/include/efiapi.h (revision 293877) > > +++ sys/boot/efi/include/efiapi.h (working copy) > > @@ -532,6 +532,7 @@ > > typedef > > EFI_STATUS > > (EFIAPI *EFI_RESERVED_SERVICE) ( > > + VOID > > ); > > > > typedef > > > > amd64 is a bit trickier: > > > > /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/efigop.h:75: > warning: 'ms_abi' attribute directive ignored > > > > I didn=E2=80=99t dig into why this is happening [yet], other than there= maybe > being MS extensions involved? > > > > Thanks, > > -NGie > > This might fix amd64: > > Index: /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/amd64/efibind= .h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/amd64/efibind.h > (revision 293877) > +++ /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/amd64/efibind.h > (working copy) > @@ -160,8 +160,10 @@ > // > > #ifdef __amd64__ > +#if defined(__clang__) && (__clang_major__ >=3D 3 && __clang_minor__ >= =3D 5) > #define EFIAPI __attribute__((ms_abi)) > #endif > +#endif > > #ifndef EFIAPI // Forces EFI calling conventions > reguardless of compiler options > #ifdef _MSC_EXTENSIONS > Sure this fix is right? If you aren't marking the ABI correctly, how could this possibly work? Warner From owner-svn-src-head@freebsd.org Thu Jan 14 16:55:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D212EA81967; Thu, 14 Jan 2016 16:55:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A259175B; Thu, 14 Jan 2016 16:55:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EGt7QN072967; Thu, 14 Jan 2016 16:55:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EGt7es072966; Thu, 14 Jan 2016 16:55:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201601141655.u0EGt7es072966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 14 Jan 2016 16:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294022 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 16:55:08 -0000 Author: trasz Date: Thu Jan 14 16:55:07 2016 New Revision: 294022 URL: https://svnweb.freebsd.org/changeset/base/294022 Log: Wrap overlong comment lines. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/etc/rc.d/mountcritlocal Modified: head/etc/rc.d/mountcritlocal ============================================================================== --- head/etc/rc.d/mountcritlocal Thu Jan 14 16:53:17 2016 (r294021) +++ head/etc/rc.d/mountcritlocal Thu Jan 14 16:55:07 2016 (r294022) @@ -36,12 +36,12 @@ mountcritlocal_start() done mount_excludes=${mount_excludes%,} - # Originally, root mount hold had to be released before mounting the root - # filesystem. This delayed the boot, so it was changed to only wait if - # the root device isn't readily available. This can result in this script - # executing before all the devices - such as graid(8) - are available. - # Thus, should the mount fail, we will wait for the root mount hold release - # and retry. + # Originally, root mount hold had to be released before mounting + # the root filesystem. This delayed the boot, so it was changed + # to only wait if the root device isn't readily available. This + # can result in this script executing before all the devices - such + # as graid(8) - are available. Thus, should the mount fail, + # we will wait for the root mount hold release and retry. mount -a -t ${mount_excludes} err=$? if [ ${err} -ne 0 ]; then From owner-svn-src-head@freebsd.org Thu Jan 14 16:56:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6134A819E7; Thu, 14 Jan 2016 16:56:39 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D84F18FE; Thu, 14 Jan 2016 16:56:39 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x22e.google.com with SMTP id f206so354360537wmf.0; Thu, 14 Jan 2016 08:56:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=sTSwci6pfbbh4k9DFmJb3xx7Z3UPeTzj9el2fk1+RwQ=; b=VBtDnEiZNYggz8+fkWpEMmGkeae8RlTapA6gPBmJP6Vyzd+0pu78yCXXj8yL9M8UWL 3/1uelLcLF/U1ZxUKt1F4xTkzU7NcPxPDaPoAzdnrScixLfR9ZUX3siJ79r5yqgIEELV DSxz0HAePwaxsWN2oXxEiKu2Ms9rCDpgt2aRviY1IVUPNGpv+Zae90zJlJLDHvG03Uxf 4HoLjXeGu/2UgCyWaK9ZThkdJGO7POkwwXr+c3dmh/e7ig0qXDl6YjZ8Eu4jDy6+Cdb5 NXDMHQPTcjdjp68aLs8gC/KFgjUqH9ZpF99nO7pEdu5ElCn8PdFGPV/JbNC5lNaQ+mjQ LyDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=sTSwci6pfbbh4k9DFmJb3xx7Z3UPeTzj9el2fk1+RwQ=; b=f2ymzzYLI+DAItb0bGs9v04Zs5yV6ifXx9CrJA4MkkpB+iJXFs/mGGJLxEKDCpzJuh OjbryQI/agDbt8tfDhVIVBA6FuFgYeMRp3FlD/SW5EYuT6qB7WQikjZNUNOE8A8IagoZ uOoQaupFZI+RqK3vfFwGvWf3CSUvdphAPZlxez8iy7atkq9T6AkK0lMgkXOnr0LH6jON FfsULyVkQJqtk/W56TS6d9e18XRycu0Kt+mztPo75+SohI1YmchtCykR+65hYr/bVNwT J9JIaQnW9uCg2q8F//mn8QbVnrI/H2P0i2KDlVoAiS4jG/pCoknRZqO9r719ua9NHprs aSSQ== X-Gm-Message-State: ALoCoQn+beo2OKD61Z1vxFcyWKAswm0Q9AiLyH0gUH8PYdDPlm5VrPvvN1d7IKW7kkVtjr7X90jw0DYxfFAB0M20gZiZjPQcAw== X-Received: by 10.194.175.198 with SMTP id cc6mr5294266wjc.24.1452790597965; Thu, 14 Jan 2016 08:56:37 -0800 (PST) Received: from brick.home (aib143.neoplus.adsl.tpnet.pl. [83.25.209.143]) by smtp.gmail.com with ESMTPSA id t3sm6887989wjz.11.2016.01.14.08.56.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jan 2016 08:56:36 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 14 Jan 2016 17:56:33 +0100 From: Edward Tomasz Napierala To: Jilles Tjoelker Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290197 - in head: etc/defaults etc/rc.d sys/kern Message-ID: <20160114165633.GA1183@brick.home> Mail-Followup-To: Jilles Tjoelker , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201510301552.t9UFqAtv073641@repo.freebsd.org> <20151221170738.GA19579@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151221170738.GA19579@stack.nl> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 16:56:39 -0000 On 1221T1807, Jilles Tjoelker wrote: > On Fri, Oct 30, 2015 at 03:52:10PM +0000, Edward Tomasz Napierala wrote: > > Author: trasz > > Date: Fri Oct 30 15:52:10 2015 > > New Revision: 290197 > > URL: https://svnweb.freebsd.org/changeset/base/290197 > > > Log: > > After r290196, the kernel won't wait for stuff like gmirror nodes > > if they are not required for mounting rootfs. However, it's possible > > that some setups try to mount them in mountcritlocal (ie from fstab). > > > Export the list of current root mount holds using a new sysctl, > > vfs.root_mount_hold, and make mountcritlocal retry if "mount -a" fails > > and the list is not empty. > > > MFC after: 1 month > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D3709 > > I like the faster startup, but the rc.d script clearly will not wait as > intended. See below. > > > Modified: > > head/etc/defaults/rc.conf > > head/etc/rc.d/mountcritlocal > > head/sys/kern/vfs_mountroot.c > > > [snip] > > Modified: head/etc/rc.d/mountcritlocal > > ============================================================================== > > --- head/etc/rc.d/mountcritlocal Fri Oct 30 15:35:04 2015 (r290196) > > +++ head/etc/rc.d/mountcritlocal Fri Oct 30 15:52:10 2015 (r290197) > > @@ -15,7 +15,7 @@ stop_cmd=sync > > > > mountcritlocal_start() > > { > > - local err > > + local err holders waited > > > > # Set up the list of network filesystem types for which mounting > > # should be delayed until after network initialization. > > @@ -35,8 +35,42 @@ mountcritlocal_start() > > mount_excludes="${mount_excludes}${fstype}," > > done > > mount_excludes=${mount_excludes%,} > > + > > + # Originally, root mount hold had to be released before mounting the root > > + # filesystem. This delayed the boot, so it was changed to only wait if > > + # the root device isn't readily available. This can result in this script > > + # executing before all the devices - such as graid(8) - are available. > > + # Thus, should the mount fail, we will wait for the root mount hold release > > + # and retry. > > These lines are a bit too long. > > > mount -a -t ${mount_excludes} > > err=$? > > + if [ $? -ne 0 ]; then > > The assignment will set $? to 0, so the new code will never be executed. > "$err" should be tested instead of $?. Thanks, fixed. Previously, I've tested it by changing "-ne" to "-eq", and didn't even realize I've missed a step. From owner-svn-src-head@freebsd.org Thu Jan 14 17:03:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68B67A81D27 for ; Thu, 14 Jan 2016 17:03:05 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 096B91E26 for ; Thu, 14 Jan 2016 17:03:05 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x22f.google.com with SMTP id f206so356638161wmf.0 for ; Thu, 14 Jan 2016 09:03:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-type; bh=MyospNQAPhvQ3K4d2d3N5TRVgaf9pgtxOXgWINQ+yo0=; b=ZAFVDw9762fkHaTDviXxcMP2/cbJl/xs7PYS3p+YmJl2TXKNwHcZTzH9VA29NRF09g zRLBk7RcuxAtrkk4mMpsObrO5VbK5DWd9+6NJuduieFCox7LLGv6OT7i5A4kqk7zAZ3V zat3+m9kg2dH5oawf0ZjJGYBfKP2Kil5aO8Uici/pjEd3vzHS1h8QYohGZ0C5T5z6QWF dx+2zLon9Z5BM9Y81aixw5thFUKhMr+GsECZ4tEAkpl8f/tWeESgCUj0AYO+w3PkW8AK jjXeaVQlt0zOx9+p0bJtOVH6BqI+CIb54QotyMU7kwPx4U6EWBl04yQ8N9Bi7CnWn1K/ +A3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=MyospNQAPhvQ3K4d2d3N5TRVgaf9pgtxOXgWINQ+yo0=; b=EGS0bUDkSY88fUBFojGR1KN/1je5tgM7pnxH7e13lV0Wmu3AvAHtD4HoOaXXcw0AdR FzNgNs2luEck7HNk/hDUO7KHq9YDwv1SjTYopH6VtzMJm9LzLHWyygwwEnfIykToc1Jr IcfRaszT5O7PPKVI3wMy/b/7KdIr/4cVw3mYNxfum+qJ+hGsb4+E3oQny/M0YgMHBn+8 JtgFrjNzmtXsMzGq+CVCQxpdCCMsN/Bhy7V/P56pCNPhy1e227lKTB+QQ/Kgbx9k4Bg8 AQU08rLQi3st4atCn6NEDtxvI55wYiBNjHTnMamGZh8iFgmGSMqijlYypQxeyPCY2ze1 KTvg== X-Gm-Message-State: ALoCoQk7/pdAPte5CARGR+i+z5C2rozDqB+QNycaqfseRmeITA8pmH5oy0FLycKi/giSPlK0GP8I19O29gAFzIIMpl0rIF2IuQ== X-Received: by 10.194.6.196 with SMTP id d4mr5176320wja.120.1452790983560; Thu, 14 Jan 2016 09:03:03 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id l2sm6901164wjf.15.2016.01.14.09.03.02 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jan 2016 09:03:02 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r293903 - in head/sys/boot: arm/uboot efi/fdt efi/libefi To: Warner Losh , NGie Cooper References: <201601140922.u0E9M1rV025146@repo.freebsd.org> <9A7534C4-0A2C-4DAC-981A-09868F1723DA@gmail.com> Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <5697D4D9.9000204@freebsd.org> Date: Thu, 14 Jan 2016 17:03:21 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 17:03:05 -0000 On 14/01/2016 16:53, Warner Losh wrote: > > > On Thu, Jan 14, 2016 at 2:47 AM, NGie Cooper > wrote: > > > > On Jan 14, 2016, at 01:27, NGie Cooper > wrote: > > > > > >> On Jan 14, 2016, at 01:22, Steven Hartland wrote: > >> > >> Author: smh > >> Date: Thu Jan 14 09:22:01 2016 > >> New Revision: 293903 > >> URL: https://svnweb.freebsd.org/changeset/base/293903 > >> > >> Log: > >> Fix GCC warnings causing build failure after r293724 > >> > >> Disable some compiler warnings for GCC (non-standard compiler) > fixing > >> build failures introduced by r293724, which enabled WARNS in > the EFI boot > >> code, when compiling with none standard compiler (GCC). > > > > Disabling warnings is wrong. Here’s how arm could be fixed: > > > > $ svn diff sys/boot/ > > Index: sys/boot/common/bootstrap.h > > =================================================================== > > --- sys/boot/common/bootstrap.h (revision 293877) > > +++ sys/boot/common/bootstrap.h (working copy) > > @@ -32,6 +32,7 @@ > > #include > > #include > > #include > > +#include > > > > /* > > * Generic device specifier; architecture-dependant > > @@ -332,12 +333,8 @@ > > extern struct arch_switch archsw; > > > > /* This must be provided by the MD code, but should it be in the > archsw? */ > > -void delay(int delay); > > - > > void dev_cleanup(void); > > > > -time_t time(time_t *tloc); > > - > > #ifndef CTASSERT /* Allow lint to override */ > > #define CTASSERT(x) _CTASSERT(x, __LINE__) > > #define _CTASSERT(x, y) __CTASSERT(x, y) > > Index: sys/boot/efi/include/efiapi.h > > =================================================================== > > --- sys/boot/efi/include/efiapi.h (revision 293877) > > +++ sys/boot/efi/include/efiapi.h (working copy) > > @@ -532,6 +532,7 @@ > > typedef > > EFI_STATUS > > (EFIAPI *EFI_RESERVED_SERVICE) ( > > + VOID > > ); > > > > typedef > > > > amd64 is a bit trickier: > > > > > /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/efigop.h:75: > warning: 'ms_abi' attribute directive ignored > > > > I didn’t dig into why this is happening [yet], other than there > maybe being MS extensions involved? > > > > Thanks, > > -NGie > > This might fix amd64: > > Index: > /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/amd64/efibind.h > =================================================================== > --- > /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/amd64/efibind.h > (revision 293877) > +++ > /scratch/tmp/ngie/svn/sys/boot/efi/libefi/../include/amd64/efibind.h > (working copy) > @@ -160,8 +160,10 @@ > // > > #ifdef __amd64__ > +#if defined(__clang__) && (__clang_major__ >= 3 && > __clang_minor__ >= 5) > #define EFIAPI __attribute__((ms_abi)) > #endif > +#endif > > #ifndef EFIAPI // Forces EFI calling conventions > reguardless of compiler options > #ifdef _MSC_EXTENSIONS > > > > Sure this fix is right? If you aren't marking the ABI correctly, how > could this possibly work? > > Warner No I don't think it is, Andrew's fix is the most appropriate (disable building of all EFI on none supported platforms). Currently I intend to backout 293903 and apply this change instead. I'm just waiting on a full tinderbox under GCC to finish. Regards Steve From owner-svn-src-head@freebsd.org Thu Jan 14 17:16:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD8D0A824D9; Thu, 14 Jan 2016 17:16:48 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C0E2161B; Thu, 14 Jan 2016 17:16:48 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EHGl4S078860; Thu, 14 Jan 2016 17:16:47 GMT (envelope-from bjk@FreeBSD.org) Received: (from bjk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EHGl7v078859; Thu, 14 Jan 2016 17:16:47 GMT (envelope-from bjk@FreeBSD.org) Message-Id: <201601141716.u0EHGl7v078859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bjk set sender to bjk@FreeBSD.org using -f From: Benjamin Kaduk Date: Thu, 14 Jan 2016 17:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294023 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 17:16:48 -0000 Author: bjk (doc committer) Date: Thu Jan 14 17:16:47 2016 New Revision: 294023 URL: https://svnweb.freebsd.org/changeset/base/294023 Log: Update .Dd, missed in r294011 Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Thu Jan 14 16:55:07 2016 (r294022) +++ head/share/man/man4/ddb.4 Thu Jan 14 17:16:47 2016 (r294023) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2015 +.Dd January 14, 2016 .Dt DDB 4 .Os .Sh NAME From owner-svn-src-head@freebsd.org Thu Jan 14 17:25:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8246DA8290B; Thu, 14 Jan 2016 17:25:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B2E81C17; Thu, 14 Jan 2016 17:25:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CF2DDB97D; Thu, 14 Jan 2016 12:25:29 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293979 - head/lib/libkvm Date: Thu, 14 Jan 2016 08:47:27 -0800 Message-ID: <1724534.L5ggXaJ3CH@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201601141551.u0EFpDTf052097@repo.freebsd.org> References: <201601141551.u0EFpDTf052097@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 14 Jan 2016 12:25:29 -0500 (EST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 17:25:31 -0000 On Thursday, January 14, 2016 03:51:13 PM John Baldwin wrote: > Author: jhb > Date: Thu Jan 14 15:51:13 2016 > New Revision: 293979 > URL: https://svnweb.freebsd.org/changeset/base/293979 > > Log: > Fix building with GCC since PAGE_MASK is signed on i386. > > Reviewed by: ngie > MFC after: 1 week > Differential Revison: https://reviews.freebsd.org/D4772 Oops, misfire on the MFC. The new libkvm isn't in stable. Note that this fixes bootstrapping from stable/9 to HEAD. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jan 14 17:35:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C942FA82E39; Thu, 14 Jan 2016 17:35:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 91D401381; Thu, 14 Jan 2016 17:35:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 8B2CD78133F; Fri, 15 Jan 2016 04:34:52 +1100 (AEDT) Date: Fri, 15 Jan 2016 04:34:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293979 - head/lib/libkvm In-Reply-To: <201601141551.u0EFpDTf052097@repo.freebsd.org> Message-ID: <20160115031903.W9581@besplex.bde.org> References: <201601141551.u0EFpDTf052097@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=IwOPfhtQleq6pfVgbWMA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 17:35:01 -0000 On Thu, 14 Jan 2016, John Baldwin wrote: > Log: > Fix building with GCC since PAGE_MASK is signed on i386. > ... > Modified: head/lib/libkvm/kvm_i386.h > ============================================================================== > --- head/lib/libkvm/kvm_i386.h Thu Jan 14 15:50:13 2016 (r293978) > +++ head/lib/libkvm/kvm_i386.h Thu Jan 14 15:51:13 2016 (r293979) > @@ -70,7 +70,7 @@ _Static_assert(NBPDR == I386_NBPDR, "NBP > > _Static_assert(PG_V == I386_PG_V, "PG_V mismatch"); > _Static_assert(PG_PS == I386_PG_PS, "PG_PS mismatch"); > -_Static_assert(PG_FRAME == I386_PG_FRAME, "PG_FRAME mismatch"); > +_Static_assert((u_int)PG_FRAME == I386_PG_FRAME, "PG_FRAME mismatch"); > _Static_assert(PG_PS_FRAME == I386_PG_PS_FRAME, "PG_PS_FRAME mismatch"); > #endif This breaks the warning. PG_FRAME still has the fragile type int and the fragile value -4096. libkvm has lots of nearby style bugs like using the long long abomination as a suffix for the literal constants, and bogus parentheses around single literals. All of these are copied from the kernel (except their ames are changed by adding an I386_ prefix). The assertions aren't very useful when half of the constants use lexically identically definitions with equal ugliness. The 2 PAE constants are the main ones that aren't asserted to be equal. I think PAE in the kernel could even use the signedness of PG_FRAME. (vm_paddr_t)-4096 first sign extends to (int64_t) with value -4096 and then overflows to the correct mask of 0xfffffffffffff000 with the correct type. So -4096 could work for both PAE and !PAE. But PAE actually uses an ifdef to to define PG_FRAME as (0x000ffffffffff000ull). This has the 2 style bugs mentioned above, and seems to have a nonsense value. I think PAE is only 36 bits, but the mask is for 52 bits. I don't like explicitly typed constants, but this problem shows that some care is needed for using constants in expressions. int is correct for PAGE_SIZE but not masks, except for masks of all except the sign bit it is OK. Bruce From owner-svn-src-head@freebsd.org Thu Jan 14 17:59:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7BFEA836F7; Thu, 14 Jan 2016 17:59:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C29911FA4; Thu, 14 Jan 2016 17:59:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 34E52B93C; Thu, 14 Jan 2016 12:59:00 -0500 (EST) From: John Baldwin To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293979 - head/lib/libkvm Date: Thu, 14 Jan 2016 09:58:46 -0800 Message-ID: <2052462.S7a40kjnu6@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160115031903.W9581@besplex.bde.org> References: <201601141551.u0EFpDTf052097@repo.freebsd.org> <20160115031903.W9581@besplex.bde.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 14 Jan 2016 12:59:00 -0500 (EST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 17:59:02 -0000 On Friday, January 15, 2016 04:34:51 AM Bruce Evans wrote: > On Thu, 14 Jan 2016, John Baldwin wrote: > > > Log: > > Fix building with GCC since PAGE_MASK is signed on i386. > > ... > > > Modified: head/lib/libkvm/kvm_i386.h > > ============================================================================== > > --- head/lib/libkvm/kvm_i386.h Thu Jan 14 15:50:13 2016 (r293978) > > +++ head/lib/libkvm/kvm_i386.h Thu Jan 14 15:51:13 2016 (r293979) > > @@ -70,7 +70,7 @@ _Static_assert(NBPDR == I386_NBPDR, "NBP > > > > _Static_assert(PG_V == I386_PG_V, "PG_V mismatch"); > > _Static_assert(PG_PS == I386_PG_PS, "PG_PS mismatch"); > > -_Static_assert(PG_FRAME == I386_PG_FRAME, "PG_FRAME mismatch"); > > +_Static_assert((u_int)PG_FRAME == I386_PG_FRAME, "PG_FRAME mismatch"); > > _Static_assert(PG_PS_FRAME == I386_PG_PS_FRAME, "PG_PS_FRAME mismatch"); > > #endif > > This breaks the warning. PG_FRAME still has the fragile type int and > the fragile value -4096. The issue is that PG_FRAME in stable/9 can't retroactively be fixed very easily. However, even PG_FRAME in HEAD still uses (~PAGE_MASK), but head is using clang which doesn't warn about this. I have not tried to build head with a modern gcc to see if it would complain. > libkvm has lots of nearby style bugs like using the long long abomination > as a suffix for the literal constants, and bogus parentheses around > single literals. All of these are copied from the kernel (except their > ames are changed by adding an I386_ prefix). The assertions aren't very > useful when half of the constants use lexically identically definitions > with equal ugliness. The 2 PAE constants are the main ones that aren't > asserted to be equal. The assertions are mostly paranoia. However, it might be better to use fixed constants for all of them as the hope is that the I386_* constants have the same values on all platforms. > I think PAE in the kernel could even use the signedness of PG_FRAME. > (vm_paddr_t)-4096 first sign extends to (int64_t) with value -4096 > and then overflows to the correct mask of 0xfffffffffffff000 with the > correct type. So -4096 could work for both PAE and !PAE. But PAE > actually uses an ifdef to to define PG_FRAME as (0x000ffffffffff000ull). > This has the 2 style bugs mentioned above, and seems to have a nonsense > value. I think PAE is only 36 bits, but the mask is for 52 bits. According to the Intel SDM, PAE can support up to 52 bits as reported by cpuid (what the kernel stores in cpu_maxphysaddr). If the cpuid leaf is not supported, then 36 bits is the maximum PA bits supported. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jan 14 18:04:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A29BEA83B01; Thu, 14 Jan 2016 18:04:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B5EE17BE; Thu, 14 Jan 2016 18:04:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EI4ne3093314; Thu, 14 Jan 2016 18:04:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EI4nQu093313; Thu, 14 Jan 2016 18:04:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601141804.u0EI4nQu093313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 14 Jan 2016 18:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294026 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 18:04:50 -0000 Author: ngie Date: Thu Jan 14 18:04:49 2016 New Revision: 294026 URL: https://svnweb.freebsd.org/changeset/base/294026 Log: Fix spelling of IPMI Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Thu Jan 14 17:44:45 2016 (r294025) +++ head/share/man/man4/ddb.4 Thu Jan 14 18:04:49 2016 (r294026) @@ -1437,7 +1437,7 @@ Other bus' bridge chipsets may be able t methods. There are many PCI and PCIe add-in cards which can generate NMI for debugging. -Modern systems typically use IMPI to generate signals to enter the +Modern systems typically use IPMI to generate signals to enter the debugger. The .Dv devel/ipmitool From owner-svn-src-head@freebsd.org Thu Jan 14 18:19:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E90ADA82361; Thu, 14 Jan 2016 18:19:06 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98BF11F20; Thu, 14 Jan 2016 18:19:06 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EIJ5tv096402; Thu, 14 Jan 2016 18:19:05 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EIJ5A1096400; Thu, 14 Jan 2016 18:19:05 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201601141819.u0EIJ5A1096400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 14 Jan 2016 18:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294027 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 18:19:07 -0000 Author: asomers Date: Thu Jan 14 18:19:05 2016 New Revision: 294027 URL: https://svnweb.freebsd.org/changeset/base/294027 Log: Fix race condition involving ZFS remove events When a ZFS drive disappears, ZFS sends a resource.fs.zfs.removed event to userland. A userland program like zfsd(8) can use that event, for example to activate a hotspare. The current code contains a race condition: vdev_geom will sent the sysevent _before_ spa.c would update the vdev's status, causing userland processes to see pool state that does not reflect the device removal. This change moves the sysevent to spa.c, closing the race. Reviewed by: delphij, Sean Eric Fagan MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4902 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Jan 14 18:04:49 2016 (r294026) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Jan 14 18:19:05 2016 (r294027) @@ -5952,6 +5952,8 @@ spa_async_remove(spa_t *spa, vdev_t *vd) vd->vdev_stat.vs_checksum_errors = 0; vdev_state_dirty(vd->vdev_top); + /* Tell userspace that the vdev is gone. */ + zfs_post_remove(spa, vd); } for (int c = 0; c < vd->vdev_children; c++) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Jan 14 18:04:49 2016 (r294026) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Jan 14 18:19:05 2016 (r294027) @@ -160,7 +160,6 @@ vdev_geom_orphan(struct g_consumer *cp) * async removal support to invoke a close on this * vdev once it is safe to do so. */ - zfs_post_remove(vd->vdev_spa, vd); vd->vdev_remove_wanted = B_TRUE; spa_async_request(vd->vdev_spa, SPA_ASYNC_REMOVE); } From owner-svn-src-head@freebsd.org Thu Jan 14 18:46:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB083A83457; Thu, 14 Jan 2016 18:46:58 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77EC8132C; Thu, 14 Jan 2016 18:46:58 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EIkvsv004887; Thu, 14 Jan 2016 18:46:57 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EIkvPo004884; Thu, 14 Jan 2016 18:46:57 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601141846.u0EIkvPo004884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 14 Jan 2016 18:46:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294028 - in head/sys/boot: arm/uboot efi/fdt efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 18:46:58 -0000 Author: smh Date: Thu Jan 14 18:46:57 2016 New Revision: 294028 URL: https://svnweb.freebsd.org/changeset/base/294028 Log: Revert r293903 Revert r293903 as EFI shouldn't be built on this platform that the this was reported on. Sponsored by: Multiplay Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/efi/fdt/Makefile head/sys/boot/efi/libefi/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Thu Jan 14 18:19:05 2016 (r294027) +++ head/sys/boot/arm/uboot/Makefile Thu Jan 14 18:46:57 2016 (r294028) @@ -8,8 +8,6 @@ NEWVERSWHAT= "U-Boot loader" ${MACHINE_A BINDIR?= /boot INSTALLFLAGS= -b WARNS?= 1 -CWARNFLAGS.gcc+= -Wno-int-to-pointer-cast - # Address at which ubldr will be loaded. # This varies for different boards and SOCs. UBLDR_LOADADDR?= 0x1000000 Modified: head/sys/boot/efi/fdt/Makefile ============================================================================== --- head/sys/boot/efi/fdt/Makefile Thu Jan 14 18:19:05 2016 (r294027) +++ head/sys/boot/efi/fdt/Makefile Thu Jan 14 18:46:57 2016 (r294028) @@ -7,8 +7,6 @@ LIB= efi_fdt INTERNALLIB= WARNS?= 6 -CWARNFLAGS.gcc+= -Wno-strict-prototypes -CWARNFLAGS.gcc+= -Wno-redundant-decls SRCS= efi_fdt.c Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Thu Jan 14 18:19:05 2016 (r294027) +++ head/sys/boot/efi/libefi/Makefile Thu Jan 14 18:46:57 2016 (r294028) @@ -3,7 +3,6 @@ LIB= efi INTERNALLIB= WARNS?= 2 -CWARNFLAGS.gcc+= -Wno-attributes SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c From owner-svn-src-head@freebsd.org Thu Jan 14 18:53:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DA2DA83756; Thu, 14 Jan 2016 18:53:56 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6CB018AC; Thu, 14 Jan 2016 18:53:55 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EIrskH007867; Thu, 14 Jan 2016 18:53:54 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EIrshB007863; Thu, 14 Jan 2016 18:53:54 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601141853.u0EIrshB007863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 14 Jan 2016 18:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294029 - in head/sys/boot/efi: . boot1 loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 18:53:56 -0000 Author: smh Date: Thu Jan 14 18:53:54 2016 New Revision: 294029 URL: https://svnweb.freebsd.org/changeset/base/294029 Log: Only build EFI components on supported compilers As the in-tree GCC does not support __attribute__((ms_abi)) EFI can only be built with Clang. The EFI loader and boot1 validated this, but unused libefi was still built causing issues under GCC after warnings where enabled by r293724. Disable building all of EFI when the selected compiler is GCC. MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/sys/boot/efi/Makefile head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/Makefile ============================================================================== --- head/sys/boot/efi/Makefile Thu Jan 14 18:46:57 2016 (r294028) +++ head/sys/boot/efi/Makefile Thu Jan 14 18:53:54 2016 (r294029) @@ -2,7 +2,8 @@ .include -SUBDIR= libefi +# In-tree GCC does not support __attribute__((ms_abi)). +.if ${COMPILER_TYPE} != "gcc" .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" .if ${MK_FDT} != "no" @@ -13,7 +14,10 @@ SUBDIR+= fdt .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "arm" -SUBDIR+= loader boot1 +SUBDIR+= libefi loader boot1 .endif +.endif # ${COMPILER_TYPE} != "gcc" + .include + Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Thu Jan 14 18:46:57 2016 (r294028) +++ head/sys/boot/efi/boot1/Makefile Thu Jan 14 18:53:54 2016 (r294029) @@ -4,9 +4,6 @@ MAN= .include -# In-tree GCC does not support __attribute__((ms_abi)). -.if ${COMPILER_TYPE} != "gcc" - MK_SSP= no PROG= boot1.sym @@ -96,8 +93,6 @@ boot1.efifat: boot1.efi CLEANFILES= boot1.efi boot1.efifat -.endif # ${COMPILER_TYPE} != "gcc" - .include beforedepend ${OBJS}: machine Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Thu Jan 14 18:46:57 2016 (r294028) +++ head/sys/boot/efi/loader/Makefile Thu Jan 14 18:53:54 2016 (r294029) @@ -4,9 +4,6 @@ MAN= .include -# In-tree GCC does not support __attribute__((ms_abi)). -.if ${COMPILER_TYPE} != "gcc" - MK_SSP= no PROG= loader.sym @@ -113,8 +110,6 @@ DPADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} $ ${LDSCRIPT} LDADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSTAND} -.endif # ${COMPILER_TYPE} != "gcc" - .include beforedepend ${OBJS}: machine From owner-svn-src-head@freebsd.org Thu Jan 14 19:00:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EB92A839D6; Thu, 14 Jan 2016 19:00:15 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F18B21DA9; Thu, 14 Jan 2016 19:00:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EJ0DnD009231; Thu, 14 Jan 2016 19:00:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EJ0DKN009224; Thu, 14 Jan 2016 19:00:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601141900.u0EJ0DKN009224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 14 Jan 2016 19:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294031 - in head: lib/clang lib/libc++ usr.bin/clang/clang usr.bin/clang/lldb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 19:00:15 -0000 Author: andrew Date: Thu Jan 14 19:00:13 2016 New Revision: 294031 URL: https://svnweb.freebsd.org/changeset/base/294031 Log: Set -mlong-calls where needed to get a static clang and lldb 3.8.0 linking. These are too large for a branch instruction to branch from an earlier point in the code to somewhere later. This will also allow these to be build with Thumb-2 when we get this infrastructure. Reviewed by: dim Differential Revision: https://reviews.freebsd.org/D4855 Modified: head/lib/clang/clang.lib.mk head/lib/libc++/Makefile head/usr.bin/clang/clang/Makefile head/usr.bin/clang/lldb/Makefile Modified: head/lib/clang/clang.lib.mk ============================================================================== --- head/lib/clang/clang.lib.mk Thu Jan 14 18:57:17 2016 (r294030) +++ head/lib/clang/clang.lib.mk Thu Jan 14 19:00:13 2016 (r294031) @@ -6,4 +6,8 @@ LLVM_SRCS= ${.CURDIR}/../../../contrib/l INTERNALLIB= +.if ${MACHINE_CPUARCH} == "arm" +STATIC_CXXFLAGS+= -mlong-calls +.endif + .include Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Thu Jan 14 18:57:17 2016 (r294030) +++ head/lib/libc++/Makefile Thu Jan 14 19:00:13 2016 (r294031) @@ -6,6 +6,9 @@ _LIBCXXRTDIR= ${.CURDIR}/../../contrib/l HDRDIR= ${.CURDIR}/../../contrib/libc++/include SRCDIR= ${.CURDIR}/../../contrib/libc++/src CXXINCLUDEDIR= ${INCLUDEDIR}/c++/v${SHLIB_MAJOR} +.if ${MACHINE_CPUARCH} == "arm" +STATIC_CXXFLAGS+= -mlong-calls +.endif .PATH: ${SRCDIR} Modified: head/usr.bin/clang/clang/Makefile ============================================================================== --- head/usr.bin/clang/clang/Makefile Thu Jan 14 18:57:17 2016 (r294030) +++ head/usr.bin/clang/clang/Makefile Thu Jan 14 19:00:13 2016 (r294031) @@ -11,6 +11,10 @@ SRCS= cc1_main.cpp \ .if ${MK_SHARED_TOOLCHAIN} == "no" NO_SHARED?= yes + +.if ${MACHINE_CPUARCH} == "arm" +CFLAGS+= -mlong-calls +.endif .endif LINKS= ${BINDIR}/clang ${BINDIR}/clang++ \ Modified: head/usr.bin/clang/lldb/Makefile ============================================================================== --- head/usr.bin/clang/lldb/Makefile Thu Jan 14 18:57:17 2016 (r294030) +++ head/usr.bin/clang/lldb/Makefile Thu Jan 14 19:00:13 2016 (r294031) @@ -8,6 +8,9 @@ LLDB_SRCS=${.CURDIR}/../../../contrib/ll CFLAGS+= -I${LLDB_SRCS}/include CXXFLAGS+= -std=c++11 +.if ${MACHINE_CPUARCH} == "arm" +CFLAGS+= -mlong-calls +.endif SRCDIR= tools/lldb/tools/driver SRCS= Driver.cpp \ From owner-svn-src-head@freebsd.org Thu Jan 14 19:27:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E779EA82215; Thu, 14 Jan 2016 19:27:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id B0A9919C5; Thu, 14 Jan 2016 19:27:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 0B0CB1043102; Fri, 15 Jan 2016 06:27:07 +1100 (AEDT) Date: Fri, 15 Jan 2016 06:27:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294011 - head/share/man/man4 In-Reply-To: <201601141623.u0EGN7me063431@repo.freebsd.org> Message-ID: <20160115044315.T9902@besplex.bde.org> References: <201601141623.u0EGN7me063431@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=ZLDtgeUadiggRli_pP4A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 19:27:17 -0000 On Thu, 14 Jan 2016, Warner Losh wrote: > Log: > Document how to enter the debugger here. I'm sure there's some better > canonical place, and the nit-pickers are welcome to move this > information there with a cross reference. > ... > Modified: head/share/man/man4/ddb.4 > ============================================================================== > --- head/share/man/man4/ddb.4 Thu Jan 14 16:21:58 2016 (r294010) > +++ head/share/man/man4/ddb.4 Thu Jan 14 16:23:07 2016 (r294011) > @@ -1435,6 +1435,47 @@ The NMI allows one to break into the deb > ... > +.Pp > +For serial consoles, you can break to the debugger by sending a BREAK > +condition on the serial line if > +.Cd options BREAK_TO_DEBUGGER > +is specified in the kernel. > +Most terminal emulation programs can send a break sequence with a > +special key sequence or via a menu item. > +However, in some setups, sending the break can be difficult to arrange > +or happens spuriously, so if the kernel contains This is all quite broken, though the above description is almost correct. The BREAK_TO_DEBUGGER option used to mean: enter (not break into) the debugger using a serial line break. This is a good method, except it is too easy to get serial line breaks. Unplugging the cable usually gives on, and turning off the other end might give one. So this method is only usable on local systems with secure cables that you don't trip over or otherwise disconnect). This option was broken to mean: the default for the sysctl that controls "breaking into" the debugger using either a serial line break or the console key for "breaking into" the debugger. For almost perfection confusion, this key is normally the "Ctrl-Print Screen" key on PC keyboards and there is a "Break" key nearby. Ctrl-Alt-Esc also works. syscons(4) misdocuments the latter as Alt-Esc. Under WinDOS, the Break key normally needs Ctrl to make it do anything, but under FreeBSD (syscons), Ctrl- Break is an alias for Scroll Lock. If you actually have a serial console, then you should normally not configure BREAK_TO_DEBUGGER since it gives the problems with cables, but this breaks the console keys. You can reenable them using the sysctl, but this also enables entry for serial line breaks since there is no longer any ifdef to keep the code for that out of the kernel, and no runtime option to control it independently of other console drivers. There is a maze of compile-time options and sysctls to give further control for non-serial consoles. These are of course spelled differently so they are hard to find. For syscons, DISABLE_KDBKEY removes the code for all debugger entry keys. Here KDBKEY has a nice confusing name. It looks a bit like KBDKEY (keyboard key) but actual meant "kernel debugger key" and now means "all key sequences that might lead to the kernel debugger". The corresponding runtime option is of course spelled differently, with kbd instead of kdb. It is hw.syscons.kbd_debug. The maze is different and more broken in vt. There is no option like DISABLE_KDBKEY. The 2 different types of key sequences for entering the debugger are misconfigured differently: - "alt-break" sequence: this is ifdefed with KDB so it is unreachable unless KDB is configured - "break" key: kdb has a stub that can be called even when KDB is not configured. The stub does a wrong thing (doesn't print a warning if KDB is not configured; similarly if KDB is configured but no back end is attached). This is gated by the sysctl, unlike "alt-break". The sysctl has been partly fixed to have a similar name. It now has the same leaf name but is under kern instead of hw (kern.vt.kbd_debug). The sysctls are gated by each other, so none of them works as documented and the maze must be understood to turn everything on or off. Actually there are separate gates for the 2 kdb sysctls. The gate for the "break" key normally defaults to off in kdb (since BREAK_TO_DEBUGGER is normally not configured), and everthing else defaults to on, so to turn on the "break" key it suffices to turn on the kdb gate for it, but that also turns on serial breaks support. vt also makes all the sysctls tunables and even documents this. It documents both "break" keys correctly. The "alt-break" entries are not documented in syscons(4) or vt(4). > +.Cd options ALT_BREAK_TO_DEBUGGER ALT_BREAK_TO_DEBUGGER was the start of the misnaming. It means "alternative method to a serial line break for entering the debugger" but is usually read as "alternative method for breaking into the debugger". Not configuring this used to omit code for doing it. Now the configuration s soft. The code is always there if KDB is, and this option just gives the default for the sysctl that controls the feature. The sysctl for this is separate from the one for the "break" key, and both are tunables. These are the only tunables in kdb. These sysctls have bad names matching the options (with "break" that is unrelated to serial line breaks in them) and similar descriptions. The names and descriptions of the console driver's sysctls never said "break". > +then the sequence of CR TILDE CTRL-B enters the debugger; > +CR TILDE CTRL-P causes a panic instead of entering the > +debugger; and > +CR TILDE CTRL-R causes an immediate reboot. There are excessive knobs to control rebooting keys too. syscons has an option and a flag to control its reboot key. This method of rebooting should never be used because its implementation is broken. Many kdb and ddb commands have a broken implementation, since since it is invalid to call almost any non-ddb function from ddb context. The implementation is almost good enough for panic. Calling panic from within ddb is invalid too, but if you are lucky it will hang or panic recursively before doing any damage. The suspend key doesn't have any knobs to control it AFAIK, and works like the panic keys here. I sometimes wish for a "signal" key that sends signals to selected threads, especially to init to go to single user mode. Bruce From owner-svn-src-head@freebsd.org Thu Jan 14 19:33:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED621A825CF; Thu, 14 Jan 2016 19:33:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F84B1E0A; Thu, 14 Jan 2016 19:33:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EJXDmI020891; Thu, 14 Jan 2016 19:33:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EJXDVg020890; Thu, 14 Jan 2016 19:33:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601141933.u0EJXDVg020890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 14 Jan 2016 19:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294032 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 19:33:15 -0000 Author: ian Date: Thu Jan 14 19:33:13 2016 New Revision: 294032 URL: https://svnweb.freebsd.org/changeset/base/294032 Log: Fix the handling of the "PDC write transfer length" erratum for at91. The problem affects revision 1xx hardware as well as later versions. Also, the recommended workaround is to set the PDC count register for a 12-byte transfer when the actual size is less than that, but there is no need to extend or zero-out the data buffer, because the blklen register contains the real transfer size and only that many bytes will be transferred. Also add a sysctl to turn debugging printfs on or off on the fly. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Thu Jan 14 19:00:13 2016 (r294031) +++ head/sys/arm/at91/at91_mci.c Thu Jan 14 19:33:13 2016 (r294032) @@ -446,6 +446,9 @@ at91_mci_attach(device_t dev) CTLFLAG_RW, &sc->allow_overclock, 0, "Allow up to 30MHz clock for 25MHz request when next highest speed 15MHz or less."); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "debug", + CTLFLAG_RWTUN, &mci_debug, 0, "enable debug output"); + /* * Our real min freq is master_clock/512, but upper driver layers are * going to set the min speed during card discovery, and the right speed @@ -783,15 +786,6 @@ at91_mci_start_cmd(struct at91_mci_softc WR4(sc, PDC_PTCR, PDC_PTCR_RXTEN); } else { len = min(BBSIZE, remaining); - /* - * If this is MCI1 revision 2xx controller, apply - * a work-around for the "Data Write Operation and - * number of bytes" erratum. - */ - if ((sc->sc_cap & CAP_MCI1_REV2XX) && len < 12) { - len = 12; - memset(sc->bbuf_vaddr[0], 0, 12); - } at91_bswap_buf(sc, sc->bbuf_vaddr[0], data->data, len); err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], sc->bbuf_vaddr[0], len, at91_mci_getaddr, @@ -800,8 +794,13 @@ at91_mci_start_cmd(struct at91_mci_softc panic("IO write dmamap_load failed\n"); bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], BUS_DMASYNC_PREWRITE); + /* + * Erratum workaround: PDC transfer length on a write + * must not be smaller than 12 bytes (3 words); only + * blklen bytes (set above) are actually transferred. + */ WR4(sc, PDC_TPR,paddr); - WR4(sc, PDC_TCR, len / 4); + WR4(sc, PDC_TCR, (len < 12) ? 3 : len / 4); sc->bbuf_len[0] = len; remaining -= len; if (remaining == 0) { @@ -818,7 +817,7 @@ at91_mci_start_cmd(struct at91_mci_softc bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], BUS_DMASYNC_PREWRITE); WR4(sc, PDC_TNPR, paddr); - WR4(sc, PDC_TNCR, len / 4); + WR4(sc, PDC_TNCR, (len < 12) ? 3 : len / 4); sc->bbuf_len[1] = len; remaining -= len; } From owner-svn-src-head@freebsd.org Thu Jan 14 20:25:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD97DA837DC; Thu, 14 Jan 2016 20:25:23 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB6411AD4; Thu, 14 Jan 2016 20:25:23 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EKPMM0035475; Thu, 14 Jan 2016 20:25:22 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EKPMKv035474; Thu, 14 Jan 2016 20:25:22 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201601142025.u0EKPMKv035474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 14 Jan 2016 20:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294035 - head/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 20:25:24 -0000 Author: gonzo Date: Thu Jan 14 20:25:22 2016 New Revision: 294035 URL: https://svnweb.freebsd.org/changeset/base/294035 Log: Fix order of last two arguments of mtx_init Spotted by: jmcneill@NetBSD.org Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c Thu Jan 14 20:04:44 2016 (r294034) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c Thu Jan 14 20:25:22 2016 (r294035) @@ -173,7 +173,7 @@ bcm_vchiq_attach(device_t dev) return (ENXIO); } - mtx_init(&sc->lock, "vchiq", MTX_DEF, 0); + mtx_init(&sc->lock, "vchiq", 0, MTX_DEF); bcm_vchiq_sc = sc; vchiq_init(); From owner-svn-src-head@freebsd.org Thu Jan 14 20:25:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5214A83815; Thu, 14 Jan 2016 20:25:36 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A49931C48; Thu, 14 Jan 2016 20:25:36 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aJoSU-000LD2-Qs; Thu, 14 Jan 2016 23:25:26 +0300 Date: Thu, 14 Jan 2016 23:25:26 +0300 From: Slawa Olhovchenkov To: Bruce Evans Cc: Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r294011 - head/share/man/man4 Message-ID: <20160114202526.GA37895@zxy.spb.ru> References: <201601141623.u0EGN7me063431@repo.freebsd.org> <20160115044315.T9902@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160115044315.T9902@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 20:25:37 -0000 On Fri, Jan 15, 2016 at 06:27:05AM +1100, Bruce Evans wrote: > On Thu, 14 Jan 2016, Warner Losh wrote: > > > Log: > > Document how to enter the debugger here. I'm sure there's some better > > canonical place, and the nit-pickers are welcome to move this > > information there with a cross reference. > > ... > > Modified: head/share/man/man4/ddb.4 > > ============================================================================== > > --- head/share/man/man4/ddb.4 Thu Jan 14 16:21:58 2016 (r294010) > > +++ head/share/man/man4/ddb.4 Thu Jan 14 16:23:07 2016 (r294011) > > @@ -1435,6 +1435,47 @@ The NMI allows one to break into the deb > > ... > > +.Pp > > +For serial consoles, you can break to the debugger by sending a BREAK > > +condition on the serial line if > > +.Cd options BREAK_TO_DEBUGGER > > +is specified in the kernel. > > +Most terminal emulation programs can send a break sequence with a > > +special key sequence or via a menu item. > > +However, in some setups, sending the break can be difficult to arrange > > +or happens spuriously, so if the kernel contains > > This is all quite broken, though the above description is almost correct. > > The BREAK_TO_DEBUGGER option used to mean: enter (not break into) the > debugger using a serial line break. This is a good method, except it > is too easy to get serial line breaks. Unplugging the cable usually > gives on, and turning off the other end might give one. So this method > is only usable on local systems with secure cables that you don't trip > over or otherwise disconnect). > > This option was broken to mean: the default for the sysctl that controls > "breaking into" the debugger using either a serial line break or the console > key for "breaking into" the debugger. For almost perfection confusion, > this key is normally the "Ctrl-Print Screen" key on PC keyboards and > there is a "Break" key nearby. Ctrl-Alt-Esc also works. syscons(4) On may keyboard "Break" subscribe to "Pause", to "Print Screen" subscribe "SysReq". From owner-svn-src-head@freebsd.org Thu Jan 14 20:51:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAA73A8228B; Thu, 14 Jan 2016 20:51:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 848D41D26; Thu, 14 Jan 2016 20:51:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EKpmCu043351; Thu, 14 Jan 2016 20:51:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EKpm7f043350; Thu, 14 Jan 2016 20:51:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601142051.u0EKpm7f043350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 Jan 2016 20:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294036 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 20:51:49 -0000 Author: jhb Date: Thu Jan 14 20:51:48 2016 New Revision: 294036 URL: https://svnweb.freebsd.org/changeset/base/294036 Log: Rename aiod_bio taskqueue to aiod_kick. This taskqueue is not used to handle bio requests. It is only used to run aio_kick_nowait() to spin up new aio daemon processes. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D4904 Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Thu Jan 14 20:25:22 2016 (r294035) +++ head/sys/kern/vfs_aio.c Thu Jan 14 20:51:48 2016 (r294036) @@ -392,7 +392,7 @@ static struct filterops lio_filtops = { static eventhandler_tag exit_tag, exec_tag; -TASKQUEUE_DEFINE_THREAD(aiod_bio); +TASKQUEUE_DEFINE_THREAD(aiod_kick); /* * Main operations function for use as a kernel module. @@ -555,7 +555,7 @@ aio_unload(void) return error; async_io_version = 0; aio_swake = NULL; - taskqueue_free(taskqueue_aiod_bio); + taskqueue_free(taskqueue_aiod_kick); delete_unrhdr(aiod_unr); uma_zdestroy(kaio_zone); uma_zdestroy(aiop_zone); @@ -802,7 +802,7 @@ restart: } } AIO_UNLOCK(ki); - taskqueue_drain(taskqueue_aiod_bio, &ki->kaio_task); + taskqueue_drain(taskqueue_aiod_kick, &ki->kaio_task); mtx_destroy(&ki->kaio_mtx); uma_zfree(kaio_zone, ki); p->p_aioinfo = NULL; @@ -1861,7 +1861,7 @@ aio_kick_nowait(struct proc *userp) } else if (((num_aio_resv_start + num_aio_procs) < max_aio_procs) && ((ki->kaio_active_count + num_aio_resv_start) < ki->kaio_maxactive_count)) { - taskqueue_enqueue(taskqueue_aiod_bio, &ki->kaio_task); + taskqueue_enqueue(taskqueue_aiod_kick, &ki->kaio_task); } } From owner-svn-src-head@freebsd.org Thu Jan 14 20:57:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABF54A8244F; Thu, 14 Jan 2016 20:57:21 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B9101239; Thu, 14 Jan 2016 20:57:21 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from aurora.physics.berkeley.edu (aurora.physics.berkeley.edu [128.32.117.67]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u0EKvICn024243 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 14 Jan 2016 12:57:19 -0800 Subject: Re: svn commit: r294029 - in head/sys/boot/efi: . boot1 loader To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601141853.u0EIrshB007863@repo.freebsd.org> From: Nathan Whitehorn Message-ID: <56980BAE.6070304@freebsd.org> Date: Thu, 14 Jan 2016 12:57:18 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201601141853.u0EIrshB007863@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZZg43Id3JBTzJW7bjd4yZ3hKYDHINE94990ynZix+BrIwYBdix1JbbvHZNZyh0typtgTLnfy9xeP2YkfrL49m/pX2grTe31v4= X-Sonic-ID: C;0BozZgG75RG/IvA4AoajKQ== M;JAhlZgG75RG/IvA4AoajKQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 20:57:21 -0000 On 01/14/16 10:53, Steven Hartland wrote: > Author: smh > Date: Thu Jan 14 18:53:54 2016 > New Revision: 294029 > URL: https://svnweb.freebsd.org/changeset/base/294029 > > Log: > Only build EFI components on supported compilers > > As the in-tree GCC does not support __attribute__((ms_abi)) EFI can only > be built with Clang. > > The EFI loader and boot1 validated this, but unused libefi was still built > causing issues under GCC after warnings where enabled by r293724. > > Disable building all of EFI when the selected compiler is GCC. > How about with newer-than-4.2 versions of GCC? Surely this *is* supported in newer compilers. Do we need some build infrastructure to how about the compiler version as well as type? -Nathan From owner-svn-src-head@freebsd.org Thu Jan 14 21:08:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB03EA82807; Thu, 14 Jan 2016 21:08:24 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B0351A81; Thu, 14 Jan 2016 21:08:24 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EL8N01047002; Thu, 14 Jan 2016 21:08:23 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EL8NDZ047001; Thu, 14 Jan 2016 21:08:23 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201601142108.u0EL8NDZ047001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Thu, 14 Jan 2016 21:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294037 - head/lib/libmd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 21:08:25 -0000 Author: jtl Date: Thu Jan 14 21:08:23 2016 New Revision: 294037 URL: https://svnweb.freebsd.org/changeset/base/294037 Log: Improvements to the MDXFileChunk() template function: - Remove unneeded fstat()/lseek() calls. - Return NULL and set errno to EINVAL on negative length. - Fix small style problems and expand variable names. After this change, it is possible to use this code for some irregular files. For example, 'md5 /dev/md0' should now succeed. Differential Revision: https://reviews.freebsd.org/D4748 Suggested by: bde Reviewed by: bde, allanjude, delphij Modified: head/lib/libmd/mdXhl.c Modified: head/lib/libmd/mdXhl.c ============================================================================== --- head/lib/libmd/mdXhl.c Thu Jan 14 20:51:48 2016 (r294036) +++ head/lib/libmd/mdXhl.c Thu Jan 14 21:08:23 2016 (r294037) @@ -1,4 +1,5 @@ -/* mdXhl.c * ---------------------------------------------------------------------------- +/* mdXhl.c + * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think @@ -52,43 +53,44 @@ MDXFileChunk(const char *filename, char unsigned char buffer[16*1024]; MDX_CTX ctx; struct stat stbuf; - int f, i, e; - off_t n; + int fd, readrv, e; + off_t remain; - MDXInit(&ctx); - f = open(filename, O_RDONLY); - if (f < 0) - return 0; - if (fstat(f, &stbuf) < 0) { - i = -1; - goto error; + if (len < 0) { + errno = EINVAL; + return NULL; } - if (ofs > stbuf.st_size) - ofs = stbuf.st_size; - if ((len == 0) || (len > stbuf.st_size - ofs)) - len = stbuf.st_size - ofs; - if (lseek(f, ofs, SEEK_SET) < 0) { - i = -1; - goto error; + + MDXInit(&ctx); + fd = open(filename, O_RDONLY); + if (fd < 0) + return NULL; + if (ofs != 0) { + errno = 0; + if (lseek(fd, ofs, SEEK_SET) != ofs || + (ofs == -1 && errno != 0)) { + readrv = -1; + goto error; + } } - n = len; - i = 0; - while (n > 0) { - if (n > sizeof(buffer)) - i = read(f, buffer, sizeof(buffer)); + remain = len; + readrv = 0; + while (len == 0 || remain > 0) { + if (len == 0 || remain > sizeof(buffer)) + readrv = read(fd, buffer, sizeof(buffer)); else - i = read(f, buffer, n); - if (i <= 0) + readrv = read(fd, buffer, remain); + if (readrv <= 0) break; - MDXUpdate(&ctx, buffer, i); - n -= i; + MDXUpdate(&ctx, buffer, readrv); + remain -= readrv; } error: e = errno; - close(f); + close(fd); errno = e; - if (i < 0) - return 0; + if (readrv < 0) + return NULL; return (MDXEnd(&ctx, buf)); } From owner-svn-src-head@freebsd.org Thu Jan 14 21:26:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A39EDA82DA9 for ; Thu, 14 Jan 2016 21:26:46 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 388B312F4 for ; Thu, 14 Jan 2016 21:26:46 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x22d.google.com with SMTP id l65so361987218wmf.1 for ; Thu, 14 Jan 2016 13:26:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=qWYKJQUBZSIA3OKpDbMSDJCTeTqB1MYthVx83ZUMF4c=; b=CVGRl6gapPC2OizB19kDtiFLU33mdxiiR7DttnWe9KjKCM1Vgu+sIqnhYrcVgghiD6 veWOMlm16KAhB6g72qaRi5hGfUkf2bpra+qf7xfWoZP9eGLf5wAJkqyO9dIFosdoneC0 Vu7T3mUGRwj8fvGSShTNEJY6mwdJBy2EULUEnXCSG/vrCOUo3eoT5HQcBPwZpbGfccFx i3CSnrA5nWX/GZuz8nPpWIJR97dQOpGGk0tTpis/ztaFrkfY13Je2PM1t78m3Mk0io2z 2c+P2VSZsgFfcNyleagA5qbRUUBCyuF2tXuJRGn8MXEQJrG/eQctYnKM9SSrc2WNK9k2 LpUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=qWYKJQUBZSIA3OKpDbMSDJCTeTqB1MYthVx83ZUMF4c=; b=luIwA1M715HO9JOq6jAIeVf0ShaF+oh7czQcg8awyHsUsz8zkZUcy/OCZfJgsOo09/ mhBsirXDSWcPz34bPmR3BMrx43pAuJDeEeDFR47jMRS9f/SfK3YRIzvAHyPhH3KO/pWu 4TmRjqHcSn9FLNTssv9WB3ZYQ9R/H4k1afmKj24FgjCrfkTspK+x+LP/zISwryZMErGD RZVMwbSU9V5jRimjiH1ja6Pariz4mw+rho5SubxU1KTd3B+ydoOtr961ejmf/oV23wh6 W/skzX+s/QDlSr5x+1WTNFjQoT4lNB+h76Psy+gO8VDDzrd0LwNMdX7lFYnV8TwZLzmF o2IA== X-Gm-Message-State: ALoCoQkh7DF8eOxrKl/+iqwph45GoPRtJSMcN+E5HykImddnE2pc1dq1gNaSy3lsM4KVGId4OAhj67tr7xITFLIq2eiwgdbVug== X-Received: by 10.194.202.135 with SMTP id ki7mr7244720wjc.81.1452806804708; Thu, 14 Jan 2016 13:26:44 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id k130sm8994918wmg.6.2016.01.14.13.26.43 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jan 2016 13:26:43 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r294029 - in head/sys/boot/efi: . boot1 loader To: Nathan Whitehorn , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601141853.u0EIrshB007863@repo.freebsd.org> <56980BAE.6070304@freebsd.org> Message-ID: <569812A6.9020101@freebsd.org> Date: Thu, 14 Jan 2016 21:27:02 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56980BAE.6070304@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 21:26:46 -0000 On 14/01/2016 20:57, Nathan Whitehorn wrote: > > > On 01/14/16 10:53, Steven Hartland wrote: >> Author: smh >> Date: Thu Jan 14 18:53:54 2016 >> New Revision: 294029 >> URL: https://svnweb.freebsd.org/changeset/base/294029 >> >> Log: >> Only build EFI components on supported compilers >> As the in-tree GCC does not support __attribute__((ms_abi)) EFI >> can only >> be built with Clang. >> The EFI loader and boot1 validated this, but unused libefi was >> still built >> causing issues under GCC after warnings where enabled by r293724. >> Disable building all of EFI when the selected compiler is GCC. > > How about with newer-than-4.2 versions of GCC? Surely this *is* > supported in newer compilers. Do we need some build infrastructure to > how about the compiler version as well as type? > -Nathan If it is then even without this change you wouldn't have have got the EFI loader or boot1, just an unused libefi. This change ensures that builds with in-tree Clang and GCC build on all platforms, even if GCC doesn't build the EFI components. If someone that uses none in-tree GCC has some time to dedicate to make this work that would be great :) Regards Steve Regards Steve From owner-svn-src-head@freebsd.org Thu Jan 14 21:28:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0E80A82E7F; Thu, 14 Jan 2016 21:28:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C7BD152B; Thu, 14 Jan 2016 21:28:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ELSue5052825; Thu, 14 Jan 2016 21:28:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ELSuKB052824; Thu, 14 Jan 2016 21:28:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601142128.u0ELSuKB052824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 Jan 2016 21:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294038 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 21:28:57 -0000 Author: jhb Date: Thu Jan 14 21:28:56 2016 New Revision: 294038 URL: https://svnweb.freebsd.org/changeset/base/294038 Log: Remove aiod_timeout. It hasn't been used since the AIO code was made MPSAFE 10 years ago. Reviewed by: kib Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D4946 Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Thu Jan 14 21:08:23 2016 (r294037) +++ head/sys/kern/vfs_aio.c Thu Jan 14 21:28:56 2016 (r294038) @@ -117,10 +117,6 @@ static uint64_t jobseqno; #define MAX_BUF_AIO 16 #endif -#ifndef AIOD_TIMEOUT_DEFAULT -#define AIOD_TIMEOUT_DEFAULT (10 * hz) -#endif - #ifndef AIOD_LIFETIME_DEFAULT #define AIOD_LIFETIME_DEFAULT (30 * hz) #endif @@ -165,10 +161,6 @@ SYSCTL_INT(_vfs_aio, OID_AUTO, num_buf_a /* XXX This should be local to aio_aqueue() */ static int num_aio_resv_start = 0; -static int aiod_timeout; -SYSCTL_INT(_vfs_aio, OID_AUTO, aiod_timeout, CTLFLAG_RW, &aiod_timeout, 0, - "Timeout value for synchronous aio operations"); - static int aiod_lifetime; SYSCTL_INT(_vfs_aio, OID_AUTO, aiod_lifetime, CTLFLAG_RW, &aiod_lifetime, 0, "Maximum lifetime for idle aiod"); @@ -504,7 +496,6 @@ aio_onceonly(void) NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); aiolio_zone = uma_zcreate("AIOLIO", sizeof(struct aioliojob), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - aiod_timeout = AIOD_TIMEOUT_DEFAULT; aiod_lifetime = AIOD_LIFETIME_DEFAULT; jobrefid = 1; async_io_version = _POSIX_VERSION; From owner-svn-src-head@freebsd.org Thu Jan 14 21:31:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B84B8A82F90; Thu, 14 Jan 2016 21:31:27 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CB731A79; Thu, 14 Jan 2016 21:31:27 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ELVQa2054945; Thu, 14 Jan 2016 21:31:26 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ELVQ70054944; Thu, 14 Jan 2016 21:31:26 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601142131.u0ELVQ70054944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 14 Jan 2016 21:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294040 - head/sys/boot/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 21:31:27 -0000 Author: smh Date: Thu Jan 14 21:31:26 2016 New Revision: 294040 URL: https://svnweb.freebsd.org/changeset/base/294040 Log: Prevent bogus compiler in ZFS boot code Silence a bogus compiler warning about indexing past the end of dn_bonus. The ZFS code ensures this is not possible but the compiler can't determine this so added an additional check to prevent this warning. Sponsored by: Multiplay Modified: head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Thu Jan 14 21:29:38 2016 (r294039) +++ head/sys/boot/zfs/zfsimpl.c Thu Jan 14 21:31:26 2016 (r294040) @@ -2165,7 +2165,13 @@ zfs_lookup(const struct zfsmount *mount, strcpy(&path[sb.st_size], p); else path[sb.st_size] = 0; - if (sb.st_size + sizeof(znode_phys_t) <= dn.dn_bonuslen) { + /* + * Second test is purely to silence bogus compiler + * warning about accessing past the end of dn_bonus. + */ + if (sb.st_size + sizeof(znode_phys_t) <= + dn.dn_bonuslen && sizeof(znode_phys_t) <= + sizeof(dn.dn_bonus)) { memcpy(path, &dn.dn_bonus[sizeof(znode_phys_t)], sb.st_size); } else { From owner-svn-src-head@freebsd.org Thu Jan 14 21:33:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0D9CA83107 for ; Thu, 14 Jan 2016 21:33:26 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 396B91CA5 for ; Thu, 14 Jan 2016 21:33:26 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x232.google.com with SMTP id f206so363494783wmf.0 for ; Thu, 14 Jan 2016 13:33:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=YC+gxE5xgepN9E5R0aDLJUWojavIx2C9bf6tcLBJjdA=; b=mjRjlaEpRcNoG6SOyK5UEntx9b/2QBw5zyTnzyRa/AzqLV7ooA/vsjeW7JWV0ThgIY C0cDOT+fRlifva64j24dwP6Gsg10EN64fdANEOYj4dqhbw0cVn/ZGUjBrulgoUNJPDXo MxjiMlczpRT1cmDq8Y9sEeGBcSbu8GGPJpQuoWMcS86NotEfNcxlBWL0gLvI3QUqJfQW AFfWlzbPJtURR14vjEehdrcQ+piaBYPhbhMRDz3UBxUy+TnQWwOhB9AEqfewu8LNln2w 925v45zRH/o6/LWR7NGUF57e8S/1kJSsUn2NTQk5Mstlvv/8nSVCN3r/VZfvyNf6pycG 0MQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=YC+gxE5xgepN9E5R0aDLJUWojavIx2C9bf6tcLBJjdA=; b=UKK6dXz9v1hw+mgdEu7CA/VkAA+tV4al00d/7z4qN8J8xqcFIixjuwHHUs+cedxVJT B0Vc85ul0v5UOZqCAtuMXtKbbJr1OeSUb9dPLb/Nx4S9lVqbjP9ESuoih0HcfsJX+MQv vL2+BpLYuNM/s3hdHHxprZRwbZF4a6tLX5/QUq6B8REoX8ByyPY78ReiWR3chQORvm+p 084iz3jd4UXXoZgBBaANtzlIFoZ6uGaJB1HF0RkIqPj2khiOyYlPGkRg3AJ400myYj6R jKPsbMj0w8u8txiiudE9Y5BgNBU/etA8/eFoKF9OH3TQzuBBtj/09+LK8jo3/QM7uYdD wuOQ== X-Gm-Message-State: ALoCoQkEh0qrEPU2fxeBmsZjcuN4MfZB3MfRfjFc+wfiJrEQpyd+JcXapFHkLrKZ0C4ZX8cdM6As3QMOfhPRlhGTAtc4sViU4A== X-Received: by 10.28.68.68 with SMTP id r65mr7464869wma.95.1452807204762; Thu, 14 Jan 2016 13:33:24 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id v191sm8947334wme.1.2016.01.14.13.33.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jan 2016 13:33:23 -0800 (PST) Subject: Re: svn commit: r294040 - head/sys/boot/zfs To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601142131.u0ELVQ70054944@repo.freebsd.org> From: Steven Hartland Message-ID: <56981437.2050301@multiplay.co.uk> Date: Thu, 14 Jan 2016 21:33:43 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201601142131.u0ELVQ70054944@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 21:33:26 -0000 Fat fingers submitted before adding headers: MFC after: 2 weeks X-MFC-With: r293268 On 14/01/2016 21:31, Steven Hartland wrote: > Author: smh > Date: Thu Jan 14 21:31:26 2016 > New Revision: 294040 > URL: https://svnweb.freebsd.org/changeset/base/294040 > > Log: > Prevent bogus compiler in ZFS boot code > > Silence a bogus compiler warning about indexing past the end of dn_bonus. > > The ZFS code ensures this is not possible but the compiler can't determine > this so added an additional check to prevent this warning. > > Sponsored by: Multiplay > > Modified: > head/sys/boot/zfs/zfsimpl.c > > Modified: head/sys/boot/zfs/zfsimpl.c > ============================================================================== > --- head/sys/boot/zfs/zfsimpl.c Thu Jan 14 21:29:38 2016 (r294039) > +++ head/sys/boot/zfs/zfsimpl.c Thu Jan 14 21:31:26 2016 (r294040) > @@ -2165,7 +2165,13 @@ zfs_lookup(const struct zfsmount *mount, > strcpy(&path[sb.st_size], p); > else > path[sb.st_size] = 0; > - if (sb.st_size + sizeof(znode_phys_t) <= dn.dn_bonuslen) { > + /* > + * Second test is purely to silence bogus compiler > + * warning about accessing past the end of dn_bonus. > + */ > + if (sb.st_size + sizeof(znode_phys_t) <= > + dn.dn_bonuslen && sizeof(znode_phys_t) <= > + sizeof(dn.dn_bonus)) { > memcpy(path, &dn.dn_bonus[sizeof(znode_phys_t)], > sb.st_size); > } else { > From owner-svn-src-head@freebsd.org Thu Jan 14 21:39:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFA91A83212; Thu, 14 Jan 2016 21:39:11 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7732E1E75; Thu, 14 Jan 2016 21:39:11 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ELdApx055750; Thu, 14 Jan 2016 21:39:10 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ELdAVe055749; Thu, 14 Jan 2016 21:39:10 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601142139.u0ELdAVe055749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 14 Jan 2016 21:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294041 - head/sys/boot/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 21:39:11 -0000 Author: smh Date: Thu Jan 14 21:39:10 2016 New Revision: 294041 URL: https://svnweb.freebsd.org/changeset/base/294041 Log: Remove unused reg param from fdt_fixup_memory MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Thu Jan 14 21:31:26 2016 (r294040) +++ head/sys/boot/fdt/fdt_loader_cmd.c Thu Jan 14 21:39:10 2016 (r294041) @@ -464,7 +464,7 @@ fdt_fixup_memory(struct fdt_mem_region * { struct fdt_mem_region *curmr; uint32_t addr_cells, size_cells; - uint32_t *addr_cellsp, *reg, *size_cellsp; + uint32_t *addr_cellsp, *size_cellsp; int err, i, len, memory, root; size_t realmrno; uint8_t *buf, *sb; From owner-svn-src-head@freebsd.org Thu Jan 14 21:46:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57806A83427 for ; Thu, 14 Jan 2016 21:46:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm2-vm1.bullet.mail.bf1.yahoo.com (nm2-vm1.bullet.mail.bf1.yahoo.com [98.139.213.158]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FD3E134A for ; Thu, 14 Jan 2016 21:46:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1452807972; bh=g3gH2I0MKjWw5nlSbPy6+KTS/KPmJ5DlKxpUqPir/X8=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=m0UIl5rRKq/lfIqREl/pxKS2eeh+2y7OkJyAFRXK6Lm2NHxWeV1hqwxEVeu4PGtx6CAxV+WVp0w8UrFTVYQS3MjkdhJXXG4lLoSjZhTWCCAeGXtjwbLU29PQV8mlMZDD7bq3r18EYRDfKLhp7XG+KsJqPtMbBfXHY1vb51miloQUmpy+PGDyeSc4rCN8mDpSK2J29Yg3gdLMf0cXrio934BcgOKyyEaGGXuSOtZQakmQs4bUzhSe42K+WuoSCvu5rEAgwp2ECuiYfM7uyJqIl82gCv3JAdAn5tI0x26JM7CmIjO4ZCRdf4Of3G6bD5BLBaDcstljIaf2wTsn4sV+Sw== Received: from [98.139.214.32] by nm2.bullet.mail.bf1.yahoo.com with NNFMP; 14 Jan 2016 21:46:12 -0000 Received: from [68.142.230.71] by tm15.bullet.mail.bf1.yahoo.com with NNFMP; 14 Jan 2016 21:46:12 -0000 Received: from [127.0.0.1] by smtp228.mail.bf1.yahoo.com with NNFMP; 14 Jan 2016 21:46:12 -0000 X-Yahoo-Newman-Id: 358251.63705.bm@smtp228.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ZT2wjJQVM1kkDgpyXCXkq5a3_KBNgyyeaMxg1zSaDiUk1SV lrW7G4fDRj9mXZI7GDaXawpb.LmpGq.q0aZhJroj1KBSFl1g2pZcDHjPR_ck 16WqkY1QuAv9n3GuwH.Kvgzm1alM1gM.vPMoXT8Qx.76.Y9NIQqcY_L0hg2X wH3Ag6Or4snmBxsIvqE9cpMWcNe6mpZAI6PeyQbKaCS0HGn_00Vs3evco7yO cJ1pbrqqO3WrukFqwEWz2WhW07czANbPQ6AhAoYAF7zphDnn8p.9Mcx9k2rV fQGBIGOYS3neI7EBVxwDcyEH1mAojAVZSgYAxdsvTfLmNC9rvlbVzCKff2Yc WuZ8MEyc404a2osr9k7I.U9yTA6s77T.R.rq4DT26b0.sMAxEK_qDZIdN0r4 9vjR8w5s215nBfph88lbrKNlMoWhWoYVYnKyidm9rq6yYCNeeEK6EymgLMyv qPLFETfzgvY.dNp__Y4R0zSTwLJzQOloIMpkv2L_s6p0o7fyD1HysFIYxjn3 PoPJUVuSX2XmqP3_RW0vcjMudVkrGr199 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r294029 - in head/sys/boot/efi: . boot1 loader To: Steven Hartland , Nathan Whitehorn , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601141853.u0EIrshB007863@repo.freebsd.org> <56980BAE.6070304@freebsd.org> <569812A6.9020101@freebsd.org> From: Pedro Giffuni Message-ID: <5698172E.6040107@FreeBSD.org> Date: Thu, 14 Jan 2016 16:46:22 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <569812A6.9020101@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 21:46:15 -0000 El 14/01/2016 a las 16:27, Steven Hartland escribiΓ³: > > > On 14/01/2016 20:57, Nathan Whitehorn wrote: >> >> >> On 01/14/16 10:53, Steven Hartland wrote: >>> Author: smh >>> Date: Thu Jan 14 18:53:54 2016 >>> New Revision: 294029 >>> URL: https://svnweb.freebsd.org/changeset/base/294029 >>> >>> Log: >>> Only build EFI components on supported compilers >>> As the in-tree GCC does not support __attribute__((ms_abi)) >>> EFI can only >>> be built with Clang. >>> The EFI loader and boot1 validated this, but unused libefi was >>> still built >>> causing issues under GCC after warnings where enabled by r293724. >>> Disable building all of EFI when the selected compiler is GCC. >> >> How about with newer-than-4.2 versions of GCC? Surely this *is* >> supported in newer compilers. Do we need some build infrastructure to >> how about the compiler version as well as type? >> -Nathan > > If it is then even without this change you wouldn't have have got the > EFI loader or boot1, just an unused libefi. > > This change ensures that builds with in-tree Clang and GCC build on > all platforms, even if GCC doesn't build the EFI components. > > If someone that uses none in-tree GCC has some time to dedicate to > make this work that would be great :) > Specially since the gcc-4.2 compiler will be axed mercilessly before 11.0-RELEASE. Pedro. From owner-svn-src-head@freebsd.org Thu Jan 14 21:52:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EA7EA838C0; Thu, 14 Jan 2016 21:52:22 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FDC81BDB; Thu, 14 Jan 2016 21:52:22 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ELqLt6061336; Thu, 14 Jan 2016 21:52:21 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ELqLqt061335; Thu, 14 Jan 2016 21:52:21 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201601142152.u0ELqLqt061335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Thu, 14 Jan 2016 21:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294042 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 21:52:22 -0000 Author: rpokala Date: Thu Jan 14 21:52:21 2016 New Revision: 294042 URL: https://svnweb.freebsd.org/changeset/base/294042 Log: Add rotationrate to geom disk dumpconf Parse and report the nominal rotation rate reported by the drive. Reviewed by: sbruno, jhb Approved by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4483 Requested by: Kevin Bowling < kevin.bowling @ kev009.com > Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Thu Jan 14 21:39:10 2016 (r294041) +++ head/sys/geom/geom_disk.c Thu Jan 14 21:52:21 2016 (r294042) @@ -549,6 +549,23 @@ g_disk_dumpconf(struct sbuf *sb, const c indent, dp->d_fwheads); sbuf_printf(sb, "%s%u\n", indent, dp->d_fwsectors); + + /* + * "rotationrate" is a little complicated, because the value + * returned by the drive might not be the RPM; 0 and 1 are + * special cases, and there's also a valid range. + */ + sbuf_printf(sb, "%s", indent); + if (dp->d_rotation_rate == 0) /* Old drives don't */ + sbuf_printf(sb, "unknown"); /* report RPM. */ + else if (dp->d_rotation_rate == 1) /* Since 0 is used */ + sbuf_printf(sb, "0"); /* above, SSDs use 1. */ + else if ((dp->d_rotation_rate >= 0x041) && + (dp->d_rotation_rate <= 0xfffe)) + sbuf_printf(sb, "%u", dp->d_rotation_rate); + else + sbuf_printf(sb, "invalid"); + sbuf_printf(sb, "\n"); if (dp->d_getattr != NULL) { buf = g_malloc(DISK_IDENT_SIZE, M_WAITOK); bp = g_alloc_bio(); From owner-svn-src-head@freebsd.org Thu Jan 14 21:53:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57F6CA8398B for ; Thu, 14 Jan 2016 21:53:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x22b.google.com (mail-qg0-x22b.google.com [IPv6:2607:f8b0:400d:c04::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1170E1EB9 for ; Thu, 14 Jan 2016 21:53:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x22b.google.com with SMTP id b35so364293040qge.0 for ; Thu, 14 Jan 2016 13:53:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=3hstROI9tobqpg6VjEhUMl7mMi4HEXSAJTVl6qNSgtI=; b=uyhDOnF3m2CsyKWlEwCPGA3QjrkwaUf/E/z098GNQiloiP65I4q98dQK4JNFUbvIaA XEWAJwUvHm6w82E7k0FsuVbM7XoyLKq8ZpUD0bEAb4L3l2u6M9Fe5MjpTwxY8gsQE3XP D3XAIRV00mrjEuGPFjZZIaLt2dq/JK8DXkDFmRmCi9OwrnWumcwlb4yPEYb+3xSfK9/g Czf4OKYi/ChVpQpB7B4FuzsZfKTL7lIEHaUdMM0txfPbckpRMOGQIbf018sxWn2DxFtR mwQwdR2d/UHw5ydu5brbfEIJkCYbZDBSzW24m9tbpFMxdn2bVqWzGoZ15vh1SA6tMG2y VwhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=3hstROI9tobqpg6VjEhUMl7mMi4HEXSAJTVl6qNSgtI=; b=WrT8ETneNHvhI01jNqMIW85of1p4zb06BpZeh+je6ykS6hs/dUm24OjP5APd8rXpub SZ7cbmyr0IH0f1ZJzVLK3KaQZJDQJjWlPt+MTlnL54xScYFhfXYFKjh5IjQIcs9eHYA9 gIQ3n6s9g2lNt84izcjsqer7ExbbwPSC5SvpZ6qmJZ/IpCwoGcvfrIpQx24KdF0N0CeO VBngqRDO6DfSltDs24d5DdAOvwWSnlwkMayVMzuKO3Kw1fZv7wSOOEQLA3ho6bvFNSB9 vzEiaKtRfQPLO2AQdv+lBBUDZKXvUFWzChSbSKKLd1wOT+Ikm8CCRFYCUWVOGlddq/hp EmJg== X-Gm-Message-State: ALoCoQlOHlHnXPiMavfGfvFrUGkaj6CvylnQNJ0QAjgPOxffXNJ96JLu0RuJwvOoLsNgH8/ibqHu30WA35ygBDDKyle310Wqjg== MIME-Version: 1.0 X-Received: by 10.140.109.247 with SMTP id l110mr8787547qgf.52.1452808402164; Thu, 14 Jan 2016 13:53:22 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.30.166 with HTTP; Thu, 14 Jan 2016 13:53:21 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <5698172E.6040107@FreeBSD.org> References: <201601141853.u0EIrshB007863@repo.freebsd.org> <56980BAE.6070304@freebsd.org> <569812A6.9020101@freebsd.org> <5698172E.6040107@FreeBSD.org> Date: Thu, 14 Jan 2016 14:53:21 -0700 X-Google-Sender-Auth: YdrfWYH9qUtLaec-lh7JcDnOaqU Message-ID: Subject: Re: svn commit: r294029 - in head/sys/boot/efi: . boot1 loader From: Warner Losh To: Pedro Giffuni Cc: Steven Hartland , Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 21:53:23 -0000 On Thu, Jan 14, 2016 at 2:46 PM, Pedro Giffuni wrote: > > > El 14/01/2016 a las 16:27, Steven Hartland escribi=C3=B3: > >> >> >> On 14/01/2016 20:57, Nathan Whitehorn wrote: >> >>> >>> >>> On 01/14/16 10:53, Steven Hartland wrote: >>> >>>> Author: smh >>>> Date: Thu Jan 14 18:53:54 2016 >>>> New Revision: 294029 >>>> URL: https://svnweb.freebsd.org/changeset/base/294029 >>>> >>>> Log: >>>> Only build EFI components on supported compilers >>>> As the in-tree GCC does not support __attribute__((ms_abi)) EFI >>>> can only >>>> be built with Clang. >>>> The EFI loader and boot1 validated this, but unused libefi was >>>> still built >>>> causing issues under GCC after warnings where enabled by r293724. >>>> Disable building all of EFI when the selected compiler is GCC. >>>> >>> >>> How about with newer-than-4.2 versions of GCC? Surely this *is* >>> supported in newer compilers. Do we need some build infrastructure to h= ow >>> about the compiler version as well as type? >>> -Nathan >>> >> >> If it is then even without this change you wouldn't have have got the EF= I >> loader or boot1, just an unused libefi. >> >> This change ensures that builds with in-tree Clang and GCC build on all >> platforms, even if GCC doesn't build the EFI components. >> >> If someone that uses none in-tree GCC has some time to dedicate to make >> this work that would be great :) >> >> > Specially since the gcc-4.2 compiler will be axed mercilessly before > 11.0-RELEASE. We hope, you mean. Never versions of gcc will be supported where they work, and will be required for some platforms where clang isn't quite there. It looks to be added somewhere around the gcc 4.7 or 4.8 time frame, though I couldn't find it in the release notes. The latest attribute docs have this listed as supported. I suspect that 4.9 or 5.0 will be the earliest version of gcc to be realistically supported with the external toolchain... Warner From owner-svn-src-head@freebsd.org Thu Jan 14 22:07:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84A6BA83F65; Thu, 14 Jan 2016 22:07:36 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55E211A49; Thu, 14 Jan 2016 22:07:36 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EM7ZUY064659; Thu, 14 Jan 2016 22:07:35 GMT (envelope-from jmallett@FreeBSD.org) Received: (from jmallett@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EM7Zvd064658; Thu, 14 Jan 2016 22:07:35 GMT (envelope-from jmallett@FreeBSD.org) Message-Id: <201601142207.u0EM7Zvd064658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmallett set sender to jmallett@FreeBSD.org using -f From: Juli Mallett Date: Thu, 14 Jan 2016 22:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294047 - head/sys/boot/userboot/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 22:07:36 -0000 Author: jmallett Date: Thu Jan 14 22:07:35 2016 New Revision: 294047 URL: https://svnweb.freebsd.org/changeset/base/294047 Log: Make it possible to specify the path to userboot.so with the -b flag. Reviewed by: neel Modified: head/sys/boot/userboot/test/test.c Modified: head/sys/boot/userboot/test/test.c ============================================================================== --- head/sys/boot/userboot/test/test.c Thu Jan 14 22:02:21 2016 (r294046) +++ head/sys/boot/userboot/test/test.c Thu Jan 14 22:07:35 2016 (r294047) @@ -414,7 +414,7 @@ void usage() { - printf("usage: [-d ] [-h \n"); + printf("usage: [-b ] [-d ] [-h \n"); exit(1); } @@ -425,9 +425,14 @@ main(int argc, char** argv) void (*func)(struct loader_callbacks *, void *, int, int); int opt; char *disk_image = NULL; + const char *userboot_obj = "/boot/userboot.so"; - while ((opt = getopt(argc, argv, "d:h:")) != -1) { + while ((opt = getopt(argc, argv, "b:d:h:")) != -1) { switch (opt) { + case 'b': + userboot_obj = optarg; + break; + case 'd': disk_image = optarg; break; @@ -441,8 +446,7 @@ main(int argc, char** argv) } } - h = dlopen("/boot/userboot.so", - RTLD_LOCAL); + h = dlopen(userboot_obj, RTLD_LOCAL); if (!h) { printf("%s\n", dlerror()); return (1); From owner-svn-src-head@freebsd.org Thu Jan 14 22:17:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D400A8236C for ; Thu, 14 Jan 2016 22:17:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm15.bullet.mail.bf1.yahoo.com (nm15.bullet.mail.bf1.yahoo.com [98.139.212.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 267451007 for ; Thu, 14 Jan 2016 22:17:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1452809833; bh=TmBr7ez6bUgMIx7PAjOr3wMD4j2MDYfJY782OT8tmS4=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=Z8ickL0msB1ykYInxUnvJ1Qq/K8Enx9CpHByaFTHuhn7H5VQx+DgBZ7HE0oJRE339jODFLWRUSRIfSgPOGywmDi8lMBD5j6hkg0uhW0K3+FwlinaLe0og2JED8hNdRAMpvohIlW/U+MDE1tQZkOERwpkmsBN/NqjnXaoJliz9fmd2dr4pWPBkgl+TBp89MVOhjAa6CWy2QTToTq+dv8pyIO/LPL1xXXzEzjsTcOjpSCLNrQreB72pzotUdi+bweoF+Lys4STYzGySlHx6+p3BPCqNW/kHnfhCIFavkUinumZs3BYGmrRqU5yFhkJynSYWbgp9ELaZBTa/9t2yZF9mA== Received: from [98.139.170.181] by nm15.bullet.mail.bf1.yahoo.com with NNFMP; 14 Jan 2016 22:17:13 -0000 Received: from [98.139.211.195] by tm24.bullet.mail.bf1.yahoo.com with NNFMP; 14 Jan 2016 22:17:13 -0000 Received: from [127.0.0.1] by smtp204.mail.bf1.yahoo.com with NNFMP; 14 Jan 2016 22:17:13 -0000 X-Yahoo-Newman-Id: 427745.27368.bm@smtp204.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: eG01mIcVM1kIVOZZ6KCiYtp2re6bhThE1lhviediq11ZJ7P R1iKcxHqSjyGDNm_WHOxyflSi2UXU973lVzaYZy5T0W.6kCRbDSKOvg8ohs1 U1cHhNBOldkXnJgYXo0fxT56twBv_yRTHPmP1vjPB8og.CjgZozyxRFpPCac 2wQiRqL5Z8iueAfsDja6BKR9pfKDQIlg.qKLMGAKWA4o7mopUyy05HHhy5i2 BUtlh0ol9smRCdmCODXXhbXDeoN0X7wTkxqL1v40QQY7tkpaQ5ahhv.hACly YHwqkw8qDTFGOb7Z4cdkm.NvsZUPxa70mcQ80iyp0DivNIaaJ0fw6vLwXMXW 0sOTrN9H4RE5rHZzzM28GtlQYo2UmdYVULDs2_ds55Oe0AEZlUMQ6iJ5YiZQ OanEzVpAb6cnRVX.JOubzXl00pvQCvRxassOLSN_ajPT2jnxhRK68Cq6I5gV CuGyuuE3dXoSU4oDk9Fjzuyd4KESnZVn0bcwWap_15fQJUDx5pUMTHJForan FVEzdz7mV42LU_VunC5V4qweun6Pm3GZy X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r294029 - in head/sys/boot/efi: . boot1 loader To: Warner Losh References: <201601141853.u0EIrshB007863@repo.freebsd.org> <56980BAE.6070304@freebsd.org> <569812A6.9020101@freebsd.org> <5698172E.6040107@FreeBSD.org> Cc: Steven Hartland , Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <56981E73.1020101@FreeBSD.org> Date: Thu, 14 Jan 2016 17:17:23 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 22:17:21 -0000 On 01/14/16 16:53, Warner Losh wrote: > > On Thu, Jan 14, 2016 at 2:46 PM, Pedro Giffuni > wrote: > > > > El 14/01/2016 a las 16:27, Steven Hartland escribiΓ³: > > > > On 14/01/2016 20:57, Nathan Whitehorn wrote: > > > > On 01/14/16 10:53, Steven Hartland wrote: > > Author: smh > Date: Thu Jan 14 18:53:54 2016 > New Revision: 294029 > URL: https://svnweb.freebsd.org/changeset/base/294029 > > Log: > Only build EFI components on supported compilers > As the in-tree GCC does not support > __attribute__((ms_abi)) EFI can only > be built with Clang. > The EFI loader and boot1 validated this, but > unused libefi was still built > causing issues under GCC after warnings where > enabled by r293724. > Disable building all of EFI when the selected > compiler is GCC. > > > How about with newer-than-4.2 versions of GCC? Surely this > *is* supported in newer compilers. Do we need some build > infrastructure to how about the compiler version as well as > type? > -Nathan > > > If it is then even without this change you wouldn't have have > got the EFI loader or boot1, just an unused libefi. > > This change ensures that builds with in-tree Clang and GCC build > on all platforms, even if GCC doesn't build the EFI components. > > If someone that uses none in-tree GCC has some time to dedicate > to make this work that would be great :) > > > Specially since the gcc-4.2 compiler will be axed mercilessly before > 11.0-RELEASE. > > > We hope, you mean. > As scheduled ... I mean. It was discussed in the BSDCan 2014 Dev Summit. > Never versions of gcc will be supported where they work, and will be > required for some platforms where clang isn't quite there. When we unhook the old crappy GCC someone will be forced to figure out how to get the external toolchain working. Otherwise we can sit and wait for ever. Pedro. From owner-svn-src-head@freebsd.org Thu Jan 14 22:30:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80D71A8270A for ; Thu, 14 Jan 2016 22:30:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm25-vm1.bullet.mail.bf1.yahoo.com (nm25-vm1.bullet.mail.bf1.yahoo.com [98.139.212.155]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 354EB18EC for ; Thu, 14 Jan 2016 22:30:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1452810236; bh=vpn9EpEMjqN4cQavu1C2ErrgIiqd1z9g6yEwGwFUxK4=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=OS3CswTg4ZsURO/iN0TkJGP+x9VyQ1oAMWqqY2rAdkx1wBTzoMe9hNd6864mZWXAK36YOljsEt/zSDLHQXaBtrReq166zsxf8qFnQJ/xmhLtPEpztNE5xNOP3oCgF9/LBqMnXkr5QJKIcyQV7zMI5PK4VMAalGwJ6Qjc100XADWLoW5BWEuCIr8ICYDWFCq9shE+VD7xP8l2Bm6/PgNP0vW77tH/L+vZUvcsqep0I+TTAuhRDdtejjbW+ZxAcOwQegaENk42+rD9AywLJ8gRm8o4FttwilqlgiIzC/Gz+ceShG+2NVKZldXxoHuKWwdX+nxbfV8u84yQwNTR0BBZkA== Received: from [98.139.215.142] by nm25.bullet.mail.bf1.yahoo.com with NNFMP; 14 Jan 2016 22:23:56 -0000 Received: from [98.139.211.196] by tm13.bullet.mail.bf1.yahoo.com with NNFMP; 14 Jan 2016 22:23:56 -0000 Received: from [127.0.0.1] by smtp205.mail.bf1.yahoo.com with NNFMP; 14 Jan 2016 22:23:56 -0000 X-Yahoo-Newman-Id: 433542.42861.bm@smtp205.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: _teMhhAVM1md.wr5AzFs94EtTOoEPFk5.9r1DirBvDlz_KF RYP5i3dG6Nvsp_nSkB5z5yJd37cEfl9B49ZwumUExRm6p3WxN2jMj82lAeJN DMCrJU1c1BAtGWDtZAakG_7GWpu00ZmBxEWcwZSuzTKGbQNKSzXFxPVukYTQ GaPwfmqpIeBBnRnNNvWbEDAzikom0hwbEVQubKL827_SLBY8rrB4V7cBffOi Qzl1KY_CXJlcpkN5feDLmpGc1yPxQljbEu2D7r_4Om1swps4R8gKFwC.Mn_g WMpDX85x0inKS.ZfbdtiD091s394lC_UlQxLCe2hWSTxD5VbiMTnufSh.MRQ k5B4hQd.8uQ62ncDuOS9hm1m4_8eXaPbxcfI7udaoARsPmAx83wSMAnf8_5d 6nHkKGT643kRJv97dKv_6HIzH8VeHgX1tVISXnBRFb3F6aPCdWK3WGxYckIN 3G4VT2Yd.jPPXMe92Ljg0q2P.9KFMoC.eRSKWsqvT_HJwF.2_XOP6OTMhxh3 5ZSphCF12xiywAJLbyS7SCv9hCi1DfFDg X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r294029 - in head/sys/boot/efi: . boot1 loader To: Warner Losh References: <201601141853.u0EIrshB007863@repo.freebsd.org> <56980BAE.6070304@freebsd.org> <569812A6.9020101@freebsd.org> <5698172E.6040107@FreeBSD.org> <56981E73.1020101@FreeBSD.org> Cc: Steven Hartland , Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <56982005.3000308@FreeBSD.org> Date: Thu, 14 Jan 2016 17:24:05 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56981E73.1020101@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 22:30:23 -0000 On 01/14/16 17:17, Pedro Giffuni wrote: > ... >> >> Specially since the gcc-4.2 compiler will be axed mercilessly before >> 11.0-RELEASE. >> >> >> We hope, you mean. >> > > As scheduled ... I mean. It was discussed in the BSDCan 2014 Dev Summit. > >> Never versions of gcc will be supported where they work, and will be >> required for some platforms where clang isn't quite there. > > When we unhook the old crappy GCC someone will be forced to figure out > how to get the external toolchain working. Otherwise we can sit and > wait for ever. > OK .. I'll take this back... I know imposing such drastic measures is not the way the project works ... sometimes I just wish ;). Pedro. From owner-svn-src-head@freebsd.org Thu Jan 14 22:40:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF683A82B93; Thu, 14 Jan 2016 22:40:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C07B11FB8; Thu, 14 Jan 2016 22:40:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EMekDq073352; Thu, 14 Jan 2016 22:40:46 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EMek62073351; Thu, 14 Jan 2016 22:40:46 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601142240.u0EMek62073351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 14 Jan 2016 22:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294048 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 22:40:48 -0000 Author: glebius Date: Thu Jan 14 22:40:46 2016 New Revision: 294048 URL: https://svnweb.freebsd.org/changeset/base/294048 Log: Fix OpenSSH client information leak. Security: SA-16:07.openssh Security: CVE-2016-0777 Modified: head/crypto/openssh/readconf.c Modified: head/crypto/openssh/readconf.c ============================================================================== --- head/crypto/openssh/readconf.c Thu Jan 14 22:07:35 2016 (r294047) +++ head/crypto/openssh/readconf.c Thu Jan 14 22:40:46 2016 (r294048) @@ -1610,7 +1610,7 @@ initialize_options(Options * options) options->tun_remote = -1; options->local_command = NULL; options->permit_local_command = -1; - options->use_roaming = -1; + options->use_roaming = 0; options->visual_host_key = -1; options->ip_qos_interactive = -1; options->ip_qos_bulk = -1; @@ -1788,8 +1788,7 @@ fill_default_options(Options * options) options->tun_remote = SSH_TUNID_ANY; if (options->permit_local_command == -1) options->permit_local_command = 0; - if (options->use_roaming == -1) - options->use_roaming = 1; + options->use_roaming = 0; if (options->visual_host_key == -1) options->visual_host_key = 0; if (options->ip_qos_interactive == -1) From owner-svn-src-head@freebsd.org Thu Jan 14 23:22:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06F78A83A8C; Thu, 14 Jan 2016 23:22:45 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C70411CD3; Thu, 14 Jan 2016 23:22:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ENMhh4087886; Thu, 14 Jan 2016 23:22:43 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ENMhjF087885; Thu, 14 Jan 2016 23:22:43 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601142322.u0ENMhjF087885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 14 Jan 2016 23:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294055 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 23:22:45 -0000 Author: jhibbits Date: Thu Jan 14 23:22:43 2016 New Revision: 294055 URL: https://svnweb.freebsd.org/changeset/base/294055 Log: Adjust VM_MAX_KERNEL_ADDRESS to the max address, not the minimum next. VM_MAX_KERNEL_ADDERESS is the maximum KVA address. 0xf8000000 is the start of device mapping space. Since several conditional checks use '<=' against VM_MAX_KERNEL_ADDRESS, bad things could feasibly happen. Modified: head/sys/powerpc/include/vmparam.h Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Thu Jan 14 22:53:07 2016 (r294054) +++ head/sys/powerpc/include/vmparam.h Thu Jan 14 23:22:43 2016 (r294055) @@ -111,7 +111,7 @@ #define KERNBASE 0xc0000000 /* start of kernel virtual */ #define VM_MIN_KERNEL_ADDRESS KERNBASE -#define VM_MAX_KERNEL_ADDRESS 0xf8000000 +#define VM_MAX_KERNEL_ADDRESS 0xf7ffffff #define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS #endif /* AIM/E500 */ @@ -129,7 +129,7 @@ struct pmap_physseg { * The physical address space is densely populated on 32-bit systems, * but may not be on 64-bit ones. */ -#ifdef __powerpc64__ +#ifdef __powerpc__ #define VM_PHYSSEG_SPARSE #else #define VM_PHYSSEG_DENSE From owner-svn-src-head@freebsd.org Fri Jan 15 00:26:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F084BA820AC; Fri, 15 Jan 2016 00:26:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0C0A1C8D; Fri, 15 Jan 2016 00:26:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F0QFN8005331; Fri, 15 Jan 2016 00:26:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F0QF8O005330; Fri, 15 Jan 2016 00:26:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601150026.u0F0QF8O005330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 15 Jan 2016 00:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294057 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 00:26:17 -0000 Author: tuexen Date: Fri Jan 15 00:26:15 2016 New Revision: 294057 URL: https://svnweb.freebsd.org/changeset/base/294057 Log: Fix a bug in INIT handling on accepted 1-to-1 style sockets when the listener is closed. This fix allows the following packetdrill test to pass: // Setup a connected, blocking 1-to-1 style socket +0.0 socket(..., SOCK_STREAM, IPPROTO_SCTP) = 3 // Check the handshake with en empty(!) cookie +0.0 bind(3, ..., ...) = 0 +0.0 listen(3, 1) = 0 +0.0 < sctp: INIT[flgs=0, tag=1, a_rwnd=1500, os=1, is=1, tsn=1] +0.0 > sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=..., os=..., is=..., tsn=1, ...] +0.0 < sctp: COOKIE_ECHO[flgs=0, len=..., val=...] +0.0 > sctp: COOKIE_ACK[flgs=0] +0.0 accept(3, ..., ...) = 4 +0.0 close(3) = 0 // Inject an INIT chunk and expect an INIT-ACK +0.0 < sctp: INIT[flgs=0, tag=3, a_rwnd=1500, os=1, is=1, tsn=1] +0.0 > sctp: INIT_ACK[flgs=0, tag=..., a_rwnd=..., os=..., is=..., tsn=..., ...] MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Fri Jan 15 00:05:58 2016 (r294056) +++ head/sys/netinet/sctp_pcb.c Fri Jan 15 00:26:15 2016 (r294057) @@ -2269,8 +2269,12 @@ sctp_findassociation_addr(struct mbuf *m } } find_tcp_pool = 0; - if ((ch->chunk_type != SCTP_INITIATION) && - (ch->chunk_type != SCTP_INITIATION_ACK) && + /* + * Don't consider INIT chunks since that breaks 1-to-1 sockets: When + * a server closes the listener, incoming INIT chunks are not + * responsed by an INIT-ACK chunk. + */ + if ((ch->chunk_type != SCTP_INITIATION_ACK) && (ch->chunk_type != SCTP_COOKIE_ACK) && (ch->chunk_type != SCTP_COOKIE_ECHO)) { /* Other chunk types go to the tcp pool. */ From owner-svn-src-head@freebsd.org Fri Jan 15 00:55:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6706A82AEE; Fri, 15 Jan 2016 00:55:37 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A4F81A5B; Fri, 15 Jan 2016 00:55:37 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F0taTk014194; Fri, 15 Jan 2016 00:55:36 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F0takc014192; Fri, 15 Jan 2016 00:55:36 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601150055.u0F0takc014192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 15 Jan 2016 00:55:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294058 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 00:55:37 -0000 Author: smh Date: Fri Jan 15 00:55:36 2016 New Revision: 294058 URL: https://svnweb.freebsd.org/changeset/base/294058 Log: Make common boot file_loadraw name parameter const Fix compiler warnings about dropping const qualifier by changing file_loadraw name param to const, and updating method to make that the case (it was abusing the variable). MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/sys/boot/common/bootstrap.h head/sys/boot/common/module.c Modified: head/sys/boot/common/bootstrap.h ============================================================================== --- head/sys/boot/common/bootstrap.h Fri Jan 15 00:26:15 2016 (r294057) +++ head/sys/boot/common/bootstrap.h Fri Jan 15 00:55:36 2016 (r294058) @@ -237,7 +237,7 @@ void unload(void); struct preloaded_file *file_alloc(void); struct preloaded_file *file_findfile(const char *name, const char *type); struct file_metadata *file_findmetadata(struct preloaded_file *fp, int type); -struct preloaded_file *file_loadraw(char *name, char *type, int insert); +struct preloaded_file *file_loadraw(const char *name, char *type, int insert); void file_discard(struct preloaded_file *fp); void file_addmetadata(struct preloaded_file *fp, int type, size_t size, void *p); int file_addmodule(struct preloaded_file *fp, char *modname, int version, Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Fri Jan 15 00:26:15 2016 (r294057) +++ head/sys/boot/common/module.c Fri Jan 15 00:55:36 2016 (r294058) @@ -388,14 +388,14 @@ file_load_dependencies(struct preloaded_ } /* - * We've been asked to load (name) as (type), so just suck it in, + * We've been asked to load (fname) as (type), so just suck it in, * no arguments or anything. */ struct preloaded_file * -file_loadraw(char *name, char *type, int insert) +file_loadraw(const char *fname, char *type, int insert) { struct preloaded_file *fp; - char *cp; + char *name; int fd, got; vm_offset_t laddr; @@ -406,12 +406,11 @@ file_loadraw(char *name, char *type, int } /* locate the file on the load path */ - cp = file_search(name, NULL); - if (cp == NULL) { - sprintf(command_errbuf, "can't find '%s'", name); + name = file_search(fname, NULL); + if (name == NULL) { + sprintf(command_errbuf, "can't find '%s'", fname); return(NULL); } - name = cp; if ((fd = open(name, O_RDONLY)) < 0) { sprintf(command_errbuf, "can't open '%s': %s", name, strerror(errno)); From owner-svn-src-head@freebsd.org Fri Jan 15 01:06:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EF80A82E72; Fri, 15 Jan 2016 01:06:38 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B52C1FF5; Fri, 15 Jan 2016 01:06:38 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F16bbF017200; Fri, 15 Jan 2016 01:06:37 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F16bN2017199; Fri, 15 Jan 2016 01:06:37 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601150106.u0F16bN2017199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 15 Jan 2016 01:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294059 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 01:06:38 -0000 Author: smh Date: Fri Jan 15 01:06:37 2016 New Revision: 294059 URL: https://svnweb.freebsd.org/changeset/base/294059 Log: Ensure boot fsread correctly probes all partitions The boot code fsread was caching the result of meta data request and reusing it even for calls with inode = 0, which is used to partitions trigger a probe. The result was that success was incorrectly returned for all partition probes after the first valid success, even for partitions which are not UFS. MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/sys/boot/common/ufsread.c Modified: head/sys/boot/common/ufsread.c ============================================================================== --- head/sys/boot/common/ufsread.c Fri Jan 15 00:55:36 2016 (r294058) +++ head/sys/boot/common/ufsread.c Fri Jan 15 01:06:37 2016 (r294059) @@ -187,8 +187,15 @@ fsread(ufs_ino_t inode, void *buf, size_ blkbuf = dmadat->blkbuf; indbuf = dmadat->indbuf; - if (!dsk_meta) { + + /* + * Force probe if inode is zero to ensure we have a valid fs, otherwise + * when probing multiple paritions, reads from subsequent parititions + * will incorrectly succeed. + */ + if (!dsk_meta || inode == 0) { inomap = 0; + dsk_meta = 0; for (n = 0; sblock_try[n] != -1; n++) { if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, SBLOCKSIZE / DEV_BSIZE)) From owner-svn-src-head@freebsd.org Fri Jan 15 01:11:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFA58A82FB0; Fri, 15 Jan 2016 01:11:40 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf0-x22d.google.com (mail-pf0-x22d.google.com [IPv6:2607:f8b0:400e:c00::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF88D13B4; Fri, 15 Jan 2016 01:11:40 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf0-x22d.google.com with SMTP id q63so111830051pfb.1; Thu, 14 Jan 2016 17:11:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=j+qngKwuKHk8apv0OiNqG35hW1M8l7gxALL8FtC8cww=; b=lDA9XoeJm5ZfmY6fpKQgn7bafNWuqpY57DDXJYlAqWCOx+afitTOBr1GTDJwoYlYMX DHrnq1OMGiNfGOsLuE4WIxHwlTSjjs+IaxTEmVVdkMwXqwf14rKM08i64nf5VaQ3UeyI VGJjBctrB9QO8TeB24pmOgNkz592l3tN50VIIybO4huruTQCFNWIWKmR655fyBv4envC EbcIGu8ueKxMiH7CcLNfaaIVjXjJj/JkRtdbwtQL8M+lfD6W9HTlCwVChU+RtYYPHhpF nhzgXC/q1JD/c3LnXagW922vaWfSi4mZtH6CuvcFB11TxGRR/Pp0qx8PcIwvcxBgCv8b OgmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:reply-to:subject:references:to:from :message-id:date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=j+qngKwuKHk8apv0OiNqG35hW1M8l7gxALL8FtC8cww=; b=D3UU88y4/MWHB3AXdNOhyPeb1Lqp6b/JvcqgEK3NI6M40HniZXVXVnxL0bzSGoJ0nK 43NjsbD/Ra3oZXLaA81KseRWvv05AnvWbGl7PdUSK7VmYSHoEP2qQmtJEQUX1Z5dHKO4 14rFs7aw6Y6DVyK7iL0cczkEP0FxCJPsINN8EfL1KXZyCZJDogrkXDbSMA1W0fk3fC6+ +ZSWBJlhgnm9+1C5CpuXYvEb+MUNvrUIkOo0S97lXWitGWiCLAV6cR+CFTAsNeHGXB4G 5YrAXVCfb7CzXCI9TLAE/zIt+Lywl0ftIlMTfpzYPP1JWHy28hjrArotbjVan0ES6RM/ ZiAw== X-Gm-Message-State: ALoCoQlGeKliw2lL3KZAHY2+T9vJXK6EUo2cx68ux3+FjPYr027YNwpaPEuPq2bGb2h9j0r+S0IArQCrEQVHc6XgMvKX/eXwhw== X-Received: by 10.98.64.27 with SMTP id n27mr10850804pfa.58.1452820300185; Thu, 14 Jan 2016 17:11:40 -0800 (PST) Received: from ?IPv6:2001:44b8:31ae:7b01:54ef:eecf:d818:dea? (2001-44b8-31ae-7b01-54ef-eecf-d818-0dea.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:54ef:eecf:d818:dea]) by smtp.gmail.com with ESMTPSA id 63sm11826528pfo.67.2016.01.14.17.11.37 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jan 2016 17:11:39 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r293854 - head/sys/dev/e1000 References: <201601132147.u0DLlR38017711@repo.freebsd.org> To: Marius Strobl , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kubilay Kocak Message-ID: <5698473F.8030203@FreeBSD.org> Date: Fri, 15 Jan 2016 12:11:27 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Thunderbird/43.0 MIME-Version: 1.0 In-Reply-To: <201601132147.u0DLlR38017711@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 01:11:41 -0000 On 14/01/2016 8:47 AM, Marius Strobl wrote: > Author: marius > Date: Wed Jan 13 21:47:27 2016 > New Revision: 293854 > URL: https://svnweb.freebsd.org/changeset/base/293854 > > Log: > Given that em(4), lem(4) and igb(4) hardware doesn't require the > alignment guarantees provided by m_defrag(9), use m_collapse(9) > instead for performance reasons. > While at it, sanitize the statistics softc members, i. e. retire > unused ones and add SYSCTL nodes missing for actually used ones. > > Differential Revision: https://reviews.freebsd.org/D4717 > > Modified: > head/sys/dev/e1000/if_em.c > head/sys/dev/e1000/if_em.h > head/sys/dev/e1000/if_igb.c > head/sys/dev/e1000/if_igb.h > head/sys/dev/e1000/if_lem.c > head/sys/dev/e1000/if_lem.h What kind of performance / overhead delta can be expected for this change? Is this worth MFC and/or Relnotes ? From owner-svn-src-head@freebsd.org Fri Jan 15 01:22:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57C0DA833C2; Fri, 15 Jan 2016 01:22:38 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 057051A00; Fri, 15 Jan 2016 01:22:37 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F1Mb1S022713; Fri, 15 Jan 2016 01:22:37 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F1MaLt022706; Fri, 15 Jan 2016 01:22:36 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601150122.u0F1MaLt022706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 15 Jan 2016 01:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294060 - in head/sys/boot/efi: boot1 include loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 01:22:38 -0000 Author: smh Date: Fri Jan 15 01:22:36 2016 New Revision: 294060 URL: https://svnweb.freebsd.org/changeset/base/294060 Log: Modularise EFI boot loader Make EFI boot loader modular in preparation for adding ZFS support. This is a partial commit of the D4515. Submitted by: Eric McCorkle Reviewed by: emaste (in part) MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4515 Added: head/sys/boot/efi/boot1/boot_module.h (contents, props changed) head/sys/boot/efi/boot1/ufs_module.c (contents, props changed) Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/include/efilib.h head/sys/boot/efi/loader/devicename.c head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Fri Jan 15 01:06:37 2016 (r294059) +++ head/sys/boot/efi/boot1/Makefile Fri Jan 15 01:22:36 2016 (r294060) @@ -2,7 +2,7 @@ MAN= -.include +.include MK_SSP= no @@ -11,13 +11,14 @@ INTERNALPROG= WARNS?= 6 # architecture-specific loader code -SRCS= boot1.c self_reloc.c start.S +SRCS= boot1.c self_reloc.c start.S ufs_module.c CFLAGS+= -I. CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+= -I${.CURDIR}/../../.. +CFLAGS+= -DEFI_UFS_BOOT # Always add MI sources and REGULAR efi loader bits .PATH: ${.CURDIR}/../loader/arch/${MACHINE} Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Fri Jan 15 01:06:37 2016 (r294059) +++ head/sys/boot/efi/boot1/boot1.c Fri Jan 15 01:22:36 2016 (r294060) @@ -5,6 +5,8 @@ * All rights reserved. * Copyright (c) 2014 Nathan Whitehorn * All rights reserved. + * Copyright (c) 2015 Eric McCorkle + * All rights reserved. * * Redistribution and use in source and binary forms are freely * permitted provided that the above copyright notice and this @@ -21,7 +23,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -29,19 +30,29 @@ __FBSDID("$FreeBSD$"); #include #include +#include "boot_module.h" + #define _PATH_LOADER "/boot/loader.efi" -#define _PATH_KERNEL "/boot/kernel/kernel" -#define BSIZEMAX 16384 +static const boot_module_t *boot_modules[] = +{ +#ifdef EFI_UFS_BOOT + &ufs_module +#endif +}; + +#define NUM_BOOT_MODULES (sizeof(boot_modules) / sizeof(boot_module_t*)) +/* The initial number of handles used to query EFI for partitions. */ +#define NUM_HANDLES_INIT 24 -void panic(const char *fmt, ...) __dead2; void putchar(int c); EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); -static int domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet); -static void load(const char *fname); +static void try_load(const boot_module_t* mod); +static EFI_STATUS probe_handle(EFI_HANDLE h); -static EFI_SYSTEM_TABLE *systab; +EFI_SYSTEM_TABLE *systab; +EFI_BOOT_SERVICES *bs; static EFI_HANDLE *image; static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; @@ -49,27 +60,92 @@ static EFI_GUID DevicePathGUID = DEVICE_ static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; -static EFI_BLOCK_IO *bootdev; -static EFI_DEVICE_PATH *bootdevpath; -static EFI_HANDLE *bootdevhandle; +/* + * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures + * memory is correctly aligned avoiding EFI_INVALID_PARAMETER returns from + * EFI methods. + */ +void * +Malloc(size_t len, const char *file __unused, int line __unused) +{ + void *out; + + if (bs->AllocatePool(EfiLoaderData, len, &out) == EFI_SUCCESS) + return (out); + + return (NULL); +} + +void +Free(void *buf, const char *file __unused, int line __unused) +{ + (void)bs->FreePool(buf); +} -EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab) +/* + * This function only returns if it fails to load the kernel. If it + * succeeds, it simply boots the kernel. + */ +void +try_load(const boot_module_t *mod) { - EFI_HANDLE handles[128]; - EFI_BLOCK_IO *blkio; - UINTN i, nparts = sizeof(handles), cols, rows, max_dim, best_mode; + size_t bufsize; + void *buf; + dev_info_t *dev; + EFI_HANDLE loaderhandle; + EFI_LOADED_IMAGE *loaded_image; + EFI_STATUS status; + + status = mod->load(_PATH_LOADER, &dev, &buf, &bufsize); + if (status == EFI_NOT_FOUND) + return; + + if (status != EFI_SUCCESS) { + printf("%s failed to load %s (%lu)\n", mod->name, _PATH_LOADER, + EFI_ERROR_CODE(status)); + return; + } + + if ((status = bs->LoadImage(TRUE, image, dev->devpath, buf, bufsize, + &loaderhandle)) != EFI_SUCCESS) { + printf("Failed to load image provided by %s, size: %zu, (%lu)\n", + mod->name, bufsize, EFI_ERROR_CODE(status)); + return; + } + + if ((status = bs->HandleProtocol(loaderhandle, &LoadedImageGUID, + (VOID**)&loaded_image)) != EFI_SUCCESS) { + printf("Failed to query LoadedImage provided by %s (%lu)\n", + mod->name, EFI_ERROR_CODE(status)); + return; + } + + loaded_image->DeviceHandle = dev->devhandle; + + if ((status = bs->StartImage(loaderhandle, NULL, NULL)) != + EFI_SUCCESS) { + printf("Failed start image provided by %s (%lu)\n", mod->name, + EFI_ERROR_CODE(status)); + return; + } +} + +EFI_STATUS +efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) +{ + EFI_HANDLE *handles; EFI_STATUS status; - EFI_DEVICE_PATH *devpath; - EFI_BOOT_SERVICES *BS; EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; - const char *path = _PATH_LOADER; + UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; + /* Basic initialization*/ systab = Xsystab; image = Ximage; + bs = Xsystab->BootServices; - BS = systab->BootServices; - status = BS->LocateProtocol(&ConsoleControlGUID, NULL, + /* Set up the console, so printf works. */ + status = bs->LocateProtocol(&ConsoleControlGUID, NULL, (VOID **)&ConsoleControl); if (status == EFI_SUCCESS) (void)ConsoleControl->SetMode(ConsoleControl, @@ -94,200 +170,162 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E conout->EnableCursor(conout, TRUE); conout->ClearScreen(conout); - printf("\n" - ">> FreeBSD EFI boot block\n"); - printf(" Loader path: %s\n", path); - - status = systab->BootServices->LocateHandle(ByProtocol, - &BlockIoProtocolGUID, NULL, &nparts, handles); - nparts /= sizeof(handles[0]); - - for (i = 0; i < nparts; i++) { - status = systab->BootServices->HandleProtocol(handles[i], - &DevicePathGUID, (void **)&devpath); - if (EFI_ERROR(status)) + printf("\n>> FreeBSD EFI boot block\n"); + printf(" Loader path: %s\n\n", _PATH_LOADER); + printf(" Initializing modules:"); + for (i = 0; i < NUM_BOOT_MODULES; i++) { + if (boot_modules[i] == NULL) continue; - while (!IsDevicePathEnd(NextDevicePathNode(devpath))) - devpath = NextDevicePathNode(devpath); + printf(" %s", boot_modules[i]->name); + if (boot_modules[i]->init != NULL) + boot_modules[i]->init(); + } + putchar('\n'); - status = systab->BootServices->HandleProtocol(handles[i], - &BlockIoProtocolGUID, (void **)&blkio); - if (EFI_ERROR(status)) - continue; + /* Get all the device handles */ + hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); + if ((status = bs->AllocatePool(EfiLoaderData, hsize, (void **)&handles)) + != EFI_SUCCESS) + panic("Failed to allocate %d handles (%lu)", NUM_HANDLES_INIT, + EFI_ERROR_CODE(status)); - if (!blkio->Media->LogicalPartition) - continue; + status = bs->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, + &hsize, handles); + switch (status) { + case EFI_SUCCESS: + break; + case EFI_BUFFER_TOO_SMALL: + (void)bs->FreePool(handles); + if ((status = bs->AllocatePool(EfiLoaderData, hsize, + (void **)&handles) != EFI_SUCCESS)) { + panic("Failed to allocate %zu handles (%lu)", hsize / + sizeof(*handles), EFI_ERROR_CODE(status)); + } + status = bs->LocateHandle(ByProtocol, &BlockIoProtocolGUID, + NULL, &hsize, handles); + if (status != EFI_SUCCESS) + panic("Failed to get device handles (%lu)\n", + EFI_ERROR_CODE(status)); + break; + default: + panic("Failed to get device handles (%lu)", + EFI_ERROR_CODE(status)); + } - if (domount(devpath, blkio, 1) >= 0) + /* Scan all partitions, probing with all modules. */ + nhandles = hsize / sizeof(*handles); + printf(" Probing %zu block devices...", nhandles); + for (i = 0; i < nhandles; i++) { + status = probe_handle(handles[i]); + switch (status) { + case EFI_UNSUPPORTED: + printf("."); + break; + case EFI_SUCCESS: + printf("+"); + break; + default: + printf("x"); break; + } } + printf(" done\n"); - if (i == nparts) - panic("No bootable partition found"); - - bootdevhandle = handles[i]; - load(path); + /* Status summary. */ + for (i = 0; i < NUM_BOOT_MODULES; i++) { + if (boot_modules[i] != NULL) { + printf(" "); + boot_modules[i]->status(); + } + } - panic("Load failed"); + /* Select a partition to boot by trying each module in order. */ + for (i = 0; i < NUM_BOOT_MODULES; i++) + if (boot_modules[i] != NULL) + try_load(boot_modules[i]); - return EFI_SUCCESS; + /* If we get here, we're out of luck... */ + panic("No bootable partitions found!"); } -static int -dskread(void *buf, u_int64_t lba, int nblk) +static EFI_STATUS +probe_handle(EFI_HANDLE h) { + dev_info_t *devinfo; + EFI_BLOCK_IO *blkio; + EFI_DEVICE_PATH *devpath; EFI_STATUS status; - int size; + UINTN i; - lba = lba / (bootdev->Media->BlockSize / DEV_BSIZE); - size = nblk * DEV_BSIZE; - status = bootdev->ReadBlocks(bootdev, bootdev->Media->MediaId, lba, - size, buf); + /* Figure out if we're dealing with an actual partition. */ + status = bs->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); + if (status == EFI_UNSUPPORTED) + return (status); - if (EFI_ERROR(status)) - return (-1); + if (status != EFI_SUCCESS) { + DPRINTF("\nFailed to query DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + return (status); + } - return (0); -} + while (!IsDevicePathEnd(NextDevicePathNode(devpath))) + devpath = NextDevicePathNode(devpath); -#include "ufsread.c" + status = bs->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); + if (status == EFI_UNSUPPORTED) + return (status); -static ssize_t -fsstat(ufs_ino_t inode) -{ -#ifndef UFS2_ONLY - static struct ufs1_dinode dp1; -#endif -#ifndef UFS1_ONLY - static struct ufs2_dinode dp2; -#endif - static struct fs fs; - static ufs_ino_t inomap; - char *blkbuf; - void *indbuf; - size_t n, size; - static ufs2_daddr_t blkmap, indmap; - - blkbuf = dmadat->blkbuf; - indbuf = dmadat->indbuf; - if (!dsk_meta) { - inomap = 0; - for (n = 0; sblock_try[n] != -1; n++) { - if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, - SBLOCKSIZE / DEV_BSIZE)) - return -1; - memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); - if (( -#if defined(UFS1_ONLY) - fs.fs_magic == FS_UFS1_MAGIC -#elif defined(UFS2_ONLY) - (fs.fs_magic == FS_UFS2_MAGIC && - fs.fs_sblockloc == sblock_try[n]) -#else - fs.fs_magic == FS_UFS1_MAGIC || - (fs.fs_magic == FS_UFS2_MAGIC && - fs.fs_sblockloc == sblock_try[n]) -#endif - ) && - fs.fs_bsize <= MAXBSIZE && - fs.fs_bsize >= (int32_t)sizeof(struct fs)) - break; - } - if (sblock_try[n] == -1) { - return -1; - } - dsk_meta++; - } else - memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); - if (!inode) - return 0; - if (inomap != inode) { - n = IPERVBLK(&fs); - if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK)) - return -1; - n = INO_TO_VBO(n, inode); -#if defined(UFS1_ONLY) - memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, - sizeof(struct ufs1_dinode)); -#elif defined(UFS2_ONLY) - memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, - sizeof(struct ufs2_dinode)); -#else - if (fs.fs_magic == FS_UFS1_MAGIC) - memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n, - sizeof(struct ufs1_dinode)); - else - memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n, - sizeof(struct ufs2_dinode)); -#endif - inomap = inode; - fs_off = 0; - blkmap = indmap = 0; - } - size = DIP(di_size); - n = size - fs_off; - return (n); -} + if (status != EFI_SUCCESS) { + DPRINTF("\nFailed to query BlockIoProtocol (%lu)\n", + EFI_ERROR_CODE(status)); + return (status); + } -static struct dmadat __dmadat; + if (!blkio->Media->LogicalPartition) + return (EFI_UNSUPPORTED); -static int -domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet) -{ + /* Run through each module, see if it can load this partition */ + for (i = 0; i < NUM_BOOT_MODULES; i++) { + if (boot_modules[i] == NULL) + continue; + + if ((status = bs->AllocatePool(EfiLoaderData, + sizeof(*devinfo), (void **)&devinfo)) != + EFI_SUCCESS) { + DPRINTF("\nFailed to allocate devinfo (%lu)\n", + EFI_ERROR_CODE(status)); + continue; + } + devinfo->dev = blkio; + devinfo->devpath = devpath; + devinfo->devhandle = h; + devinfo->devdata = NULL; + devinfo->next = NULL; + + status = boot_modules[i]->probe(devinfo); + if (status == EFI_SUCCESS) + return (EFI_SUCCESS); + (void)bs->FreePool(devinfo); + } - dmadat = &__dmadat; - bootdev = blkio; - bootdevpath = device; - if (fsread(0, NULL, 0)) { - if (!quiet) - printf("domount: can't read superblock\n"); - return (-1); - } - if (!quiet) - printf("Succesfully mounted UFS filesystem\n"); - return (0); + return (EFI_UNSUPPORTED); } -static void -load(const char *fname) +void +add_device(dev_info_t **devinfop, dev_info_t *devinfo) { - ufs_ino_t ino; - EFI_STATUS status; - EFI_HANDLE loaderhandle; - EFI_LOADED_IMAGE *loaded_image; - void *buffer; - size_t bufsize; + dev_info_t *dev; - if ((ino = lookup(fname)) == 0) { - printf("File %s not found\n", fname); + if (*devinfop == NULL) { + *devinfop = devinfo; return; } - bufsize = fsstat(ino); - status = systab->BootServices->AllocatePool(EfiLoaderData, - bufsize, &buffer); - fsread(ino, buffer, bufsize); - - /* XXX: For secure boot, we need our own loader here */ - status = systab->BootServices->LoadImage(TRUE, image, bootdevpath, - buffer, bufsize, &loaderhandle); - if (EFI_ERROR(status)) - printf("LoadImage failed with error %lu\n", - EFI_ERROR_CODE(status)); - - status = systab->BootServices->HandleProtocol(loaderhandle, - &LoadedImageGUID, (VOID**)&loaded_image); - if (EFI_ERROR(status)) - printf("HandleProtocol failed with error %lu\n", - EFI_ERROR_CODE(status)); + for (dev = *devinfop; dev->next != NULL; dev = dev->next) + ; - loaded_image->DeviceHandle = bootdevhandle; - - status = systab->BootServices->StartImage(loaderhandle, NULL, NULL); - if (EFI_ERROR(status)) - printf("StartImage failed with error %lu\n", - EFI_ERROR_CODE(status)); + dev->next = devinfo; } void Added: head/sys/boot/efi/boot1/boot_module.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/boot1/boot_module.h Fri Jan 15 01:22:36 2016 (r294060) @@ -0,0 +1,110 @@ +/*- + * Copyright (c) 2015 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _BOOT_MODULE_H_ +#define _BOOT_MODULE_H_ + +#include + +#include +#include +#include + +#ifdef EFI_DEBUG +#define DPRINTF(fmt, args...) \ + do { \ + printf(fmt, ##args) \ + } while (0) +#else +#define DPRINTF(fmt, args...) {} +#endif + +/* EFI device info */ +typedef struct dev_info +{ + EFI_BLOCK_IO *dev; + EFI_DEVICE_PATH *devpath; + EFI_HANDLE *devhandle; + void *devdata; + struct dev_info *next; +} dev_info_t; + +/* + * A boot loader module. + * + * This is a standard interface for filesystem modules in the EFI system. + */ +typedef struct boot_module_t +{ + const char *name; + + /* init is the optional initialiser for the module. */ + void (*init)(); + + /* + * probe checks to see if the module can handle dev. + * + * Return codes: + * EFI_SUCCESS = The module can handle the device. + * EFI_NOT_FOUND = The module can not handle the device. + * Other = The module encountered an error. + */ + EFI_STATUS (*probe)(dev_info_t* dev); + + /* + * load should select the best out of a set of devices that probe + * indicated were loadable and load it. + * + * Return codes: + * EFI_SUCCESS = The module can handle the device. + * EFI_NOT_FOUND = The module can not handle the device. + * Other = The module encountered an error. + */ + EFI_STATUS (*load)(const char *loader_path, dev_info_t **devinfo, + void **buf, size_t *bufsize); + + /* status outputs information about the probed devices. */ + void (*status)(); + +} boot_module_t; + +/* Standard boot modules. */ +#ifdef EFI_UFS_BOOT +extern const boot_module_t ufs_module; +#endif + +/* Functions available to modules. */ +extern void add_device(dev_info_t **devinfop, dev_info_t *devinfo); +extern void panic(const char *fmt, ...) __dead2; +extern int printf(const char *fmt, ...); +extern int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); + +extern EFI_SYSTEM_TABLE *systab; +extern EFI_BOOT_SERVICES *bs; + +#endif Added: head/sys/boot/efi/boot1/ufs_module.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/boot1/ufs_module.c Fri Jan 15 01:22:36 2016 (r294060) @@ -0,0 +1,253 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * Copyright (c) 2001 Robert Drehmel + * All rights reserved. + * Copyright (c) 2014 Nathan Whitehorn + * All rights reserved. + * Copyright (c) 2015 Eric McCorkle + * All rights reverved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +#include "boot_module.h" + +static dev_info_t *devinfo; +static dev_info_t *devices; + +static int +dskread(void *buf, u_int64_t lba, int nblk) +{ + int size; + EFI_STATUS status; + + lba = lba / (devinfo->dev->Media->BlockSize / DEV_BSIZE); + size = nblk * DEV_BSIZE; + + status = devinfo->dev->ReadBlocks(devinfo->dev, + devinfo->dev->Media->MediaId, lba, size, buf); + + if (status != EFI_SUCCESS) { + DPRINTF("dskread: failed dev: %p, id: %u, lba: %lu, size: %d, " + "status: %lu\n", devinfo->dev, + devinfo->dev->Media->MediaId, lba, size, + EFI_ERROR_CODE(status)); + return (-1); + } + + return (0); +} + +#include "ufsread.c" + +static ssize_t +fsstat(ufs_ino_t inode) +{ +#ifndef UFS2_ONLY + static struct ufs1_dinode dp1; +#endif +#ifndef UFS1_ONLY + static struct ufs2_dinode dp2; +#endif + static struct fs fs; + static ufs_ino_t inomap; + char *blkbuf; + void *indbuf; + size_t n, size; + static ufs2_daddr_t blkmap, indmap; + + blkbuf = dmadat->blkbuf; + indbuf = dmadat->indbuf; + if (!dsk_meta) { + inomap = 0; + for (n = 0; sblock_try[n] != -1; n++) { + if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, + SBLOCKSIZE / DEV_BSIZE)) + return (-1); + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); + if (( +#if defined(UFS1_ONLY) + fs.fs_magic == FS_UFS1_MAGIC +#elif defined(UFS2_ONLY) + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) +#else + fs.fs_magic == FS_UFS1_MAGIC || + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) +#endif + ) && + fs.fs_bsize <= MAXBSIZE && + fs.fs_bsize >= (int32_t)sizeof(struct fs)) + break; + } + if (sblock_try[n] == -1) { + return (-1); + } + dsk_meta++; + } else + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); + if (!inode) + return (0); + if (inomap != inode) { + n = IPERVBLK(&fs); + if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK)) + return (-1); + n = INO_TO_VBO(n, inode); +#if defined(UFS1_ONLY) + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); +#elif defined(UFS2_ONLY) + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); +#else + if (fs.fs_magic == FS_UFS1_MAGIC) + memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n, + sizeof(struct ufs1_dinode)); + else + memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n, + sizeof(struct ufs2_dinode)); +#endif + inomap = inode; + fs_off = 0; + blkmap = indmap = 0; + } + size = DIP(di_size); + n = size - fs_off; + + return (n); +} + +static struct dmadat __dmadat; + +static EFI_STATUS +probe(dev_info_t* dev) +{ + + devinfo = dev; + dmadat = &__dmadat; + if (fsread(0, NULL, 0) < 0) + return (EFI_UNSUPPORTED); + + add_device(&devices, dev); + + return (EFI_SUCCESS); +} + +static EFI_STATUS +try_load(dev_info_t *dev, const char *loader_path, void **bufp, size_t *bufsize) +{ + ufs_ino_t ino; + EFI_STATUS status; + size_t size; + ssize_t read; + void *buf; + + devinfo = dev; + if ((ino = lookup(loader_path)) == 0) + return (EFI_NOT_FOUND); + + size = fsstat(ino); + if (size <= 0) { + printf("Failed to fsstat %s ino: %d\n", loader_path, ino); + return (EFI_INVALID_PARAMETER); + } + + if ((status = bs->AllocatePool(EfiLoaderData, size, &buf)) != + EFI_SUCCESS) { + printf("Failed to allocate read buffer (%lu)\n", + EFI_ERROR_CODE(status)); + return (status); + } + + read = fsread(ino, buf, size); + if ((size_t)read != size) { + printf("Failed to read %s (%zd != %zu)\n", loader_path, read, + size); + (void)bs->FreePool(buf); + return (EFI_INVALID_PARAMETER); + } + + *bufp = buf; + *bufsize = size; + + return (EFI_SUCCESS); +} + +static EFI_STATUS +load(const char *loader_path, dev_info_t **devinfop, void **buf, + size_t *bufsize) +{ + dev_info_t *dev; + EFI_STATUS status; + + for (dev = devices; dev != NULL; dev = dev->next) { + status = try_load(dev, loader_path, buf, bufsize); + if (status == EFI_SUCCESS) { + *devinfop = dev; + return (EFI_SUCCESS); + } else if (status != EFI_NOT_FOUND) { + return (status); + } + } + + return (EFI_NOT_FOUND); +} + +static void +status() +{ + int i; + dev_info_t *dev; + + for (dev = devices, i = 0; dev != NULL; dev = dev->next, i++) + ; + + printf("%s found ", ufs_module.name); + switch (i) { + case 0: + printf("no partitions\n"); + break; + case 1: + printf("%d partition\n", i); + break; + default: + printf("%d partitions\n", i); + } +} + +const boot_module_t ufs_module = +{ + .name = "UFS", + .probe = probe, + .load = load, + .status = status +}; Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Fri Jan 15 01:06:37 2016 (r294059) +++ head/sys/boot/efi/include/efilib.h Fri Jan 15 01:22:36 2016 (r294060) @@ -39,7 +39,6 @@ extern struct devsw efinet_dev; extern struct netif_driver efinetif; void *efi_get_table(EFI_GUID *tbl); -void efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table); int efi_register_handles(struct devsw *, EFI_HANDLE *, EFI_HANDLE *, int); EFI_HANDLE efi_find_handle(struct devsw *, int); Modified: head/sys/boot/efi/loader/devicename.c ============================================================================== --- head/sys/boot/efi/loader/devicename.c Fri Jan 15 01:06:37 2016 (r294059) +++ head/sys/boot/efi/loader/devicename.c Fri Jan 15 01:22:36 2016 (r294060) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -86,7 +87,7 @@ efi_parsedev(struct devdesc **dev, const struct devsw *dv; char *cp; const char *np; - int i, err; + int i; /* minimum length check */ if (strlen(devspec) < 2) @@ -101,24 +102,26 @@ efi_parsedev(struct devdesc **dev, const if (devsw[i] == NULL) return (ENOENT); - idev = malloc(sizeof(struct devdesc)); - if (idev == NULL) - return (ENOMEM); - - idev->d_dev = dv; - idev->d_type = dv->dv_type; - idev->d_unit = -1; - - err = 0; np = devspec + strlen(dv->dv_name); - if (*np != '\0' && *np != ':') { - idev->d_unit = strtol(np, &cp, 0); - if (cp == np) { - idev->d_unit = -1; - free(idev); - return (EUNIT); + + { + idev = malloc(sizeof(struct devdesc)); + if (idev == NULL) + return (ENOMEM); + + idev->d_dev = dv; + idev->d_type = dv->dv_type; + idev->d_unit = -1; + if (*np != '\0' && *np != ':') { + idev->d_unit = strtol(np, &cp, 0); + if (cp == np) { + idev->d_unit = -1; + free(idev); + return (EUNIT); + } } } + if (*cp != '\0' && *cp != ':') { free(idev); return (EINVAL); @@ -137,7 +140,7 @@ char * efi_fmtdev(void *vdev) { struct devdesc *dev = (struct devdesc *)vdev; - static char buf[32]; /* XXX device length constant? */ + static char buf[SPECNAMELEN + 1]; switch(dev->d_type) { case DEVT_NONE: Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Fri Jan 15 01:06:37 2016 (r294059) +++ head/sys/boot/efi/loader/main.c Fri Jan 15 01:22:36 2016 (r294060) @@ -28,6 +28,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -45,7 +46,6 @@ extern char bootprog_rev[]; extern char bootprog_date[]; extern char bootprog_maker[]; -struct devdesc currdev; /* our current device */ struct arch_switch archsw; /* MI/MD interface boundary */ EFI_GUID acpi = ACPI_TABLE_GUID; @@ -61,15 +61,36 @@ EFI_GUID memtype = MEMORY_TYPE_INFORMATI EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; EFI_GUID fdtdtb = FDT_TABLE_GUID; +/* + * Need this because EFI uses UTF-16 unicode string constants, but we + * use UTF-8. We can't use printf due to the possiblity of \0 and we + * don't support support wide characters either. + */ +static void +print_str16(const CHAR16 *str) +{ + int i; + + for (i = 0; str[i]; i++) + printf("%c", (char)str[i]); +} + EFI_STATUS *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Jan 15 01:34:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E292AA8378B; Fri, 15 Jan 2016 01:34:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C59A1FDE; Fri, 15 Jan 2016 01:34:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F1YhPc025802; Fri, 15 Jan 2016 01:34:43 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F1YhKi025798; Fri, 15 Jan 2016 01:34:43 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201601150134.u0F1YhKi025798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Fri, 15 Jan 2016 01:34:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294062 - in head: share/man/man4 sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 01:34:45 -0000 Author: cem Date: Fri Jan 15 01:34:43 2016 New Revision: 294062 URL: https://svnweb.freebsd.org/changeset/base/294062 Log: ioat(4): Add support for 'fence' bit with DMA_FENCE flag Some classes of IOAT hardware prefetch reads. DMA operations that depend on the result of prior DMA operations must use the DMA_FENCE flag to prevent stale reads. (E.g., I've hit this personally on Broadwell-EP. The Broadwell-DE has a different IOAT unit that is documented to not pipeline DMA operations.) Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/ioat.4 head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h Modified: head/share/man/man4/ioat.4 ============================================================================== --- head/share/man/man4/ioat.4 Fri Jan 15 01:26:32 2016 (r294061) +++ head/share/man/man4/ioat.4 Fri Jan 15 01:34:43 2016 (r294062) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2016 +.Dd January 14, 2016 .Dt IOAT 4 .Os .Sh NAME @@ -134,7 +134,7 @@ Null operations do nothing, but may be u mechanism. .Pp All operations can optionally trigger an interrupt at completion with the -.Ar DMA_EN_INT +.Ar DMA_INT_EN flag. For example, a user might submit multiple operations to the same channel and only enable an interrupt and callback for the last operation. @@ -160,6 +160,17 @@ flag. .Ar DMA_NO_WAIT may return NULL.) .Pp +Operations that depend on the result of prior operations should use +.Ar DMA_FENCE . +For example, such a scenario can happen when two related DMA operations are +queued. +First, a DMA copy to one location (A), followed directly by a DMA copy +from A to B. +In this scenario, some classes of I/OAT hardware may prefetch A for the second +operation before it is written by the first operation. +To avoid reading a stale value in sequences of dependent operations, use +.Ar DMA_FENCE . +.Pp All operations, as well as .Fn ioat_get_dmaengine , can return NULL in special circumstances. Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Fri Jan 15 01:26:32 2016 (r294061) +++ head/sys/dev/ioat/ioat.c Fri Jan 15 01:34:43 2016 (r294062) @@ -852,6 +852,8 @@ ioat_op_generic(struct ioat_softc *ioat, if ((flags & DMA_INT_EN) != 0) hw_desc->u.control_generic.int_enable = 1; + if ((flags & DMA_FENCE) != 0) + hw_desc->u.control_generic.fence = 1; hw_desc->size = size; hw_desc->src_addr = src; Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Fri Jan 15 01:26:32 2016 (r294061) +++ head/sys/dev/ioat/ioat.h Fri Jan 15 01:34:43 2016 (r294062) @@ -46,7 +46,13 @@ __FBSDID("$FreeBSD$"); * descriptor without blocking. */ #define DMA_NO_WAIT 0x2 -#define DMA_ALL_FLAGS (DMA_INT_EN | DMA_NO_WAIT) +/* + * Disallow prefetching the source of the following operation. Ordinarily, DMA + * operations can be pipelined on some hardware. E.g., operation 2's source + * may be prefetched before operation 1 completes. + */ +#define DMA_FENCE 0x4 +#define DMA_ALL_FLAGS (DMA_INT_EN | DMA_NO_WAIT | DMA_FENCE) /* * Hardware revision number. Different hardware revisions support different From owner-svn-src-head@freebsd.org Fri Jan 15 02:33:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B376A82E32; Fri, 15 Jan 2016 02:33:50 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06D4A13C9; Fri, 15 Jan 2016 02:33:49 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F2Xne4043919; Fri, 15 Jan 2016 02:33:49 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F2Xmgd043907; Fri, 15 Jan 2016 02:33:48 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601150233.u0F2Xmgd043907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 15 Jan 2016 02:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294068 - in head/sys/boot/efi: boot1 include libefi loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 02:33:50 -0000 Author: smh Date: Fri Jan 15 02:33:47 2016 New Revision: 294068 URL: https://svnweb.freebsd.org/changeset/base/294068 Log: Add EFI ZFS boot support This builds on the modular EFI loader support added r294060 adding a module to provide ZFS boot support on EFI systems. It should be noted that EFI uses a fixed size memory block for all allocations performed by the loader so it may be necessary to tune this size. For example when building an image which uses mfs_root e.g. mfsbsd, adding the following to /etc/make.conf would be needed to prevent EFI from running out of memory when loading the mfs_root image. EFI_STAGING_SIZE=128 Submitted by: Eric McCorkle MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Added: head/sys/boot/efi/boot1/zfs_module.c (contents, props changed) Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/boot1/boot_module.h head/sys/boot/efi/include/efilib.h head/sys/boot/efi/libefi/handles.c head/sys/boot/efi/loader/Makefile head/sys/boot/efi/loader/conf.c head/sys/boot/efi/loader/devicename.c head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Fri Jan 15 02:32:57 2016 (r294067) +++ head/sys/boot/efi/boot1/Makefile Fri Jan 15 02:33:47 2016 (r294068) @@ -10,8 +10,22 @@ PROG= boot1.sym INTERNALPROG= WARNS?= 6 +.if ${MK_ZFS} != "no" +# Disable warnings that are currently incompatible with the zfs boot code +CWARNFLAGS.zfs_module.c += -Wno-array-bounds +CWARNFLAGS.zfs_module.c += -Wno-cast-align +CWARNFLAGS.zfs_module.c += -Wno-cast-qual +CWARNFLAGS.zfs_module.c += -Wno-missing-prototypes +CWARNFLAGS.zfs_module.c += -Wno-sign-compare +CWARNFLAGS.zfs_module.c += -Wno-unused-parameter +CWARNFLAGS.zfs_module.c += -Wno-unused-function +.endif + # architecture-specific loader code SRCS= boot1.c self_reloc.c start.S ufs_module.c +.if ${MK_ZFS} != "no" +SRCS+= zfs_module.c +.endif CFLAGS+= -I. CFLAGS+= -I${.CURDIR}/../include @@ -20,6 +34,12 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/d CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -DEFI_UFS_BOOT +.if ${MK_ZFS} != "no" +CFLAGS+= -I${.CURDIR}/../../zfs/ +CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs/ +CFLAGS+= -DEFI_ZFS_BOOT +.endif + # Always add MI sources and REGULAR efi loader bits .PATH: ${.CURDIR}/../loader/arch/${MACHINE} .PATH: ${.CURDIR}/../loader Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Fri Jan 15 02:32:57 2016 (r294067) +++ head/sys/boot/efi/boot1/boot1.c Fri Jan 15 02:33:47 2016 (r294068) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); static const boot_module_t *boot_modules[] = { +#ifdef EFI_ZFS_BOOT + &zfs_module, +#endif #ifdef EFI_UFS_BOOT &ufs_module #endif Modified: head/sys/boot/efi/boot1/boot_module.h ============================================================================== --- head/sys/boot/efi/boot1/boot_module.h Fri Jan 15 02:32:57 2016 (r294067) +++ head/sys/boot/efi/boot1/boot_module.h Fri Jan 15 02:33:47 2016 (r294068) @@ -97,6 +97,9 @@ typedef struct boot_module_t #ifdef EFI_UFS_BOOT extern const boot_module_t ufs_module; #endif +#ifdef EFI_ZFS_BOOT +extern const boot_module_t zfs_module; +#endif /* Functions available to modules. */ extern void add_device(dev_info_t **devinfop, dev_info_t *devinfo); Added: head/sys/boot/efi/boot1/zfs_module.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/boot1/zfs_module.c Fri Jan 15 02:33:47 2016 (r294068) @@ -0,0 +1,199 @@ +/*- + * Copyright (c) 2015 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#include +#include +#include +#include +#include +#include +#include + +#include "boot_module.h" + +#include "libzfs.h" +#include "zfsimpl.c" + +static dev_info_t *devices; + +static int +vdev_read(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) +{ + dev_info_t *devinfo; + off_t lba; + EFI_STATUS status; + + devinfo = (dev_info_t *)priv; + lba = off / devinfo->dev->Media->BlockSize; + + status = devinfo->dev->ReadBlocks(devinfo->dev, + devinfo->dev->Media->MediaId, lba, bytes, buf); + if (status != EFI_SUCCESS) { + DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %lu, size: %d," + " status: %lu\n", devinfo->dev, + devinfo->dev->Media->MediaId, lba, size, + EFI_ERROR_CODE(status)); + return (-1); + } + + return (0); +} + +static EFI_STATUS +probe(dev_info_t *dev) +{ + spa_t *spa; + dev_info_t *tdev; + EFI_STATUS status; + + /* ZFS consumes the dev on success so we need a copy. */ + if ((status = bs->AllocatePool(EfiLoaderData, sizeof(*dev), + (void**)&tdev)) != EFI_SUCCESS) { + DPRINTF("Failed to allocate tdev (%lu)\n", + EFI_ERROR_CODE(status)); + return (status); + } + memcpy(tdev, dev, sizeof(*dev)); + + if (vdev_probe(vdev_read, tdev, &spa) != 0) { + (void)bs->FreePool(tdev); + return (EFI_UNSUPPORTED); + } + + dev->devdata = spa; + add_device(&devices, dev); + + return (EFI_SUCCESS); +} + +static EFI_STATUS +try_load(dev_info_t *devinfo, const char *loader_path, void **bufp, size_t *bufsize) +{ + spa_t *spa; + struct zfsmount zfsmount; + dnode_phys_t dn; + struct stat st; + int err; + void *buf; + EFI_STATUS status; + + spa = devinfo->devdata; + if (zfs_spa_init(spa) != 0) { + /* Init failed, don't report this loudly. */ + return (EFI_NOT_FOUND); + } + + if (zfs_mount(spa, 0, &zfsmount) != 0) { + /* Mount failed, don't report this loudly. */ + return (EFI_NOT_FOUND); + } + + if ((err = zfs_lookup(&zfsmount, loader_path, &dn)) != 0) { + printf("Failed to lookup %s on pool %s (%d)\n", loader_path, + spa->spa_name, err); + return (EFI_INVALID_PARAMETER); + } + + if ((err = zfs_dnode_stat(spa, &dn, &st)) != 0) { + printf("Failed to lookup %s on pool %s (%d)\n", loader_path, + spa->spa_name, err); + return (EFI_INVALID_PARAMETER); + } + + if ((status = bs->AllocatePool(EfiLoaderData, (UINTN)st.st_size, &buf)) + != EFI_SUCCESS) { + printf("Failed to allocate load buffer for pool %s (%lu)\n", + spa->spa_name, EFI_ERROR_CODE(status)); + return (EFI_INVALID_PARAMETER); + } + + if ((err = dnode_read(spa, &dn, 0, buf, st.st_size)) != 0) { + printf("Failed to read node from %s (%d)\n", spa->spa_name, + err); + (void)bs->FreePool(buf); + return (EFI_INVALID_PARAMETER); + } + + *bufsize = st.st_size; + *bufp = buf; + + return (EFI_SUCCESS); +} + +static EFI_STATUS +load(const char *loader_path, dev_info_t **devinfop, void **bufp, + size_t *bufsize) +{ + dev_info_t *devinfo; + EFI_STATUS status; + + for (devinfo = devices; devinfo != NULL; devinfo = devinfo->next) { + status = try_load(devinfo, loader_path, bufp, bufsize); + if (status == EFI_SUCCESS) { + *devinfop = devinfo; + return (EFI_SUCCESS); + } else if (status != EFI_NOT_FOUND) { + return (status); + } + } + + return (EFI_NOT_FOUND); +} + +static void +status() +{ + spa_t *spa; + + spa = STAILQ_FIRST(&zfs_pools); + if (spa == NULL) { + printf("%s found no pools\n", zfs_module.name); + return; + } + + printf("%s found the following pools:", zfs_module.name); + STAILQ_FOREACH(spa, &zfs_pools, spa_link) + printf(" %s", spa->spa_name); + + printf("\n"); +} + +static void +init() +{ + + zfs_init(); +} + +const boot_module_t zfs_module = +{ + .name = "ZFS", + .init = init, + .probe = probe, + .load = load, + .status = status +}; Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Fri Jan 15 02:32:57 2016 (r294067) +++ head/sys/boot/efi/include/efilib.h Fri Jan 15 02:33:47 2016 (r294068) @@ -42,7 +42,8 @@ void *efi_get_table(EFI_GUID *tbl); int efi_register_handles(struct devsw *, EFI_HANDLE *, EFI_HANDLE *, int); EFI_HANDLE efi_find_handle(struct devsw *, int); -int efi_handle_lookup(EFI_HANDLE, struct devsw **, int *); +int efi_handle_lookup(EFI_HANDLE, struct devsw **, int *, uint64_t *); +int efi_handle_update_dev(EFI_HANDLE, struct devsw *, int, uint64_t); int efi_status_to_errno(EFI_STATUS); time_t efi_time(EFI_TIME *); Modified: head/sys/boot/efi/libefi/handles.c ============================================================================== --- head/sys/boot/efi/libefi/handles.c Fri Jan 15 02:32:57 2016 (r294067) +++ head/sys/boot/efi/libefi/handles.c Fri Jan 15 02:33:47 2016 (r294068) @@ -35,6 +35,7 @@ struct entry { EFI_HANDLE alias; struct devsw *dev; int unit; + uint64_t extra; }; struct entry *entry; @@ -79,7 +80,7 @@ efi_find_handle(struct devsw *dev, int u } int -efi_handle_lookup(EFI_HANDLE h, struct devsw **dev, int *unit) +efi_handle_lookup(EFI_HANDLE h, struct devsw **dev, int *unit, uint64_t *extra) { int idx; @@ -90,7 +91,28 @@ efi_handle_lookup(EFI_HANDLE h, struct d *dev = entry[idx].dev; if (unit != NULL) *unit = entry[idx].unit; + if (extra != NULL) + *extra = entry[idx].extra; return (0); } return (ENOENT); } + +int +efi_handle_update_dev(EFI_HANDLE h, struct devsw *dev, int unit, + uint64_t guid) +{ + int idx; + + for (idx = 0; idx < nentries; idx++) { + if (entry[idx].handle != h) + continue; + entry[idx].dev = dev; + entry[idx].unit = unit; + entry[idx].alias = NULL; + entry[idx].extra = guid; + return (0); + } + + return (ENOENT); +} Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Fri Jan 15 02:32:57 2016 (r294067) +++ head/sys/boot/efi/loader/Makefile Fri Jan 15 02:33:47 2016 (r294068) @@ -21,6 +21,16 @@ SRCS= autoload.c \ smbios.c \ vers.c +.if ${MK_ZFS} != "no" +SRCS+= zfs.c +.PATH: ${.CURDIR}/../../zfs + +# Disable warnings that are currently incompatible with the zfs boot code +CWARNFLAGS.zfs.c+= -Wno-sign-compare +CWARNFLAGS.zfs.c+= -Wno-array-bounds +CWARNFLAGS.zfs.c+= -Wno-missing-prototypes +.endif + .PATH: ${.CURDIR}/arch/${MACHINE} # For smbios.c .PATH: ${.CURDIR}/../../i386/libi386 @@ -33,6 +43,11 @@ CFLAGS+= -I${.CURDIR}/../include/${MACHI CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../i386/libi386 +.if ${MK_ZFS} != "no" +CFLAGS+= -I${.CURDIR}/../../zfs +CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +CFLAGS+= -DEFI_ZFS_BOOT +.endif CFLAGS+= -DNO_PCI -DEFI # make buildenv doesn't set DESTDIR, this means LIBSTAND Modified: head/sys/boot/efi/loader/conf.c ============================================================================== --- head/sys/boot/efi/loader/conf.c Fri Jan 15 02:32:57 2016 (r294067) +++ head/sys/boot/efi/loader/conf.c Fri Jan 15 02:33:47 2016 (r294068) @@ -31,14 +31,23 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef EFI_ZFS_BOOT +#include +#endif struct devsw *devsw[] = { &efipart_dev, &efinet_dev, +#ifdef EFI_ZFS_BOOT + &zfs_dev, +#endif NULL }; struct fs_ops *file_system[] = { +#ifdef EFI_ZFS_BOOT + &zfs_fsops, +#endif &dosfs_fsops, &ufs_fsops, &cd9660_fsops, Modified: head/sys/boot/efi/loader/devicename.c ============================================================================== --- head/sys/boot/efi/loader/devicename.c Fri Jan 15 02:32:57 2016 (r294067) +++ head/sys/boot/efi/loader/devicename.c Fri Jan 15 02:33:47 2016 (r294068) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef EFI_ZFS_BOOT +#include +#endif #include #include @@ -104,6 +107,23 @@ efi_parsedev(struct devdesc **dev, const np = devspec + strlen(dv->dv_name); +#ifdef EFI_ZFS_BOOT + if (dv->dv_type == DEVT_ZFS) { + int err; + + idev = malloc(sizeof(struct zfs_devdesc)); + if (idev == NULL) + return (ENOMEM); + + err = zfs_parsedev((struct zfs_devdesc*)idev, np, path); + if (err != 0) { + free(idev); + return (err); + } + *dev = idev; + cp = strchr(np + 1, ':'); + } else +#endif { idev = malloc(sizeof(struct devdesc)); if (idev == NULL) @@ -143,6 +163,10 @@ efi_fmtdev(void *vdev) static char buf[SPECNAMELEN + 1]; switch(dev->d_type) { +#ifdef EFI_ZFS_BOOT + case DEVT_ZFS: + return (zfs_fmtdev(dev)); +#endif case DEVT_NONE: strcpy(buf, "(no device)"); break; Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Fri Jan 15 02:32:57 2016 (r294067) +++ head/sys/boot/efi/loader/main.c Fri Jan 15 02:33:47 2016 (r294068) @@ -39,6 +39,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EFI_ZFS_BOOT +#include +#endif + #include "loader_efi.h" extern char bootprog_name[]; @@ -61,6 +65,10 @@ EFI_GUID memtype = MEMORY_TYPE_INFORMATI EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; EFI_GUID fdtdtb = FDT_TABLE_GUID; +#ifdef EFI_ZFS_BOOT +static void efi_zfs_probe(void); +#endif + /* * Need this because EFI uses UTF-16 unicode string constants, but we * use UTF-8. We can't use printf due to the possiblity of \0 and we @@ -83,6 +91,7 @@ main(int argc, CHAR16 *argv[]) EFI_GUID *guid; int i, j, vargood, unit; struct devsw *dev; + uint64_t pool_guid; UINTN k; archsw.arch_autoload = efi_autoload; @@ -90,6 +99,10 @@ main(int argc, CHAR16 *argv[]) archsw.arch_copyin = efi_copyin; archsw.arch_copyout = efi_copyout; archsw.arch_readin = efi_readin; +#ifdef EFI_ZFS_BOOT + /* Note this needs to be set before ZFS init. */ + archsw.arch_zfs_probe = efi_zfs_probe; +#endif /* * XXX Chicken-and-egg problem; we want to have console output @@ -168,10 +181,27 @@ main(int argc, CHAR16 *argv[]) */ BS->SetWatchdogTimer(0, 0, 0, NULL); - if (efi_handle_lookup(img->DeviceHandle, &dev, &unit) != 0) + if (efi_handle_lookup(img->DeviceHandle, &dev, &unit, &pool_guid) != 0) return (EFI_NOT_FOUND); switch (dev->dv_type) { +#ifdef EFI_ZFS_BOOT + case DEVT_ZFS: { + struct zfs_devdesc currdev; + + currdev.d_dev = dev; + currdev.d_unit = unit; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_opendata = NULL; + currdev.pool_guid = pool_guid; + currdev.root_guid = 0; + env_setenv("currdev", EV_VOLATILE, efi_fmtdev(&currdev), + efi_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, efi_fmtdev(&currdev), env_noset, + env_nounset); + break; + } +#endif default: { struct devdesc currdev; @@ -456,6 +486,29 @@ command_nvram(int argc, char *argv[]) return (CMD_OK); } +#ifdef EFI_ZFS_BOOT +COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset", + command_lszfs); + +static int +command_lszfs(int argc, char *argv[]) +{ + int err; + + if (argc != 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } + + err = zfs_list(argv[1]); + if (err != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } + return (CMD_OK); +} +#endif + #ifdef LOADER_FDT_SUPPORT extern int command_fdt_internal(int argc, char *argv[]); @@ -474,3 +527,23 @@ command_fdt(int argc, char *argv[]) COMMAND_SET(fdt, "fdt", "flattened device tree handling", command_fdt); #endif + +#ifdef EFI_ZFS_BOOT +static void +efi_zfs_probe(void) +{ + EFI_HANDLE h; + u_int unit; + int i; + char dname[SPECNAMELEN + 1]; + uint64_t guid; + + unit = 0; + h = efi_find_handle(&efipart_dev, 0); + for (i = 0; h != NULL; h = efi_find_handle(&efipart_dev, ++i)) { + snprintf(dname, sizeof(dname), "%s%d:", efipart_dev.dv_name, i); + if (zfs_probe_dev(dname, &guid) == 0) + (void)efi_handle_update_dev(h, &zfs_dev, unit++, guid); + } +} +#endif From owner-svn-src-head@freebsd.org Fri Jan 15 05:45:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFF63A83ADC; Fri, 15 Jan 2016 05:45:11 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92D981D79; Fri, 15 Jan 2016 05:45:11 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F5jAMD002523; Fri, 15 Jan 2016 05:45:10 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F5jAd7002519; Fri, 15 Jan 2016 05:45:10 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201601150545.u0F5jAd7002519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 15 Jan 2016 05:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294072 - in head/sys/boot: i386/loader userboot/userboot zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 05:45:11 -0000 Author: allanjude Date: Fri Jan 15 05:45:10 2016 New Revision: 294072 URL: https://svnweb.freebsd.org/changeset/base/294072 Log: Move init_zfs_bootenv to sys/boot/zfs/zfs.c instead of having a copy in each loader While here, add a filter to ignore special datasets MFC after: 3 days Sponsored by: ScaleEngine Inc. Modified: head/sys/boot/i386/loader/main.c head/sys/boot/userboot/userboot/main.c head/sys/boot/zfs/libzfs.h head/sys/boot/zfs/zfs.c Modified: head/sys/boot/i386/loader/main.c ============================================================================== --- head/sys/boot/i386/loader/main.c Fri Jan 15 05:38:27 2016 (r294071) +++ head/sys/boot/i386/loader/main.c Fri Jan 15 05:45:10 2016 (r294072) @@ -69,7 +69,6 @@ static int isa_inb(int port); static void isa_outb(int port, int value); void exit(int code); #ifdef LOADER_ZFS_SUPPORT -static void init_zfs_bootenv(char *currdev); static void i386_zfs_probe(void); #endif @@ -306,34 +305,6 @@ extract_currdev(void) env_nounset); } -#ifdef LOADER_ZFS_SUPPORT -static void -init_zfs_bootenv(char *currdev) -{ - char *beroot; - - if (strlen(currdev) == 0) - return; - if(strncmp(currdev, "zfs:", 4) != 0) - return; - /* Remove the trailing : */ - currdev[strlen(currdev) - 1] = '\0'; - setenv("zfs_be_active", currdev, 1); - setenv("zfs_be_currpage", "1", 1); - /* Do not overwrite if already set */ - setenv("vfs.root.mountfrom", currdev, 0); - /* Forward past zfs: */ - currdev = strchr(currdev, ':'); - currdev++; - /* Remove the last element (current bootenv) */ - beroot = strrchr(currdev, '/'); - if (beroot != NULL) - beroot[0] = '\0'; - beroot = currdev; - setenv("zfs_be_root", beroot, 1); -} -#endif - COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); static int Modified: head/sys/boot/userboot/userboot/main.c ============================================================================== --- head/sys/boot/userboot/userboot/main.c Fri Jan 15 05:38:27 2016 (r294071) +++ head/sys/boot/userboot/userboot/main.c Fri Jan 15 05:45:10 2016 (r294072) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); static void userboot_zfs_probe(void); static int userboot_zfs_found; -static void init_zfs_bootenv(char *currdev); #endif #define USERBOOT_VERSION USERBOOT_VERSION_3 @@ -200,32 +199,6 @@ extract_currdev(void) #if defined(USERBOOT_ZFS_SUPPORT) static void -init_zfs_bootenv(char *currdev) -{ - char *beroot; - - if (strlen(currdev) == 0) - return; - if(strncmp(currdev, "zfs:", 4) != 0) - return; - /* Remove the trailing : */ - currdev[strlen(currdev) - 1] = '\0'; - setenv("zfs_be_active", currdev, 1); - setenv("zfs_be_currpage", "1", 1); - /* Do not overwrite if already set */ - setenv("vfs.root.mountfrom", currdev, 0); - /* Forward past zfs: */ - currdev = strchr(currdev, ':'); - currdev++; - /* Remove the last element (current bootenv) */ - beroot = strrchr(currdev, '/'); - if (beroot != NULL) - beroot[0] = '\0'; - beroot = currdev; - setenv("zfs_be_root", beroot, 1); -} - -static void userboot_zfs_probe(void) { char devname[32]; Modified: head/sys/boot/zfs/libzfs.h ============================================================================== --- head/sys/boot/zfs/libzfs.h Fri Jan 15 05:38:27 2016 (r294071) +++ head/sys/boot/zfs/libzfs.h Fri Jan 15 05:45:10 2016 (r294072) @@ -62,6 +62,7 @@ int zfs_parsedev(struct zfs_devdesc *dev char *zfs_fmtdev(void *vdev); int zfs_probe_dev(const char *devname, uint64_t *pool_guid); int zfs_list(const char *name); +void init_zfs_bootenv(char *currdev); int zfs_bootenv(const char *name); int zfs_belist_add(const char *name); int zfs_set_env(void); Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Fri Jan 15 05:38:27 2016 (r294071) +++ head/sys/boot/zfs/zfs.c Fri Jan 15 05:45:10 2016 (r294072) @@ -709,6 +709,32 @@ zfs_list(const char *name) return (zfs_list_dataset(spa, objid)); } +void +init_zfs_bootenv(char *currdev) +{ + char *beroot; + + if (strlen(currdev) == 0) + return; + if(strncmp(currdev, "zfs:", 4) != 0) + return; + /* Remove the trailing : */ + currdev[strlen(currdev) - 1] = '\0'; + setenv("zfs_be_active", currdev, 1); + setenv("zfs_be_currpage", "1", 1); + /* Do not overwrite if already set */ + setenv("vfs.root.mountfrom", currdev, 0); + /* Forward past zfs: */ + currdev = strchr(currdev, ':'); + currdev++; + /* Remove the last element (current bootenv) */ + beroot = strrchr(currdev, '/'); + if (beroot != NULL) + beroot[0] = '\0'; + beroot = currdev; + setenv("zfs_be_root", beroot, 1); +} + int zfs_bootenv(const char *name) { @@ -779,8 +805,15 @@ int zfs_belist_add(const char *name) { + /* Skip special datasets that start with a $ character */ + if (strncmp(name, "$", 1) == 0) { + return (0); + } /* Add the boot environment to the head of the SLIST */ zfs_be = malloc(sizeof(struct zfs_be_entry)); + if (zfs_be == NULL) { + return (ENOMEM); + } zfs_be->name = name; SLIST_INSERT_HEAD(&zfs_be_head, zfs_be, entries); zfs_env_count++; From owner-svn-src-head@freebsd.org Fri Jan 15 05:45:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5548CA83C84; Fri, 15 Jan 2016 05:45:47 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2363C11D3; Fri, 15 Jan 2016 05:45:47 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F5jkOW002582; Fri, 15 Jan 2016 05:45:46 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F5jk48002581; Fri, 15 Jan 2016 05:45:46 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201601150545.u0F5jk48002581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 15 Jan 2016 05:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294073 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 05:45:47 -0000 Author: allanjude Date: Fri Jan 15 05:45:45 2016 New Revision: 294073 URL: https://svnweb.freebsd.org/changeset/base/294073 Log: Connect the ZFS boot environment menu to the UEFI loader MFC after: 3 days Sponsored by: ScaleEngine Inc. Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Fri Jan 15 05:45:10 2016 (r294072) +++ head/sys/boot/efi/loader/main.c Fri Jan 15 05:45:45 2016 (r294073) @@ -199,6 +199,7 @@ main(int argc, CHAR16 *argv[]) efi_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, efi_fmtdev(&currdev), env_noset, env_nounset); + init_zfs_bootenv(zfs_fmtdev(&currdev)); break; } #endif @@ -507,6 +508,38 @@ command_lszfs(int argc, char *argv[]) } return (CMD_OK); } + +COMMAND_SET(reloadbe, "reloadbe", "refresh the list of ZFS Boot Environments", + command_reloadbe); + +static int +command_reloadbe(int argc, char *argv[]) +{ + int err; + char *root; + + if (argc > 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } + + if (argc == 2) { + err = zfs_bootenv(argv[1]); + } else { + root = getenv("zfs_be_root"); + if (root == NULL) { + return (CMD_OK); + } + err = zfs_bootenv(root); + } + + if (err != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } + + return (CMD_OK); +} #endif #ifdef LOADER_FDT_SUPPORT From owner-svn-src-head@freebsd.org Fri Jan 15 06:21:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27DD9A814E2; Fri, 15 Jan 2016 06:21:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 011271939; Fri, 15 Jan 2016 06:21:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F6LdCJ013982; Fri, 15 Jan 2016 06:21:39 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F6Ld5h013977; Fri, 15 Jan 2016 06:21:39 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601150621.u0F6Ld5h013977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 15 Jan 2016 06:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294075 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 06:21:41 -0000 Author: arybchik Date: Fri Jan 15 06:21:39 2016 New Revision: 294075 URL: https://svnweb.freebsd.org/changeset/base/294075 Log: sfxge: rename hunt_link_state_t to ef10_link_state_t Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4932 Modified: head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_mac.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/hunt_phy.c head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 05:48:28 2016 (r294074) +++ head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 06:21:39 2016 (r294075) @@ -482,16 +482,16 @@ ef10_nvram_partn_size( /* PHY */ -typedef struct hunt_link_state_s { - uint32_t hls_adv_cap_mask; - uint32_t hls_lp_cap_mask; - unsigned int hls_fcntl; - efx_link_mode_t hls_link_mode; +typedef struct ef10_link_state_s { + uint32_t els_adv_cap_mask; + uint32_t els_lp_cap_mask; + unsigned int els_fcntl; + efx_link_mode_t els_link_mode; #if EFSYS_OPT_LOOPBACK - efx_loopback_type_t hls_loopback; + efx_loopback_type_t els_loopback; #endif - boolean_t hls_mac_up; -} hunt_link_state_t; + boolean_t els_mac_up; +} ef10_link_state_t; extern void hunt_phy_link_ev( @@ -502,7 +502,7 @@ hunt_phy_link_ev( extern __checkReturn efx_rc_t hunt_phy_get_link( __in efx_nic_t *enp, - __out hunt_link_state_t *hlsp); + __out ef10_link_state_t *elsp); extern __checkReturn efx_rc_t hunt_phy_power( Modified: head/sys/dev/sfxge/common/hunt_mac.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mac.c Fri Jan 15 05:48:28 2016 (r294074) +++ head/sys/dev/sfxge/common/hunt_mac.c Fri Jan 15 06:21:39 2016 (r294075) @@ -48,16 +48,16 @@ hunt_mac_poll( */ efx_port_t *epp = &(enp->en_port); - hunt_link_state_t hls; + ef10_link_state_t els; efx_rc_t rc; - if ((rc = hunt_phy_get_link(enp, &hls)) != 0) + if ((rc = hunt_phy_get_link(enp, &els)) != 0) goto fail1; - epp->ep_adv_cap_mask = hls.hls_adv_cap_mask; - epp->ep_fcntl = hls.hls_fcntl; + epp->ep_adv_cap_mask = els.els_adv_cap_mask; + epp->ep_fcntl = els.els_fcntl; - *link_modep = hls.hls_link_mode; + *link_modep = els.els_link_mode; return (0); @@ -79,17 +79,17 @@ hunt_mac_up( * essentially identical. */ - hunt_link_state_t hls; + ef10_link_state_t els; efx_rc_t rc; /* * Because Huntington doesn't *require* polling, we can't rely on * hunt_mac_poll() being executed to populate epp->ep_mac_up. */ - if ((rc = hunt_phy_get_link(enp, &hls)) != 0) + if ((rc = hunt_phy_get_link(enp, &els)) != 0) goto fail1; - *mac_upp = hls.hls_mac_up; + *mac_upp = els.els_mac_up; return (0); Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Fri Jan 15 05:48:28 2016 (r294074) +++ head/sys/dev/sfxge/common/hunt_nic.c Fri Jan 15 06:21:39 2016 (r294075) @@ -1096,7 +1096,7 @@ hunt_board_cfg( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint8_t mac_addr[6]; uint32_t board_type = 0; - hunt_link_state_t hls; + ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); uint32_t port; uint32_t pf; @@ -1170,10 +1170,10 @@ hunt_board_cfg( goto fail6; /* Obtain the default PHY advertised capabilities */ - if ((rc = hunt_phy_get_link(enp, &hls)) != 0) + if ((rc = hunt_phy_get_link(enp, &els)) != 0) goto fail7; - epp->ep_default_adv_cap_mask = hls.hls_adv_cap_mask; - epp->ep_adv_cap_mask = hls.hls_adv_cap_mask; + epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; + epp->ep_adv_cap_mask = els.els_adv_cap_mask; /* * Enable firmware workarounds for hardware errata. Modified: head/sys/dev/sfxge/common/hunt_phy.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_phy.c Fri Jan 15 05:48:28 2016 (r294074) +++ head/sys/dev/sfxge/common/hunt_phy.c Fri Jan 15 06:21:39 2016 (r294075) @@ -219,7 +219,7 @@ fail1: __checkReturn efx_rc_t hunt_phy_get_link( __in efx_nic_t *enp, - __out hunt_link_state_t *hlsp) + __out ef10_link_state_t *elsp) { /* * TBD: consider common Siena/Hunt function: Hunt is very similar @@ -252,14 +252,14 @@ hunt_phy_get_link( } hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_CAP), - &hlsp->hls_adv_cap_mask); + &elsp->els_adv_cap_mask); hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP), - &hlsp->hls_lp_cap_mask); + &elsp->els_lp_cap_mask); hunt_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS), MCDI_OUT_DWORD(req, GET_LINK_OUT_LINK_SPEED), MCDI_OUT_DWORD(req, GET_LINK_OUT_FCNTL), - &hlsp->hls_link_mode, &hlsp->hls_fcntl); + &elsp->els_link_mode, &elsp->els_fcntl); #if EFSYS_OPT_LOOPBACK /* Assert the MC_CMD_LOOPBACK and EFX_LOOPBACK namespace agree */ @@ -282,10 +282,10 @@ hunt_phy_get_link( EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PCS == EFX_LOOPBACK_PCS); EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PMAPMD == EFX_LOOPBACK_PMA_PMD); - hlsp->hls_loopback = MCDI_OUT_DWORD(req, GET_LINK_OUT_LOOPBACK_MODE); + elsp->els_loopback = MCDI_OUT_DWORD(req, GET_LINK_OUT_LOOPBACK_MODE); #endif /* EFSYS_OPT_LOOPBACK */ - hlsp->hls_mac_up = MCDI_OUT_DWORD(req, GET_LINK_OUT_MAC_FAULT) == 0; + elsp->els_mac_up = MCDI_OUT_DWORD(req, GET_LINK_OUT_MAC_FAULT) == 0; return (0); Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Fri Jan 15 05:48:28 2016 (r294074) +++ head/sys/dev/sfxge/common/medford_nic.c Fri Jan 15 06:21:39 2016 (r294075) @@ -47,7 +47,7 @@ medford_board_cfg( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint8_t mac_addr[6] = { 0 }; uint32_t board_type = 0; - hunt_link_state_t hls; + ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); uint32_t port; uint32_t pf; @@ -126,10 +126,10 @@ medford_board_cfg( goto fail6; /* Obtain the default PHY advertised capabilities */ - if ((rc = hunt_phy_get_link(enp, &hls)) != 0) + if ((rc = hunt_phy_get_link(enp, &els)) != 0) goto fail7; - epp->ep_default_adv_cap_mask = hls.hls_adv_cap_mask; - epp->ep_adv_cap_mask = hls.hls_adv_cap_mask; + epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; + epp->ep_adv_cap_mask = els.els_adv_cap_mask; if (EFX_PCI_FUNCTION_IS_VF(encp)) { /* From owner-svn-src-head@freebsd.org Fri Jan 15 06:23:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A93DAA816C4; Fri, 15 Jan 2016 06:23:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80C041C03; Fri, 15 Jan 2016 06:23:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F6N5jl014091; Fri, 15 Jan 2016 06:23:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F6N4R3014084; Fri, 15 Jan 2016 06:23:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601150623.u0F6N4R3014084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 15 Jan 2016 06:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294076 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 06:23:06 -0000 Author: arybchik Date: Fri Jan 15 06:23:04 2016 New Revision: 294076 URL: https://svnweb.freebsd.org/changeset/base/294076 Log: sfxge: rework MCDI request completion Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4933 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_mcdi.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Jan 15 06:21:39 2016 (r294075) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Jan 15 06:23:04 2016 (r294076) @@ -463,7 +463,6 @@ typedef struct efx_mcdi_ops_s { efx_rc_t (*emco_init)(efx_nic_t *, const efx_mcdi_transport_t *); void (*emco_send_request)(efx_nic_t *, void *, size_t, void *, size_t); - void (*emco_request_copyout)(efx_nic_t *, efx_mcdi_req_t *); efx_rc_t (*emco_poll_reboot)(efx_nic_t *); boolean_t (*emco_poll_response)(efx_nic_t *); void (*emco_read_response)(efx_nic_t *, void *, size_t, size_t); Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Jan 15 06:21:39 2016 (r294075) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Jan 15 06:23:04 2016 (r294076) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); static efx_mcdi_ops_t __efx_mcdi_siena_ops = { siena_mcdi_init, /* emco_init */ siena_mcdi_send_request, /* emco_send_request */ - siena_mcdi_request_copyout, /* emco_request_copyout */ siena_mcdi_poll_reboot, /* emco_poll_reboot */ siena_mcdi_poll_response, /* emco_poll_response */ siena_mcdi_read_response, /* emco_read_response */ @@ -77,7 +76,6 @@ static efx_mcdi_ops_t __efx_mcdi_siena_o static efx_mcdi_ops_t __efx_mcdi_ef10_ops = { ef10_mcdi_init, /* emco_init */ ef10_mcdi_send_request, /* emco_send_request */ - ef10_mcdi_request_copyout, /* emco_request_copyout */ ef10_mcdi_poll_reboot, /* emco_poll_reboot */ ef10_mcdi_poll_response, /* emco_poll_response */ ef10_mcdi_read_response, /* emco_read_response */ @@ -211,16 +209,6 @@ efx_mcdi_send_request( emcop->emco_send_request(enp, hdrp, hdr_len, sdup, sdu_len); } -static void -efx_mcdi_request_copyout( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp) -{ - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; - - emcop->emco_request_copyout(enp, emrp); -} - static efx_rc_t efx_mcdi_poll_reboot( __in efx_nic_t *enp) @@ -353,7 +341,7 @@ efx_mcdi_request_start( } - void +static void efx_mcdi_read_response_header( __in efx_nic_t *enp, __inout efx_mcdi_req_t *emrp) @@ -468,6 +456,50 @@ fail1: emrp->emr_out_length_used = 0; } +static void +efx_mcdi_finish_response( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp) +{ +#if EFSYS_OPT_MCDI_LOGGING + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; +#endif /* EFSYS_OPT_MCDI_LOGGING */ + efx_dword_t hdr[2]; + unsigned int hdr_len; + size_t bytes; + + if (emrp->emr_out_buf == NULL) + return; + + /* Read the command header to detect MCDI response format */ + hdr_len = sizeof (hdr[0]); + efx_mcdi_read_response(enp, &hdr[0], 0, hdr_len); + if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) { + /* + * Read the actual payload length. The length given in the event + * is only correct for responses with the V1 format. + */ + efx_mcdi_read_response(enp, &hdr[1], hdr_len, sizeof (hdr[1])); + hdr_len += sizeof (hdr[1]); + + emrp->emr_out_length_used = EFX_DWORD_FIELD(hdr[1], + MC_CMD_V2_EXTN_IN_ACTUAL_LEN); + } + + /* Copy payload out into caller supplied buffer */ + bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length); + efx_mcdi_read_response(enp, emrp->emr_out_buf, hdr_len, bytes); + +#if EFSYS_OPT_MCDI_LOGGING + if (emtp->emt_logger != NULL) { + emtp->emt_logger(emtp->emt_context, + EFX_LOG_MCDI_RESPONSE, + &hdr, hdr_len, + emrp->emr_out_buf, bytes); + } +#endif /* EFSYS_OPT_MCDI_LOGGING */ +} + __checkReturn boolean_t efx_mcdi_request_poll( @@ -515,7 +547,7 @@ efx_mcdi_request_poll( if ((rc = emrp->emr_rc) != 0) goto fail2; - efx_mcdi_request_copyout(enp, emrp); + efx_mcdi_finish_response(enp, emrp); return (B_TRUE); fail2: @@ -709,7 +741,6 @@ efx_mcdi_ev_cpl( { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; efx_mcdi_req_t *emrp; int state; @@ -751,7 +782,7 @@ efx_mcdi_ev_cpl( } } if (errcode == 0) { - emcop->emco_request_copyout(enp, emrp); + efx_mcdi_finish_response(enp, emrp); } emtp->emt_ev_cpl(emtp->emt_context); Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Fri Jan 15 06:21:39 2016 (r294075) +++ head/sys/dev/sfxge/common/efx_mcdi.h Fri Jan 15 06:23:04 2016 (r294076) @@ -88,11 +88,6 @@ efx_mcdi_execute_quiet( __in efx_nic_t *enp, __inout efx_mcdi_req_t *emrp); - extern void -efx_mcdi_read_response_header( - __in efx_nic_t *enp, - __inout efx_mcdi_req_t *emrp); - extern void efx_mcdi_ev_cpl( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 06:21:39 2016 (r294075) +++ head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 06:23:04 2016 (r294076) @@ -305,11 +305,6 @@ ef10_mcdi_read_response( __in size_t offset, __in size_t length); -extern void -ef10_mcdi_request_copyout( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp); - extern efx_rc_t ef10_mcdi_poll_reboot( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Fri Jan 15 06:21:39 2016 (r294075) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Fri Jan 15 06:23:04 2016 (r294076) @@ -150,50 +150,6 @@ ef10_mcdi_send_request( EFX_BAR_WRITED(enp, ER_DZ_MC_DB_HWRD_REG, &dword, B_FALSE); } - void -ef10_mcdi_request_copyout( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp) -{ -#if EFSYS_OPT_MCDI_LOGGING - const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; -#endif /* EFSYS_OPT_MCDI_LOGGING */ - efx_dword_t hdr[2]; - unsigned int hdr_len; - size_t bytes; - - if (emrp->emr_out_buf == NULL) - return; - - /* Read the command header to detect MCDI response format */ - hdr_len = sizeof (hdr[0]); - ef10_mcdi_read_response(enp, &hdr[0], 0, hdr_len); - if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) { - /* - * Read the actual payload length. The length given in the event - * is only correct for responses with the V1 format. - */ - ef10_mcdi_read_response(enp, &hdr[1], hdr_len, sizeof (hdr[1])); - hdr_len += sizeof (hdr[1]); - - emrp->emr_out_length_used = EFX_DWORD_FIELD(hdr[1], - MC_CMD_V2_EXTN_IN_ACTUAL_LEN); - } - - /* Copy payload out into caller supplied buffer */ - bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length); - ef10_mcdi_read_response(enp, emrp->emr_out_buf, hdr_len, bytes); - -#if EFSYS_OPT_MCDI_LOGGING - if (emtp->emt_logger != NULL) { - emtp->emt_logger(emtp->emt_context, - EFX_LOG_MCDI_RESPONSE, - &hdr, hdr_len, - emrp->emr_out_buf, bytes); - } -#endif /* EFSYS_OPT_MCDI_LOGGING */ -} - __checkReturn boolean_t ef10_mcdi_poll_response( __in efx_nic_t *enp) Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Fri Jan 15 06:21:39 2016 (r294075) +++ head/sys/dev/sfxge/common/siena_impl.h Fri Jan 15 06:23:04 2016 (r294076) @@ -132,11 +132,6 @@ siena_mcdi_read_response( __in size_t offset, __in size_t length); -extern void -siena_mcdi_request_copyout( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp); - extern efx_rc_t siena_mcdi_poll_reboot( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Fri Jan 15 06:21:39 2016 (r294075) +++ head/sys/dev/sfxge/common/siena_mcdi.c Fri Jan 15 06:23:04 2016 (r294076) @@ -89,35 +89,6 @@ siena_mcdi_send_request( EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, dbr, &dword, B_FALSE); } - void -siena_mcdi_request_copyout( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp) -{ -#if EFSYS_OPT_MCDI_LOGGING - const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; - efx_dword_t hdr; -#endif - size_t bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length); - - /* Copy payload out if caller supplied buffer */ - if (emrp->emr_out_buf != NULL) { - siena_mcdi_read_response(enp, emrp->emr_out_buf, - sizeof (efx_dword_t), bytes); - } - -#if EFSYS_OPT_MCDI_LOGGING - if (emtp->emt_logger != NULL) { - siena_mcdi_read_response(enp, &hdr, 0, sizeof (hdr)); - - emtp->emt_logger(emtp->emt_context, - EFX_LOG_MCDI_RESPONSE, - &hdr, sizeof (hdr), - emrp->emr_out_buf, bytes); - } -#endif /* EFSYS_OPT_MCDI_LOGGING */ -} - efx_rc_t siena_mcdi_poll_reboot( __in efx_nic_t *enp) From owner-svn-src-head@freebsd.org Fri Jan 15 06:25:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0CC9A817E9; Fri, 15 Jan 2016 06:25:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F0CB1D97; Fri, 15 Jan 2016 06:25:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F6PRGg014216; Fri, 15 Jan 2016 06:25:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F6PRso014212; Fri, 15 Jan 2016 06:25:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601150625.u0F6PRso014212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 15 Jan 2016 06:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294077 - in head: share/man/man4 sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 06:25:28 -0000 Author: arybchik Date: Fri Jan 15 06:25:26 2016 New Revision: 294077 URL: https://svnweb.freebsd.org/changeset/base/294077 Log: sfxge: support FATSOv2 Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4934 Modified: head/share/man/man4/sfxge.4 head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/sfxge/sfxge_tx.h Modified: head/share/man/man4/sfxge.4 ============================================================================== --- head/share/man/man4/sfxge.4 Fri Jan 15 06:23:04 2016 (r294076) +++ head/share/man/man4/sfxge.4 Fri Jan 15 06:25:26 2016 (r294077) @@ -121,8 +121,10 @@ If a packet is dropped, the counter is incremented and the local sender receives ENOBUFS. The value must be greater than or equal to 0. .It Va hw.sfxge.tso_fw_assisted -Enable/disable usage of FW-assisted TSO if supported by NIC firmware. -Enabled by default. +Bitmask to enable/disable usage of FW-assisted TSO version if supported +by NIC firmware. +FATSOv1 (bit 0) and FATSOv2 (bit 1) are supported. +All enabled by default. .It Va hw.sfxge.N.max_rss_channels The maximum number of allocated RSS channels for the Nth adapter. If set to 0 or unset, the number of channels is determined by the number Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Fri Jan 15 06:23:04 2016 (r294076) +++ head/sys/dev/sfxge/sfxge.h Fri Jan 15 06:25:26 2016 (r294077) @@ -280,7 +280,10 @@ struct sfxge_softc { unsigned int rxq_count; unsigned int txq_count; - int tso_fw_assisted; + unsigned int tso_fw_assisted; +#define SFXGE_FATSOV1 (1 << 0) +#define SFXGE_FATSOV2 (1 << 1) + #if EFSYS_OPT_MCDI_LOGGING int mcdi_logging; #endif Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Fri Jan 15 06:23:04 2016 (r294076) +++ head/sys/dev/sfxge/sfxge_tx.c Fri Jan 15 06:25:26 2016 (r294077) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -96,11 +97,11 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_p "Maximum number of any packets in deferred packet put-list"); #define SFXGE_PARAM_TSO_FW_ASSISTED SFXGE_PARAM(tso_fw_assisted) -static int sfxge_tso_fw_assisted = 1; +static int sfxge_tso_fw_assisted = (SFXGE_FATSOV1 | SFXGE_FATSOV2); TUNABLE_INT(SFXGE_PARAM_TSO_FW_ASSISTED, &sfxge_tso_fw_assisted); SYSCTL_INT(_hw_sfxge, OID_AUTO, tso_fw_assisted, CTLFLAG_RDTUN, &sfxge_tso_fw_assisted, 0, - "Use FW-assisted TSO if supported by NIC firmware"); + "Bitmask of FW-assisted TSO allowed to use if supported by NIC firmware"); static const struct { @@ -850,6 +851,8 @@ struct sfxge_tso_state { unsigned out_len; /* Remaining length in current segment */ unsigned seqnum; /* Current sequence number */ unsigned packet_space; /* Remaining space in current packet */ + unsigned segs_space; /* Remaining number of DMA segments + for the packet (FATSOv2 only) */ /* Input position */ uint64_t dma_addr; /* DMA address of current position */ @@ -952,7 +955,7 @@ static void tso_start(struct sfxge_txq * struct tcphdr th_copy; #endif - tso->fw_assisted = txq->sc->tso_fw_assisted; + tso->fw_assisted = txq->tso_fw_assisted; tso->mbuf = mbuf; /* Find network protocol and header */ @@ -1059,6 +1062,8 @@ static void tso_fill_packet_with_fragmen { efx_desc_t *desc; int n; + uint64_t dma_addr = tso->dma_addr; + boolean_t eop; if (tso->in_len == 0 || tso->packet_space == 0) return; @@ -1066,20 +1071,38 @@ static void tso_fill_packet_with_fragmen KASSERT(tso->in_len > 0, ("TSO input length went negative")); KASSERT(tso->packet_space > 0, ("TSO packet space went negative")); - n = min(tso->in_len, tso->packet_space); + if (tso->fw_assisted & SFXGE_FATSOV2) { + n = tso->in_len; + tso->out_len -= n; + tso->seqnum += n; + tso->in_len = 0; + if (n < tso->packet_space) { + tso->packet_space -= n; + tso->segs_space--; + } else { + tso->packet_space = tso->seg_size - + (n - tso->packet_space) % tso->seg_size; + tso->segs_space = + EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX - 1 - + (tso->packet_space != tso->seg_size); + } + } else { + n = min(tso->in_len, tso->packet_space); + tso->packet_space -= n; + tso->out_len -= n; + tso->dma_addr += n; + tso->in_len -= n; + } - tso->packet_space -= n; - tso->out_len -= n; - tso->in_len -= n; + /* + * It is OK to use binary OR below to avoid extra branching + * since all conditions may always be checked. + */ + eop = (tso->out_len == 0) | (tso->packet_space == 0) | + (tso->segs_space == 0); desc = &txq->pend_desc[txq->n_pend_desc++]; - efx_tx_qdesc_dma_create(txq->common, - tso->dma_addr, - n, - tso->out_len == 0 || tso->packet_space == 0, - desc); - - tso->dma_addr += n; + efx_tx_qdesc_dma_create(txq->common, dma_addr, n, eop, desc); } /* Callback from bus_dmamap_load() for long TSO headers. */ @@ -1112,28 +1135,47 @@ static int tso_start_new_packet(struct s int rc; if (tso->fw_assisted) { - uint8_t tcp_flags = tso->tcp_flags; + if (tso->fw_assisted & SFXGE_FATSOV2) { + /* Add 2 FATSOv2 option descriptors */ + desc = &txq->pend_desc[txq->n_pend_desc]; + efx_tx_qdesc_tso2_create(txq->common, + tso->packet_id, + tso->seqnum, + tso->seg_size, + desc, + EFX_TX_FATSOV2_OPT_NDESCS); + desc += EFX_TX_FATSOV2_OPT_NDESCS; + txq->n_pend_desc += EFX_TX_FATSOV2_OPT_NDESCS; + KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0")); + id = (id + EFX_TX_FATSOV2_OPT_NDESCS) & txq->ptr_mask; - if (tso->out_len > tso->seg_size) - tcp_flags &= ~(TH_FIN | TH_PUSH); + tso->segs_space = + EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX - 1; + } else { + uint8_t tcp_flags = tso->tcp_flags; - /* TSO option descriptor */ - desc = &txq->pend_desc[txq->n_pend_desc++]; - efx_tx_qdesc_tso_create(txq->common, - tso->packet_id, - tso->seqnum, - tcp_flags, - desc++); - KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0")); - id = (id + 1) & txq->ptr_mask; + if (tso->out_len > tso->seg_size) + tcp_flags &= ~(TH_FIN | TH_PUSH); + + /* Add FATSOv1 option descriptor */ + desc = &txq->pend_desc[txq->n_pend_desc++]; + efx_tx_qdesc_tso_create(txq->common, + tso->packet_id, + tso->seqnum, + tcp_flags, + desc++); + KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0")); + id = (id + 1) & txq->ptr_mask; + + tso->seqnum += tso->seg_size; + tso->segs_space = UINT_MAX; + } /* Header DMA descriptor */ *desc = tso->header_desc; txq->n_pend_desc++; KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0")); id = (id + 1) & txq->ptr_mask; - - tso->seqnum += tso->seg_size; } else { /* Allocate a DMA-mapped header buffer. */ if (__predict_true(tso->header_len <= TSOH_STD_SIZE)) { @@ -1215,6 +1257,8 @@ static int tso_start_new_packet(struct s 0, desc); id = (id + 1) & txq->ptr_mask; + + tso->segs_space = UINT_MAX; } tso->packet_space = tso->seg_size; txq->tso_packets++; @@ -1264,15 +1308,19 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq } /* End of packet? */ - if (tso.packet_space == 0) { + if ((tso.packet_space == 0) | (tso.segs_space == 0)) { + unsigned int n_fatso_opt_desc = + (tso.fw_assisted & SFXGE_FATSOV2) ? + EFX_TX_FATSOV2_OPT_NDESCS : + (tso.fw_assisted & SFXGE_FATSOV1) ? 1 : 0; + /* If the queue is now full due to tiny MSS, * or we can't create another header, discard * the remainder of the input mbuf but do not * roll back the work we have done. */ - if (txq->n_pend_desc + tso.fw_assisted + - 1 /* header */ + n_dma_seg > - txq->max_pkt_desc) { + if (txq->n_pend_desc + n_fatso_opt_desc + + 1 /* header */ + n_dma_seg > txq->max_pkt_desc) { txq->tso_pdrop_too_many++; break; } @@ -1407,12 +1455,67 @@ sfxge_tx_qstop(struct sfxge_softc *sc, u SFXGE_TXQ_UNLOCK(txq); } +/* + * Estimate maximum number of Tx descriptors required for TSO packet. + * With minimum MSS and maximum mbuf length we might need more (even + * than a ring-ful of descriptors), but this should not happen in + * practice except due to deliberate attack. In that case we will + * truncate the output at a packet boundary. + */ +static unsigned int +sfxge_tx_max_pkt_desc(const struct sfxge_softc *sc, enum sfxge_txq_type type, + unsigned int tso_fw_assisted) +{ + /* One descriptor for every input fragment */ + unsigned int max_descs = SFXGE_TX_MAPPING_MAX_SEG; + unsigned int sw_tso_max_descs; + unsigned int fa_tso_v1_max_descs = 0; + unsigned int fa_tso_v2_max_descs = 0; + + /* VLAN tagging Tx option descriptor may be required */ + if (efx_nic_cfg_get(sc->enp)->enc_hw_tx_insert_vlan_enabled) + max_descs++; + + if (type == SFXGE_TXQ_IP_TCP_UDP_CKSUM) { + /* + * Plus header and payload descriptor for each output segment. + * Minus one since header fragment is already counted. + * Even if FATSO is used, we should be ready to fallback + * to do it in the driver. + */ + sw_tso_max_descs = SFXGE_TSO_MAX_SEGS * 2 - 1; + + /* FW assisted TSOv1 requires one more descriptor per segment + * in comparison to SW TSO */ + if (tso_fw_assisted & SFXGE_FATSOV1) + fa_tso_v1_max_descs = + sw_tso_max_descs + SFXGE_TSO_MAX_SEGS; + + /* FW assisted TSOv2 requires 3 (2 FATSO plus header) extra + * descriptors per superframe limited by number of DMA fetches + * per packet. The first packet header is already counted. + */ + if (tso_fw_assisted & SFXGE_FATSOV2) { + fa_tso_v2_max_descs = + howmany(SFXGE_TX_MAPPING_MAX_SEG, + EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX - 1) * + (EFX_TX_FATSOV2_OPT_NDESCS + 1) - 1; + } + + max_descs += MAX(sw_tso_max_descs, + MAX(fa_tso_v1_max_descs, fa_tso_v2_max_descs)); + } + + return (max_descs); +} + static int sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int index) { struct sfxge_txq *txq; efsys_mem_t *esmp; uint16_t flags; + unsigned int tso_fw_assisted; struct sfxge_evq *evq; unsigned int desc_index; int rc; @@ -1434,6 +1537,7 @@ sfxge_tx_qstart(struct sfxge_softc *sc, return (rc); /* Determine the kind of queue we are creating. */ + tso_fw_assisted = 0; switch (txq->type) { case SFXGE_TXQ_NON_CKSUM: flags = 0; @@ -1443,6 +1547,9 @@ sfxge_tx_qstart(struct sfxge_softc *sc, break; case SFXGE_TXQ_IP_TCP_UDP_CKSUM: flags = EFX_TXQ_CKSUM_IPV4 | EFX_TXQ_CKSUM_TCPUDP; + tso_fw_assisted = sc->tso_fw_assisted; + if (tso_fw_assisted & SFXGE_FATSOV2) + flags |= EFX_TXQ_FATSOV2; break; default: KASSERT(0, ("Impossible TX queue")); @@ -1453,8 +1560,19 @@ sfxge_tx_qstart(struct sfxge_softc *sc, /* Create the common code transmit queue. */ if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp, sc->txq_entries, txq->buf_base_id, flags, evq->common, - &txq->common, &desc_index)) != 0) - goto fail; + &txq->common, &desc_index)) != 0) { + /* Retry if no FATSOv2 resources, otherwise fail */ + if ((rc != ENOSPC) || (~flags & EFX_TXQ_FATSOV2)) + goto fail; + + /* Looks like all FATSOv2 contexts are used */ + flags &= ~EFX_TXQ_FATSOV2; + tso_fw_assisted &= ~SFXGE_FATSOV2; + if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp, + sc->txq_entries, txq->buf_base_id, flags, evq->common, + &txq->common, &desc_index)) != 0) + goto fail; + } /* Initialise queue descriptor indexes */ txq->added = txq->pending = txq->completed = txq->reaped = desc_index; @@ -1466,6 +1584,10 @@ sfxge_tx_qstart(struct sfxge_softc *sc, txq->init_state = SFXGE_TXQ_STARTED; txq->flush_state = SFXGE_FLUSH_REQUIRED; + txq->tso_fw_assisted = tso_fw_assisted; + + txq->max_pkt_desc = sfxge_tx_max_pkt_desc(sc, txq->type, + tso_fw_assisted); SFXGE_TXQ_UNLOCK(txq); @@ -1574,38 +1696,6 @@ sfxge_tx_qfini(struct sfxge_softc *sc, u free(txq, M_SFXGE); } -/* - * Estimate maximum number of Tx descriptors required for TSO packet. - * With minimum MSS and maximum mbuf length we might need more (even - * than a ring-ful of descriptors), but this should not happen in - * practice except due to deliberate attack. In that case we will - * truncate the output at a packet boundary. - */ -static unsigned int -sfxge_tx_max_pkt_desc(const struct sfxge_softc *sc, enum sfxge_txq_type type) -{ - /* One descriptor for every input fragment */ - unsigned int max_descs = SFXGE_TX_MAPPING_MAX_SEG; - - /* VLAN tagging Tx option descriptor may be required */ - if (efx_nic_cfg_get(sc->enp)->enc_hw_tx_insert_vlan_enabled) - max_descs++; - - if (type == SFXGE_TXQ_IP_TCP_UDP_CKSUM) { - /* - * Plus header and payload descriptor for each output segment. - * Minus one since header fragment is already counted. - */ - max_descs += SFXGE_TSO_MAX_SEGS * 2 - 1; - - /* FW assisted TSO requires one more descriptor per segment */ - if (sc->tso_fw_assisted) - max_descs += SFXGE_TSO_MAX_SEGS; - } - - return (max_descs); -} - static int sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index, enum sfxge_txq_type type, unsigned int evq_index) @@ -1735,8 +1825,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u txq->init_state = SFXGE_TXQ_INITIALIZED; txq->hw_vlan_tci = 0; - txq->max_pkt_desc = sfxge_tx_max_pkt_desc(sc, type); - return (0); fail_txq_stat_init: @@ -1846,10 +1934,12 @@ sfxge_tx_init(struct sfxge_softc *sc) sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc; sc->tso_fw_assisted = sfxge_tso_fw_assisted; - if (sc->tso_fw_assisted) - sc->tso_fw_assisted = - (encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO) && - (encp->enc_fw_assisted_tso_enabled); + if ((~encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO) || + (!encp->enc_fw_assisted_tso_enabled)) + sc->tso_fw_assisted &= ~SFXGE_FATSOV1; + if ((~encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO_V2) || + (!encp->enc_fw_assisted_tso_v2_enabled)) + sc->tso_fw_assisted &= ~SFXGE_FATSOV2; sc->txqs_node = SYSCTL_ADD_NODE( device_get_sysctl_ctx(sc->dev), Modified: head/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.h Fri Jan 15 06:23:04 2016 (r294076) +++ head/sys/dev/sfxge/sfxge_tx.h Fri Jan 15 06:25:26 2016 (r294077) @@ -170,6 +170,7 @@ struct sfxge_txq { struct sfxge_softc *sc; enum sfxge_txq_state init_state; enum sfxge_flush_state flush_state; + unsigned int tso_fw_assisted; enum sfxge_txq_type type; unsigned int txq_index; unsigned int evq_index; From owner-svn-src-head@freebsd.org Fri Jan 15 06:26:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03016A8189D; Fri, 15 Jan 2016 06:26:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0B171F22; Fri, 15 Jan 2016 06:26:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F6Qb1N014296; Fri, 15 Jan 2016 06:26:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F6QbSV014293; Fri, 15 Jan 2016 06:26:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601150626.u0F6QbSV014293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 15 Jan 2016 06:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294078 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 06:26:39 -0000 Author: arybchik Date: Fri Jan 15 06:26:37 2016 New Revision: 294078 URL: https://svnweb.freebsd.org/changeset/base/294078 Log: sfxge: medford stores a single global copy of VPD Not per PF copies as on Huntington. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4935 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/hunt_vpd.c head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Jan 15 06:25:26 2016 (r294077) +++ head/sys/dev/sfxge/common/efx.h Fri Jan 15 06:26:37 2016 (r294078) @@ -1162,6 +1162,8 @@ typedef struct efx_nic_cfg_s { /* External port identifier */ uint8_t enc_external_port; uint32_t enc_mcdi_max_payload_length; + /* VPD may be per-PF or global */ + boolean_t enc_vpd_is_global; } efx_nic_cfg_t; #define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff) Modified: head/sys/dev/sfxge/common/hunt_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_vpd.c Fri Jan 15 06:25:26 2016 (r294077) +++ head/sys/dev/sfxge/common/hunt_vpd.c Fri Jan 15 06:26:37 2016 (r294078) @@ -48,13 +48,20 @@ ef10_vpd_init( caddr_t svpd; size_t svpd_size; uint32_t pci_pf; + uint32_t tag; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - pci_pf = enp->en_nic_cfg.enc_pf; + if (enp->en_nic_cfg.enc_vpd_is_global) { + tag = TLV_TAG_GLOBAL_STATIC_VPD; + } else { + pci_pf = enp->en_nic_cfg.enc_pf; + tag = TLV_TAG_PF_STATIC_VPD(pci_pf); + } + /* * The VPD interface exposes VPD resources from the combined static and * dynamic VPD storage. As the static VPD configuration should *never* @@ -64,8 +71,7 @@ ef10_vpd_init( svpd_size = 0; rc = ef10_nvram_partn_read_tlv(enp, NVRAM_PARTITION_TYPE_STATIC_CONFIG, - TLV_TAG_PF_STATIC_VPD(pci_pf), - &svpd, &svpd_size); + tag, &svpd, &svpd_size); if (rc != 0) { if (rc == EACCES) { /* Unpriviledged functions cannot access VPD */ @@ -132,17 +138,22 @@ ef10_vpd_read( caddr_t dvpd; size_t dvpd_size; uint32_t pci_pf; + uint32_t tag; efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - pci_pf = enp->en_nic_cfg.enc_pf; + if (enp->en_nic_cfg.enc_vpd_is_global) { + tag = TLV_TAG_GLOBAL_DYNAMIC_VPD; + } else { + pci_pf = enp->en_nic_cfg.enc_pf; + tag = TLV_TAG_PF_DYNAMIC_VPD(pci_pf); + } if ((rc = ef10_nvram_partn_read_tlv(enp, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, - TLV_TAG_PF_DYNAMIC_VPD(pci_pf), - &dvpd, &dvpd_size)) != 0) + tag, &dvpd, &dvpd_size)) != 0) goto fail1; if (dvpd_size > size) { @@ -396,12 +407,18 @@ ef10_vpd_write( { size_t vpd_length; uint32_t pci_pf; + uint32_t tag; efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - pci_pf = enp->en_nic_cfg.enc_pf; + if (enp->en_nic_cfg.enc_vpd_is_global) { + tag = TLV_TAG_GLOBAL_DYNAMIC_VPD; + } else { + pci_pf = enp->en_nic_cfg.enc_pf; + tag = TLV_TAG_PF_DYNAMIC_VPD(pci_pf); + } /* Determine total length of new dynamic VPD */ if ((rc = efx_vpd_hunk_length(data, size, &vpd_length)) != 0) @@ -410,8 +427,7 @@ ef10_vpd_write( /* Store new dynamic VPD in all segments in DYNAMIC_CONFIG partition */ if ((rc = ef10_nvram_partn_write_segment_tlv(enp, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, - TLV_TAG_PF_DYNAMIC_VPD(pci_pf), - data, vpd_length, B_TRUE)) != 0) { + tag, data, vpd_length, B_TRUE)) != 0) { goto fail2; } Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Fri Jan 15 06:25:26 2016 (r294077) +++ head/sys/dev/sfxge/common/medford_nic.c Fri Jan 15 06:26:37 2016 (r294078) @@ -212,6 +212,12 @@ medford_board_cfg( */ encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; + /* + * Medford stores a single global copy of VPD, not per-PF as on + * Huntington. + */ + encp->enc_vpd_is_global = B_TRUE; + return (0); fail11: From owner-svn-src-head@freebsd.org Fri Jan 15 06:27:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14AFFA81916; Fri, 15 Jan 2016 06:27:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id D35A910D8; Fri, 15 Jan 2016 06:27:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 6EF96781E91; Fri, 15 Jan 2016 17:27:36 +1100 (AEDT) Date: Fri, 15 Jan 2016 17:27:35 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Slawa Olhovchenkov cc: Bruce Evans , Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r294011 - head/share/man/man4 In-Reply-To: <20160114202526.GA37895@zxy.spb.ru> Message-ID: <20160115164328.T1507@besplex.bde.org> References: <201601141623.u0EGN7me063431@repo.freebsd.org> <20160115044315.T9902@besplex.bde.org> <20160114202526.GA37895@zxy.spb.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R4L+YolX c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=WegLRiAvH-7D9ifhZisA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 06:27:40 -0000 On Thu, 14 Jan 2016, Slawa Olhovchenkov wrote: > On Fri, Jan 15, 2016 at 06:27:05AM +1100, Bruce Evans wrote: >> The BREAK_TO_DEBUGGER option used to mean: enter (not break into) the >> debugger using a serial line break. This is a good method, except it >> ... >> >> This option was broken to mean: the default for the sysctl that controls >> "breaking into" the debugger using either a serial line break or the console >> key for "breaking into" the debugger. For almost perfection confusion, >> this key is normally the "Ctrl-Print Screen" key on PC keyboards and >> there is a "Break" key nearby. Ctrl-Alt-Esc also works. syscons(4) > > On may keyboard "Break" subscribe to "Pause", to "Print Screen" > subscribe "SysReq". This is similar but not quite the same on all 6 of my (US) keyboards (except it is the same on 2 identical models). SysReq seems to be going away and is only on my 2 20+ year old keyboards. PrintScreen is is even more useless/unsupported for its original operation. But my worst (and most expensive) keyboard axed ScrollLock before PrintScreen. I use ScrollLock a lot under FreeBSD but never noticed it doing anything elsewhere. Bruce From owner-svn-src-head@freebsd.org Fri Jan 15 06:27:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33EEAA819A4; Fri, 15 Jan 2016 06:27:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 101E1127F; Fri, 15 Jan 2016 06:27:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F6Rqkd014378; Fri, 15 Jan 2016 06:27:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F6RpUg014373; Fri, 15 Jan 2016 06:27:51 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601150627.u0F6RpUg014373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 15 Jan 2016 06:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294079 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 06:27:53 -0000 Author: arybchik Date: Fri Jan 15 06:27:51 2016 New Revision: 294079 URL: https://svnweb.freebsd.org/changeset/base/294079 Log: sfxge: Medford still needs fallback for no privilege mask Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4936 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Jan 15 06:26:37 2016 (r294078) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Jan 15 06:27:51 2016 (r294079) @@ -81,6 +81,11 @@ extern __checkReturn efx_rc_t ef10_get_datapath_caps( __in efx_nic_t *enp); +extern __checkReturn efx_rc_t +ef10_get_privilege_mask( + __in efx_nic_t *enp, + __out uint32_t *maskp); + extern __checkReturn efx_rc_t ef10_external_port_mapping( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 06:26:37 2016 (r294078) +++ head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 06:27:51 2016 (r294079) @@ -742,7 +742,7 @@ ef10_tx_qstats_update( #define HUNT_MIN_PIO_ALLOC_SIZE (HUNT_PIOBUF_SIZE / 32) -#define HUNT_LEGACY_PF_PRIVILEGE_MASK \ +#define EF10_LEGACY_PF_PRIVILEGE_MASK \ (MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN | \ MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK | \ MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD | \ @@ -755,7 +755,7 @@ ef10_tx_qstats_update( MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST | \ MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS) -#define HUNT_LEGACY_VF_PRIVILEGE_MASK 0 +#define EF10_LEGACY_VF_PRIVILEGE_MASK 0 typedef uint32_t efx_piobuf_handle_t; Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Fri Jan 15 06:26:37 2016 (r294078) +++ head/sys/dev/sfxge/common/hunt_nic.c Fri Jan 15 06:27:51 2016 (r294079) @@ -980,6 +980,42 @@ fail1: return (rc); } + + __checkReturn efx_rc_t +ef10_get_privilege_mask( + __in efx_nic_t *enp, + __out uint32_t *maskp) +{ + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + uint32_t mask; + efx_rc_t rc; + + if ((rc = efx_mcdi_privilege_mask(enp, encp->enc_pf, encp->enc_vf, + &mask)) != 0) { + if (rc != ENOTSUP) + goto fail1; + + /* Fallback for old firmware without privilege mask support */ + if (EFX_PCI_FUNCTION_IS_PF(encp)) { + /* Assume PF has admin privilege */ + mask = EF10_LEGACY_PF_PRIVILEGE_MASK; + } else { + /* VF is always unprivileged by default */ + mask = EF10_LEGACY_VF_PRIVILEGE_MASK; + } + } + + *maskp = mask; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + /* * The external port mapping is a one-based numbering of the external * connectors on the board. It does not distinguish off-board separated @@ -1312,20 +1348,8 @@ hunt_board_cfg( * the privilege mask to check for sufficient privileges, as that * can result in time-of-check/time-of-use bugs. */ - if ((rc = efx_mcdi_privilege_mask(enp, pf, vf, &mask)) != 0) { - if (rc != ENOTSUP) - goto fail13; - - /* Fallback for old firmware without privilege mask support */ - if (EFX_PCI_FUNCTION_IS_PF(encp)) { - /* Assume PF has admin privilege */ - mask = HUNT_LEGACY_PF_PRIVILEGE_MASK; - } else { - /* VF is always unprivileged by default */ - mask = HUNT_LEGACY_VF_PRIVILEGE_MASK; - } - } - + if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) + goto fail13; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Fri Jan 15 06:26:37 2016 (r294078) +++ head/sys/dev/sfxge/common/medford_nic.c Fri Jan 15 06:27:51 2016 (r294079) @@ -189,9 +189,8 @@ medford_board_cfg( * the privilege mask to check for sufficient privileges, as that * can result in time-of-check/time-of-use bugs. */ - if ((rc = efx_mcdi_privilege_mask(enp, pf, vf, &mask)) != 0) + if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) goto fail10; - encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ From owner-svn-src-head@freebsd.org Fri Jan 15 06:29:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70DC8A81AD5; Fri, 15 Jan 2016 06:29:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31D41144A; Fri, 15 Jan 2016 06:29:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F6Sx0k014462; Fri, 15 Jan 2016 06:28:59 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F6SwQ7014456; Fri, 15 Jan 2016 06:28:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601150628.u0F6SwQ7014456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 15 Jan 2016 06:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294080 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 06:29:00 -0000 Author: arybchik Date: Fri Jan 15 06:28:58 2016 New Revision: 294080 URL: https://svnweb.freebsd.org/changeset/base/294080 Log: sfxge: convert nvram rw_start method to use partition id Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4937 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nvram.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_nvram.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Jan 15 06:27:51 2016 (r294079) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Jan 15 06:28:58 2016 (r294080) @@ -485,7 +485,6 @@ typedef struct efx_nvram_ops_s { #endif /* EFSYS_OPT_DIAG */ efx_rc_t (*envo_get_version)(efx_nic_t *, efx_nvram_type_t, uint32_t *, uint16_t *); - efx_rc_t (*envo_rw_start)(efx_nic_t *, efx_nvram_type_t, size_t *); efx_rc_t (*envo_read_chunk)(efx_nic_t *, efx_nvram_type_t, unsigned int, caddr_t, size_t); efx_rc_t (*envo_erase)(efx_nic_t *, efx_nvram_type_t); @@ -498,6 +497,7 @@ typedef struct efx_nvram_ops_s { efx_rc_t (*envo_type_to_partn)(efx_nic_t *, efx_nvram_type_t, uint32_t *); efx_rc_t (*envo_partn_size)(efx_nic_t *, uint32_t, size_t *); + efx_rc_t (*envo_partn_rw_start)(efx_nic_t *, uint32_t, size_t *); } efx_nvram_ops_t; #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Jan 15 06:27:51 2016 (r294079) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Jan 15 06:28:58 2016 (r294080) @@ -43,7 +43,6 @@ static efx_nvram_ops_t __efx_nvram_falco falcon_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ falcon_nvram_get_version, /* envo_get_version */ - falcon_nvram_rw_start, /* envo_rw_start */ falcon_nvram_read_chunk, /* envo_read_chunk */ falcon_nvram_erase, /* envo_erase */ falcon_nvram_write_chunk, /* envo_write_chunk */ @@ -51,6 +50,7 @@ static efx_nvram_ops_t __efx_nvram_falco falcon_nvram_set_version, /* envo_set_version */ falcon_nvram_type_to_partn, /* envo_type_to_partn */ falcon_nvram_partn_size, /* envo_partn_size */ + falcon_nvram_partn_rw_start, /* envo_partn_rw_start */ }; #endif /* EFSYS_OPT_FALCON */ @@ -62,7 +62,6 @@ static efx_nvram_ops_t __efx_nvram_siena siena_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ siena_nvram_get_version, /* envo_get_version */ - siena_nvram_rw_start, /* envo_rw_start */ siena_nvram_read_chunk, /* envo_read_chunk */ siena_nvram_erase, /* envo_erase */ siena_nvram_write_chunk, /* envo_write_chunk */ @@ -70,6 +69,7 @@ static efx_nvram_ops_t __efx_nvram_siena siena_nvram_set_version, /* envo_set_version */ siena_nvram_type_to_partn, /* envo_type_to_partn */ siena_nvram_partn_size, /* envo_partn_size */ + siena_nvram_partn_rw_start, /* envo_partn_rw_start */ }; #endif /* EFSYS_OPT_SIENA */ @@ -81,7 +81,6 @@ static efx_nvram_ops_t __efx_nvram_ef10_ ef10_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ ef10_nvram_get_version, /* envo_get_version */ - ef10_nvram_rw_start, /* envo_rw_start */ ef10_nvram_read_chunk, /* envo_read_chunk */ ef10_nvram_erase, /* envo_erase */ ef10_nvram_write_chunk, /* envo_write_chunk */ @@ -89,6 +88,7 @@ static efx_nvram_ops_t __efx_nvram_ef10_ ef10_nvram_set_version, /* envo_set_version */ ef10_nvram_type_to_partn, /* envo_type_to_partn */ ef10_nvram_partn_size, /* envo_partn_size */ + ef10_nvram_partn_rw_start, /* envo_partn_rw_start */ }; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ @@ -237,6 +237,7 @@ efx_nvram_rw_start( __out_opt size_t *chunk_sizep) { efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -247,13 +248,18 @@ efx_nvram_rw_start( EFSYS_ASSERT3U(enp->en_nvram_locked, ==, EFX_NVRAM_INVALID); - if ((rc = envop->envo_rw_start(enp, type, chunk_sizep)) != 0) + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + if ((rc = envop->envo_partn_rw_start(enp, partn, chunk_sizep)) != 0) + goto fail2; + enp->en_nvram_locked = type; return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 06:27:51 2016 (r294079) +++ head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 06:28:58 2016 (r294080) @@ -417,12 +417,6 @@ ef10_nvram_get_version( __out_ecount(4) uint16_t version[4]); extern __checkReturn efx_rc_t -ef10_nvram_rw_start( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out size_t *pref_chunkp); - -extern __checkReturn efx_rc_t ef10_nvram_read_chunk( __in efx_nic_t *enp, __in efx_nvram_type_t type, @@ -472,6 +466,12 @@ ef10_nvram_partn_size( __in uint32_t partn, __out size_t *sizep); +extern __checkReturn efx_rc_t +ef10_nvram_partn_rw_start( + __in efx_nic_t *enp, + __in uint32_t partn, + __out size_t *chunk_sizep); + #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Fri Jan 15 06:27:51 2016 (r294079) +++ head/sys/dev/sfxge/common/hunt_nvram.c Fri Jan 15 06:28:58 2016 (r294080) @@ -1747,27 +1747,21 @@ fail1: } __checkReturn efx_rc_t -ef10_nvram_rw_start( +ef10_nvram_partn_rw_start( __in efx_nic_t *enp, - __in efx_nvram_type_t type, + __in uint32_t partn, __out size_t *chunk_sizep) { - uint32_t partn; efx_rc_t rc; - if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0) - goto fail2; + goto fail1; if (chunk_sizep != NULL) *chunk_sizep = EF10_NVRAM_CHUNK; return (0); -fail2: - EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Fri Jan 15 06:27:51 2016 (r294079) +++ head/sys/dev/sfxge/common/siena_impl.h Fri Jan 15 06:28:58 2016 (r294080) @@ -217,12 +217,6 @@ siena_nvram_get_version( __out_ecount(4) uint16_t version[4]); extern __checkReturn efx_rc_t -siena_nvram_rw_start( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out size_t *pref_chunkp); - -extern __checkReturn efx_rc_t siena_nvram_read_chunk( __in efx_nic_t *enp, __in efx_nvram_type_t type, @@ -266,6 +260,12 @@ siena_nvram_partn_size( __in uint32_t partn, __out size_t *sizep); +extern __checkReturn efx_rc_t +siena_nvram_partn_rw_start( + __in efx_nic_t *enp, + __in uint32_t partn, + __out size_t *chunk_sizep); + #endif /* EFSYS_OPT_NVRAM */ #if EFSYS_OPT_VPD Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Fri Jan 15 06:27:51 2016 (r294079) +++ head/sys/dev/sfxge/common/siena_nvram.c Fri Jan 15 06:28:58 2016 (r294080) @@ -572,27 +572,21 @@ fail1: } __checkReturn efx_rc_t -siena_nvram_rw_start( +siena_nvram_partn_rw_start( __in efx_nic_t *enp, - __in efx_nvram_type_t type, + __in uint32_t partn, __out size_t *chunk_sizep) { - uint32_t partn; efx_rc_t rc; - if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - if ((rc = siena_nvram_partn_lock(enp, partn)) != 0) - goto fail2; + goto fail1; if (chunk_sizep != NULL) *chunk_sizep = SIENA_NVRAM_CHUNK; return (0); -fail2: - EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-head@freebsd.org Fri Jan 15 06:30:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67BEAA81C0C; Fri, 15 Jan 2016 06:30:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2704B1724; Fri, 15 Jan 2016 06:30:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F6UlAd016508; Fri, 15 Jan 2016 06:30:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F6Ulft016507; Fri, 15 Jan 2016 06:30:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601150630.u0F6Ulft016507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 15 Jan 2016 06:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294081 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 06:30:48 -0000 Author: arybchik Date: Fri Jan 15 06:30:46 2016 New Revision: 294081 URL: https://svnweb.freebsd.org/changeset/base/294081 Log: sfxge: cleanup: simplify ef10_get_datapath_caps Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4938 Modified: head/sys/dev/sfxge/common/hunt_nic.c Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Fri Jan 15 06:28:58 2016 (r294080) +++ head/sys/dev/sfxge/common/hunt_nic.c Fri Jan 15 06:30:46 2016 (r294081) @@ -430,8 +430,8 @@ fail1: static __checkReturn efx_rc_t efx_mcdi_get_capabilities( __in efx_nic_t *enp, - __out efx_dword_t *flagsp, - __out efx_dword_t *flags2p) + __out uint32_t *flagsp, + __out uint32_t *flags2p) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, @@ -457,13 +457,12 @@ efx_mcdi_get_capabilities( goto fail2; } - *flagsp = *MCDI_OUT2(req, efx_dword_t, GET_CAPABILITIES_OUT_FLAGS1); + *flagsp = MCDI_OUT_DWORD(req, GET_CAPABILITIES_OUT_FLAGS1); if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) - EFX_ZERO_DWORD(*flags2p); + *flags2p = 0; else - *flags2p = *MCDI_OUT2(req, efx_dword_t, - GET_CAPABILITIES_V2_OUT_FLAGS2); + *flags2p = MCDI_OUT_DWORD(req, GET_CAPABILITIES_V2_OUT_FLAGS2); return (0); @@ -897,78 +896,63 @@ ef10_get_datapath_caps( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - efx_dword_t datapath_capabilities; - efx_dword_t datapath_capabilities_v2; + uint32_t flags; + uint32_t flags2; efx_rc_t rc; - if ((rc = efx_mcdi_get_capabilities(enp, &datapath_capabilities, - &datapath_capabilities_v2)) != 0) + if ((rc = efx_mcdi_get_capabilities(enp, &flags, &flags2)) != 0) goto fail1; +#define CAP_FLAG(flags1, field) \ + ((flags1) & (1 << (MC_CMD_GET_CAPABILITIES_V2_OUT_ ## field ## _LBN))) + +#define CAP_FLAG2(flags2, field) \ + ((flags2) & (1 << (MC_CMD_GET_CAPABILITIES_V2_OUT_ ## field ## _LBN))) + /* * Huntington RXDP firmware inserts a 0 or 14 byte prefix. * We only support the 14 byte prefix here. */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14) != 1) { + if (CAP_FLAG(flags, RX_PREFIX_LEN_14) == 0) { rc = ENOTSUP; goto fail2; } encp->enc_rx_prefix_size = 14; /* Check if the firmware supports TSO */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_TX_TSO) == 1) - encp->enc_fw_assisted_tso_enabled = B_TRUE; - else - encp->enc_fw_assisted_tso_enabled = B_FALSE; + encp->enc_fw_assisted_tso_enabled = + CAP_FLAG(flags, TX_TSO) ? B_TRUE : B_FALSE; /* Check if the firmware supports FATSOv2 */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities_v2, - GET_CAPABILITIES_V2_OUT_TX_TSO_V2) == 1) - encp->enc_fw_assisted_tso_v2_enabled = B_TRUE; - else - encp->enc_fw_assisted_tso_v2_enabled = B_FALSE; + encp->enc_fw_assisted_tso_v2_enabled = + CAP_FLAG2(flags2, TX_TSO_V2) ? B_TRUE : B_FALSE; /* Check if the firmware has vadapter/vport/vswitch support */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_EVB) == 1) - encp->enc_datapath_cap_evb = B_TRUE; - else - encp->enc_datapath_cap_evb = B_FALSE; + encp->enc_datapath_cap_evb = + CAP_FLAG(flags, EVB) ? B_TRUE : B_FALSE; /* Check if the firmware supports VLAN insertion */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_TX_VLAN_INSERTION) == 1) - encp->enc_hw_tx_insert_vlan_enabled = B_TRUE; - else - encp->enc_hw_tx_insert_vlan_enabled = B_FALSE; + encp->enc_hw_tx_insert_vlan_enabled = + CAP_FLAG(flags, TX_VLAN_INSERTION) ? B_TRUE : B_FALSE; /* Check if the firmware supports RX event batching */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_RX_BATCHING) == 1) { - encp->enc_rx_batching_enabled = B_TRUE; + encp->enc_rx_batching_enabled = + CAP_FLAG(flags, RX_BATCHING) ? B_TRUE : B_FALSE; + + if (encp->enc_rx_batching_enabled) encp->enc_rx_batch_max = 16; - } else { - encp->enc_rx_batching_enabled = B_FALSE; - } /* Check if the firmware supports disabling scatter on RXQs */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_RX_DISABLE_SCATTER) == 1) { - encp->enc_rx_disable_scatter_supported = B_TRUE; - } else { - encp->enc_rx_disable_scatter_supported = B_FALSE; - } + encp->enc_rx_disable_scatter_supported = + CAP_FLAG(flags, RX_DISABLE_SCATTER) ? B_TRUE : B_FALSE; /* Check if the firmware supports set mac with running filters */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED) - == 1) { - encp->enc_allow_set_mac_with_installed_filters = B_TRUE; - } else { - encp->enc_allow_set_mac_with_installed_filters = B_FALSE; - } + encp->enc_allow_set_mac_with_installed_filters = + CAP_FLAG(flags, VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED) ? + B_TRUE : B_FALSE; + +#undef CAP_FLAG +#undef CAP_FLAG2 return (0); From owner-svn-src-head@freebsd.org Fri Jan 15 09:05:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23677A83A89; Fri, 15 Jan 2016 09:05:16 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8BF51594; Fri, 15 Jan 2016 09:05:15 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F95E9O061260; Fri, 15 Jan 2016 09:05:14 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F95Em4061256; Fri, 15 Jan 2016 09:05:14 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601150905.u0F95Em4061256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 15 Jan 2016 09:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294084 - in head/sys/fs: nfs nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 09:05:16 -0000 Author: melifaro Date: Fri Jan 15 09:05:14 2016 New Revision: 294084 URL: https://svnweb.freebsd.org/changeset/base/294084 Log: Make nfscl_getmyip() use new routing KPI. * Use standard IPv6 SAS instead of rt->rt_ifa address. * Make address lookup work for IPv6 LLA. * Save address into buffer provided by caller instead of using static vars. Discussed with: rmacklem Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Fri Jan 15 09:01:53 2016 (r294083) +++ head/sys/fs/nfs/nfs_var.h Fri Jan 15 09:05:14 2016 (r294084) @@ -306,7 +306,7 @@ void nfscl_reqstart(struct nfsrv_descrip nfsuint64 *nfscl_getcookie(struct nfsnode *, off_t off, int); void nfscl_fillsattr(struct nfsrv_descript *, struct vattr *, vnode_t, int, u_int32_t); -u_int8_t *nfscl_getmyip(struct nfsmount *, int *); +u_int8_t *nfscl_getmyip(struct nfsmount *, struct in6_addr *, int *); int nfsm_getfh(struct nfsrv_descript *, struct nfsfh **); int nfscl_mtofh(struct nfsrv_descript *, struct nfsfh **, struct nfsvattr *, int *); Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Fri Jan 15 09:01:53 2016 (r294083) +++ head/sys/fs/nfsclient/nfs_clport.c Fri Jan 15 09:05:14 2016 (r294084) @@ -34,6 +34,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" #include "opt_inet6.h" #include @@ -46,7 +47,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -1038,73 +1041,66 @@ nfscl_loadfsinfo(struct nfsmount *nmp, s } /* - * Get a pointer to my IP addrress and return it. - * Return NULL if you can't find one. + * Lookups source address which should be used to communicate with + * @nmp and stores it inside @pdst. + * + * Returns 0 on success. */ u_int8_t * -nfscl_getmyip(struct nfsmount *nmp, int *isinet6p) +nfscl_getmyip(struct nfsmount *nmp, struct in6_addr *paddr, int *isinet6p) { - struct sockaddr_in sad, *sin; - struct rtentry *rt; - u_int8_t *retp = NULL; - static struct in_addr laddr; + int error, fibnum; - *isinet6p = 0; - /* - * Loop up a route for the destination address. - */ + fibnum = curthread->td_proc->p_fibnum; + +#ifdef INET if (nmp->nm_nam->sa_family == AF_INET) { - bzero(&sad, sizeof (sad)); + struct sockaddr_in *sin; + struct nhop4_extended nh_ext; + sin = (struct sockaddr_in *)nmp->nm_nam; - sad.sin_family = AF_INET; - sad.sin_len = sizeof (struct sockaddr_in); - sad.sin_addr.s_addr = sin->sin_addr.s_addr; CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred)); - rt = rtalloc1_fib((struct sockaddr *)&sad, 0, 0UL, - curthread->td_proc->p_fibnum); - if (rt != NULL) { - if (rt->rt_ifp != NULL && - rt->rt_ifa != NULL && - ((rt->rt_ifp->if_flags & IFF_LOOPBACK) == 0) && - rt->rt_ifa->ifa_addr->sa_family == AF_INET) { - sin = (struct sockaddr_in *) - rt->rt_ifa->ifa_addr; - laddr.s_addr = sin->sin_addr.s_addr; - retp = (u_int8_t *)&laddr; - } - RTFREE_LOCKED(rt); - } + error = fib4_lookup_nh_ext(fibnum, sin->sin_addr, 0, 0, + &nh_ext); CURVNET_RESTORE(); + if (error != 0) + return (NULL); + + if ((ntohl(nh_ext.nh_src.s_addr) >> IN_CLASSA_NSHIFT) == + IN_LOOPBACKNET) { + /* Ignore loopback addresses */ + return (NULL); + } + + *isinet6p = 0; + *((struct in_addr *)paddr) = nh_ext.nh_src; + + return (u_int8_t *)paddr; + } +#endif #ifdef INET6 - } else if (nmp->nm_nam->sa_family == AF_INET6) { - struct sockaddr_in6 sad6, *sin6; - static struct in6_addr laddr6; + if (nmp->nm_nam->sa_family == AF_INET6) { + struct sockaddr_in6 *sin6; - bzero(&sad6, sizeof (sad6)); sin6 = (struct sockaddr_in6 *)nmp->nm_nam; - sad6.sin6_family = AF_INET6; - sad6.sin6_len = sizeof (struct sockaddr_in6); - sad6.sin6_addr = sin6->sin6_addr; + CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred)); - rt = rtalloc1_fib((struct sockaddr *)&sad6, 0, 0UL, - curthread->td_proc->p_fibnum); - if (rt != NULL) { - if (rt->rt_ifp != NULL && - rt->rt_ifa != NULL && - ((rt->rt_ifp->if_flags & IFF_LOOPBACK) == 0) && - rt->rt_ifa->ifa_addr->sa_family == AF_INET6) { - sin6 = (struct sockaddr_in6 *) - rt->rt_ifa->ifa_addr; - laddr6 = sin6->sin6_addr; - retp = (u_int8_t *)&laddr6; - *isinet6p = 1; - } - RTFREE_LOCKED(rt); - } + error = in6_selectsrc_addr(fibnum, &sin6->sin6_addr, + sin6->sin6_scope_id, NULL, paddr, NULL); CURVNET_RESTORE(); -#endif + if (error != 0) + return (NULL); + + if (IN6_IS_ADDR_LOOPBACK(paddr)) + return (NULL); + + /* Scope is embedded in */ + *isinet6p = 1; + + return (u_int8_t *)paddr; } - return (retp); +#endif + return (NULL); } /* Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Fri Jan 15 09:01:53 2016 (r294083) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Fri Jan 15 09:05:14 2016 (r294084) @@ -829,6 +829,7 @@ nfsrpc_setclient(struct nfsmount *nmp, s u_int32_t lease; static u_int32_t rev = 0; struct nfsclds *dsp, *ndsp, *tdsp; + struct in6_addr a6; if (nfsboottime.tv_sec == 0) NFSSETBOOTTIME(nfsboottime); @@ -889,7 +890,7 @@ nfsrpc_setclient(struct nfsmount *nmp, s *tl = txdr_unsigned(NFS_CALLBCKPROG); callblen = strlen(nfsv4_callbackaddr); if (callblen == 0) - cp = nfscl_getmyip(nmp, &isinet6); + cp = nfscl_getmyip(nmp, &a6, &isinet6); if (nfscl_enablecallb && nfs_numnfscbd > 0 && (callblen > 0 || cp != NULL)) { port = htons(nfsv4_cbport); From owner-svn-src-head@freebsd.org Fri Jan 15 11:19:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CF12A82699; Fri, 15 Jan 2016 11:19:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED444182D; Fri, 15 Jan 2016 11:18:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FBIxDX000268; Fri, 15 Jan 2016 11:18:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FBIw98000265; Fri, 15 Jan 2016 11:18:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601151118.u0FBIw98000265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 15 Jan 2016 11:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294086 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 11:19:00 -0000 Author: hselasky Date: Fri Jan 15 11:18:58 2016 New Revision: 294086 URL: https://svnweb.freebsd.org/changeset/base/294086 Log: Implement support for PCI suspend, resume and shutdown events in the LinuxKPI. Fix a few spaces to tabs. Bump the FreeBSD version to force recompilation of existing KMODs. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/src/linux_pci.c head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Jan 15 09:23:12 2016 (r294085) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Jan 15 11:18:58 2016 (r294086) @@ -129,8 +129,9 @@ struct pci_driver { const struct pci_device_id *id_table; int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); void (*remove)(struct pci_dev *dev); - int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ - int (*resume) (struct pci_dev *dev); /* Device woken up */ + int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ + int (*resume) (struct pci_dev *dev); /* Device woken up */ + void (*shutdown) (struct pci_dev *dev); /* Device shutdown */ driver_t driver; devclass_t bsdclass; const struct pci_error_handlers *err_handler; Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Jan 15 09:23:12 2016 (r294085) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Jan 15 11:18:58 2016 (r294086) @@ -61,11 +61,17 @@ __FBSDID("$FreeBSD$"); static device_probe_t linux_pci_probe; static device_attach_t linux_pci_attach; static device_detach_t linux_pci_detach; +static device_suspend_t linux_pci_suspend; +static device_resume_t linux_pci_resume; +static device_shutdown_t linux_pci_shutdown; static device_method_t pci_methods[] = { DEVMETHOD(device_probe, linux_pci_probe), DEVMETHOD(device_attach, linux_pci_attach), DEVMETHOD(device_detach, linux_pci_detach), + DEVMETHOD(device_suspend, linux_pci_suspend), + DEVMETHOD(device_resume, linux_pci_resume), + DEVMETHOD(device_shutdown, linux_pci_shutdown), DEVMETHOD_END }; @@ -169,6 +175,46 @@ linux_pci_detach(device_t dev) return (0); } +static int +linux_pci_suspend(device_t dev) +{ + struct pm_message pm = { }; + struct pci_dev *pdev; + int err; + + pdev = device_get_softc(dev); + if (pdev->pdrv->suspend != NULL) + err = -pdev->pdrv->suspend(pdev, pm); + else + err = 0; + return (err); +} + +static int +linux_pci_resume(device_t dev) +{ + struct pci_dev *pdev; + int err; + + pdev = device_get_softc(dev); + if (pdev->pdrv->resume != NULL) + err = -pdev->pdrv->resume(pdev); + else + err = 0; + return (err); +} + +static int +linux_pci_shutdown(device_t dev) +{ + struct pci_dev *pdev; + + pdev = device_get_softc(dev); + if (pdev->pdrv->shutdown != NULL) + pdev->pdrv->shutdown(pdev); + return (0); +} + int pci_register_driver(struct pci_driver *pdrv) { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Jan 15 09:23:12 2016 (r294085) +++ head/sys/sys/param.h Fri Jan 15 11:18:58 2016 (r294086) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100093 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100094 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Fri Jan 15 11:40:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0250A82F5F; Fri, 15 Jan 2016 11:40:42 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B152D130A; Fri, 15 Jan 2016 11:40:42 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FBefOl006256; Fri, 15 Jan 2016 11:40:41 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FBef8c006253; Fri, 15 Jan 2016 11:40:41 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601151140.u0FBef8c006253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 15 Jan 2016 11:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294087 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 11:40:43 -0000 Author: andrew Date: Fri Jan 15 11:40:41 2016 New Revision: 294087 URL: https://svnweb.freebsd.org/changeset/base/294087 Log: Remove the commented out sc device from the i.MX kernels, they both use vt(4). Modified: head/sys/arm/conf/IMX53 head/sys/arm/conf/IMX6 Modified: head/sys/arm/conf/IMX53 ============================================================================== --- head/sys/arm/conf/IMX53 Fri Jan 15 11:18:58 2016 (r294086) +++ head/sys/arm/conf/IMX53 Fri Jan 15 11:40:41 2016 (r294087) @@ -136,11 +136,3 @@ device wlan_amrr # AMRR transmit rate # Flattened Device Tree options FDT # Configure using FDT/DTB data - -# NOTE: serial console will be disabled if syscons enabled -# Uncomment following lines for framebuffer/syscons support -#device sc -#device vt -#device kbdmux -#options SC_DFLT_FONT # compile font in -#makeoptions SC_DFLT_FONT=cp437 Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Fri Jan 15 11:18:58 2016 (r294086) +++ head/sys/arm/conf/IMX6 Fri Jan 15 11:40:41 2016 (r294087) @@ -125,14 +125,6 @@ device u3g # USB modems #device wlan_tkip # 802.11 TKIP support #device wlan_amrr # AMRR transmit rate control algorithm -# NOTE: serial console will be disabled if syscons enabled -# Uncomment following lines for framebuffer/syscons support -# Wandboard has no video console support yet. -#device sc -#device kbdmux -#options SC_DFLT_FONT # compile font in -#makeoptions SC_DFLT_FONT=cp437 - device vt device kbdmux device ukbd From owner-svn-src-head@freebsd.org Fri Jan 15 12:09:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38343A842FC; Fri, 15 Jan 2016 12:09:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04246194E; Fri, 15 Jan 2016 12:09:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FC9Fxx014862; Fri, 15 Jan 2016 12:09:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FC9F9d014861; Fri, 15 Jan 2016 12:09:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601151209.u0FC9F9d014861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 15 Jan 2016 12:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294088 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 12:09:17 -0000 Author: hselasky Date: Fri Jan 15 12:09:15 2016 New Revision: 294088 URL: https://svnweb.freebsd.org/changeset/base/294088 Log: Use the recently added "make_dev_s()" function to solve old race setting the si_drv1 field in "struct cdev" when creating new character devices. Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri Jan 15 11:40:41 2016 (r294087) +++ head/sys/dev/usb/usb_device.c Fri Jan 15 12:09:15 2016 (r294088) @@ -1962,6 +1962,7 @@ usb_make_dev(struct usb_device *udev, co int fi, int rwmode, uid_t uid, gid_t gid, int mode) { struct usb_fs_privdata* pd; + struct make_dev_args args; char buffer[32]; /* Store information to locate ourselves again later */ @@ -1980,17 +1981,19 @@ usb_make_dev(struct usb_device *udev, co pd->bus_index, pd->dev_index, pd->ep_addr); } - pd->cdev = make_dev(&usb_devsw, 0, uid, gid, mode, "%s", devname); + /* Setup arguments for make_dev_s() */ + make_dev_args_init(&args); + args.mda_devsw = &usb_devsw; + args.mda_uid = uid; + args.mda_gid = gid; + args.mda_mode = mode; + args.mda_si_drv1 = pd; - if (pd->cdev == NULL) { + if (make_dev_s(&args, &pd->cdev, "%s", devname) != 0) { DPRINTFN(0, "Failed to create device %s\n", devname); free(pd, M_USBDEV); return (NULL); } - - /* XXX setting si_drv1 and creating the device is not atomic! */ - pd->cdev->si_drv1 = pd; - return (pd); } From owner-svn-src-head@freebsd.org Fri Jan 15 13:47:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3872EA83425; Fri, 15 Jan 2016 13:47:13 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 096C8184D; Fri, 15 Jan 2016 13:47:12 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FDlCDX044395; Fri, 15 Jan 2016 13:47:12 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FDlCkv044394; Fri, 15 Jan 2016 13:47:12 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601151347.u0FDlCkv044394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 15 Jan 2016 13:47:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294089 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 13:47:13 -0000 Author: melifaro Date: Fri Jan 15 13:47:11 2016 New Revision: 294089 URL: https://svnweb.freebsd.org/changeset/base/294089 Log: Clean up original route path selection logic a bit. NULL pointer dereference claimed by Coverity was possible if one (or several) next-hops for had their weights set to 0. CID: 1348482 Modified: head/sys/net/radix_mpath.c Modified: head/sys/net/radix_mpath.c ============================================================================== --- head/sys/net/radix_mpath.c Fri Jan 15 12:09:15 2016 (r294088) +++ head/sys/net/radix_mpath.c Fri Jan 15 13:47:11 2016 (r294089) @@ -201,19 +201,20 @@ static struct rtentry * rt_mpath_selectrte(struct rtentry *rte, uint32_t hash) { struct radix_node *rn0, *rn; - u_int32_t n; + uint32_t total_weight; struct rtentry *rt; int64_t weight; /* beyond here, we use rn as the master copy */ rn0 = rn = (struct radix_node *)rte; - n = rn_mpath_count(rn0); + rt = rte; /* gw selection by Modulo-N Hash (RFC2991) XXX need improvement? */ + total_weight = rn_mpath_count(rn0); hash += hashjitter; - hash %= n; - for (weight = abs((int32_t)hash), rt = rte; - weight >= rt->rt_weight && rn; + hash %= total_weight; + for (weight = abs((int32_t)hash); + rt != NULL && weight >= rt->rt_weight; weight -= rt->rt_weight) { /* stay within the multipath routes */ From owner-svn-src-head@freebsd.org Fri Jan 15 14:34:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A11DA844E2; Fri, 15 Jan 2016 14:34:32 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45CB11583; Fri, 15 Jan 2016 14:34:32 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FEYVPp058994; Fri, 15 Jan 2016 14:34:31 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FEYVT0058993; Fri, 15 Jan 2016 14:34:31 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201601151434.u0FEYVT0058993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 15 Jan 2016 14:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294090 - head/sys/xen/xenbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 14:34:32 -0000 Author: royger Date: Fri Jan 15 14:34:31 2016 New Revision: 294090 URL: https://svnweb.freebsd.org/changeset/base/294090 Log: xenbus: add a comment with the names of the generated accessors For easy grepping. Sponsored by: Citrix Systems R&D Modified: head/sys/xen/xenbus/xenbusvar.h Modified: head/sys/xen/xenbus/xenbusvar.h ============================================================================== --- head/sys/xen/xenbus/xenbusvar.h Fri Jan 15 13:47:11 2016 (r294089) +++ head/sys/xen/xenbus/xenbusvar.h Fri Jan 15 14:34:31 2016 (r294090) @@ -82,7 +82,13 @@ enum { }; /** - * Simplified accessors for xenbus devices + * Simplified accessors for xenbus devices: + * + * xenbus_get_node + * xenbus_get_type + * xenbus_get_state + * xenbus_get_otherend_id + * xenbus_get_otherend_path */ #define XENBUS_ACCESSOR(var, ivar, type) \ __BUS_ACCESSOR(xenbus, var, XENBUS, ivar, type) From owner-svn-src-head@freebsd.org Fri Jan 15 15:12:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05373A832E6; Fri, 15 Jan 2016 15:12:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5EF510F1; Fri, 15 Jan 2016 15:12:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FFCVZQ070731; Fri, 15 Jan 2016 15:12:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FFCVoD070724; Fri, 15 Jan 2016 15:12:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601151512.u0FFCVoD070724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 15 Jan 2016 15:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294091 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 15:12:33 -0000 Author: arybchik Date: Fri Jan 15 15:12:30 2016 New Revision: 294091 URL: https://svnweb.freebsd.org/changeset/base/294091 Log: sfxge: rename common hunt PHY methods to ef10 and use for Medford Leaving BIST methods for now as, though the Medford bootrom now has lots of BIST support, production firmware doesn't appear to have been updated yet. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4949 Modified: head/sys/dev/sfxge/common/efx_phy.c head/sys/dev/sfxge/common/hunt_ev.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_mac.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/hunt_phy.c head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Fri Jan 15 14:34:31 2016 (r294090) +++ head/sys/dev/sfxge/common/efx_phy.c Fri Jan 15 15:12:30 2016 (r294091) @@ -265,33 +265,34 @@ static efx_phy_ops_t __efx_phy_siena_ops }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON -static efx_phy_ops_t __efx_phy_hunt_ops = { - hunt_phy_power, /* epo_power */ +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +static efx_phy_ops_t __efx_phy_ef10_ops = { + ef10_phy_power, /* epo_power */ NULL, /* epo_reset */ - hunt_phy_reconfigure, /* epo_reconfigure */ - hunt_phy_verify, /* epo_verify */ + ef10_phy_reconfigure, /* epo_reconfigure */ + ef10_phy_verify, /* epo_verify */ NULL, /* epo_uplink_check */ NULL, /* epo_downlink_check */ - hunt_phy_oui_get, /* epo_oui_get */ + ef10_phy_oui_get, /* epo_oui_get */ #if EFSYS_OPT_PHY_STATS - hunt_phy_stats_update, /* epo_stats_update */ + ef10_phy_stats_update, /* epo_stats_update */ #endif /* EFSYS_OPT_PHY_STATS */ #if EFSYS_OPT_PHY_PROPS #if EFSYS_OPT_NAMES - hunt_phy_prop_name, /* epo_prop_name */ + ef10_phy_prop_name, /* epo_prop_name */ #endif - hunt_phy_prop_get, /* epo_prop_get */ - hunt_phy_prop_set, /* epo_prop_set */ + ef10_phy_prop_get, /* epo_prop_get */ + ef10_phy_prop_set, /* epo_prop_set */ #endif /* EFSYS_OPT_PHY_PROPS */ #if EFSYS_OPT_BIST + /* FIXME: Are these BIST methods appropriate for Medford? */ hunt_bist_enable_offline, /* epo_bist_enable_offline */ hunt_bist_start, /* epo_bist_start */ hunt_bist_poll, /* epo_bist_poll */ hunt_bist_stop, /* epo_bist_stop */ #endif /* EFSYS_OPT_BIST */ }; -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ __checkReturn efx_rc_t efx_phy_probe( @@ -356,9 +357,14 @@ efx_phy_probe( #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - epop = (efx_phy_ops_t *)&__efx_phy_hunt_ops; + epop = (efx_phy_ops_t *)&__efx_phy_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + epop = (efx_phy_ops_t *)&__efx_phy_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ default: rc = ENOTSUP; goto fail1; Modified: head/sys/dev/sfxge/common/hunt_ev.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_ev.c Fri Jan 15 14:34:31 2016 (r294090) +++ head/sys/dev/sfxge/common/hunt_ev.c Fri Jan 15 15:12:30 2016 (r294091) @@ -835,7 +835,7 @@ ef10_ev_mcdi( case MCDI_EVENT_CODE_LINKCHANGE: { efx_link_mode_t link_mode; - hunt_phy_link_ev(enp, eqp, &link_mode); + ef10_phy_link_ev(enp, eqp, &link_mode); should_abort = eecp->eec_link_change(arg, link_mode); break; } Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 14:34:31 2016 (r294090) +++ head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 15:12:30 2016 (r294091) @@ -489,38 +489,38 @@ typedef struct ef10_link_state_s { } ef10_link_state_t; extern void -hunt_phy_link_ev( +ef10_phy_link_ev( __in efx_nic_t *enp, __in efx_qword_t *eqp, __out efx_link_mode_t *link_modep); extern __checkReturn efx_rc_t -hunt_phy_get_link( +ef10_phy_get_link( __in efx_nic_t *enp, __out ef10_link_state_t *elsp); extern __checkReturn efx_rc_t -hunt_phy_power( +ef10_phy_power( __in efx_nic_t *enp, __in boolean_t on); extern __checkReturn efx_rc_t -hunt_phy_reconfigure( +ef10_phy_reconfigure( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_phy_verify( +ef10_phy_verify( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_phy_oui_get( +ef10_phy_oui_get( __in efx_nic_t *enp, __out uint32_t *ouip); #if EFSYS_OPT_PHY_STATS extern __checkReturn efx_rc_t -hunt_phy_stats_update( +ef10_phy_stats_update( __in efx_nic_t *enp, __in efsys_mem_t *esmp, __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat); @@ -532,21 +532,21 @@ hunt_phy_stats_update( #if EFSYS_OPT_NAMES extern const char * -hunt_phy_prop_name( +ef10_phy_prop_name( __in efx_nic_t *enp, __in unsigned int id); #endif /* EFSYS_OPT_NAMES */ extern __checkReturn efx_rc_t -hunt_phy_prop_get( +ef10_phy_prop_get( __in efx_nic_t *enp, __in unsigned int id, __in uint32_t flags, __out uint32_t *valp); extern __checkReturn efx_rc_t -hunt_phy_prop_set( +ef10_phy_prop_set( __in efx_nic_t *enp, __in unsigned int id, __in uint32_t val); Modified: head/sys/dev/sfxge/common/hunt_mac.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mac.c Fri Jan 15 14:34:31 2016 (r294090) +++ head/sys/dev/sfxge/common/hunt_mac.c Fri Jan 15 15:12:30 2016 (r294091) @@ -51,7 +51,7 @@ hunt_mac_poll( ef10_link_state_t els; efx_rc_t rc; - if ((rc = hunt_phy_get_link(enp, &els)) != 0) + if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail1; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -86,7 +86,7 @@ hunt_mac_up( * Because Huntington doesn't *require* polling, we can't rely on * hunt_mac_poll() being executed to populate epp->ep_mac_up. */ - if ((rc = hunt_phy_get_link(enp, &els)) != 0) + if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail1; *mac_upp = els.els_mac_up; Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Fri Jan 15 14:34:31 2016 (r294090) +++ head/sys/dev/sfxge/common/hunt_nic.c Fri Jan 15 15:12:30 2016 (r294091) @@ -1190,7 +1190,7 @@ hunt_board_cfg( goto fail6; /* Obtain the default PHY advertised capabilities */ - if ((rc = hunt_phy_get_link(enp, &els)) != 0) + if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail7; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; Modified: head/sys/dev/sfxge/common/hunt_phy.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_phy.c Fri Jan 15 14:34:31 2016 (r294090) +++ head/sys/dev/sfxge/common/hunt_phy.c Fri Jan 15 15:12:30 2016 (r294091) @@ -37,15 +37,10 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_HUNTINGTON static void -hunt_phy_decode_cap( +mcdi_phy_decode_cap( __in uint32_t mcdi_cap, __out uint32_t *maskp) { - /* - * TBD: consider common Siena/Hunt function: Hunt is a superset of - * Siena here (adds 40G) - */ - uint32_t mask; mask = 0; @@ -76,7 +71,7 @@ hunt_phy_decode_cap( } static void -hunt_phy_decode_link_mode( +mcdi_phy_decode_link_mode( __in efx_nic_t *enp, __in uint32_t link_flags, __in unsigned int speed, @@ -84,11 +79,6 @@ hunt_phy_decode_link_mode( __out efx_link_mode_t *link_modep, __out unsigned int *fcntlp) { - /* - * TBD: consider common Siena/Hunt function: Hunt is a superset of - * Siena here (adds 40G and generate-only flow control) - */ - boolean_t fd = !!(link_flags & (1 << MC_CMD_GET_LINK_OUT_FULL_DUPLEX_LBN)); boolean_t up = !!(link_flags & @@ -127,16 +117,11 @@ hunt_phy_decode_link_mode( void -hunt_phy_link_ev( +ef10_phy_link_ev( __in efx_nic_t *enp, __in efx_qword_t *eqp, __out efx_link_mode_t *link_modep) { - /* - * TBD: consider common Siena/Hunt function: Hunt is a superset of - * Siena here (adds 40G) - */ - efx_port_t *epp = &(enp->en_port); unsigned int link_flags; unsigned int speed; @@ -167,10 +152,10 @@ hunt_phy_link_ev( } link_flags = MCDI_EV_FIELD(eqp, LINKCHANGE_LINK_FLAGS); - hunt_phy_decode_link_mode(enp, link_flags, speed, + mcdi_phy_decode_link_mode(enp, link_flags, speed, MCDI_EV_FIELD(eqp, LINKCHANGE_FCNTL), &link_mode, &fcntl); - hunt_phy_decode_cap(MCDI_EV_FIELD(eqp, LINKCHANGE_LP_CAP), + mcdi_phy_decode_cap(MCDI_EV_FIELD(eqp, LINKCHANGE_LP_CAP), &lp_cap_mask); /* @@ -191,19 +176,17 @@ hunt_phy_link_ev( } __checkReturn efx_rc_t -hunt_phy_power( +ef10_phy_power( __in efx_nic_t *enp, __in boolean_t power) { - /* TBD: consider common Siena/Hunt function: essentially identical */ - efx_rc_t rc; if (!power) return (0); /* Check if the PHY is a zombie */ - if ((rc = hunt_phy_verify(enp)) != 0) + if ((rc = ef10_phy_verify(enp)) != 0) goto fail1; enp->en_reset_flags |= EFX_RESET_PHY; @@ -217,16 +200,10 @@ fail1: } __checkReturn efx_rc_t -hunt_phy_get_link( +ef10_phy_get_link( __in efx_nic_t *enp, __out ef10_link_state_t *elsp) { - /* - * TBD: consider common Siena/Hunt function: Hunt is very similar - * (at least for now; not clear that the loopbacks should necessarily - * be quite the same...) - */ - efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_LINK_IN_LEN, MC_CMD_GET_LINK_OUT_LEN)]; @@ -251,12 +228,12 @@ hunt_phy_get_link( goto fail2; } - hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_CAP), + mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_CAP), &elsp->els_adv_cap_mask); - hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP), + mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP), &elsp->els_lp_cap_mask); - hunt_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS), + mcdi_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS), MCDI_OUT_DWORD(req, GET_LINK_OUT_LINK_SPEED), MCDI_OUT_DWORD(req, GET_LINK_OUT_FCNTL), &elsp->els_link_mode, &elsp->els_fcntl); @@ -298,15 +275,9 @@ fail1: } __checkReturn efx_rc_t -hunt_phy_reconfigure( +ef10_phy_reconfigure( __in efx_nic_t *enp) { - /* - * TBD: this is a little different for now (no LED support for Hunt - * yet), but ultimately should consider common Siena/Hunt function: - * Hunt should be a superset of Siena here (adds 40G) - */ - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_port_t *epp = &(enp->en_port); efx_mcdi_req_t req; @@ -428,11 +399,9 @@ fail1: } __checkReturn efx_rc_t -hunt_phy_verify( +ef10_phy_verify( __in efx_nic_t *enp) { - /* TBD: consider common Siena/Hunt function: essentially identical */ - efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_PHY_STATE_IN_LEN, MC_CMD_GET_PHY_STATE_OUT_LEN)]; @@ -479,7 +448,7 @@ fail1: } __checkReturn efx_rc_t -hunt_phy_oui_get( +ef10_phy_oui_get( __in efx_nic_t *enp, __out uint32_t *ouip) { @@ -491,7 +460,7 @@ hunt_phy_oui_get( #if EFSYS_OPT_PHY_STATS __checkReturn efx_rc_t -hunt_phy_stats_update( +ef10_phy_stats_update( __in efx_nic_t *enp, __in efsys_mem_t *esmp, __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat) @@ -509,8 +478,8 @@ hunt_phy_stats_update( #if EFSYS_OPT_NAMES -extern const char * -hunt_phy_prop_name( + const char * +ef10_phy_prop_name( __in efx_nic_t *enp, __in unsigned int id) { @@ -521,8 +490,8 @@ hunt_phy_prop_name( #endif /* EFSYS_OPT_NAMES */ -extern __checkReturn efx_rc_t -hunt_phy_prop_get( + __checkReturn efx_rc_t +ef10_phy_prop_get( __in efx_nic_t *enp, __in unsigned int id, __in uint32_t flags, @@ -533,8 +502,8 @@ hunt_phy_prop_get( return (ENOTSUP); } -extern __checkReturn efx_rc_t -hunt_phy_prop_set( + __checkReturn efx_rc_t +ef10_phy_prop_set( __in efx_nic_t *enp, __in unsigned int id, __in uint32_t val) Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Fri Jan 15 14:34:31 2016 (r294090) +++ head/sys/dev/sfxge/common/medford_nic.c Fri Jan 15 15:12:30 2016 (r294091) @@ -126,7 +126,7 @@ medford_board_cfg( goto fail6; /* Obtain the default PHY advertised capabilities */ - if ((rc = hunt_phy_get_link(enp, &els)) != 0) + if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail7; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; From owner-svn-src-head@freebsd.org Fri Jan 15 15:17:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34566A83555; Fri, 15 Jan 2016 15:17:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0538815D4; Fri, 15 Jan 2016 15:17:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FFHjLu070944; Fri, 15 Jan 2016 15:17:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FFHilr070940; Fri, 15 Jan 2016 15:17:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601151517.u0FFHilr070940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 15 Jan 2016 15:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294092 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 15:17:46 -0000 Author: arybchik Date: Fri Jan 15 15:17:44 2016 New Revision: 294092 URL: https://svnweb.freebsd.org/changeset/base/294092 Log: sfxge: rename Huntington MAC methods to EF10 and use for Medford Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4950 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_mac.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Jan 15 15:12:30 2016 (r294091) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Jan 15 15:17:44 2016 (r294092) @@ -97,6 +97,7 @@ typedef enum efx_mac_type_e { EFX_MAC_FALCON_XMAC, EFX_MAC_SIENA, EFX_MAC_HUNTINGTON, + EFX_MAC_MEDFORD, EFX_MAC_NTYPES } efx_mac_type_t; Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Fri Jan 15 15:12:30 2016 (r294091) +++ head/sys/dev/sfxge/common/efx_mac.c Fri Jan 15 15:17:44 2016 (r294092) @@ -113,27 +113,27 @@ static efx_mac_ops_t __efx_siena_mac_ops }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON -static efx_mac_ops_t __efx_hunt_mac_ops = { +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +static efx_mac_ops_t __efx_ef10_mac_ops = { NULL, /* emo_reset */ - hunt_mac_poll, /* emo_poll */ - hunt_mac_up, /* emo_up */ - hunt_mac_addr_set, /* emo_addr_set */ - hunt_mac_reconfigure, /* emo_reconfigure */ - hunt_mac_multicast_list_set, /* emo_multicast_list_set */ - hunt_mac_filter_default_rxq_set, /* emo_filter_default_rxq_set */ - hunt_mac_filter_default_rxq_clear, + ef10_mac_poll, /* emo_poll */ + ef10_mac_up, /* emo_up */ + ef10_mac_addr_set, /* emo_addr_set */ + ef10_mac_reconfigure, /* emo_reconfigure */ + ef10_mac_multicast_list_set, /* emo_multicast_list_set */ + ef10_mac_filter_default_rxq_set, /* emo_filter_default_rxq_set */ + ef10_mac_filter_default_rxq_clear, /* emo_filter_default_rxq_clear */ #if EFSYS_OPT_LOOPBACK - hunt_mac_loopback_set, /* emo_loopback_set */ + ef10_mac_loopback_set, /* emo_loopback_set */ #endif /* EFSYS_OPT_LOOPBACK */ #if EFSYS_OPT_MAC_STATS efx_mcdi_mac_stats_upload, /* emo_stats_upload */ efx_mcdi_mac_stats_periodic, /* emo_stats_periodic */ - hunt_mac_stats_update /* emo_stats_update */ + ef10_mac_stats_update /* emo_stats_update */ #endif /* EFSYS_OPT_MAC_STATS */ }; -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ static efx_mac_ops_t *__efx_mac_ops[] = { /* [EFX_MAC_INVALID] */ @@ -158,7 +158,13 @@ static efx_mac_ops_t *__efx_mac_ops[] = #endif /* [EFX_MAC_HUNTINGTON] */ #if EFSYS_OPT_HUNTINGTON - &__efx_hunt_mac_ops, + &__efx_ef10_mac_ops, +#else + NULL, +#endif + /* [EFX_MAC_MEDFORD] */ +#if EFSYS_OPT_MEDFORD + &__efx_ef10_mac_ops, #else NULL, #endif @@ -781,6 +787,13 @@ efx_mac_select( efx_mac_ops_t *emop; int rc = EINVAL; +#if EFSYS_OPT_SIENA + if (enp->en_family == EFX_FAMILY_SIENA) { + type = EFX_MAC_SIENA; + goto chosen; + } +#endif + #if EFSYS_OPT_HUNTINGTON if (enp->en_family == EFX_FAMILY_HUNTINGTON) { type = EFX_MAC_HUNTINGTON; @@ -788,9 +801,9 @@ efx_mac_select( } #endif -#if EFSYS_OPT_SIENA - if (enp->en_family == EFX_FAMILY_SIENA) { - type = EFX_MAC_SIENA; +#if EFSYS_OPT_MEDFORD + if (enp->en_family == EFX_FAMILY_MEDFORD) { + type = EFX_MAC_MEDFORD; goto chosen; } #endif Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 15:12:30 2016 (r294091) +++ head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 15:17:44 2016 (r294092) @@ -220,41 +220,41 @@ ef10_nic_unprobe( /* MAC */ extern __checkReturn efx_rc_t -hunt_mac_poll( +ef10_mac_poll( __in efx_nic_t *enp, __out efx_link_mode_t *link_modep); extern __checkReturn efx_rc_t -hunt_mac_up( +ef10_mac_up( __in efx_nic_t *enp, __out boolean_t *mac_upp); extern __checkReturn efx_rc_t -hunt_mac_addr_set( +ef10_mac_addr_set( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_mac_reconfigure( +ef10_mac_reconfigure( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_mac_multicast_list_set( +ef10_mac_multicast_list_set( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_mac_filter_default_rxq_set( +ef10_mac_filter_default_rxq_set( __in efx_nic_t *enp, __in efx_rxq_t *erp, __in boolean_t using_rss); extern void -hunt_mac_filter_default_rxq_clear( +ef10_mac_filter_default_rxq_clear( __in efx_nic_t *enp); #if EFSYS_OPT_LOOPBACK extern __checkReturn efx_rc_t -hunt_mac_loopback_set( +ef10_mac_loopback_set( __in efx_nic_t *enp, __in efx_link_mode_t link_mode, __in efx_loopback_type_t loopback_type); @@ -264,7 +264,7 @@ hunt_mac_loopback_set( #if EFSYS_OPT_MAC_STATS extern __checkReturn efx_rc_t -hunt_mac_stats_update( +ef10_mac_stats_update( __in efx_nic_t *enp, __in efsys_mem_t *esmp, __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat, Modified: head/sys/dev/sfxge/common/hunt_mac.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mac.c Fri Jan 15 15:12:30 2016 (r294091) +++ head/sys/dev/sfxge/common/hunt_mac.c Fri Jan 15 15:17:44 2016 (r294092) @@ -38,15 +38,10 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_HUNTINGTON __checkReturn efx_rc_t -hunt_mac_poll( +ef10_mac_poll( __in efx_nic_t *enp, __out efx_link_mode_t *link_modep) { - /* - * TBD: Consider a common Siena/Huntington function. The code is - * essentially identical. - */ - efx_port_t *epp = &(enp->en_port); ef10_link_state_t els; efx_rc_t rc; @@ -70,21 +65,16 @@ fail1: } __checkReturn efx_rc_t -hunt_mac_up( +ef10_mac_up( __in efx_nic_t *enp, __out boolean_t *mac_upp) { - /* - * TBD: Consider a common Siena/Huntington function. The code is - * essentially identical. - */ - ef10_link_state_t els; efx_rc_t rc; /* - * Because Huntington doesn't *require* polling, we can't rely on - * hunt_mac_poll() being executed to populate epp->ep_mac_up. + * Because EF10 doesn't *require* polling, we can't rely on + * ef10_mac_poll() being executed to populate epp->ep_mac_up. */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail1; @@ -100,7 +90,7 @@ fail1: } /* - * Huntington uses MC_CMD_VADAPTOR_SET_MAC to set the + * EF10 adapters use MC_CMD_VADAPTOR_SET_MAC to set the * MAC address; the address field in MC_CMD_SET_MAC has no * effect. * MC_CMD_VADAPTOR_SET_MAC requires mac-spoofing privilege and @@ -144,7 +134,7 @@ fail1: } __checkReturn efx_rc_t -hunt_mac_addr_set( +ef10_mac_addr_set( __in efx_nic_t *enp) { efx_rc_t rc; @@ -153,8 +143,11 @@ hunt_mac_addr_set( if (rc != ENOTSUP) goto fail1; - /* Fallback for older firmware without Vadapter support */ - if ((rc = hunt_mac_reconfigure(enp)) != 0) + /* + * Fallback for older Huntington firmware without Vadapter + * support. + */ + if ((rc = ef10_mac_reconfigure(enp)) != 0) goto fail2; } @@ -170,7 +163,7 @@ fail1: } __checkReturn efx_rc_t -hunt_mac_reconfigure( +ef10_mac_reconfigure( __in efx_nic_t *enp) { efx_port_t *epp = &(enp->en_port); @@ -197,6 +190,8 @@ hunt_mac_reconfigure( * from reaching the filters. As Huntington filters drop any * traffic that does not match a filter it is ok to leave the * MAC running in promiscuous mode. See bug41141. + * + * FIXME: Does REJECT_UNCST behave the same way on Medford? */ MCDI_IN_POPULATE_DWORD_2(req, SET_MAC_IN_REJECT, SET_MAC_IN_REJECT_UNCST, 0, @@ -247,16 +242,15 @@ fail1: } __checkReturn efx_rc_t -hunt_mac_multicast_list_set( +ef10_mac_multicast_list_set( __in efx_nic_t *enp) { efx_port_t *epp = &(enp->en_port); efx_mac_ops_t *emop = epp->ep_emop; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); - - /* FIXME: Insert filters for multicast list */ + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); if ((rc = emop->emo_reconfigure(enp)) != 0) goto fail1; @@ -270,7 +264,7 @@ fail1: } __checkReturn efx_rc_t -hunt_mac_filter_default_rxq_set( +ef10_mac_filter_default_rxq_set( __in efx_nic_t *enp, __in efx_rxq_t *erp, __in boolean_t using_rss) @@ -304,7 +298,7 @@ fail1: } void -hunt_mac_filter_default_rxq_clear( +ef10_mac_filter_default_rxq_clear( __in efx_nic_t *enp) { efx_port_t *epp = &(enp->en_port); @@ -322,23 +316,18 @@ hunt_mac_filter_default_rxq_clear( #if EFSYS_OPT_LOOPBACK __checkReturn efx_rc_t -hunt_mac_loopback_set( +ef10_mac_loopback_set( __in efx_nic_t *enp, __in efx_link_mode_t link_mode, __in efx_loopback_type_t loopback_type) { - /* - * TBD: Consider a common Siena/Huntington function. The code is - * essentially identical. - */ - efx_port_t *epp = &(enp->en_port); efx_phy_ops_t *epop = epp->ep_epop; efx_loopback_type_t old_loopback_type; efx_link_mode_t old_loopback_link_mode; efx_rc_t rc; - /* The PHY object handles this on Huntington */ + /* The PHY object handles this on EF10 */ old_loopback_type = epp->ep_loopback_type; old_loopback_link_mode = epp->ep_loopback_link_mode; epp->ep_loopback_type = loopback_type; @@ -362,12 +351,12 @@ fail1: #if EFSYS_OPT_MAC_STATS -#define HUNT_MAC_STAT_READ(_esmp, _field, _eqp) \ +#define EF10_MAC_STAT_READ(_esmp, _field, _eqp) \ EFSYS_MEM_READQ((_esmp), (_field) * sizeof (efx_qword_t), _eqp) __checkReturn efx_rc_t -hunt_mac_stats_update( +ef10_mac_stats_update( __in efx_nic_t *enp, __in efsys_mem_t *esmp, __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat, @@ -381,301 +370,301 @@ hunt_mac_stats_update( /* Read END first so we don't race with the MC */ EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_END, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_END, &generation_end); EFSYS_MEM_READ_BARRIER(); /* TX */ - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_CONTROL_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_CONTROL_PKTS, &value); EFSYS_STAT_SUBR_QWORD(&(stat[EFX_MAC_TX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PAUSE_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PAUSE_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_PAUSE_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_UNICAST_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_UNICAST_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_UNICST_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTICAST_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTICAST_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_MULTICST_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BROADCAST_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BROADCAST_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_BRDCST_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BYTES, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_OCTETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LT64_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LT64_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_64_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_64_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_65_TO_127_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_65_TO_127_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_65_TO_127_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_128_TO_255_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_128_TO_255_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_128_TO_255_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_256_TO_511_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_256_TO_511_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_256_TO_511_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_512_TO_1023_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_512_TO_1023_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_512_TO_1023_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_1024_TO_15XX_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_1024_TO_15XX_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_1024_TO_15XX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_15XX_TO_JUMBO_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_15XX_TO_JUMBO_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_GE_15XX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_GTJUMBO_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_GTJUMBO_PKTS, &value); EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_TX_GE_15XX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BAD_FCS_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BAD_FCS_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_ERRORS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_SINGLE_COLLISION_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_SINGLE_COLLISION_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_SGL_COL_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTIPLE_COLLISION_PKTS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTIPLE_COLLISION_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_MULT_COL_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_COLLISION_PKTS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_COLLISION_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_EX_COL_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LATE_COLLISION_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LATE_COLLISION_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LATE_COL_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_DEFERRED_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_DEFERRED_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_DEF_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_DEFERRED_PKTS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_DEFERRED_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_EX_DEF_PKTS]), &value); /* RX */ - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BYTES, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_OCTETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNICAST_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNICAST_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_UNICST_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MULTICAST_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MULTICAST_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_MULTICST_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BROADCAST_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BROADCAST_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_BRDCST_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PAUSE_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PAUSE_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_PAUSE_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNDERSIZE_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNDERSIZE_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_LE_64_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_64_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_64_PKTS, &value); EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_RX_LE_64_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_65_TO_127_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_65_TO_127_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_65_TO_127_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_128_TO_255_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_128_TO_255_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_128_TO_255_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_256_TO_511_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_256_TO_511_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_256_TO_511_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_512_TO_1023_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_512_TO_1023_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_512_TO_1023_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_1024_TO_15XX_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_1024_TO_15XX_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_1024_TO_15XX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_15XX_TO_JUMBO_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_15XX_TO_JUMBO_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_GE_15XX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_GTJUMBO_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_GTJUMBO_PKTS, &value); EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_RX_GE_15XX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BAD_FCS_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BAD_FCS_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_FCS_ERRORS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_OVERFLOW_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_OVERFLOW_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_DROP_EVENTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_FALSE_CARRIER_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_FALSE_CARRIER_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_FALSE_CARRIER_ERRORS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_SYMBOL_ERROR_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_SYMBOL_ERROR_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_SYMBOL_ERRORS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_ALIGN_ERROR_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_ALIGN_ERROR_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_ALIGN_ERRORS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_INTERNAL_ERROR_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_INTERNAL_ERROR_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_INTERNAL_ERRORS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_JABBER_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_JABBER_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_JABBER_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_CHAR_ERR, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_CHAR_ERR, &value); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE0_CHAR_ERR]), &(value.eq_dword[0])); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE1_CHAR_ERR]), &(value.eq_dword[1])); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_CHAR_ERR, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_CHAR_ERR, &value); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE2_CHAR_ERR]), &(value.eq_dword[0])); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE3_CHAR_ERR]), &(value.eq_dword[1])); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_DISP_ERR, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_DISP_ERR, &value); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE0_DISP_ERR]), &(value.eq_dword[0])); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE1_DISP_ERR]), &(value.eq_dword[1])); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_DISP_ERR, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_DISP_ERR, &value); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE2_DISP_ERR]), &(value.eq_dword[0])); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE3_DISP_ERR]), &(value.eq_dword[1])); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MATCH_FAULT, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MATCH_FAULT, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_MATCH_FAULT]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_NODESC_DROPS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_NODESC_DROPS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_NODESC_DROP_CNT]), &value); /* Packet memory (EF10 only) */ - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_TRUNC_BB_OVERFLOW]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_BB_OVERFLOW]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_VFIFO_FULL, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_VFIFO_FULL, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_TRUNC_VFIFO_FULL]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_VFIFO_FULL, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_VFIFO_FULL, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_VFIFO_FULL]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_QBB, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_QBB, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_TRUNC_QBB]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_QBB, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_QBB, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_QBB]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_MAPPING, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_MAPPING, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_MAPPING]), &value); /* RX datapath */ - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_Q_DISABLED_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_Q_DISABLED_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_Q_DISABLED_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_DI_DROPPED_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_DI_DROPPED_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_DI_DROPPED_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_STREAMING_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_STREAMING_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_STREAMING_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_FETCH_CONDITIONS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_FETCH_CONDITIONS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_FETCH]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_WAIT_CONDITIONS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_WAIT_CONDITIONS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_WAIT]), &value); /* VADAPTER RX */ - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_UNICAST_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_BYTES, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_UNICAST_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_MULTICAST_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_BYTES, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_MULTICAST_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BROADCAST_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_BYTES, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BROADCAST_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BAD_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_BYTES, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BAD_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_OVERFLOW, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_OVERFLOW, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_OVERFLOW]), &value); /* VADAPTER TX */ - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_UNICAST_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_BYTES, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_UNICAST_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_MULTICAST_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_BYTES, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_MULTICAST_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BROADCAST_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_BYTES, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BROADCAST_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_PACKETS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BAD_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_BYTES, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BAD_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_OVERFLOW, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_OVERFLOW, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_OVERFLOW]), &value); EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE); EFSYS_MEM_READ_BARRIER(); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_START, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_START, &generation_start); /* Check that we didn't read the stats in the middle of a DMA */ From owner-svn-src-head@freebsd.org Fri Jan 15 15:19:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A51DA83602; Fri, 15 Jan 2016 15:19:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 053741865; Fri, 15 Jan 2016 15:19:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FFJJlb071046; Fri, 15 Jan 2016 15:19:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FFJIiI071040; Fri, 15 Jan 2016 15:19:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601151519.u0FFJIiI071040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 15 Jan 2016 15:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294093 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 15:19:20 -0000 Author: arybchik Date: Fri Jan 15 15:19:18 2016 New Revision: 294093 URL: https://svnweb.freebsd.org/changeset/base/294093 Log: sfxge: convert nvram read method to use partition id Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4951 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nvram.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_nvram.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Jan 15 15:17:44 2016 (r294092) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Jan 15 15:19:18 2016 (r294093) @@ -486,8 +486,6 @@ typedef struct efx_nvram_ops_s { #endif /* EFSYS_OPT_DIAG */ efx_rc_t (*envo_get_version)(efx_nic_t *, efx_nvram_type_t, uint32_t *, uint16_t *); - efx_rc_t (*envo_read_chunk)(efx_nic_t *, efx_nvram_type_t, - unsigned int, caddr_t, size_t); efx_rc_t (*envo_erase)(efx_nic_t *, efx_nvram_type_t); efx_rc_t (*envo_write_chunk)(efx_nic_t *, efx_nvram_type_t, unsigned int, caddr_t, size_t); @@ -499,6 +497,8 @@ typedef struct efx_nvram_ops_s { uint32_t *); efx_rc_t (*envo_partn_size)(efx_nic_t *, uint32_t, size_t *); efx_rc_t (*envo_partn_rw_start)(efx_nic_t *, uint32_t, size_t *); + efx_rc_t (*envo_partn_read)(efx_nic_t *, uint32_t, + unsigned int, caddr_t, size_t); } efx_nvram_ops_t; #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Jan 15 15:17:44 2016 (r294092) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Jan 15 15:19:18 2016 (r294093) @@ -43,7 +43,6 @@ static efx_nvram_ops_t __efx_nvram_falco falcon_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ falcon_nvram_get_version, /* envo_get_version */ - falcon_nvram_read_chunk, /* envo_read_chunk */ falcon_nvram_erase, /* envo_erase */ falcon_nvram_write_chunk, /* envo_write_chunk */ falcon_nvram_rw_finish, /* envo_rw_finish */ @@ -51,6 +50,7 @@ static efx_nvram_ops_t __efx_nvram_falco falcon_nvram_type_to_partn, /* envo_type_to_partn */ falcon_nvram_partn_size, /* envo_partn_size */ falcon_nvram_partn_rw_start, /* envo_partn_rw_start */ + falcon_nvram_partn_read, /* envo_partn_read */ }; #endif /* EFSYS_OPT_FALCON */ @@ -62,7 +62,6 @@ static efx_nvram_ops_t __efx_nvram_siena siena_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ siena_nvram_get_version, /* envo_get_version */ - siena_nvram_read_chunk, /* envo_read_chunk */ siena_nvram_erase, /* envo_erase */ siena_nvram_write_chunk, /* envo_write_chunk */ siena_nvram_rw_finish, /* envo_rw_finish */ @@ -70,6 +69,7 @@ static efx_nvram_ops_t __efx_nvram_siena siena_nvram_type_to_partn, /* envo_type_to_partn */ siena_nvram_partn_size, /* envo_partn_size */ siena_nvram_partn_rw_start, /* envo_partn_rw_start */ + siena_nvram_partn_read, /* envo_partn_read */ }; #endif /* EFSYS_OPT_SIENA */ @@ -81,7 +81,6 @@ static efx_nvram_ops_t __efx_nvram_ef10_ ef10_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ ef10_nvram_get_version, /* envo_get_version */ - ef10_nvram_read_chunk, /* envo_read_chunk */ ef10_nvram_erase, /* envo_erase */ ef10_nvram_write_chunk, /* envo_write_chunk */ ef10_nvram_rw_finish, /* envo_rw_finish */ @@ -89,6 +88,7 @@ static efx_nvram_ops_t __efx_nvram_ef10_ ef10_nvram_type_to_partn, /* envo_type_to_partn */ ef10_nvram_partn_size, /* envo_partn_size */ ef10_nvram_partn_rw_start, /* envo_partn_rw_start */ + ef10_nvram_partn_read, /* envo_partn_read */ }; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ @@ -275,6 +275,7 @@ efx_nvram_read_chunk( __in size_t size) { efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -285,11 +286,16 @@ efx_nvram_read_chunk( EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - if ((rc = envop->envo_read_chunk(enp, type, offset, data, size)) != 0) + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + if ((rc = envop->envo_partn_read(enp, partn, offset, data, size)) != 0) + goto fail2; + return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 15:17:44 2016 (r294092) +++ head/sys/dev/sfxge/common/hunt_impl.h Fri Jan 15 15:19:18 2016 (r294093) @@ -370,14 +370,6 @@ ef10_nvram_partn_lock( __in uint32_t partn); extern __checkReturn efx_rc_t -ef10_nvram_partn_read( - __in efx_nic_t *enp, - __in uint32_t partn, - __in unsigned int offset, - __out_bcount(size) caddr_t data, - __in size_t size); - -extern __checkReturn efx_rc_t ef10_nvram_partn_erase( __in efx_nic_t *enp, __in uint32_t partn, @@ -416,14 +408,6 @@ ef10_nvram_get_version( __out uint32_t *subtypep, __out_ecount(4) uint16_t version[4]); -extern __checkReturn efx_rc_t -ef10_nvram_read_chunk( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __in unsigned int offset, - __out_bcount(size) caddr_t data, - __in size_t size); - extern __checkReturn efx_rc_t ef10_nvram_erase( __in efx_nic_t *enp, @@ -472,6 +456,14 @@ ef10_nvram_partn_rw_start( __in uint32_t partn, __out size_t *chunk_sizep); +extern __checkReturn efx_rc_t +ef10_nvram_partn_read( + __in efx_nic_t *enp, + __in uint32_t partn, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size); + #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Fri Jan 15 15:17:44 2016 (r294092) +++ head/sys/dev/sfxge/common/hunt_nvram.c Fri Jan 15 15:19:18 2016 (r294093) @@ -1769,33 +1769,6 @@ fail1: } __checkReturn efx_rc_t -ef10_nvram_read_chunk( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __in unsigned int offset, - __out_bcount(size) caddr_t data, - __in size_t size) -{ - uint32_t partn; - efx_rc_t rc; - - if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - - if ((rc = ef10_nvram_partn_read(enp, partn, offset, data, size)) != 0) - goto fail2; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t ef10_nvram_erase( __in efx_nic_t *enp, __in efx_nvram_type_t type) Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Fri Jan 15 15:17:44 2016 (r294092) +++ head/sys/dev/sfxge/common/siena_impl.h Fri Jan 15 15:19:18 2016 (r294093) @@ -156,14 +156,6 @@ siena_nvram_partn_lock( __in uint32_t partn); extern __checkReturn efx_rc_t -siena_nvram_partn_read( - __in efx_nic_t *enp, - __in uint32_t partn, - __in unsigned int offset, - __out_bcount(size) caddr_t data, - __in size_t size); - -extern __checkReturn efx_rc_t siena_nvram_partn_erase( __in efx_nic_t *enp, __in uint32_t partn, @@ -216,14 +208,6 @@ siena_nvram_get_version( __out uint32_t *subtypep, __out_ecount(4) uint16_t version[4]); -extern __checkReturn efx_rc_t -siena_nvram_read_chunk( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __in unsigned int offset, - __out_bcount(size) caddr_t data, - __in size_t size); - extern __checkReturn efx_rc_t siena_nvram_erase( __in efx_nic_t *enp, @@ -266,6 +250,14 @@ siena_nvram_partn_rw_start( __in uint32_t partn, __out size_t *chunk_sizep); +extern __checkReturn efx_rc_t +siena_nvram_partn_read( + __in efx_nic_t *enp, + __in uint32_t partn, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size); + #endif /* EFSYS_OPT_NVRAM */ #if EFSYS_OPT_VPD Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Fri Jan 15 15:17:44 2016 (r294092) +++ head/sys/dev/sfxge/common/siena_nvram.c Fri Jan 15 15:19:18 2016 (r294093) @@ -594,33 +594,6 @@ fail1: } __checkReturn efx_rc_t -siena_nvram_read_chunk( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __in unsigned int offset, - __out_bcount(size) caddr_t data, - __in size_t size) -{ - uint32_t partn; - efx_rc_t rc; - - if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - - if ((rc = siena_nvram_partn_read(enp, partn, offset, data, size)) != 0) - goto fail2; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t siena_nvram_erase( __in efx_nic_t *enp, __in efx_nvram_type_t type) From owner-svn-src-head@freebsd.org Fri Jan 15 15:20:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E2ECA836C6; Fri, 15 Jan 2016 15:20:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19BB41A90; Fri, 15 Jan 2016 15:20:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FFKR2C071138; Fri, 15 Jan 2016 15:20:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FFKRnH071137; Fri, 15 Jan 2016 15:20:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601151520.u0FFKRnH071137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 15 Jan 2016 15:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294094 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 15:20:28 -0000 Author: arybchik Date: Fri Jan 15 15:20:26 2016 New Revision: 294094 URL: https://svnweb.freebsd.org/changeset/base/294094 Log: sfxge: check the RX DMA end padding configuration on Medford Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4952 Modified: head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Fri Jan 15 15:19:18 2016 (r294093) +++ head/sys/dev/sfxge/common/medford_nic.c Fri Jan 15 15:20:26 2016 (r294094) @@ -39,6 +39,64 @@ __FBSDID("$FreeBSD$"); #include "ef10_tlv_layout.h" +static __checkReturn efx_rc_t +efx_mcdi_get_rxdp_config( + __in efx_nic_t *enp, + __out uint32_t *end_paddingp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_RXDP_CONFIG_IN_LEN, + MC_CMD_GET_RXDP_CONFIG_OUT_LEN)]; + uint32_t end_padding; + efx_rc_t rc; + + memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_RXDP_CONFIG; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_RXDP_CONFIG_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_RXDP_CONFIG_OUT_LEN; + + efx_mcdi_execute(enp, &req); + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, + GET_RXDP_CONFIG_OUT_PAD_HOST_DMA) == 0) { + /* RX DMA end padding is disabled */ + end_padding = 0; + } else { + switch(MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, + GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) { + case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64: + end_padding = 64; + break; + case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_128: + end_padding = 128; + break; + case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_256: + end_padding = 256; + break; + default: + rc = ENOTSUP; + goto fail2; + } + } + + *end_paddingp = end_padding; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t medford_board_cfg( __in efx_nic_t *enp) @@ -56,6 +114,7 @@ medford_board_cfg( uint32_t flags; uint32_t sysclk; uint32_t base, nvec; + uint32_t end_padding; efx_rc_t rc; /* @@ -161,8 +220,10 @@ medford_board_cfg( /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; - /* FIXME: RX DMA end padding is configurable on Medford */ - encp->enc_rx_buf_align_end = 64; + /* Get the RX DMA end padding alignment configuration */ + if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) + goto fail10; + encp->enc_rx_buf_align_end = end_padding; /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; @@ -190,13 +251,13 @@ medford_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail10; + goto fail11; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail11; + goto fail12; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -219,6 +280,8 @@ medford_board_cfg( return (0); +fail12: + EFSYS_PROBE(fail12); fail11: EFSYS_PROBE(fail11); fail10: From owner-svn-src-head@freebsd.org Fri Jan 15 16:45:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80DC2A82513; Fri, 15 Jan 2016 16:45:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52B1B1E5A; Fri, 15 Jan 2016 16:45:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FGjaD9097865; Fri, 15 Jan 2016 16:45:36 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FGjasg097864; Fri, 15 Jan 2016 16:45:36 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201601151645.u0FGjasg097864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 15 Jan 2016 16:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294095 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 16:45:37 -0000 Author: bz Date: Fri Jan 15 16:45:36 2016 New Revision: 294095 URL: https://svnweb.freebsd.org/changeset/base/294095 Log: Unbreak NOIP builds after r294084. Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Fri Jan 15 15:20:26 2016 (r294094) +++ head/sys/fs/nfsclient/nfs_clport.c Fri Jan 15 16:45:36 2016 (r294095) @@ -1049,10 +1049,11 @@ nfscl_loadfsinfo(struct nfsmount *nmp, s u_int8_t * nfscl_getmyip(struct nfsmount *nmp, struct in6_addr *paddr, int *isinet6p) { +#if defined(INET6) || defined(INET) int error, fibnum; fibnum = curthread->td_proc->p_fibnum; - +#endif #ifdef INET if (nmp->nm_nam->sa_family == AF_INET) { struct sockaddr_in *sin; From owner-svn-src-head@freebsd.org Fri Jan 15 18:27:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5BB6A84FC9; Fri, 15 Jan 2016 18:27:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF15B19D4; Fri, 15 Jan 2016 18:27:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FIRYXT028612; Fri, 15 Jan 2016 18:27:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FIRY1I028611; Fri, 15 Jan 2016 18:27:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601151827.u0FIRY1I028611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 15 Jan 2016 18:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294097 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 18:27:36 -0000 Author: ian Date: Fri Jan 15 18:27:34 2016 New Revision: 294097 URL: https://svnweb.freebsd.org/changeset/base/294097 Log: Reduce diffs to upstream by adding a couple comment blocks and moving the parse_boot_param() function to the end of the file. Modified: head/sys/arm/at91/board_tsc4370.c Modified: head/sys/arm/at91/board_tsc4370.c ============================================================================== --- head/sys/arm/at91/board_tsc4370.c Fri Jan 15 17:55:00 2016 (r294096) +++ head/sys/arm/at91/board_tsc4370.c Fri Jan 15 18:27:34 2016 (r294097) @@ -70,6 +70,10 @@ WR4HW(uint32_t devbase, uint32_t regoff, *(volatile uint32_t *)(AT91_BASE + devbase + regoff) = val; } +/* + * This is the same calculation the at91 uart driver does, we use it to update + * the console uart baud rate after changing the MCK rate. + */ #ifndef BAUD2DIVISOR #define BAUD2DIVISOR(b) \ ((((at91_master_clock * 10) / ((b) * 16)) + 5) / 10) @@ -96,34 +100,6 @@ static struct arm_boot_params boot_param static struct tsc_bootinfo inkernel_bootinfo; /* - * Override the default boot param parser (supplied via weak linkage) with one - * that knows how to handle our custom tsc_bootinfo passed in from boot2. - */ -vm_offset_t -parse_boot_param(struct arm_boot_params *abp) -{ - - boot_params = *abp; - - /* - * If the right magic is in r0 and a non-NULL pointer is in r1, then - * it's our bootinfo, copy it. The pointer in r1 is a physical address - * passed from boot2. This routine is called immediately upon entry to - * initarm() and is in very nearly the same environment as boot2. In - * particular, va=pa and we can safely copy the args before we lose easy - * access to the memory they're stashed in right now. - * - * Note that all versions of boot2 that we've ever shipped have put - * zeroes into r2 and r3. Maybe that'll be useful some day. - */ - if (abp->abp_r0 == TSC_BOOTINFO_MAGIC && abp->abp_r1 != 0) { - inkernel_bootinfo = *(struct tsc_bootinfo *)(abp->abp_r1); - } - - return fake_preload_metadata(abp); -} - -/* * Change the master clock config and wait for it to stabilize. */ static void @@ -516,6 +492,8 @@ board_init(void) */ master_clock_init(); + /* From this point on you can use printf. */ + /* * Configure UARTs. */ @@ -598,5 +576,33 @@ board_init(void) return (at91_ramsize()); } +/* + * Override the default boot param parser (supplied via weak linkage) with one + * that knows how to handle our custom tsc_bootinfo passed in from boot2. + */ +vm_offset_t +parse_boot_param(struct arm_boot_params *abp) +{ + + boot_params = *abp; + + /* + * If the right magic is in r0 and a non-NULL pointer is in r1, then + * it's our bootinfo, copy it. The pointer in r1 is a physical address + * passed from boot2. This routine is called immediately upon entry to + * initarm() and is in very nearly the same environment as boot2. In + * particular, va=pa and we can safely copy the args before we lose easy + * access to the memory they're stashed in right now. + * + * Note that all versions of boot2 that we've ever shipped have put + * zeroes into r2 and r3. Maybe that'll be useful some day. + */ + if (abp->abp_r0 == TSC_BOOTINFO_MAGIC && abp->abp_r1 != 0) { + inkernel_bootinfo = *(struct tsc_bootinfo *)(abp->abp_r1); + } + + return fake_preload_metadata(abp); +} + ARM_BOARD(NONE, "TSC4370 Controller Board"); From owner-svn-src-head@freebsd.org Fri Jan 15 18:53:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7D6FA83C9A; Fri, 15 Jan 2016 18:53:07 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C386A1CD2; Fri, 15 Jan 2016 18:53:07 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FIr6tP037491; Fri, 15 Jan 2016 18:53:06 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FIr6wN037487; Fri, 15 Jan 2016 18:53:06 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601151853.u0FIr6wN037487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 15 Jan 2016 18:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294098 - in head: lib/libkvm sys/arm/arm sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 18:53:08 -0000 Author: skra Date: Fri Jan 15 18:53:06 2016 New Revision: 294098 URL: https://svnweb.freebsd.org/changeset/base/294098 Log: Add mmu format info into ARM vmcore. Fix kvatop translation for 64K pages. Reviewed by: jhb Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D4942 Modified: head/lib/libkvm/kvm_arm.h head/lib/libkvm/kvm_minidump_arm.c head/sys/arm/arm/minidump_machdep.c head/sys/arm/include/minidump.h Modified: head/lib/libkvm/kvm_arm.h ============================================================================== --- head/lib/libkvm/kvm_arm.h Fri Jan 15 18:27:34 2016 (r294097) +++ head/lib/libkvm/kvm_arm.h Fri Jan 15 18:53:06 2016 (r294098) @@ -67,13 +67,16 @@ typedef uint32_t arm_pt_entry_t; #define ARM_L1_C_ADDR_MASK 0xfffffc00 /* phys address of L2 Table */ #define ARM_L2_TYPE_INV 0x00 /* Invalid (fault) */ -#define ARM_L2_TYPE_L 0x01 /* Large Page - 64k - not used yet*/ -#define ARM_L2_TYPE_S 0x02 /* Small Page - 4 */ +#define ARM_L2_TYPE_L 0x01 /* Large Page - 64k */ +#define ARM_L2_TYPE_S 0x02 /* Small Page - 4k */ +#define ARM_L2_TYPE_T 0x03 /* Tiny Page - 1k - not used */ #define ARM_L2_TYPE_MASK 0x03 #define ARM_L2_ADDR_BITS 0x000ff000 /* L2 PTE address bits */ #ifdef __arm__ +#include + _Static_assert(PAGE_SHIFT == ARM_PAGE_SHIFT, "PAGE_SHIFT mismatch"); _Static_assert(PAGE_SIZE == ARM_PAGE_SIZE, "PAGE_SIZE mismatch"); _Static_assert(PAGE_MASK == ARM_PAGE_MASK, "PAGE_MASK mismatch"); @@ -99,6 +102,9 @@ _Static_assert(L1_C_ADDR_MASK == ARM_L1_ _Static_assert(L2_TYPE_INV == ARM_L2_TYPE_INV, "L2_TYPE_INV mismatch"); _Static_assert(L2_TYPE_L == ARM_L2_TYPE_L, "L2_TYPE_L mismatch"); _Static_assert(L2_TYPE_S == ARM_L2_TYPE_S, "L2_TYPE_S mismatch"); +#if __ARM_ARCH < 6 +_Static_assert(L2_TYPE_T == ARM_L2_TYPE_T, "L2_TYPE_T mismatch"); +#endif _Static_assert(L2_TYPE_MASK == ARM_L2_TYPE_MASK, "L2_TYPE_MASK mismatch"); _Static_assert(L2_ADDR_BITS == ARM_L2_ADDR_BITS, "L2_ADDR_BITS mismatch"); #endif Modified: head/lib/libkvm/kvm_minidump_arm.c ============================================================================== --- head/lib/libkvm/kvm_minidump_arm.c Fri Jan 15 18:27:34 2016 (r294097) +++ head/lib/libkvm/kvm_minidump_arm.c Fri Jan 15 18:53:06 2016 (r294098) @@ -112,6 +112,12 @@ _arm_minidump_initvtop(kvm_t *kd) vmst->hdr.bitmapsize = _kvm32toh(kd, vmst->hdr.bitmapsize); vmst->hdr.ptesize = _kvm32toh(kd, vmst->hdr.ptesize); vmst->hdr.kernbase = _kvm32toh(kd, vmst->hdr.kernbase); + vmst->hdr.arch = _kvm32toh(kd, vmst->hdr.arch); + vmst->hdr.mmuformat = _kvm32toh(kd, vmst->hdr.mmuformat); + if (vmst->hdr.mmuformat == MINIDUMP_MMU_FORMAT_UNKNOWN) { + /* This is a safe default as 1K pages are not used. */ + vmst->hdr.mmuformat = MINIDUMP_MMU_FORMAT_V6; + } /* Skip header and msgbuf */ off = ARM_PAGE_SIZE + arm_round_page(vmst->hdr.msgbufsize); @@ -179,19 +185,27 @@ _arm_minidump_kvatop(kvm_t *kd, kvaddr_t if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> ARM_PAGE_SHIFT; pte = _kvm32toh(kd, ptemap[pteindex]); - if (!pte) { + if ((pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_INV) { _kvm_err(kd, kd->program, "_arm_minidump_kvatop: pte not valid"); goto invalid; } if ((pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_L) { - offset = va & ARM_L2_L_OFFSET; - a = pte & ARM_L2_L_FRAME; - } else if ((pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_S) { + /* 64K page -> convert to be like 4K page */ + offset = va & ARM_L2_S_OFFSET; + a = (pte & ARM_L2_L_FRAME) + + (va & ARM_L2_L_OFFSET & ARM_L2_S_FRAME); + } else { + if (kd->vmst->hdr.mmuformat == MINIDUMP_MMU_FORMAT_V4 && + (pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_T) { + _kvm_err(kd, kd->program, + "_arm_minidump_kvatop: pte not supported"); + goto invalid; + } + /* 4K page */ offset = va & ARM_L2_S_OFFSET; a = pte & ARM_L2_S_FRAME; - } else - goto invalid; + } ofs = _kvm_hpt_find(&vm->hpt, a); if (ofs == -1) { @@ -203,7 +217,6 @@ _arm_minidump_kvatop(kvm_t *kd, kvaddr_t *pa = ofs + offset; return (ARM_PAGE_SIZE - offset); - } else _kvm_err(kd, kd->program, "_arm_minidump_kvatop: virtual " "address 0x%jx not minidumped", (uintmax_t)va); Modified: head/sys/arm/arm/minidump_machdep.c ============================================================================== --- head/sys/arm/arm/minidump_machdep.c Fri Jan 15 18:27:34 2016 (r294097) +++ head/sys/arm/arm/minidump_machdep.c Fri Jan 15 18:53:06 2016 (r294098) @@ -312,7 +312,12 @@ minidumpsys(struct dumperinfo *di) mdhdr.bitmapsize = vm_page_dump_size; mdhdr.ptesize = ptesize; mdhdr.kernbase = KERNBASE; - + mdhdr.arch = __ARM_ARCH; +#if __ARM_ARCH >= 6 + mdhdr.mmuformat = MINIDUMP_MMU_FORMAT_V6; +#else + mdhdr.mmuformat = MINIDUMP_MMU_FORMAT_V4; +#endif mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_ARM_VERSION, dumpsize, di->blocksize); Modified: head/sys/arm/include/minidump.h ============================================================================== --- head/sys/arm/include/minidump.h Fri Jan 15 18:27:34 2016 (r294097) +++ head/sys/arm/include/minidump.h Fri Jan 15 18:53:06 2016 (r294098) @@ -28,11 +28,18 @@ */ #ifndef _MACHINE_MINIDUMP_H_ -#define _MACHINE_MINIDUMP_H_ 1 +#define _MACHINE_MINIDUMP_H_ #define MINIDUMP_MAGIC "minidump FreeBSD/arm" #define MINIDUMP_VERSION 1 +/* + * The first page of vmcore is dedicated to the following header. + * As the rest of the page is zeroed, any header extension can be + * done without version bumping. It should be taken into account + * only that new entries will be zero in old vmcores. + */ + struct minidumphdr { char magic[24]; uint32_t version; @@ -40,6 +47,13 @@ struct minidumphdr { uint32_t bitmapsize; uint32_t ptesize; uint32_t kernbase; + uint32_t arch; + uint32_t mmuformat; }; +#define MINIDUMP_MMU_FORMAT_UNKNOWN 0 +#define MINIDUMP_MMU_FORMAT_V4 1 +#define MINIDUMP_MMU_FORMAT_V6 2 +#define MINIDUMP_MMU_FORMAT_V6_LPAE 3 + #endif /* _MACHINE_MINIDUMP_H_ */ From owner-svn-src-head@freebsd.org Fri Jan 15 21:45:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDC1FA83483; Fri, 15 Jan 2016 21:45:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9117A14EA; Fri, 15 Jan 2016 21:45:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FLjrdr087152; Fri, 15 Jan 2016 21:45:53 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FLjrOi087151; Fri, 15 Jan 2016 21:45:53 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601152145.u0FLjrOi087151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 15 Jan 2016 21:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294102 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 21:45:54 -0000 Author: dim Date: Fri Jan 15 21:45:53 2016 New Revision: 294102 URL: https://svnweb.freebsd.org/changeset/base/294102 Log: MFV r294101: 6527 Possible access beyond end of string in zpool comment Reviewed by: George Wilson Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Approved by: Gordon Ross illumos/illumos-gate@2bd7a8d078223b122d65fea49bb8641f858b1409 This fixes erroneous double increments of the 'check' variable in a loop in spa_prop_validate(). I ran into this in the clang380-import branch, where clang 3.8.0 warns about it. (It is already fixed there.) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jan 15 21:41:45 2016 (r294101) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jan 15 21:45:53 2016 (r294102) @@ -610,7 +610,6 @@ spa_prop_validate(spa_t *spa, nvlist_t * error = SET_ERROR(EINVAL); break; } - check++; } if (strlen(strval) > ZPROP_MAX_COMMENT) error = E2BIG; From owner-svn-src-head@freebsd.org Fri Jan 15 21:59:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1E7BA83880; Fri, 15 Jan 2016 21:59:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 896451BF2; Fri, 15 Jan 2016 21:59:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FLxIqU090330; Fri, 15 Jan 2016 21:59:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FLxIdA090329; Fri, 15 Jan 2016 21:59:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601152159.u0FLxIdA090329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 15 Jan 2016 21:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294103 - head/tools/regression/sockets/accf_data_attach X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 21:59:19 -0000 Author: ngie Date: Fri Jan 15 21:59:18 2016 New Revision: 294103 URL: https://svnweb.freebsd.org/changeset/base/294103 Log: - Check for accf_filter before running the tests, otherwise it will always fail at subtest 9/11 - Use strncpy instead of strcpy with afa.af_name Modified: head/tools/regression/sockets/accf_data_attach/accf_data_attach.c Modified: head/tools/regression/sockets/accf_data_attach/accf_data_attach.c ============================================================================== --- head/tools/regression/sockets/accf_data_attach/accf_data_attach.c Fri Jan 15 21:45:53 2016 (r294102) +++ head/tools/regression/sockets/accf_data_attach/accf_data_attach.c Fri Jan 15 21:59:18 2016 (r294103) @@ -27,6 +27,7 @@ */ #include +#include #include #include @@ -65,6 +66,16 @@ main(void) socklen_t len; int lso, ret; + /* XXX: PLAIN_TEST_REQUIRE_MODULE "backport" for stable/9 */ + const char *_mod_name = "accf_data"; + + if (modfind(_mod_name) == -1) { + printf("1..0 # SKIP - module %s could not be resolved: %s\n", + _mod_name, strerror(errno)); + _exit(0); + } + /* XXX: PLAIN_TEST_REQUIRE_MODULE for stable/9 */ + printf("1..11\n"); /* @@ -119,7 +130,7 @@ main(void) * yet a listen() socket. */ bzero(&afa, sizeof(afa)); - strcpy(afa.af_name, ACCF_NAME); + strncpy(afa.af_name, ACCF_NAME, sizeof(afa.af_name)); ret = setsockopt(lso, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa)); if (ret == 0) errx(-1, "not ok 5 - setsockopt() before listen() succeeded"); @@ -164,7 +175,7 @@ main(void) * Step 8: After listen(). This call to setsockopt() should succeed. */ bzero(&afa, sizeof(afa)); - strcpy(afa.af_name, ACCF_NAME); + strncpy(afa.af_name, ACCF_NAME, sizeof(afa.af_name)); ret = setsockopt(lso, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa)); if (ret != 0) errx(-1, "not ok 9 - setsockopt() after listen() failed with %d " From owner-svn-src-head@freebsd.org Fri Jan 15 22:08:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1082A83C17; Fri, 15 Jan 2016 22:08:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74C99122B; Fri, 15 Jan 2016 22:08:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FM8p9G093290; Fri, 15 Jan 2016 22:08:51 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FM8pPP093288; Fri, 15 Jan 2016 22:08:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601152208.u0FM8pPP093288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 15 Jan 2016 22:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294104 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 22:08:52 -0000 Author: bdrewery Date: Fri Jan 15 22:08:51 2016 New Revision: 294104 URL: https://svnweb.freebsd.org/changeset/base/294104 Log: FAST_DEPEND: Rework optimization for r290524. The .MAKEFLAGS check inside of the .for loop is extremely slow for some reason. Just moving it out of the loop trimmed -V lookup time from 11 seconds to 1 second in the kernel obj directory. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/sys/conf/kern.post.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Fri Jan 15 21:59:18 2016 (r294103) +++ head/share/mk/bsd.dep.mk Fri Jan 15 22:08:51 2016 (r294104) @@ -170,12 +170,12 @@ DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.c .if !empty(DEPENDSRCS) DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} .endif -.for __obj in ${DEPENDOBJS:O:u} +DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./} .if ${.MAKEFLAGS:M-V} == "" -.sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}" -.endif -DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}} +.for __depend_obj in ${DEPENDFILES_OBJS} +.sinclude "${__depend_obj}" .endfor +.endif .endif # ${MK_FAST_DEPEND} == "yes" .endif # defined(SRCS) Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Fri Jan 15 21:59:18 2016 (r294103) +++ head/sys/conf/kern.post.mk Fri Jan 15 22:08:51 2016 (r294104) @@ -206,12 +206,12 @@ DEPEND_CFLAGS+= -MD -MP -MF.depend.${.TA DEPEND_CFLAGS+= -MT${.TARGET} CFLAGS+= ${DEPEND_CFLAGS} DEPENDOBJS+= ${SYSTEM_OBJS} -.for __obj in ${DEPENDOBJS:O:u} +DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/.depend./} .if ${.MAKEFLAGS:M-V} == "" -.sinclude ".depend.${__obj}" -.endif -DEPENDFILES_OBJS+= .depend.${__obj} +.for __depend_obj in ${DEPENDFILES_OBJS} +.sinclude "${__depend_obj}" .endfor +.endif .endif # ${MK_FAST_DEPEND} == "yes" .NOPATH: .depend ${DEPENDFILES_OBJS} From owner-svn-src-head@freebsd.org Fri Jan 15 22:09:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C02BA83C3F; Fri, 15 Jan 2016 22:09:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 418371372; Fri, 15 Jan 2016 22:09:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FM8xpD093338; Fri, 15 Jan 2016 22:08:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FM8xqV093337; Fri, 15 Jan 2016 22:08:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601152208.u0FM8xqV093337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 15 Jan 2016 22:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294105 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 22:09:00 -0000 Author: bdrewery Date: Fri Jan 15 22:08:58 2016 New Revision: 294105 URL: https://svnweb.freebsd.org/changeset/base/294105 Log: FAST_DEPEND: Fix incremental builds leading to kernel panics. This fixes .depend.genassym.o not being included. genassym.o depends on all of the system headers and when rebuilt regenerates assym.s which lists offsets for critial .S files to utilize. By having a struct in a system header change its offsets and not have generassym.o be rebuilt, this would lead to panics. The flaw in the initial commit was seeing ${OBJS} in ${SYSTEM_OBJS} and assuming it had all of ${SRCS} in it. This is not the case though. The older mkdep code splits out all of the various SRC lists for generating the .depend file. It also includes ${GEN_CFILES}, which had genassym.c and was the only significant file lacking from ${SYSTEM_OBJS} upon inspection, since it is not linked in. Rather than duplicate the likely soon-to-be-removed mkdep lists, just add genassym.o to the DEPENDOBJS list. Using ${SRCS} as bsd.dep.mk does would be nice but there are many files in the build that are only added to ${OBJS} and not ${SRCS}, such as bf_enc.o derived from bf_enc.S for i386. Sponsored by: EMC / Isilon Storage Division Reported by: dhw (several panics on current@) Pointyhat to: bdrewery Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Fri Jan 15 22:08:51 2016 (r294104) +++ head/sys/conf/kern.post.mk Fri Jan 15 22:08:58 2016 (r294105) @@ -205,7 +205,7 @@ DEPENDFILES+= .depend.* DEPEND_CFLAGS+= -MD -MP -MF.depend.${.TARGET} DEPEND_CFLAGS+= -MT${.TARGET} CFLAGS+= ${DEPEND_CFLAGS} -DEPENDOBJS+= ${SYSTEM_OBJS} +DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/.depend./} .if ${.MAKEFLAGS:M-V} == "" .for __depend_obj in ${DEPENDFILES_OBJS} From owner-svn-src-head@freebsd.org Fri Jan 15 22:58:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5CB6A84A5C; Fri, 15 Jan 2016 22:58:24 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71BEF1EFE; Fri, 15 Jan 2016 22:58:24 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FMwNmY008177; Fri, 15 Jan 2016 22:58:23 GMT (envelope-from ak@FreeBSD.org) Received: (from ak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FMwN67008175; Fri, 15 Jan 2016 22:58:23 GMT (envelope-from ak@FreeBSD.org) Message-Id: <201601152258.u0FMwN67008175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ak set sender to ak@FreeBSD.org using -f From: Alex Kozlov Date: Fri, 15 Jan 2016 22:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294107 - head/usr.bin/unzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 22:58:24 -0000 Author: ak (ports committer) Date: Fri Jan 15 22:58:23 2016 New Revision: 294107 URL: https://svnweb.freebsd.org/changeset/base/294107 Log: - Extract common code from extract()/extract_stdout() to extract2fd() - Update information about central directory handling Obtained from: NetBSD Approved by: des Modified: head/usr.bin/unzip/unzip.1 head/usr.bin/unzip/unzip.c Modified: head/usr.bin/unzip/unzip.1 ============================================================================== --- head/usr.bin/unzip/unzip.1 Fri Jan 15 22:49:20 2016 (r294106) +++ head/usr.bin/unzip/unzip.1 Fri Jan 15 22:58:23 2016 (r294107) @@ -154,8 +154,8 @@ option should only affect files which ar zipfile's central directory. Since the .Xr archive 3 -library reads zipfiles sequentially, and does not use the central -directory, that information is not available to the +library does not provide access to that information, it is not available +to the .Nm utility. Instead, the Modified: head/usr.bin/unzip/unzip.c ============================================================================== --- head/usr.bin/unzip/unzip.c Fri Jan 15 22:49:20 2016 (r294106) +++ head/usr.bin/unzip/unzip.c Fri Jan 15 22:58:23 2016 (r294107) @@ -488,6 +488,92 @@ check_binary(const unsigned char *buf, s } /* + * Extract to a file descriptor + */ +static int +extract2fd(struct archive *a, char *pathname, int fd) +{ + int cr, text, warn; + ssize_t len; + unsigned char *p, *q, *end; + + text = a_opt; + warn = 0; + cr = 0; + + /* loop over file contents and write to fd */ + for (int n = 0; ; n++) { + if (fd != STDOUT_FILENO) + if (tty && (n % 4) == 0) + info(" %c\b\b", spinner[(n / 4) % sizeof spinner]); + + len = archive_read_data(a, buffer, sizeof buffer); + + if (len < 0) + ac(len); + + /* left over CR from previous buffer */ + if (a_opt && cr) { + if (len == 0 || buffer[0] != '\n') + if (write(fd, "\r", 1) != 1) + error("write('%s')", pathname); + cr = 0; + } + + /* EOF */ + if (len == 0) + break; + end = buffer + len; + + /* + * Detect whether this is a text file. The correct way to + * do this is to check the least significant bit of the + * "internal file attributes" field of the corresponding + * file header in the central directory, but libarchive + * does not provide access to this field, so we have to + * guess by looking for non-ASCII characters in the + * buffer. Hopefully we won't guess wrong. If we do + * guess wrong, we print a warning message later. + */ + if (a_opt && n == 0) { + if (check_binary(buffer, len)) + text = 0; + } + + /* simple case */ + if (!a_opt || !text) { + if (write(fd, buffer, len) != len) + error("write('%s')", pathname); + continue; + } + + /* hard case: convert \r\n to \n (sigh...) */ + for (p = buffer; p < end; p = q + 1) { + for (q = p; q < end; q++) { + if (!warn && BYTE_IS_BINARY(*q)) { + warningx("%s may be corrupted due" + " to weak text file detection" + " heuristic", pathname); + warn = 1; + } + if (q[0] != '\r') + continue; + if (&q[1] == end) { + cr = 1; + break; + } + if (q[1] == '\n') + break; + } + if (write(fd, p, q - p) != q - p) + error("write('%s')", pathname); + } + } + + return text; +} + +/* * Extract a regular file. */ static void @@ -497,10 +583,8 @@ extract_file(struct archive *a, struct a struct timespec mtime; struct stat sb; struct timespec ts[2]; - int cr, fd, text, warn, check; - ssize_t len; + int fd, check, text; const char *linkname; - unsigned char *p, *q, *end; mode = archive_entry_mode(e) & 0777; if (mode == 0) @@ -558,77 +642,10 @@ recheck: if ((fd = open(*path, O_RDWR|O_CREAT|O_TRUNC, mode)) < 0) error("open('%s')", *path); - /* loop over file contents and write to disk */ info(" extracting: %s", *path); - text = a_opt; - warn = 0; - cr = 0; - for (int n = 0; ; n++) { - if (tty && (n % 4) == 0) - info(" %c\b\b", spinner[(n / 4) % sizeof spinner]); - len = archive_read_data(a, buffer, sizeof buffer); + text = extract2fd(a, *path, fd); - if (len < 0) - ac(len); - - /* left over CR from previous buffer */ - if (a_opt && cr) { - if (len == 0 || buffer[0] != '\n') - if (write(fd, "\r", 1) != 1) - error("write('%s')", *path); - cr = 0; - } - - /* EOF */ - if (len == 0) - break; - end = buffer + len; - - /* - * Detect whether this is a text file. The correct way to - * do this is to check the least significant bit of the - * "internal file attributes" field of the corresponding - * file header in the central directory, but libarchive - * does not read the central directory, so we have to - * guess by looking for non-ASCII characters in the - * buffer. Hopefully we won't guess wrong. If we do - * guess wrong, we print a warning message later. - */ - if (a_opt && n == 0) { - if (check_binary(buffer, len)) - text = 0; - } - - /* simple case */ - if (!a_opt || !text) { - if (write(fd, buffer, len) != len) - error("write('%s')", *path); - continue; - } - - /* hard case: convert \r\n to \n (sigh...) */ - for (p = buffer; p < end; p = q + 1) { - for (q = p; q < end; q++) { - if (!warn && BYTE_IS_BINARY(*q)) { - warningx("%s may be corrupted due" - " to weak text file detection" - " heuristic", *path); - warn = 1; - } - if (q[0] != '\r') - continue; - if (&q[1] == end) { - cr = 1; - break; - } - if (q[1] == '\n') - break; - } - if (write(fd, p, q - p) != q - p) - error("write('%s')", *path); - } - } if (tty) info(" \b\b"); if (text) @@ -726,9 +743,6 @@ extract_stdout(struct archive *a, struct { char *pathname; mode_t filetype; - int cr, text, warn; - ssize_t len; - unsigned char *p, *q, *end; pathname = pathdup(archive_entry_pathname(e)); filetype = archive_entry_filetype(e); @@ -758,73 +772,7 @@ extract_stdout(struct archive *a, struct if (c_opt) info("x %s\n", pathname); - text = a_opt; - warn = 0; - cr = 0; - for (int n = 0; ; n++) { - len = archive_read_data(a, buffer, sizeof buffer); - - if (len < 0) - ac(len); - - /* left over CR from previous buffer */ - if (a_opt && cr) { - if (len == 0 || buffer[0] != '\n') { - if (fwrite("\r", 1, 1, stderr) != 1) - error("write('%s')", pathname); - } - cr = 0; - } - - /* EOF */ - if (len == 0) - break; - end = buffer + len; - - /* - * Detect whether this is a text file. The correct way to - * do this is to check the least significant bit of the - * "internal file attributes" field of the corresponding - * file header in the central directory, but libarchive - * does not read the central directory, so we have to - * guess by looking for non-ASCII characters in the - * buffer. Hopefully we won't guess wrong. If we do - * guess wrong, we print a warning message later. - */ - if (a_opt && n == 0) { - if (check_binary(buffer, len)) - text = 0; - } - - /* simple case */ - if (!a_opt || !text) { - if (fwrite(buffer, 1, len, stdout) != (size_t)len) - error("write('%s')", pathname); - continue; - } - - /* hard case: convert \r\n to \n (sigh...) */ - for (p = buffer; p < end; p = q + 1) { - for (q = p; q < end; q++) { - if (!warn && BYTE_IS_BINARY(*q)) { - warningx("%s may be corrupted due" - " to weak text file detection" - " heuristic", pathname); - warn = 1; - } - if (q[0] != '\r') - continue; - if (&q[1] == end) { - cr = 1; - break; - } - if (q[1] == '\n') - break; - } - if (fwrite(p, 1, q - p, stdout) != (size_t)(q - p)) - error("write('%s')", pathname); - } - } + (void)extract2fd(a, pathname, STDOUT_FILENO); free(pathname); } From owner-svn-src-head@freebsd.org Fri Jan 15 23:04:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1559A84C93; Fri, 15 Jan 2016 23:04:37 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A01121480; Fri, 15 Jan 2016 23:04:37 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FN4aaj010988; Fri, 15 Jan 2016 23:04:36 GMT (envelope-from ak@FreeBSD.org) Received: (from ak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FN4adm010987; Fri, 15 Jan 2016 23:04:36 GMT (envelope-from ak@FreeBSD.org) Message-Id: <201601152304.u0FN4adm010987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ak set sender to ak@FreeBSD.org using -f From: Alex Kozlov Date: Fri, 15 Jan 2016 23:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294108 - head/usr.bin/unzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 23:04:37 -0000 Author: ak (ports committer) Date: Fri Jan 15 23:04:36 2016 New Revision: 294108 URL: https://svnweb.freebsd.org/changeset/base/294108 Log: - Match directory extraction message with Infozip [1] - Add comment explaining masks in check_binary() Obtained from: NetBSD [1] Approved by: des Modified: head/usr.bin/unzip/unzip.c Modified: head/usr.bin/unzip/unzip.c ============================================================================== --- head/usr.bin/unzip/unzip.c Fri Jan 15 22:58:23 2016 (r294107) +++ head/usr.bin/unzip/unzip.c Fri Jan 15 23:04:36 2016 (r294108) @@ -403,7 +403,7 @@ extract_dir(struct archive *a, struct ar if (mode & 0004) mode |= 0001; - info("d %s\n", path); + info(" creating: %s/\n", path); make_dir(path, mode); ac(archive_read_data_skip(a)); } @@ -466,7 +466,9 @@ handle_existing_file(char **path) * one white-listed byte has to be found. * * Black-listed: 0..6, 14..25, 28..31 + * 0xf3ffc07f = 11110011111111111100000001111111b * White-listed: 9..10, 13, >= 32 + * 0x00002600 = 00000000000000000010011000000000b * * See the proginfo/txtvsbin.txt in the zip sources for a detailed discussion. */ @@ -930,7 +932,8 @@ static void usage(void) { - fprintf(stderr, "Usage: unzip [-aCcfjLlnopqtuvyZ1] [-d dir] [-x pattern] zipfile\n"); + fprintf(stderr, "Usage: unzip [-aCcfjLlnopqtuvyZ1] [-d dir] [-x pattern] " + "zipfile\n"); exit(1); } From owner-svn-src-head@freebsd.org Fri Jan 15 23:13:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F7D7A84F91; Fri, 15 Jan 2016 23:13:02 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61BE21D55; Fri, 15 Jan 2016 23:13:02 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FND1Fc014025; Fri, 15 Jan 2016 23:13:01 GMT (envelope-from ak@FreeBSD.org) Received: (from ak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FND11p014024; Fri, 15 Jan 2016 23:13:01 GMT (envelope-from ak@FreeBSD.org) Message-Id: <201601152313.u0FND11p014024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ak set sender to ak@FreeBSD.org using -f From: Alex Kozlov Date: Fri, 15 Jan 2016 23:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294111 - head/usr.bin/less X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 23:13:02 -0000 Author: ak (ports committer) Date: Fri Jan 15 23:13:01 2016 New Revision: 294111 URL: https://svnweb.freebsd.org/changeset/base/294111 Log: - Add support for zip to lesspipe.sh Approved by: des Modified: head/usr.bin/less/lesspipe.sh Modified: head/usr.bin/less/lesspipe.sh ============================================================================== --- head/usr.bin/less/lesspipe.sh Fri Jan 15 23:10:37 2016 (r294110) +++ head/usr.bin/less/lesspipe.sh Fri Jan 15 23:13:01 2016 (r294111) @@ -4,6 +4,9 @@ # $FreeBSD$ case "$1" in + *.zip) + exec unzip -c "$1" 2>/dev/null + ;; *.Z) exec uncompress -c "$1" 2>/dev/null ;; From owner-svn-src-head@freebsd.org Fri Jan 15 23:28:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1054A833A7; Fri, 15 Jan 2016 23:28:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86A29148A; Fri, 15 Jan 2016 23:28:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0FNSDU2017220; Fri, 15 Jan 2016 23:28:13 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0FNSCRX017208; Fri, 15 Jan 2016 23:28:12 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201601152328.u0FNSCRX017208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 15 Jan 2016 23:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294113 - in head: . contrib/mdocml etc/mtree usr.bin/mandoc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 23:28:15 -0000 Author: bapt Date: Fri Jan 15 23:28:12 2016 New Revision: 294113 URL: https://svnweb.freebsd.org/changeset/base/294113 Log: Update mandoc to 20160116 Added: head/contrib/mdocml/compat_err.c - copied unchanged from r294112, vendor/mdocml/dist/compat_err.c head/contrib/mdocml/compat_getline.c - copied unchanged from r294112, vendor/mdocml/dist/compat_getline.c head/contrib/mdocml/compat_isblank.c - copied unchanged from r294112, vendor/mdocml/dist/compat_isblank.c head/contrib/mdocml/compat_mkdtemp.c - copied unchanged from r294112, vendor/mdocml/dist/compat_mkdtemp.c head/contrib/mdocml/compat_progname.c - copied unchanged from r294112, vendor/mdocml/dist/compat_progname.c head/contrib/mdocml/compat_stringlist.c - copied unchanged from r294112, vendor/mdocml/dist/compat_stringlist.c head/contrib/mdocml/compat_stringlist.h - copied unchanged from r294112, vendor/mdocml/dist/compat_stringlist.h head/contrib/mdocml/compat_vasprintf.c - copied unchanged from r294112, vendor/mdocml/dist/compat_vasprintf.c head/contrib/mdocml/config.log - copied unchanged from r294112, vendor/mdocml/dist/config.log head/contrib/mdocml/man.conf.5 - copied unchanged from r294112, vendor/mdocml/dist/man.conf.5 head/contrib/mdocml/manconf.h - copied unchanged from r294112, vendor/mdocml/dist/manconf.h head/contrib/mdocml/mandoc.css - copied unchanged from r294112, vendor/mdocml/dist/mandoc.css head/contrib/mdocml/mandoc_ohash.c - copied unchanged from r294112, vendor/mdocml/dist/mandoc_ohash.c head/contrib/mdocml/mandoc_ohash.h - copied unchanged from r294112, vendor/mdocml/dist/mandoc_ohash.h head/contrib/mdocml/mdoc_state.c - copied unchanged from r294112, vendor/mdocml/dist/mdoc_state.c head/contrib/mdocml/roff.h - copied unchanged from r294112, vendor/mdocml/dist/roff.h head/contrib/mdocml/roff_int.h - copied unchanged from r294112, vendor/mdocml/dist/roff_int.h head/contrib/mdocml/soelim.1 - copied unchanged from r294112, vendor/mdocml/dist/soelim.1 head/contrib/mdocml/soelim.c - copied unchanged from r294112, vendor/mdocml/dist/soelim.c head/contrib/mdocml/tag.c - copied unchanged from r294112, vendor/mdocml/dist/tag.c head/contrib/mdocml/tag.h - copied unchanged from r294112, vendor/mdocml/dist/tag.h head/contrib/mdocml/test-err.c - copied unchanged from r294112, vendor/mdocml/dist/test-err.c head/contrib/mdocml/test-getline.c - copied unchanged from r294112, vendor/mdocml/dist/test-getline.c head/contrib/mdocml/test-isblank.c - copied unchanged from r294112, vendor/mdocml/dist/test-isblank.c head/contrib/mdocml/test-mkdtemp.c - copied unchanged from r294112, vendor/mdocml/dist/test-mkdtemp.c head/contrib/mdocml/test-pledge.c - copied unchanged from r294112, vendor/mdocml/dist/test-pledge.c head/contrib/mdocml/test-progname.c - copied unchanged from r294112, vendor/mdocml/dist/test-progname.c head/contrib/mdocml/test-rewb-bsd.c - copied unchanged from r294112, vendor/mdocml/dist/test-rewb-bsd.c head/contrib/mdocml/test-rewb-sysv.c - copied unchanged from r294112, vendor/mdocml/dist/test-rewb-sysv.c head/contrib/mdocml/test-stringlist.c - copied unchanged from r294112, vendor/mdocml/dist/test-stringlist.c head/contrib/mdocml/test-vasprintf.c - copied unchanged from r294112, vendor/mdocml/dist/test-vasprintf.c Deleted: head/contrib/mdocml/chars.in head/contrib/mdocml/compat_fgetln.c head/contrib/mdocml/example.style.css head/contrib/mdocml/style.css Modified: head/ObsoleteFiles.inc head/contrib/mdocml/INSTALL head/contrib/mdocml/LICENSE head/contrib/mdocml/Makefile head/contrib/mdocml/Makefile.depend head/contrib/mdocml/NEWS head/contrib/mdocml/TODO head/contrib/mdocml/apropos.1 head/contrib/mdocml/att.c head/contrib/mdocml/cgi.c head/contrib/mdocml/cgi.h.example head/contrib/mdocml/chars.c head/contrib/mdocml/compat_fts.c head/contrib/mdocml/compat_fts.h head/contrib/mdocml/compat_ohash.h head/contrib/mdocml/compat_sqlite3_errstr.c head/contrib/mdocml/config.h head/contrib/mdocml/configure head/contrib/mdocml/configure.local.example head/contrib/mdocml/demandoc.c head/contrib/mdocml/eqn.7 head/contrib/mdocml/eqn.c head/contrib/mdocml/gmdiff head/contrib/mdocml/html.c head/contrib/mdocml/html.h head/contrib/mdocml/lib.c head/contrib/mdocml/libman.h head/contrib/mdocml/libmandoc.h head/contrib/mdocml/libmdoc.h head/contrib/mdocml/libroff.h head/contrib/mdocml/main.c head/contrib/mdocml/main.h head/contrib/mdocml/man.1 head/contrib/mdocml/man.c head/contrib/mdocml/man.cgi.8 head/contrib/mdocml/man.h head/contrib/mdocml/man_hash.c head/contrib/mdocml/man_html.c head/contrib/mdocml/man_macro.c head/contrib/mdocml/man_term.c head/contrib/mdocml/man_validate.c head/contrib/mdocml/mandoc.1 head/contrib/mdocml/mandoc.3 head/contrib/mdocml/mandoc.c head/contrib/mdocml/mandoc.h head/contrib/mdocml/mandoc_aux.c head/contrib/mdocml/mandoc_aux.h head/contrib/mdocml/mandoc_char.7 head/contrib/mdocml/mandoc_headers.3 head/contrib/mdocml/mandocdb.c head/contrib/mdocml/manpage.c head/contrib/mdocml/manpath.c head/contrib/mdocml/mansearch.3 head/contrib/mdocml/mansearch.c head/contrib/mdocml/mansearch.h head/contrib/mdocml/mchars_alloc.3 head/contrib/mdocml/mdoc.7 head/contrib/mdocml/mdoc.c head/contrib/mdocml/mdoc.h head/contrib/mdocml/mdoc_argv.c head/contrib/mdocml/mdoc_hash.c head/contrib/mdocml/mdoc_html.c head/contrib/mdocml/mdoc_macro.c head/contrib/mdocml/mdoc_man.c head/contrib/mdocml/mdoc_term.c head/contrib/mdocml/mdoc_validate.c head/contrib/mdocml/msec.c head/contrib/mdocml/out.c head/contrib/mdocml/out.h head/contrib/mdocml/preconv.c head/contrib/mdocml/read.c head/contrib/mdocml/roff.7 head/contrib/mdocml/roff.c head/contrib/mdocml/st.c head/contrib/mdocml/tbl.c head/contrib/mdocml/tbl_data.c head/contrib/mdocml/tbl_html.c head/contrib/mdocml/tbl_layout.c head/contrib/mdocml/tbl_opts.c head/contrib/mdocml/tbl_term.c head/contrib/mdocml/term.c head/contrib/mdocml/term.h head/contrib/mdocml/term_ascii.c head/contrib/mdocml/term_ps.c head/contrib/mdocml/test-dirent-namlen.c head/contrib/mdocml/test-fts.c head/contrib/mdocml/test-getsubopt.c head/contrib/mdocml/test-mmap.c head/contrib/mdocml/test-ohash.c head/contrib/mdocml/test-reallocarray.c head/contrib/mdocml/test-sqlite3.c head/contrib/mdocml/test-sqlite3_errstr.c head/contrib/mdocml/test-strcasestr.c head/contrib/mdocml/test-strlcat.c head/contrib/mdocml/test-strlcpy.c head/contrib/mdocml/test-strptime.c head/contrib/mdocml/test-strsep.c head/contrib/mdocml/test-strtonum.c head/contrib/mdocml/test-wchar.c head/contrib/mdocml/tree.c head/etc/mtree/BSD.usr.dist head/usr.bin/mandoc/Makefile Directory Properties: head/contrib/mdocml/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Jan 15 23:16:04 2016 (r294112) +++ head/ObsoleteFiles.inc Fri Jan 15 23:28:12 2016 (r294113) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20160116: Update mandoc to cvs snapshot 20160116 +OLD_FILES+=/usr/share/mdocml/example.style.css +OLD_FILES+=/usr/share/mdocml/style.css +OLD_DIRS+=/usr/share/mdocml # 20151225: new clang import which bumps version from 3.7.0 to 3.7.1. OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/asan_interface.h Modified: head/contrib/mdocml/INSTALL ============================================================================== --- head/contrib/mdocml/INSTALL Fri Jan 15 23:16:04 2016 (r294112) +++ head/contrib/mdocml/INSTALL Fri Jan 15 23:28:12 2016 (r294113) @@ -1,4 +1,4 @@ -$Id: INSTALL,v 1.10 2015/03/09 21:00:14 schwarze Exp $ +$Id: INSTALL,v 1.13 2015/11/07 14:01:16 schwarze Exp $ About mdocml, the portable mandoc distribution ---------------------------------------------- @@ -42,6 +42,8 @@ generates. If anything looks wrong or d wish, read the file "configure.local.example", create and edit a file "configure.local", and re-run "./configure" until the result seems right to you. +On Solaris 10 and earlier, you may have to run "ksh ./configure" +because the native /bin/sh lacks some POSIX features. 3. Run "make". Any POSIX-compatible make, in particular both BSD make and GNU make, @@ -82,9 +84,10 @@ manual page source. Understanding mandoc dependencies --------------------------------- -The mandoc(1), man(1), and demandoc(1) utilities have no external -dependencies, but makewhatis(8) and apropos(1) depend on the -following software: +The mandoc(1), man(1), and demandoc(1) utilities only depend +on the zlib library for decompressing gzipped manual pages, +but makewhatis(8) and apropos(1) depend on the following +additional software: 1. The SQLite database system, see . The recommended version of SQLite is 3.8.4.3 or newer. The mandoc @@ -107,6 +110,11 @@ If you run into that problem, set "HAVE_ If your system does not have it, the bundled compatibility version will be used, so you probably need not worry about it. +One of the chief design goals of the mandoc toolbox is to make +sure that nothing related to documentation requires C++. +Consequently, linking mandoc against any kind of C++ program +would defeat the purpose and is not supported. + Checking autoconfiguration quality ---------------------------------- Modified: head/contrib/mdocml/LICENSE ============================================================================== --- head/contrib/mdocml/LICENSE Fri Jan 15 23:16:04 2016 (r294112) +++ head/contrib/mdocml/LICENSE Fri Jan 15 23:28:12 2016 (r294113) @@ -1,4 +1,4 @@ -$Id: LICENSE,v 1.7 2015/02/16 14:56:22 schwarze Exp $ +$Id: LICENSE,v 1.11 2015/11/07 17:58:55 schwarze Exp $ With the exceptions noted below, all code and documentation contained in the mdocml toolkit is protected by the Copyright @@ -8,10 +8,12 @@ Copyright (c) 2008-2012, 2014 Kristaps D Copyright (c) 2010-2015 Ingo Schwarze Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger Copyright (c) 2013 Franco Fichtner +Copyright (c) 2014 Baptiste Daroussin Copyright (c) 1999, 2004 Marc Espie Copyright (c) 1998, 2004, 2010 Todd C. Miller Copyright (c) 2008 Otto Moerbeek Copyright (c) 2004 Ted Unangst +Copyright (c) 1994 Christos Zoulas Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre See the individual source files for information about who contributed @@ -35,13 +37,16 @@ OR IN CONNECTION WITH THE USE OR PERFORM The following files included from outside sources are protected by -other people's Copyright and are distributed under a 3-clause BSD -license; see these individual files for details. +other people's Copyright and are distributed under various 2-clause +and 3-clause BSD licenses; see these individual files for details. -compat_fts.c, compat_fts.h, +soelim.c, soelim.1: +Copyright (c) 2014 Baptiste Daroussin + +compat_err.c, compat_fts.c, compat_fts.h, compat_getsubopt.c, compat_strcasestr.c, compat_strsep.c, man.1: Copyright (c) 1989,1990,1993,1994 The Regents of the University of California -compat_fgetln.c: -Copyright (c) 1998 The NetBSD Foundation, Inc. +compat_stringlist.c, compat_stringlist.h: +Copyright (c) 1994 Christos Zoulas Modified: head/contrib/mdocml/Makefile ============================================================================== --- head/contrib/mdocml/Makefile Fri Jan 15 23:16:04 2016 (r294112) +++ head/contrib/mdocml/Makefile Fri Jan 15 23:28:12 2016 (r294113) @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.457 2015/03/13 12:35:32 schwarze Exp $ +# $Id: Makefile,v 1.480 2015/11/07 21:53:14 schwarze Exp $ # # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons # Copyright (c) 2011, 2013, 2014, 2015 Ingo Schwarze @@ -20,36 +20,49 @@ VERSION = 1.13.3 # === LIST OF FILES ==================================================== TESTSRCS = test-dirent-namlen.c \ - test-fgetln.c \ + test-err.c \ test-fts.c \ + test-getline.c \ test-getsubopt.c \ + test-isblank.c \ + test-mkdtemp.c \ test-mmap.c \ test-ohash.c \ + test-pledge.c \ + test-progname.c \ test-reallocarray.c \ test-sqlite3.c \ test-sqlite3_errstr.c \ test-strcasestr.c \ + test-stringlist.c \ test-strlcat.c \ test-strlcpy.c \ test-strptime.c \ test-strsep.c \ test-strtonum.c \ + test-vasprintf.c \ test-wchar.c SRCS = att.c \ cgi.c \ chars.c \ - compat_fgetln.c \ + compat_err.c \ compat_fts.c \ + compat_getline.c \ compat_getsubopt.c \ + compat_isblank.c \ + compat_mkdtemp.c \ compat_ohash.c \ + compat_progname.c \ compat_reallocarray.c \ compat_sqlite3_errstr.c \ compat_strcasestr.c \ + compat_stringlist.c \ compat_strlcat.c \ compat_strlcpy.c \ compat_strsep.c \ compat_strtonum.c \ + compat_vasprintf.c \ demandoc.c \ eqn.c \ eqn_html.c \ @@ -65,6 +78,7 @@ SRCS = att.c \ man_validate.c \ mandoc.c \ mandoc_aux.c \ + mandoc_ohash.c \ mandocdb.c \ manpage.c \ manpath.c \ @@ -76,6 +90,7 @@ SRCS = att.c \ mdoc_html.c \ mdoc_macro.c \ mdoc_man.c \ + mdoc_state.c \ mdoc_term.c \ mdoc_validate.c \ msec.c \ @@ -83,7 +98,9 @@ SRCS = att.c \ preconv.c \ read.c \ roff.c \ + soelim.c \ st.c \ + tag.c \ tbl.c \ tbl_data.c \ tbl_html.c \ @@ -93,8 +110,7 @@ SRCS = att.c \ term.c \ term_ascii.c \ term_ps.c \ - tree.c \ - $(TESTSRCS) + tree.c DISTFILES = INSTALL \ LICENSE \ @@ -104,14 +120,13 @@ DISTFILES = INSTALL \ TODO \ apropos.1 \ cgi.h.example \ - chars.in \ compat_fts.h \ compat_ohash.h \ + compat_stringlist.h \ configure \ configure.local.example \ demandoc.1 \ eqn.7 \ - example.style.css \ gmdiff \ html.h \ lib.in \ @@ -121,13 +136,15 @@ DISTFILES = INSTALL \ libroff.h \ main.h \ makewhatis.8 \ - man-cgi.css \ man.1 \ man.7 \ man.cgi.8 \ + man.conf.5 \ man.h \ + manconf.h \ mandoc.1 \ mandoc.3 \ + mandoc.css \ mandoc.db.5 \ mandoc.h \ mandoc_aux.h \ @@ -136,7 +153,7 @@ DISTFILES = INSTALL \ mandoc_headers.3 \ mandoc_html.3 \ mandoc_malloc.3 \ - manpath.h \ + mandoc_ohash.h \ mansearch.3 \ mansearch.h \ mchars_alloc.3 \ @@ -146,12 +163,15 @@ DISTFILES = INSTALL \ out.h \ predefs.in \ roff.7 \ + roff.h \ + soelim.1 \ st.in \ - style.css \ + tag.h \ tbl.3 \ tbl.7 \ term.h \ - $(SRCS) + $(SRCS) \ + $(TESTSRCS) LIBMAN_OBJS = man.o \ man_hash.o \ @@ -164,6 +184,7 @@ LIBMDOC_OBJS = att.o \ mdoc_argv.o \ mdoc_hash.o \ mdoc_macro.o \ + mdoc_state.o \ mdoc_validate.o \ st.o @@ -180,21 +201,27 @@ LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ chars.o \ mandoc.o \ mandoc_aux.o \ + mandoc_ohash.o \ msec.o \ preconv.o \ read.o -COMPAT_OBJS = compat_fgetln.o \ +COMPAT_OBJS = compat_err.o \ compat_fts.o \ + compat_getline.o \ compat_getsubopt.o \ + compat_isblank.o \ + compat_mkdtemp.o \ compat_ohash.o \ + compat_progname.o \ compat_reallocarray.o \ compat_sqlite3_errstr.o \ compat_strcasestr.o \ compat_strlcat.o \ compat_strlcpy.o \ compat_strsep.o \ - compat_strtonum.o + compat_strtonum.o \ + compat_vasprintf.o MANDOC_HTML_OBJS = eqn_html.o \ html.o \ @@ -218,6 +245,7 @@ BASE_OBJS = $(MANDOC_HTML_OBJS) \ main.o \ manpath.o \ out.o \ + tag.o \ tree.o MAIN_OBJS = $(BASE_OBJS) @@ -236,10 +264,18 @@ MANPAGE_OBJS = manpage.o mansearch.o ma DEMANDOC_OBJS = demandoc.o +SOELIM_OBJS = soelim.o \ + compat_err.o \ + compat_getline.o \ + compat_progname.o \ + compat_reallocarray.o \ + compat_stringlist.o + WWW_MANS = apropos.1.html \ demandoc.1.html \ man.1.html \ mandoc.1.html \ + soelim.1.html \ mandoc.3.html \ mandoc_escape.3.html \ mandoc_headers.3.html \ @@ -248,6 +284,7 @@ WWW_MANS = apropos.1.html \ mansearch.3.html \ mchars_alloc.3.html \ tbl.3.html \ + man.conf.5.html \ mandoc.db.5.html \ eqn.7.html \ man.7.html \ @@ -258,11 +295,12 @@ WWW_MANS = apropos.1.html \ makewhatis.8.html \ man.cgi.8.html \ man.h.html \ + manconf.h.html \ mandoc.h.html \ mandoc_aux.h.html \ - manpath.h.html \ mansearch.h.html \ - mdoc.h.html + mdoc.h.html \ + roff.h.html WWW_OBJS = mdocml.tar.gz \ mdocml.sha256 @@ -275,7 +313,7 @@ include Makefile.local all: base-build $(BUILD_TARGETS) Makefile.local -base-build: mandoc demandoc +base-build: mandoc demandoc soelim cgi-build: man.cgi @@ -301,33 +339,36 @@ clean: rm -f man.cgi $(CGI_OBJS) rm -f manpage $(MANPAGE_OBJS) rm -f demandoc $(DEMANDOC_OBJS) + rm -f soelim $(SOELIM_OBJS) rm -f $(WWW_MANS) $(WWW_OBJS) rm -rf *.dSYM base-install: base-build mkdir -p $(DESTDIR)$(BINDIR) - mkdir -p $(DESTDIR)$(EXAMPLEDIR) mkdir -p $(DESTDIR)$(LIBDIR) mkdir -p $(DESTDIR)$(INCLUDEDIR) mkdir -p $(DESTDIR)$(MANDIR)/man1 mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man5 mkdir -p $(DESTDIR)$(MANDIR)/man7 $(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR) + $(INSTALL_PROGRAM) soelim $(DESTDIR)$(BINDIR)/$(BINM_SOELIM) ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_MAN) $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) - $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h \ + $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h roff.h \ $(DESTDIR)$(INCLUDEDIR) $(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) soelim.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_SOELIM).1 $(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1 $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) man.conf.5 $(DESTDIR)$(MANDIR)/man5/${MANM_MANCONF}.5 $(INSTALL_MAN) man.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MAN}.7 $(INSTALL_MAN) mdoc.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MDOC}.7 $(INSTALL_MAN) roff.7 $(DESTDIR)$(MANDIR)/man7/${MANM_ROFF}.7 $(INSTALL_MAN) eqn.7 $(DESTDIR)$(MANDIR)/man7/${MANM_EQN}.7 $(INSTALL_MAN) tbl.7 $(DESTDIR)$(MANDIR)/man7/${MANM_TBL}.7 $(INSTALL_MAN) mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 - $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR) db-install: base-build mkdir -p $(DESTDIR)$(BINDIR) @@ -354,8 +395,7 @@ cgi-install: cgi-build mkdir -p $(DESTDIR)$(WWWPREFIX)/man/mandoc/man1 mkdir -p $(DESTDIR)$(WWWPREFIX)/man/mandoc/man8 $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) - $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css - $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR) + $(INSTALL_DATA) mandoc.css $(DESTDIR)$(HTDOCDIR) $(INSTALL_MAN) apropos.1 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man1/ $(INSTALL_MAN) man.cgi.8 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man8/ @@ -376,13 +416,16 @@ man.cgi: $(CGI_OBJS) libmandoc.a $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) demandoc: $(DEMANDOC_OBJS) libmandoc.a - $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a $(DBLIB) + +soelim: $(SOELIM_OBJS) + $(CC) $(LDFLAGS) -o $@ $(SOELIM_OBJS) # --- maintainer targets --- www-install: www mkdir -p $(HTDOCDIR)/snapshots - $(INSTALL_DATA) $(WWW_MANS) style.css $(HTDOCDIR) + $(INSTALL_DATA) $(WWW_MANS) mandoc.css $(HTDOCDIR) $(INSTALL_DATA) $(WWW_OBJS) $(HTDOCDIR)/snapshots $(INSTALL_DATA) mdocml.tar.gz \ $(HTDOCDIR)/snapshots/mdocml-$(VERSION).tar.gz @@ -416,4 +459,4 @@ mdocml.tar.gz: $(DISTFILES) .1.1.html .3.3.html .5.5.html .7.7.html .8.8.html: mandoc ./mandoc -Thtml -Wall,stop \ - -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< > $@ + -Ostyle=mandoc.css,man=%N.%S.html,includes=%I.html $< > $@ Modified: head/contrib/mdocml/Makefile.depend ============================================================================== --- head/contrib/mdocml/Makefile.depend Fri Jan 15 23:16:04 2016 (r294112) +++ head/contrib/mdocml/Makefile.depend Fri Jan 15 23:28:12 2016 (r294113) @@ -1,51 +1,61 @@ -att.o: att.c config.h mdoc.h libmdoc.h -cgi.o: cgi.c config.h mandoc.h mandoc_aux.h main.h manpath.h mansearch.h cgi.h -chars.o: chars.c config.h mandoc.h mandoc_aux.h libmandoc.h chars.in -compat_fgetln.o: compat_fgetln.c config.h +att.o: att.c config.h roff.h mdoc.h libmdoc.h +cgi.o: cgi.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h main.h manconf.h mansearch.h cgi.h +chars.o: chars.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h libmandoc.h +compat_err.o: compat_err.c config.h compat_fts.o: compat_fts.c config.h compat_fts.h +compat_getline.o: compat_getline.c config.h compat_getsubopt.o: compat_getsubopt.c config.h +compat_isblank.o: compat_isblank.c config.h +compat_mkdtemp.o: compat_mkdtemp.c config.h compat_ohash.o: compat_ohash.c config.h compat_ohash.h +compat_progname.o: compat_progname.c config.h compat_reallocarray.o: compat_reallocarray.c config.h compat_sqlite3_errstr.o: compat_sqlite3_errstr.c config.h compat_strcasestr.o: compat_strcasestr.c config.h +compat_stringlist.o: compat_stringlist.c config.h compat_stringlist.h compat_strlcat.o: compat_strlcat.c config.h compat_strlcpy.o: compat_strlcpy.c config.h compat_strsep.o: compat_strsep.c config.h compat_strtonum.o: compat_strtonum.c config.h -demandoc.o: demandoc.c config.h man.h mdoc.h mandoc.h +compat_vasprintf.o: compat_vasprintf.c config.h +demandoc.o: demandoc.c config.h roff.h man.h mdoc.h mandoc.h eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h eqn_term.o: eqn_term.c config.h mandoc.h out.h term.h -html.o: html.c config.h mandoc.h mandoc_aux.h out.h html.h main.h -lib.o: lib.c config.h mdoc.h libmdoc.h lib.in -main.o: main.c config.h mandoc.h mandoc_aux.h main.h mdoc.h man.h manpath.h mansearch.h -man.o: man.c config.h man.h mandoc.h mandoc_aux.h libman.h libmandoc.h -man_hash.o: man_hash.c config.h man.h libman.h -man_html.o: man_html.c config.h mandoc_aux.h man.h out.h html.h main.h -man_macro.o: man_macro.c config.h man.h mandoc.h libmandoc.h libman.h -man_term.o: man_term.c config.h mandoc.h mandoc_aux.h out.h man.h term.h main.h -man_validate.o: man_validate.c config.h man.h mandoc.h mandoc_aux.h libman.h libmandoc.h +html.o: html.c config.h mandoc.h mandoc_aux.h out.h html.h manconf.h main.h +lib.o: lib.c config.h roff.h mdoc.h libmdoc.h lib.in +main.o: main.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h tag.h main.h manconf.h mansearch.h +man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h +man_hash.o: man_hash.c config.h roff.h man.h libman.h +man_html.o: man_html.c config.h mandoc_aux.h roff.h man.h out.h html.h main.h +man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h +man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h main.h +man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h mandoc.o: mandoc.c config.h mandoc.h mandoc_aux.h libmandoc.h mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h -mandocdb.o: mandocdb.c config.h compat_fts.h compat_ohash.h mdoc.h man.h mandoc.h mandoc_aux.h manpath.h mansearch.h -manpage.o: manpage.c config.h manpath.h mansearch.h -manpath.o: manpath.c config.h mandoc_aux.h manpath.h -mansearch.o: mansearch.c config.h compat_ohash.h mandoc.h mandoc_aux.h manpath.h mansearch.h +mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h +mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h manconf.h mansearch.h +manpage.o: manpage.c config.h manconf.h mansearch.h +manpath.o: manpath.c config.h mandoc_aux.h manconf.h +mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h mansearch_const.o: mansearch_const.c config.h mansearch.h -mdoc.o: mdoc.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h -mdoc_argv.o: mdoc_argv.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h -mdoc_hash.o: mdoc_hash.c config.h mdoc.h libmdoc.h -mdoc_html.o: mdoc_html.c config.h mandoc_aux.h mdoc.h out.h html.h main.h -mdoc_macro.o: mdoc_macro.c config.h mdoc.h mandoc.h libmdoc.h libmandoc.h -mdoc_man.o: mdoc_man.c config.h mandoc.h mandoc_aux.h out.h man.h mdoc.h main.h -mdoc_term.o: mdoc_term.c config.h mandoc.h mandoc_aux.h out.h term.h mdoc.h main.h -mdoc_validate.o: mdoc_validate.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h +mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h +mdoc_hash.o: mdoc_hash.c config.h roff.h mdoc.h libmdoc.h +mdoc_html.o: mdoc_html.c config.h mandoc_aux.h roff.h mdoc.h out.h html.h main.h +mdoc_macro.o: mdoc_macro.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_man.o: mdoc_man.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h out.h main.h +mdoc_state.o: mdoc_state.c mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h +mdoc_term.o: mdoc_term.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h term.h tag.h main.h +mdoc_validate.o: mdoc_validate.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h msec.o: msec.c config.h mandoc.h libmandoc.h msec.in out.o: out.c config.h mandoc_aux.h mandoc.h out.h preconv.o: preconv.c config.h mandoc.h libmandoc.h -read.o: read.c config.h mandoc.h mandoc_aux.h libmandoc.h mdoc.h man.h -roff.o: roff.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h predefs.in -st.o: st.c config.h mdoc.h libmdoc.h st.in +read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h libmandoc.h roff_int.h +roff.o: roff.c config.h mandoc.h mandoc_aux.h roff.h libmandoc.h roff_int.h libroff.h predefs.in +soelim.o: soelim.c config.h compat_stringlist.h +st.o: st.c config.h roff.h mdoc.h libmdoc.h st.in +tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h tag.h tbl.o: tbl.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h tbl_data.o: tbl_data.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h tbl_html.o: tbl_html.c config.h mandoc.h out.h html.h @@ -53,22 +63,6 @@ tbl_layout.o: tbl_layout.c config.h mand tbl_opts.o: tbl_opts.c config.h mandoc.h libmandoc.h libroff.h tbl_term.o: tbl_term.c config.h mandoc.h out.h term.h term.o: term.c config.h mandoc.h mandoc_aux.h out.h term.h main.h -term_ascii.o: term_ascii.c config.h mandoc.h mandoc_aux.h out.h term.h main.h -term_ps.o: term_ps.c config.h mandoc_aux.h out.h term.h main.h -tree.o: tree.c config.h mandoc.h mdoc.h man.h main.h -test-dirent-namlen.o: test-dirent-namlen.c -test-fgetln.o: test-fgetln.c -test-fts.o: test-fts.c -test-getsubopt.o: test-getsubopt.c -test-mmap.o: test-mmap.c -test-ohash.o: test-ohash.c -test-reallocarray.o: test-reallocarray.c -test-sqlite3.o: test-sqlite3.c -test-sqlite3_errstr.o: test-sqlite3_errstr.c -test-strcasestr.o: test-strcasestr.c -test-strlcat.o: test-strlcat.c -test-strlcpy.o: test-strlcpy.c -test-strptime.o: test-strptime.c -test-strsep.o: test-strsep.c -test-strtonum.o: test-strtonum.c -test-wchar.o: test-wchar.c +term_ascii.o: term_ascii.c config.h mandoc.h mandoc_aux.h out.h term.h manconf.h main.h +term_ps.o: term_ps.c config.h mandoc_aux.h out.h term.h manconf.h main.h +tree.o: tree.c config.h mandoc.h roff.h mdoc.h man.h main.h Modified: head/contrib/mdocml/NEWS ============================================================================== --- head/contrib/mdocml/NEWS Fri Jan 15 23:16:04 2016 (r294112) +++ head/contrib/mdocml/NEWS Fri Jan 15 23:28:12 2016 (r294113) @@ -1,4 +1,4 @@ -$Id: NEWS,v 1.9 2015/03/13 12:35:32 schwarze Exp $ +$Id: NEWS,v 1.10 2015/11/05 16:58:20 schwarze Exp $ This file lists the most important changes in the mdocml.bsd.lv distribution. @@ -93,7 +93,7 @@ Changes in version 1.13.3, released on M * roff(7): Three minor fixes with respect to evaluation of conditionals. * roff(7): Let .it accept numerical expressions, not just constants. * mandoc_char(7): Correct some character names and renderings. - * If earlier files set a non-zero exit status, never reset it to zero. + * If earlier files set a non-zero exit status, never reset it to zero. --- THANKS TO --- * Jonathan Gray (OpenBSD) for yet more testing with afl (the American Fuzzy Lop security fuzzer), again resulting in many bug reports. Modified: head/contrib/mdocml/TODO ============================================================================== --- head/contrib/mdocml/TODO Fri Jan 15 23:16:04 2016 (r294112) +++ head/contrib/mdocml/TODO Fri Jan 15 23:28:12 2016 (r294113) @@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.202 2015/03/11 13:11:22 schwarze Exp $ +* $Id: TODO,v 1.216 2016/01/08 01:37:32 schwarze Exp $ ************************************************************************ Many issues are annotated for difficulty as follows: @@ -66,6 +66,7 @@ are mere guesses, and some may be wrong. loc * exist * algo * size * imp ** - .ns (no-space mode) occurs in xine-config(1) + when implementing this, also let .TH set it reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 loc *** exist *** algo *** size ** imp * @@ -105,6 +106,19 @@ are mere guesses, and some may be wrong. needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 loc ** exist *** algo *** size * imp *** +- \\ in high-level macro arguments + Currently, \\ is expanded in two situations: + 1) macro and string definition (roff.c setstrn()) + 2) macro argument parsing (mandoc.c mandoc_getarg()) + For user defined macros, the second happens in time because of ROFF_REPARSE. + But for standard high-level macros, it only happens after entering the + high level parsers, which is too late because the code doesn't get + back to roff.c roff_res() from that point. Because this requires + distinguishing requests, user-defined macros and standard macros + on the roff_res() level, it is hard to solve without the parser reorg. + Found by naddy@ in devel/cutils cobfusc(1) Mon, 16 Feb 2015 19:10:52 +0100 + loc *** exist *** algo *** size ** imp * + - using undefined strings or macros defines them to be empty wl@ Mon, 14 Nov 2011 14:37:01 +0000 loc * exist * algo * size * imp * @@ -194,6 +208,26 @@ are mere guesses, and some may be wrong. --- missing tbl features ----------------------------------------------- +- horizontal lines in the layout still consume data cells + and can be mixed with actual data on the same table line + synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 + loc ** exist ** algo ** size ** imp *** + +- the "w" layout option is ignored + synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 + loc * exist * algo * size * imp ** + +- the "s" layout column specifier is used for placement of data + into columns, but ignored during column width calculations + synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 + loc * exist ** algo *** size * imp ** + +- support mdoc(7) and man(7) macros inside tbl(7) code; + probably requires the parser reorg and letting tbl(7) + use roff_node such that macro sets can mix; + informed by bapt@ that FreeBSD needs this. + loc *** exist ** algo *** size ** imp *** + - look at the POSIX manuals in the books/man-pages-posix port, they use some unsupported tbl(7) features. loc * exist ** algo ** size ** imp *** @@ -203,13 +237,13 @@ are mere guesses, and some may be wrong. suggested by bentley@ Tue, 14 Oct 2014 04:10:55 -0600 loc * exist ** algo * size * imp ** -- allow standalone `.' to be interpreted as an end-of-layout - delimiter instead of being thrown away as a no-op roff line - reported by Yuri Pankov, Wed 18 May 2011 11:34:59 CEST - loc ** exist ** algo ** size * imp ** - --- missing eqn features ----------------------------------------------- +- In a matrix, break the output line after each matrix line. + Found in the discussion at CDBUG 2015. + Suggested by Avi Weinstock. + loc * exist * algo * size * imp ** + - The "size" keyword is parsed, but ignored by the formatter. loc * exist * algo * size * imp * @@ -227,13 +261,9 @@ are mere guesses, and some may be wrong. Werner LEMBERG on groff at gnu dot org Sun, 10 Nov 2013 12:47:46 loc ** exist ** algo * size * imp * -- When makewhatis(8) encounters a FATAL parse error, - it silently treats the file as formatted, which makes no sense - at all for paths like man1/foo.1 - and which also contradicts - what the manual says at the end of the description. - The end result will be ENOENT for file names returned - by mansearch() in manpage.file. - loc * exist * algo * size * imp ** +- change the default PAGER to more -Es and use the pager + even for apropos title line output; req by bapt@ + loc * exist * algo * size * imp *** - makewhatis(8) for preformatted pages: parse the section number from the header line @@ -255,11 +285,13 @@ are mere guesses, and some may be wrong. - kettenis wants base roff, ms, and me Fri, 1 Jan 2010 22:13:15 +0100 (CET) loc ** exist ** algo ** size *** imp * ---- compatibility checks ----------------------------------------------- +- Vsevolod Stakhov (FreeBSD) needs either a markdown output formatter + for mandoc -mdoc or a markdown to mdoc converter because they + have to maintain manuals needed both in markdown and mdoc format. + Look at the libsoldout (markdown -> whatever) + loc * exist * algo * size ** imp ** -- write a configure check for [[:<:]] support and provide some - fallback for whatis(1) when it doesn't work; - Svyatoslav Mishyn Wed, 17 Dec 2014 11:07:10 +0200 +--- compatibility checks ----------------------------------------------- - is .Bk implemented correctly in modern groff? sobrado@ Tue, 19 Apr 2011 22:12:55 +0200 @@ -293,6 +325,9 @@ are mere guesses, and some may be wrong. http://swtch.com/plan9port/man/man7/man.html "Anthony J. Bentley" 28 Dec 2010 21:58:40 -0700 +- check compatibility with COHERENT troff: + http://www.nesssoftware.com/home/mwc/source.php + - check compatibility with the man(7) formatter https://raw.githubusercontent.com/rofl0r/hardcore-utils/master/man.c @@ -381,6 +416,12 @@ are mere guesses, and some may be wrong. see also matthew@ Fri, 18 Jul 2014 19:25:12 -0700 loc * exist * algo ** size * imp *** +- .Bf at the beginning of a paragraph inserts a bogus 1ex horizontal + space, see for example random(3). Introduced in + http://mdocml.bsd.lv/cgi-bin/cvsweb/mdoc_html.c.diff?r1=1.91&r2=1.92 + reported by deraadt@ Mon, 28 Sep 2015 20:14:13 -0600 (MDT) + loc ** exist ** algo ** size * imp * + - jsg on icb, Nov 3, 2014: try to guess Xr in man(7) for hyperlinking @@ -394,6 +435,10 @@ are mere guesses, and some may be wrong. - consider whether can be used for Ar Dv Er Ev Fa Va. from bentley@ Wed, 13 Aug 2014 09:17:55 -0600 +- generate tags in HTML + idea from florian@ Tue, 7 Apr 2015 00:26:28 +0000 + may be possible to implement with .Lk img://something.png alt_text + - check https://github.com/trentm/mdocml ************************************************************************ @@ -466,6 +511,10 @@ are mere guesses, and some may be wrong. found while talking to Chris Bennett loc * exist * algo * size * imp * +- Sequences of multiple man(7) paragraphs (.PP, .IP) interspersed + with .ps and .nf/.fi produce execessive blank lines, see libJudy + and graphics/dcmtk. The parser reorg may help with this. + - trailing whitespace must be ignored even when followed by a font escape, see for example makes @@ -475,9 +524,31 @@ are mere guesses, and some may be wrong. loc ** exist ** algo ** size * imp ** ************************************************************************ +* portability +************************************************************************ + +- systems having UTF-8 but not en_US.UTF-8 + call locale(1) from ./configure, select a UTF-8-locale, + and use that for test-wchar.c and term_ascii.c + to Markus Waldeck Sat, 18 Jul 2015 01:55:37 +0200 + loc * exist * algo * size * imp * + +************************************************************************ * warning issues ************************************************************************ +- provide a way in mandoc(1) to warn about broken .Xr links; + probably cannot be on by default in -Tlint because it needs + to access the manpath and mandoc.db(3) after parsing. + asked for by jmc@ Fri, 4 Dec 2015 22:39:40 +0000 + +- Report errors in -O suboption parsing. + loc * exist * algo * size * imp ** + +- warn when .Sh or .Ss contain other macros + Steffen Nurpmeso, savannah.gnu.org/bugs/index.php?45034 + loc * exist * algo * size * imp ** + - check that MANDOCERR_BADTAB is thrown in the right cases, i.e. when finding a literal tab character in fill mode, and possibly change the wording of the warning message @@ -557,11 +628,6 @@ Several areas can be cleaned up to make * structural issues ************************************************************************ -- Improve -O suboption parsing. Do it in the main program such that - errors can be reported. Pay attention to distinguishing the - mandoc(1) and apropos(1) styles of both options. - loc ** exist * algo ** size ** imp *** - - Use libz directly instead of forking gunzip(1). Suggested by bapt at FreeBSD among others. Modified: head/contrib/mdocml/apropos.1 ============================================================================== --- head/contrib/mdocml/apropos.1 Fri Jan 15 23:16:04 2016 (r294112) +++ head/contrib/mdocml/apropos.1 Fri Jan 15 23:28:12 2016 (r294113) @@ -1,4 +1,4 @@ -.\" $Id: apropos.1,v 1.37 2015/02/16 16:23:54 schwarze Exp $ +.\" $Id: apropos.1,v 1.39 2015/04/03 08:46:17 schwarze Exp $ .\" .\" Copyright (c) 2011, 2012 Kristaps Dzonsons .\" Copyright (c) 2011, 2012, 2014 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: February 16 2015 $ +.Dd $Mdocdate: April 3 2015 $ .Dt APROPOS 1 .Os .Sh NAME @@ -210,7 +210,7 @@ This has syntax .Sm off .Oo .Op Ar key Op , Ar key ... -.Pq Cm = | ~ +.Pq Cm = | \(ti .Oc .Ar val , .Sm on @@ -227,7 +227,7 @@ for a list of available keys. Operator .Cm = evaluates a substring, while -.Cm ~ +.Cm \(ti evaluates a regular expression. .It Fl i Ar term If @@ -365,7 +365,8 @@ Specifies the pagination program to use .Ev MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, -.Pa /usr/bin/more Fl s +.Xr more 1 +.Fl s will be used. .El .Sh FILES @@ -398,7 +399,7 @@ as well: .Pp Search in names and descriptions using a regular expression: .Pp -.Dl $ apropos '~set.?[ug]id' +.Dl $ apropos \(aq\(tiset.?[ug]id\(aq .Pp Search for manuals in the library section mentioning both the .Qq optind @@ -413,15 +414,15 @@ Do exactly the same as calling with the argument .Qq ssh : .Pp -.Dl $ apropos \-\- \-i 'Nm~[[:<:]]ssh[[:>:]]' +.Dl $ apropos \-\- \-i \(aqNm\(ti[[:<:]]ssh[[:>:]]\(aq .Pp The following two invocations are equivalent: .Pp .D1 Li $ apropos -S Ar arch Li -s Ar section expression .Bd -ragged -offset indent .Li $ apropos \e( Ar expression Li \e) -.Li -a arch~^( Ns Ar arch Ns Li |any)$ -.Li -a sec~^ Ns Ar section Ns Li $ +.Li -a arch\(ti^( Ns Ar arch Ns Li |any)$ +.Li -a sec\(ti^ Ns Ar section Ns Li $ .Ed .Sh SEE ALSO .Xr man 1 , Modified: head/contrib/mdocml/att.c ============================================================================== --- head/contrib/mdocml/att.c Fri Jan 15 23:16:04 2016 (r294112) +++ head/contrib/mdocml/att.c Fri Jan 15 23:28:12 2016 (r294113) @@ -1,4 +1,4 @@ -/* $Id: att.c,v 1.13 2014/11/28 18:57:31 schwarze Exp $ */ +/* $Id: att.c,v 1.15 2015/10/06 18:32:19 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -19,6 +19,7 @@ #include #include +#include "roff.h" #include "mdoc.h" #include "libmdoc.h" @@ -45,5 +46,5 @@ mdoc_a2att(const char *p) LINE("V.3", "AT&T System\\~V Release\\~3 UNIX"); LINE("V.4", "AT&T System\\~V Release\\~4 UNIX"); - return(NULL); + return NULL; } Modified: head/contrib/mdocml/cgi.c ============================================================================== --- head/contrib/mdocml/cgi.c Fri Jan 15 23:16:04 2016 (r294112) +++ head/contrib/mdocml/cgi.c Fri Jan 15 23:28:12 2016 (r294113) @@ -1,15 +1,15 @@ -/* $Id: cgi.c,v 1.104 2015/02/10 08:05:30 schwarze Exp $ */ +/* $Id: cgi.c,v 1.116 2016/01/04 12:36:26 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons - * Copyright (c) 2014 Ingo Schwarze + * Copyright (c) 2014, 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF @@ -30,10 +30,13 @@ #include #include -#include "mandoc.h" #include "mandoc_aux.h" +#include "mandoc.h" +#include "roff.h" +#include "mdoc.h" +#include "man.h" #include "main.h" -#include "manpath.h" +#include "manconf.h" #include "mansearch.h" #include "cgi.h" @@ -60,9 +63,6 @@ static void html_print(const char *); static void html_putchar(char); static int http_decode(char *); static void http_parse(struct req *, const char *); -static void http_print(const char *); -static void http_putchar(char); -static void http_printquery(const struct req *, const char *); static void pathgen(struct req *); static void pg_error_badrequest(const char *); static void pg_error_internal(void); @@ -74,6 +74,7 @@ static void pg_searchres(const struct static void pg_show(struct req *, const char *); static void resp_begin_html(int, const char *); static void resp_begin_http(int, const char *); +static void resp_copy(const char *); static void resp_end_html(void); static void resp_searchform(const struct req *); static void resp_show(const struct req *, const char *); @@ -145,40 +146,6 @@ html_putchar(char c) } } -static void -http_printquery(const struct req *req, const char *sep) -{ - - if (NULL != req->q.query) { - printf("query="); - http_print(req->q.query); - } - if (0 == req->q.equal) - printf("%sapropos=1", sep); - if (NULL != req->q.sec) { - printf("%ssec=", sep); - http_print(req->q.sec); - } - if (NULL != req->q.arch) { - printf("%sarch=", sep); - http_print(req->q.arch); - } - if (strcmp(req->q.manpath, req->p[0])) { - printf("%smanpath=", sep); - http_print(req->q.manpath); - } -} - -static void -http_print(const char *p) -{ - - if (NULL == p) - return; - while ('\0' != *p) - http_putchar(*p++); -} - /* * Call through to html_putchar(). * Accepts NULL strings. @@ -299,20 +266,6 @@ next: } } -static void -http_putchar(char c) -{ - - if (isalnum((unsigned char)c)) { - putchar((unsigned char)c); - return; - } else if (' ' == c) { - putchar('+'); - return; - } - printf("%%%.2x", c); -} - /* * HTTP-decode a string. The standard explanation is that this turns * "%4e+foo" into "n foo" in the regular way. This is done in-place @@ -331,13 +284,13 @@ http_decode(char *p) for ( ; '\0' != *p; p++, q++) { if ('%' == *p) { if ('\0' == (hex[0] = *(p + 1))) - return(0); + return 0; if ('\0' == (hex[1] = *(p + 2))) - return(0); + return 0; if (1 != sscanf(hex, "%x", &c)) - return(0); + return 0; if ('\0' == c) - return(0); + return 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Jan 16 00:37:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A94D9A84BF9; Sat, 16 Jan 2016 00:37:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 864F914E9; Sat, 16 Jan 2016 00:37:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G0bSc1037392; Sat, 16 Jan 2016 00:37:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G0bSmb037387; Sat, 16 Jan 2016 00:37:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601160037.u0G0bSmb037387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 16 Jan 2016 00:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294114 - in head/share/man: man4 man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 00:37:29 -0000 Author: imp Date: Sat Jan 16 00:37:27 2016 New Revision: 294114 URL: https://svnweb.freebsd.org/changeset/base/294114 Log: Read-only is hyphenated when it modifies a noun. Modified: head/share/man/man4/geom_uncompress.4 head/share/man/man4/geom_uzip.4 head/share/man/man4/sctp.4 head/share/man/man9/cd.9 head/share/man/man9/zone.9 Modified: head/share/man/man4/geom_uncompress.4 ============================================================================== --- head/share/man/man4/geom_uncompress.4 Fri Jan 15 23:28:12 2016 (r294113) +++ head/share/man/man4/geom_uncompress.4 Sat Jan 16 00:37:27 2016 (r294114) @@ -46,7 +46,7 @@ geom_uncompress_load="YES" .Sh DESCRIPTION The .Nm -framework provides support for compressed read only disk images. +framework provides support for compressed read-only disk images. This allows significant storage savings at the expense of a little CPU time on each read. Data written in the GEOM label area allows Modified: head/share/man/man4/geom_uzip.4 ============================================================================== --- head/share/man/man4/geom_uzip.4 Fri Jan 15 23:28:12 2016 (r294113) +++ head/share/man/man4/geom_uzip.4 Sat Jan 16 00:37:27 2016 (r294114) @@ -48,7 +48,7 @@ geom_uzip_load="YES" .Sh DESCRIPTION The .Nm -framework provides support for compressed read only +framework provides support for compressed read-only disk images. This allows significant storage savings at the expense of a little CPU time on each read. Modified: head/share/man/man4/sctp.4 ============================================================================== --- head/share/man/man4/sctp.4 Fri Jan 15 23:28:12 2016 (r294113) +++ head/share/man/man4/sctp.4 Sat Jan 16 00:37:27 2016 (r294114) @@ -390,16 +390,16 @@ is passed to .Tn SCTP else an error will be returned. .It Dv SCTP_STATUS -This option is a read only option that returns +This option is a read-only option that returns various status information about the specified association. .It Dv SCTP_GET_PEER_ADDR_INFO -This read only option returns information about a peer +This read-only option returns information about a peer address. .It Dv SCTP_PEER_AUTH_CHUNKS -This read only option returns a list of the chunks +This read-only option returns a list of the chunks the peer requires to be authenticated. .It Dv SCTP_LOCAL_AUTH_CHUNKS -This read only option returns a list of the locally +This read-only option returns a list of the locally required chunks that must be authenticated. .It Dv SCTP_RESET_STREAMS This socket option is used to cause a stream sequence Modified: head/share/man/man9/cd.9 ============================================================================== --- head/share/man/man9/cd.9 Fri Jan 15 23:28:12 2016 (r294113) +++ head/share/man/man9/cd.9 Sat Jan 16 00:37:27 2016 (r294114) @@ -33,7 +33,7 @@ .Sh DESCRIPTION The .Nm -device driver provides a read only interface for CDROM drives +device driver provides a read-only interface for CDROM drives .Tn ( SCSI type 5) and WORM drives Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Fri Jan 15 23:28:12 2016 (r294113) +++ head/share/man/man9/zone.9 Sat Jan 16 00:37:27 2016 (r294114) @@ -343,7 +343,7 @@ macro is provided to create this type of .Pp The .Fn SYSCTL_UMA_CUR parent nbr name access zone descr -macro declares a static read only +macro declares a static read-only .Xr sysctl oid that exports the approximate current occupancy of the zone. The From owner-svn-src-head@freebsd.org Sat Jan 16 00:39:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48C38A84CBF; Sat, 16 Jan 2016 00:39:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18ADF1771; Sat, 16 Jan 2016 00:39:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G0dbZx037504; Sat, 16 Jan 2016 00:39:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G0dbro037503; Sat, 16 Jan 2016 00:39:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601160039.u0G0dbro037503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 16 Jan 2016 00:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294115 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 00:39:38 -0000 Author: imp Date: Sat Jan 16 00:39:36 2016 New Revision: 294115 URL: https://svnweb.freebsd.org/changeset/base/294115 Log: Read-only is typically hyphenated. Move (read only) to a spot where it modifies a noun and hyphenate. Modified: head/share/man/man5/nandfs.5 Modified: head/share/man/man5/nandfs.5 ============================================================================== --- head/share/man/man5/nandfs.5 Sat Jan 16 00:37:27 2016 (r294114) +++ head/share/man/man5/nandfs.5 Sat Jan 16 00:39:36 2016 (r294115) @@ -109,7 +109,7 @@ partition at the specified mount point d .Xr umount_nandfs 8 .Sh HISTORY The NAND FS concepts are based on NILFS principles and initial implementation -was derived from early NILFS NetBSD code (read only). Since then the NAND FS +was derived from early read-only NILFS NetBSD code. Since then the NAND FS code diverged significantly and is by no means compatible with NILFS. .Pp The NAND Flash file system first appeared in From owner-svn-src-head@freebsd.org Sat Jan 16 00:43:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FF42A84E23; Sat, 16 Jan 2016 00:43:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63FFE1B7E; Sat, 16 Jan 2016 00:43:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G0hAoi040108; Sat, 16 Jan 2016 00:43:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G0hAV4040107; Sat, 16 Jan 2016 00:43:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601160043.u0G0hAV4040107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 16 Jan 2016 00:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294116 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 00:43:11 -0000 Author: imp Date: Sat Jan 16 00:43:10 2016 New Revision: 294116 URL: https://svnweb.freebsd.org/changeset/base/294116 Log: Although not directly modifying a noun, read-only should be hyphenated in this context (or in any, really). Modified: head/share/man/man4/ffclock.4 Modified: head/share/man/man4/ffclock.4 ============================================================================== --- head/share/man/man4/ffclock.4 Sat Jan 16 00:39:36 2016 (r294115) +++ head/share/man/man4/ffclock.4 Sat Jan 16 00:43:10 2016 (r294116) @@ -87,7 +87,7 @@ in order to change the default active sy .It Va kern.sysclock.available Lists the names of available system clocks .Po -read only +read-only .Pc . .El .Pp @@ -98,7 +98,7 @@ sysctl tree which provides the following .It Va kern.sysclock.ffclock.version Feed-forward clock kernel version .Po -read only +read-only .Pc . .It Va kern.sysclock.ffclock.ffcounter_bypass Use reliable hardware timecounter as the feed-forward counter. From owner-svn-src-head@freebsd.org Sat Jan 16 00:45:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDC00A84EF7; Sat, 16 Jan 2016 00:45:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DA991E24; Sat, 16 Jan 2016 00:45:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G0jmD4040293; Sat, 16 Jan 2016 00:45:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G0jmAD040292; Sat, 16 Jan 2016 00:45:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601160045.u0G0jmAD040292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 16 Jan 2016 00:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294118 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 00:45:49 -0000 Author: imp Date: Sat Jan 16 00:45:48 2016 New Revision: 294118 URL: https://svnweb.freebsd.org/changeset/base/294118 Log: Improve the sentence flow as well which has the happy benefit of making read-only modify a noun, a case where it unquestionably should be hyphenated. Modified: head/share/man/man4/acpi_panasonic.4 Modified: head/share/man/man4/acpi_panasonic.4 ============================================================================== --- head/share/man/man4/acpi_panasonic.4 Sat Jan 16 00:44:10 2016 (r294117) +++ head/share/man/man4/acpi_panasonic.4 Sat Jan 16 00:45:48 2016 (r294118) @@ -142,11 +142,11 @@ The following MIBs are available: .Bl -tag -width indent .It Va hw.acpi.panasonic.lcd_brightness_max The maximum level of brightness. -The value is read only and +This read-only value is automatically set according to hardware model. .It Va hw.acpi.panasonic.lcd_brightness_min The minimum level of brightness. -The value is read only and +This read-only value is automatically set according to hardware model. .It Va hw.acpi.panasonic.lcd_brightness Current brightness level of the LCD (read-write). From owner-svn-src-head@freebsd.org Sat Jan 16 01:13:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD6E2A846E5; Sat, 16 Jan 2016 01:13:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F1A41C8A; Sat, 16 Jan 2016 01:13:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G1DRqK049227; Sat, 16 Jan 2016 01:13:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G1DRZo049226; Sat, 16 Jan 2016 01:13:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601160113.u0G1DRZo049226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 16 Jan 2016 01:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294121 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 01:13:28 -0000 Author: imp Date: Sat Jan 16 01:13:27 2016 New Revision: 294121 URL: https://svnweb.freebsd.org/changeset/base/294121 Log: Add some clarifications. Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Sat Jan 16 01:03:39 2016 (r294120) +++ head/share/man/man4/ddb.4 Sat Jan 16 01:13:27 2016 (r294121) @@ -1437,15 +1437,18 @@ Other bus' bridge chipsets may be able t methods. There are many PCI and PCIe add-in cards which can generate NMI for debugging. -Modern systems typically use IPMI to generate signals to enter the +Modern server systems typically use IPMI to generate signals to enter the debugger. The .Dv devel/ipmitool port can be used to send the .Cd chassis power diag command which delivers an NMI to the processor. +Embedded systems often use JTAG for debugging, but rarely use it in +combination with +.Nm . .Pp -For serial consoles, you can break to the debugger by sending a BREAK +For serial consoles, you can enter the debugger by sending a BREAK condition on the serial line if .Cd options BREAK_TO_DEBUGGER is specified in the kernel. @@ -1464,11 +1467,13 @@ TILDE is the ASCII tilde character (~). CTRL-x is Control x created by hitting the control key and then x and then releasing both. .Pp -The break to debugger behavior may also be enabled by setting the +The break to enter the debugger behavior may be enabled at trim-time +by setting the .Xr sysctl 8 .Dv debug.kdb.break_to_debugger to 1. -The alt break to debugger behavior may also be enabled by setting the +The alternate sequence to enter the debugger behavior may be enabled +at run-time by setting the .Xr sysctl 8 .Dv debug.kdb.alt_break_to_debugger to 1. From owner-svn-src-head@freebsd.org Sat Jan 16 01:30:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86159A84B7C; Sat, 16 Jan 2016 01:30:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56AB111C0; Sat, 16 Jan 2016 01:30:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G1Ut0J052365; Sat, 16 Jan 2016 01:30:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G1UtZ3052364; Sat, 16 Jan 2016 01:30:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601160130.u0G1UtZ3052364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 16 Jan 2016 01:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294122 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 01:30:56 -0000 Author: imp Date: Sat Jan 16 01:30:55 2016 New Revision: 294122 URL: https://svnweb.freebsd.org/changeset/base/294122 Log: trim-time? What was I thinking. run-time. Noticed by: Allan Jude Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Sat Jan 16 01:13:27 2016 (r294121) +++ head/share/man/man4/ddb.4 Sat Jan 16 01:30:55 2016 (r294122) @@ -1467,7 +1467,7 @@ TILDE is the ASCII tilde character (~). CTRL-x is Control x created by hitting the control key and then x and then releasing both. .Pp -The break to enter the debugger behavior may be enabled at trim-time +The break to enter the debugger behavior may be enabled at run-time by setting the .Xr sysctl 8 .Dv debug.kdb.break_to_debugger From owner-svn-src-head@freebsd.org Sat Jan 16 01:37:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C42DA84D04; Sat, 16 Jan 2016 01:37:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFF22164B; Sat, 16 Jan 2016 01:37:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G1bH7S055199; Sat, 16 Jan 2016 01:37:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G1bHY4055198; Sat, 16 Jan 2016 01:37:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601160137.u0G1bHY4055198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 16 Jan 2016 01:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294123 - head/tools/regression/sockets/so_setfib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 01:37:19 -0000 Author: ngie Date: Sat Jan 16 01:37:17 2016 New Revision: 294123 URL: https://svnweb.freebsd.org/changeset/base/294123 Log: Add missing newline to message about requiring root privileges This will help ensure that scripts/parsers don't get confused when the message is printed out MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/sockets/so_setfib/so_setfib.c Directory Properties: head/ (props changed) Modified: head/tools/regression/sockets/so_setfib/so_setfib.c ============================================================================== --- head/tools/regression/sockets/so_setfib/so_setfib.c Sat Jan 16 01:30:55 2016 (r294122) +++ head/tools/regression/sockets/so_setfib/so_setfib.c Sat Jan 16 01:37:17 2016 (r294123) @@ -171,7 +171,7 @@ main(int argc __unused, char *argv[] __u size_t s; if (geteuid() != 0) { - printf("1..0 # SKIP: must be root"); + printf("1..0 # SKIP: must be root\n"); return (0); } From owner-svn-src-head@freebsd.org Sat Jan 16 02:02:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BCE8A83541; Sat, 16 Jan 2016 02:02:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F64C1242; Sat, 16 Jan 2016 02:02:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G22pBn063701; Sat, 16 Jan 2016 02:02:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G22paX063699; Sat, 16 Jan 2016 02:02:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601160202.u0G22paX063699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 16 Jan 2016 02:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294125 - in head/tools/regression/sockets: rtsocket unix_socket X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 02:02:52 -0000 Author: ngie Date: Sat Jan 16 02:02:50 2016 New Revision: 294125 URL: https://svnweb.freebsd.org/changeset/base/294125 Log: Test for EPROTOTYPE not EPROTONOSUPPORT - `SOCK_RAW` is the implied supported type parameter for socket(2) per route(4) - localsw in `sys/kern/uipc_usrreq.c` doesn't have an entry for `SOCK_RAW`, so the prototype is invalid (this isn't explicitly documented anywhere I could find) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/sockets/rtsocket/rtsocket.c head/tools/regression/sockets/unix_socket/unix_socket.c Directory Properties: head/ (props changed) Modified: head/tools/regression/sockets/rtsocket/rtsocket.c ============================================================================== --- head/tools/regression/sockets/rtsocket/rtsocket.c Sat Jan 16 01:40:46 2016 (r294124) +++ head/tools/regression/sockets/rtsocket/rtsocket.c Sat Jan 16 02:02:50 2016 (r294125) @@ -52,7 +52,7 @@ main(void) sock); } - if (errno != EPROTONOSUPPORT) + if (errno != EPROTOTYPE) err(-1, "socket(PF_ROUTE, SOCK_STREAM, 0)"); sock = socket(PF_ROUTE, SOCK_DGRAM, 0); @@ -62,7 +62,7 @@ main(void) sock); } - if (errno != EPROTONOSUPPORT) + if (errno != EPROTOTYPE) err(-1, "socket(PF_ROUTE, SOCK_DGRAM, 0)"); sock = socket(PF_ROUTE, SOCK_RAW, 0); @@ -77,7 +77,7 @@ main(void) "socketpair(PF_ROUTE, SOCK_STREAM, 0, socks) success"); } - if (errno != EPROTONOSUPPORT) + if (errno != EPROTOTYPE) err(-1, "socketpair(PF_ROUTE, SOCK_STREAM, 0, socks)"); if (socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) == 0) { @@ -87,7 +87,7 @@ main(void) "socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) success"); } - if (errno != EPROTONOSUPPORT) + if (errno != EPROTOTYPE) err(-1, "socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks)"); if (socketpair(PF_ROUTE, SOCK_RAW, 0, socks) == 0) { Modified: head/tools/regression/sockets/unix_socket/unix_socket.c ============================================================================== --- head/tools/regression/sockets/unix_socket/unix_socket.c Sat Jan 16 01:40:46 2016 (r294124) +++ head/tools/regression/sockets/unix_socket/unix_socket.c Sat Jan 16 02:02:50 2016 (r294125) @@ -59,7 +59,7 @@ main(void) close(sock); errx(-1, "socket(PF_LOCAL, SOCK_RAW, 0) returned %d", sock); } - if (errno != EPROTONOSUPPORT) + if (errno != EPROTOTYPE) err(-1, "socket(PF_LOCAL, SOCK_RAW, 0)"); if (socketpair(PF_LOCAL, SOCK_STREAM, 0, socks) < 0) From owner-svn-src-head@freebsd.org Sat Jan 16 02:15:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FA49A838CA; Sat, 16 Jan 2016 02:15:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB7341798; Sat, 16 Jan 2016 02:15:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G2FDpJ066730; Sat, 16 Jan 2016 02:15:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G2FDlc066728; Sat, 16 Jan 2016 02:15:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601160215.u0G2FDlc066728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 16 Jan 2016 02:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294126 - in head/tools/regression/sockets: reconnect sendfile X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 02:15:15 -0000 Author: ngie Date: Sat Jan 16 02:15:13 2016 New Revision: 294126 URL: https://svnweb.freebsd.org/changeset/base/294126 Log: Fix warnings with gcc 5.0 reconnect.c: - Convert the K&R prototype of main to an ANSI prototype to mute a warning from gcc 4.2.1 - Close s_sock2 after finishing off the last test to plug a leak and mute a warning from gcc 5.0 about a -Wunused-but-set variable sendfile.c: - Fix a -Wunused-but-set warning with gcc 5.0 with pagesize in main(..) MFC after: 5 days Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/sockets/reconnect/reconnect.c head/tools/regression/sockets/sendfile/sendfile.c Directory Properties: head/ (props changed) Modified: head/tools/regression/sockets/reconnect/reconnect.c ============================================================================== --- head/tools/regression/sockets/reconnect/reconnect.c Sat Jan 16 02:02:50 2016 (r294125) +++ head/tools/regression/sockets/reconnect/reconnect.c Sat Jan 16 02:15:13 2016 (r294126) @@ -104,7 +104,7 @@ cleanup(void) } int -main() +main(void) { int s_sock1, s_sock2, c_sock; @@ -127,6 +127,7 @@ main() connect_uds_server(c_sock, uds_name1); close(s_sock1); connect_uds_server(c_sock, uds_name2); + close(s_sock2); exit (0); } Modified: head/tools/regression/sockets/sendfile/sendfile.c ============================================================================== --- head/tools/regression/sockets/sendfile/sendfile.c Sat Jan 16 02:02:50 2016 (r294125) +++ head/tools/regression/sockets/sendfile/sendfile.c Sat Jan 16 02:15:13 2016 (r294126) @@ -459,12 +459,9 @@ cleanup(void) int main(int argc, char *argv[]) { - int pagesize; path[0] = '\0'; - pagesize = getpagesize(); - if (argc == 1) { snprintf(path, sizeof(path), "sendfile.XXXXXXXXXXXX"); file_fd = mkstemp(path); From owner-svn-src-head@freebsd.org Sat Jan 16 02:18:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E11C2A83A14; Sat, 16 Jan 2016 02:18:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCA991996; Sat, 16 Jan 2016 02:18:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G2IaSn066904; Sat, 16 Jan 2016 02:18:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G2IaRW066902; Sat, 16 Jan 2016 02:18:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601160218.u0G2IaRW066902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 16 Jan 2016 02:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294127 - head/tools/regression/sockets/zerosend X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 02:18:38 -0000 Author: ngie Date: Sat Jan 16 02:18:36 2016 New Revision: 294127 URL: https://svnweb.freebsd.org/changeset/base/294127 Log: Fix warnings with clang/gcc - Get rid of unused argc/argv variables in main - Exit on failure with a return code of 1 instead of -1 with err/errx as a return code of -1 is implementation dependent - Bump WARNS to 6 MFC after: 5 days Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/sockets/zerosend/Makefile head/tools/regression/sockets/zerosend/zerosend.c Directory Properties: head/ (props changed) Modified: head/tools/regression/sockets/zerosend/Makefile ============================================================================== --- head/tools/regression/sockets/zerosend/Makefile Sat Jan 16 02:15:13 2016 (r294126) +++ head/tools/regression/sockets/zerosend/Makefile Sat Jan 16 02:18:36 2016 (r294127) @@ -2,6 +2,6 @@ PROG= zerosend MAN= -WARNS?= 2 +WARNS?= 6 .include Modified: head/tools/regression/sockets/zerosend/zerosend.c ============================================================================== --- head/tools/regression/sockets/zerosend/zerosend.c Sat Jan 16 02:15:13 2016 (r294126) +++ head/tools/regression/sockets/zerosend/zerosend.c Sat Jan 16 02:18:36 2016 (r294127) @@ -54,9 +54,9 @@ try_0send(const char *test, int fd) ch = 0; len = send(fd, &ch, 0, 0); if (len < 0) - err(-1, "%s: try_0send", test); + err(1, "%s: try_0send", test); if (len != 0) - errx(-1, "%s: try_0send: returned %zd", test, len); + errx(1, "%s: try_0send: returned %zd", test, len); } static void @@ -68,9 +68,9 @@ try_0write(const char *test, int fd) ch = 0; len = write(fd, &ch, 0); if (len < 0) - err(-1, "%s: try_0write", test); + err(1, "%s: try_0write", test); if (len != 0) - errx(-1, "%s: try_0write: returned %zd", test, len); + errx(1, "%s: try_0write: returned %zd", test, len); } static void @@ -87,24 +87,24 @@ setup_udp(const char *test, int *fdp) sin.sin_port = htons(PORT1); sock1 = socket(PF_INET, SOCK_DGRAM, 0); if (sock1 < 0) - err(-1, "%s: setup_udp: socket", test); + err(1, "%s: setup_udp: socket", test); if (bind(sock1, (struct sockaddr *)&sin, sizeof(sin)) < 0) - err(-1, "%s: setup_udp: bind(%s, %d)", test, + err(1, "%s: setup_udp: bind(%s, %d)", test, inet_ntoa(sin.sin_addr), PORT1); sin.sin_port = htons(PORT2); if (connect(sock1, (struct sockaddr *)&sin, sizeof(sin)) < 0) - err(-1, "%s: setup_udp: connect(%s, %d)", test, + err(1, "%s: setup_udp: connect(%s, %d)", test, inet_ntoa(sin.sin_addr), PORT2); sock2 = socket(PF_INET, SOCK_DGRAM, 0); if (sock2 < 0) - err(-1, "%s: setup_udp: socket", test); + err(1, "%s: setup_udp: socket", test); if (bind(sock2, (struct sockaddr *)&sin, sizeof(sin)) < 0) - err(-1, "%s: setup_udp: bind(%s, %d)", test, + err(1, "%s: setup_udp: bind(%s, %d)", test, inet_ntoa(sin.sin_addr), PORT2); sin.sin_port = htons(PORT1); if (connect(sock2, (struct sockaddr *)&sin, sizeof(sin)) < 0) - err(-1, "%s: setup_udp: connect(%s, %d)", test, + err(1, "%s: setup_udp: connect(%s, %d)", test, inet_ntoa(sin.sin_addr), PORT1); fdp[0] = sock1; @@ -130,12 +130,12 @@ setup_tcp(const char *test, int *fdp) sin.sin_port = htons(PORT1); sock1 = socket(PF_INET, SOCK_STREAM, 0); if (sock1 < 0) - err(-1, "%s: setup_tcp: socket", test); + err(1, "%s: setup_tcp: socket", test); if (bind(sock1, (struct sockaddr *)&sin, sizeof(sin)) < 0) - err(-1, "%s: bind(%s, %d)", test, inet_ntoa(sin.sin_addr), + err(1, "%s: bind(%s, %d)", test, inet_ntoa(sin.sin_addr), PORT1); if (listen(sock1, -1) < 0) - err(-1, "%s: listen", test); + err(1, "%s: listen", test); /* * Now connect to it, non-blocking so that we don't deadlock against @@ -143,25 +143,25 @@ setup_tcp(const char *test, int *fdp) */ sock2 = socket(PF_INET, SOCK_STREAM, 0); if (sock2 < 0) - err(-1, "%s: setup_tcp: socket", test); + err(1, "%s: setup_tcp: socket", test); if (fcntl(sock2, F_SETFL, O_NONBLOCK) < 0) - err(-1, "%s: setup_tcp: fcntl(O_NONBLOCK)", test); + err(1, "%s: setup_tcp: fcntl(O_NONBLOCK)", test); if (connect(sock2, (struct sockaddr *)&sin, sizeof(sin)) < 0 && errno != EINPROGRESS) - err(-1, "%s: setup_tcp: connect(%s, %d)", test, + err(1, "%s: setup_tcp: connect(%s, %d)", test, inet_ntoa(sin.sin_addr), PORT1); /* * Now pick up the connection after sleeping a moment to make sure * there's been time for some packets to go back and forth. */ - if (sleep(1) < 0) - err(-1, "%s: sleep(1)", test); + if (sleep(1) != 0) + err(1, "%s: sleep(1)", test); sock3 = accept(sock1, NULL, NULL); if (sock3 < 0) - err(-1, "%s: accept", test); - if (sleep(1) < 0) - err(-1, "%s: sleep(1)", test); + err(1, "%s: accept", test); + if (sleep(1) != 0) + err(1, "%s: sleep(1)", test); FD_ZERO(&writefds); FD_SET(sock2, &writefds); @@ -171,11 +171,11 @@ setup_tcp(const char *test, int *fdp) tv.tv_usec = 0; ret = select(sock2 + 1, NULL, &writefds, &exceptfds, &tv); if (ret < 0) - err(-1, "%s: setup_tcp: select", test); + err(1, "%s: setup_tcp: select", test); if (FD_ISSET(sock2, &exceptfds)) - errx(-1, "%s: setup_tcp: select: exception", test); + errx(1, "%s: setup_tcp: select: exception", test); if (!FD_ISSET(sock2, &writefds)) - errx(-1, "%s: setup_tcp: select: not writable", test); + errx(1, "%s: setup_tcp: select: not writable", test); close(sock1); fdp[0] = sock2; @@ -187,7 +187,7 @@ setup_udsstream(const char *test, int *f { if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fdp) < 0) - err(-1, "%s: setup_udsstream: socketpair", test); + err(1, "%s: setup_udsstream: socketpair", test); } static void @@ -195,7 +195,7 @@ setup_udsdgram(const char *test, int *fd { if (socketpair(PF_LOCAL, SOCK_DGRAM, 0, fdp) < 0) - err(-1, "%s: setup_udsdgram: socketpair", test); + err(1, "%s: setup_udsdgram: socketpair", test); } static void @@ -203,7 +203,7 @@ setup_pipe(const char *test, int *fdp) { if (pipe(fdp) < 0) - err(-1, "%s: setup_pipe: pipe", test); + err(1, "%s: setup_pipe: pipe", test); } static void @@ -213,19 +213,19 @@ setup_fifo(const char *test, int *fdp) int fd1, fd2; if (mkstemp(path) == -1) - err(-1, "%s: setup_fifo: mktemp", test); + err(1, "%s: setup_fifo: mktemp", test); unlink(path); if (mkfifo(path, 0600) < 0) - err(-1, "%s: setup_fifo: mkfifo(%s)", test, path); + err(1, "%s: setup_fifo: mkfifo(%s)", test, path); fd1 = open(path, O_RDONLY | O_NONBLOCK); if (fd1 < 0) - err(-1, "%s: setup_fifo: open(%s, O_RDONLY)", test, path); + err(1, "%s: setup_fifo: open(%s, O_RDONLY)", test, path); fd2 = open(path, O_WRONLY | O_NONBLOCK); if (fd2 < 0) - err(-1, "%s: setup_fifo: open(%s, O_WRONLY)", test, path); + err(1, "%s: setup_fifo: open(%s, O_WRONLY)", test, path); fdp[0] = fd2; fdp[1] = fd1; @@ -242,7 +242,7 @@ close_both(int *fdp) } int -main(int argc, char *argv[]) +main(void) { int fd[2]; From owner-svn-src-head@freebsd.org Sat Jan 16 02:19:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70408A83B7B; Sat, 16 Jan 2016 02:19:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41E3F1B47; Sat, 16 Jan 2016 02:19:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G2Jvfh067006; Sat, 16 Jan 2016 02:19:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G2Jv1S067004; Sat, 16 Jan 2016 02:19:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601160219.u0G2Jv1S067004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 16 Jan 2016 02:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294128 - head/tools/regression/sockets/unix_gc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 02:19:58 -0000 Author: ngie Date: Sat Jan 16 02:19:56 2016 New Revision: 294128 URL: https://svnweb.freebsd.org/changeset/base/294128 Log: Fix -Wunused warning with clang/gcc - Get rid of unused argc/argv variables in main - Bump WARNS to 6 MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/sockets/unix_gc/Makefile head/tools/regression/sockets/unix_gc/unix_gc.c Directory Properties: head/ (props changed) Modified: head/tools/regression/sockets/unix_gc/Makefile ============================================================================== --- head/tools/regression/sockets/unix_gc/Makefile Sat Jan 16 02:18:36 2016 (r294127) +++ head/tools/regression/sockets/unix_gc/Makefile Sat Jan 16 02:19:56 2016 (r294128) @@ -2,6 +2,6 @@ PROG= unix_gc MAN= -WARNS?= 3 +WARNS?= 6 .include Modified: head/tools/regression/sockets/unix_gc/unix_gc.c ============================================================================== --- head/tools/regression/sockets/unix_gc/unix_gc.c Sat Jan 16 02:18:36 2016 (r294127) +++ head/tools/regression/sockets/unix_gc/unix_gc.c Sat Jan 16 02:19:56 2016 (r294128) @@ -752,7 +752,7 @@ recursion(void) #define RMDIR "rm -Rf " int -main(int argc, char *argv[]) +main(void) { char cmd[sizeof(RMDIR) + PATH_MAX]; int serrno; From owner-svn-src-head@freebsd.org Sat Jan 16 02:21:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48690A83D6E for ; Sat, 16 Jan 2016 02:21:45 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D60431E72 for ; Sat, 16 Jan 2016 02:21:44 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22f.google.com with SMTP id b14so49771910wmb.1 for ; Fri, 15 Jan 2016 18:21:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=v0Fvy3IkUhxZE8HsL/kcIzlNPDXoxjBX+Yk+Zu8PuG0=; b=WOa0scWC0ntgyERthYCZcoqLlKD9lI90v7VqO4Q3UvH6JtrUFr8Vu733v1PkkKzQZ/ 5yWKwczFlDe2GiKvVsvyF6x6fiL4CxB3Miwxe+ewlOZrSR0lDqXwVLx+EMNOywfQse4R u0P6QV5iy7R+8DvD4jA5yAhp0g0oJup4sr0sJu4X7V7Bd4JUQmnAoYX2K+FfeeOaZbWV SrTC7iTMtHOcYi1bE8bXPa0QLMdjfPIB1XsED3QbOUeQhvND8y4UNQNd6IpwfrIj4Fhm bO+g9r8UlgF/goqjA3/78c0Mn7exF65gVunVTXG54mQll4elLqQgaTdBUrk2/YWeJ8c+ lOJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=v0Fvy3IkUhxZE8HsL/kcIzlNPDXoxjBX+Yk+Zu8PuG0=; b=maqcfbwcIsxM8y43fSnURdJbjLrsbwGR/rt4uC5Ix3jL08KITqssmfk/nOb3tpe4KE dzKRf2Fk7lO34Gw70ftRwIVvgb+x5vzMd0nzkci+YB9ZYeiww4Nk88hyvqx28AOasfLO NpDdPUy9zcQAbpAPwOsVjF4GVacYAm44QUO9w8R3MfRn5A7DMzKgTFOXEfQih+8lhTas a8/YvAf/RbEMtwGcS5mhenbr8uTglmqtviazN9lhl/EdWt/stZHZs6OO5+6Xg832BWB+ gBhz2lWoctBPOHXzvXnnvJsQ1fu5OYTDVKJNaBrIMVDd72XKB/7YR9B8ciGb3FMHvkWh BAdA== X-Gm-Message-State: ALoCoQnieLU3sfdOXCZ5tXlz4v8/jRu6/bYlTPs7GilBuQJRFuqxXTWK1h364W0st8VJhTcUnORo6aiOR1TFChM6DevFu7P6HQ== X-Received: by 10.194.174.73 with SMTP id bq9mr12892941wjc.145.1452910902922; Fri, 15 Jan 2016 18:21:42 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id w8sm12983972wjx.21.2016.01.15.18.21.41 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Jan 2016 18:21:42 -0800 (PST) Subject: Re: svn commit: r294127 - head/tools/regression/sockets/zerosend To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601160218.u0G2IaRW066902@repo.freebsd.org> From: Steven Hartland Message-ID: <5699A94A.8070209@multiplay.co.uk> Date: Sat, 16 Jan 2016 02:22:02 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201601160218.u0G2IaRW066902@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 02:21:45 -0000 The main params change seems a bit odd, wouldn't have expected that to be valid, shouldn't they just be flagged __unused? On 16/01/2016 02:18, Garrett Cooper wrote: > Author: ngie > Date: Sat Jan 16 02:18:36 2016 > New Revision: 294127 > URL: https://svnweb.freebsd.org/changeset/base/294127 > > Log: > Fix warnings with clang/gcc > > - Get rid of unused argc/argv variables in main > - Exit on failure with a return code of 1 instead of -1 with err/errx as a > return code of -1 is implementation dependent > - Bump WARNS to 6 > > MFC after: 5 days > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/tools/regression/sockets/zerosend/Makefile > head/tools/regression/sockets/zerosend/zerosend.c > Directory Properties: > head/ (props changed) > > Modified: head/tools/regression/sockets/zerosend/Makefile > ============================================================================== > --- head/tools/regression/sockets/zerosend/Makefile Sat Jan 16 02:15:13 2016 (r294126) > +++ head/tools/regression/sockets/zerosend/Makefile Sat Jan 16 02:18:36 2016 (r294127) > @@ -2,6 +2,6 @@ > > PROG= zerosend > MAN= > -WARNS?= 2 > +WARNS?= 6 > > .include > > Modified: head/tools/regression/sockets/zerosend/zerosend.c > ============================================================================== > --- head/tools/regression/sockets/zerosend/zerosend.c Sat Jan 16 02:15:13 2016 (r294126) > +++ head/tools/regression/sockets/zerosend/zerosend.c Sat Jan 16 02:18:36 2016 (r294127) > @@ -54,9 +54,9 @@ try_0send(const char *test, int fd) > ch = 0; > len = send(fd, &ch, 0, 0); > if (len < 0) > - err(-1, "%s: try_0send", test); > + err(1, "%s: try_0send", test); > if (len != 0) > - errx(-1, "%s: try_0send: returned %zd", test, len); > + errx(1, "%s: try_0send: returned %zd", test, len); > } > > static void > @@ -68,9 +68,9 @@ try_0write(const char *test, int fd) > ch = 0; > len = write(fd, &ch, 0); > if (len < 0) > - err(-1, "%s: try_0write", test); > + err(1, "%s: try_0write", test); > if (len != 0) > - errx(-1, "%s: try_0write: returned %zd", test, len); > + errx(1, "%s: try_0write: returned %zd", test, len); > } > > static void > @@ -87,24 +87,24 @@ setup_udp(const char *test, int *fdp) > sin.sin_port = htons(PORT1); > sock1 = socket(PF_INET, SOCK_DGRAM, 0); > if (sock1 < 0) > - err(-1, "%s: setup_udp: socket", test); > + err(1, "%s: setup_udp: socket", test); > if (bind(sock1, (struct sockaddr *)&sin, sizeof(sin)) < 0) > - err(-1, "%s: setup_udp: bind(%s, %d)", test, > + err(1, "%s: setup_udp: bind(%s, %d)", test, > inet_ntoa(sin.sin_addr), PORT1); > sin.sin_port = htons(PORT2); > if (connect(sock1, (struct sockaddr *)&sin, sizeof(sin)) < 0) > - err(-1, "%s: setup_udp: connect(%s, %d)", test, > + err(1, "%s: setup_udp: connect(%s, %d)", test, > inet_ntoa(sin.sin_addr), PORT2); > > sock2 = socket(PF_INET, SOCK_DGRAM, 0); > if (sock2 < 0) > - err(-1, "%s: setup_udp: socket", test); > + err(1, "%s: setup_udp: socket", test); > if (bind(sock2, (struct sockaddr *)&sin, sizeof(sin)) < 0) > - err(-1, "%s: setup_udp: bind(%s, %d)", test, > + err(1, "%s: setup_udp: bind(%s, %d)", test, > inet_ntoa(sin.sin_addr), PORT2); > sin.sin_port = htons(PORT1); > if (connect(sock2, (struct sockaddr *)&sin, sizeof(sin)) < 0) > - err(-1, "%s: setup_udp: connect(%s, %d)", test, > + err(1, "%s: setup_udp: connect(%s, %d)", test, > inet_ntoa(sin.sin_addr), PORT1); > > fdp[0] = sock1; > @@ -130,12 +130,12 @@ setup_tcp(const char *test, int *fdp) > sin.sin_port = htons(PORT1); > sock1 = socket(PF_INET, SOCK_STREAM, 0); > if (sock1 < 0) > - err(-1, "%s: setup_tcp: socket", test); > + err(1, "%s: setup_tcp: socket", test); > if (bind(sock1, (struct sockaddr *)&sin, sizeof(sin)) < 0) > - err(-1, "%s: bind(%s, %d)", test, inet_ntoa(sin.sin_addr), > + err(1, "%s: bind(%s, %d)", test, inet_ntoa(sin.sin_addr), > PORT1); > if (listen(sock1, -1) < 0) > - err(-1, "%s: listen", test); > + err(1, "%s: listen", test); > > /* > * Now connect to it, non-blocking so that we don't deadlock against > @@ -143,25 +143,25 @@ setup_tcp(const char *test, int *fdp) > */ > sock2 = socket(PF_INET, SOCK_STREAM, 0); > if (sock2 < 0) > - err(-1, "%s: setup_tcp: socket", test); > + err(1, "%s: setup_tcp: socket", test); > if (fcntl(sock2, F_SETFL, O_NONBLOCK) < 0) > - err(-1, "%s: setup_tcp: fcntl(O_NONBLOCK)", test); > + err(1, "%s: setup_tcp: fcntl(O_NONBLOCK)", test); > if (connect(sock2, (struct sockaddr *)&sin, sizeof(sin)) < 0 && > errno != EINPROGRESS) > - err(-1, "%s: setup_tcp: connect(%s, %d)", test, > + err(1, "%s: setup_tcp: connect(%s, %d)", test, > inet_ntoa(sin.sin_addr), PORT1); > > /* > * Now pick up the connection after sleeping a moment to make sure > * there's been time for some packets to go back and forth. > */ > - if (sleep(1) < 0) > - err(-1, "%s: sleep(1)", test); > + if (sleep(1) != 0) > + err(1, "%s: sleep(1)", test); > sock3 = accept(sock1, NULL, NULL); > if (sock3 < 0) > - err(-1, "%s: accept", test); > - if (sleep(1) < 0) > - err(-1, "%s: sleep(1)", test); > + err(1, "%s: accept", test); > + if (sleep(1) != 0) > + err(1, "%s: sleep(1)", test); > > FD_ZERO(&writefds); > FD_SET(sock2, &writefds); > @@ -171,11 +171,11 @@ setup_tcp(const char *test, int *fdp) > tv.tv_usec = 0; > ret = select(sock2 + 1, NULL, &writefds, &exceptfds, &tv); > if (ret < 0) > - err(-1, "%s: setup_tcp: select", test); > + err(1, "%s: setup_tcp: select", test); > if (FD_ISSET(sock2, &exceptfds)) > - errx(-1, "%s: setup_tcp: select: exception", test); > + errx(1, "%s: setup_tcp: select: exception", test); > if (!FD_ISSET(sock2, &writefds)) > - errx(-1, "%s: setup_tcp: select: not writable", test); > + errx(1, "%s: setup_tcp: select: not writable", test); > > close(sock1); > fdp[0] = sock2; > @@ -187,7 +187,7 @@ setup_udsstream(const char *test, int *f > { > > if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fdp) < 0) > - err(-1, "%s: setup_udsstream: socketpair", test); > + err(1, "%s: setup_udsstream: socketpair", test); > } > > static void > @@ -195,7 +195,7 @@ setup_udsdgram(const char *test, int *fd > { > > if (socketpair(PF_LOCAL, SOCK_DGRAM, 0, fdp) < 0) > - err(-1, "%s: setup_udsdgram: socketpair", test); > + err(1, "%s: setup_udsdgram: socketpair", test); > } > > static void > @@ -203,7 +203,7 @@ setup_pipe(const char *test, int *fdp) > { > > if (pipe(fdp) < 0) > - err(-1, "%s: setup_pipe: pipe", test); > + err(1, "%s: setup_pipe: pipe", test); > } > > static void > @@ -213,19 +213,19 @@ setup_fifo(const char *test, int *fdp) > int fd1, fd2; > > if (mkstemp(path) == -1) > - err(-1, "%s: setup_fifo: mktemp", test); > + err(1, "%s: setup_fifo: mktemp", test); > unlink(path); > > if (mkfifo(path, 0600) < 0) > - err(-1, "%s: setup_fifo: mkfifo(%s)", test, path); > + err(1, "%s: setup_fifo: mkfifo(%s)", test, path); > > fd1 = open(path, O_RDONLY | O_NONBLOCK); > if (fd1 < 0) > - err(-1, "%s: setup_fifo: open(%s, O_RDONLY)", test, path); > + err(1, "%s: setup_fifo: open(%s, O_RDONLY)", test, path); > > fd2 = open(path, O_WRONLY | O_NONBLOCK); > if (fd2 < 0) > - err(-1, "%s: setup_fifo: open(%s, O_WRONLY)", test, path); > + err(1, "%s: setup_fifo: open(%s, O_WRONLY)", test, path); > > fdp[0] = fd2; > fdp[1] = fd1; > @@ -242,7 +242,7 @@ close_both(int *fdp) > } > > int > -main(int argc, char *argv[]) > +main(void) > { > int fd[2]; > > From owner-svn-src-head@freebsd.org Sat Jan 16 02:26:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D438AA83F00; Sat, 16 Jan 2016 02:26:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x229.google.com (mail-pf0-x229.google.com [IPv6:2607:f8b0:400e:c00::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6330113B; Sat, 16 Jan 2016 02:26:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x229.google.com with SMTP id q63so130327179pfb.1; Fri, 15 Jan 2016 18:26:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/ZPLTvep2m0VBQb1fxSWnB+0kUyE+17UFXAJjrMCInI=; b=xqNnC0CwFkd4YzrjmOrVBOdGZ/zhi0hQS0z9D/lI8wSXpovbsqLj9Pk4qaCoASAGZM C5VmKZIJprr+gjM2FMW9K5h1Vy6+7Ti2g+vccBGIlcLAhySqUQHJHArn/D7cekYjSjHI TrpXrzBESd070rwPo5P91IX0kcY650XvE0OUDXmFC09H67pWP99bsN8oVzspw7HDcn+2 uB/wLzWRZaIw8Xj2QWjcD7nLo/ymnS568RFK5GvCmsaJYXqGAjytr4nHnBBbEIaNcmhL hno685DxzI7vEGcGNXI+5x9ruIHytFgGmlI9igb8owwYuk65JVNxuSNdX+ldpIOZUX1z McJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=/ZPLTvep2m0VBQb1fxSWnB+0kUyE+17UFXAJjrMCInI=; b=kLlAjxWozm0POF81s3QLXQtubDleYhH8zwMpusfjVW61V3slfYtdpUcoDwNEDS08xM pD2Z1hKzK5BOE5kDupXLSRodIxB2jXb/YURV7r5o6MYjW8AWSwkKUS+rO91UjCxEeynH o1AgwKZ+rYLzAb1UsDnzsrq1Y2PsgXC0j6AjqPWoihNcu6Zvomgq1FMO2+nm58e98q7H mnH6aH+Q26yiT4jCvHWNKvghU1RqlkJDWVg8ffxxLD/GB8BSpx62rgh/mwosObC4VkgS SWLtCT4gRmRiRkYfvFH7WwoHrywjjuE/IxE1DfmsOhtAO6YSayC6SXU2aOLp+nTWBWLx eHlA== X-Gm-Message-State: ALoCoQmT8JAkKAC7Kzi/3OdYEOHUUlANtipWHrAJJNZj9D1mmqRzb8eUJgrrgBAc6JrsMeWKiXalYyBUVMigfkHX0SL3UeIG3Q== X-Received: by 10.98.42.135 with SMTP id q129mr19384238pfq.13.1452911211301; Fri, 15 Jan 2016 18:26:51 -0800 (PST) Received: from [192.168.100.136] ([199.231.240.59]) by smtp.gmail.com with ESMTPSA id g87sm18237104pfj.1.2016.01.15.18.26.49 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Jan 2016 18:26:49 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r294127 - head/tools/regression/sockets/zerosend From: NGie Cooper In-Reply-To: <5699A94A.8070209@multiplay.co.uk> Date: Fri, 15 Jan 2016 18:26:49 -0800 Cc: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <740B6378-A27E-43DA-BC24-293A672355AC@gmail.com> References: <201601160218.u0G2IaRW066902@repo.freebsd.org> <5699A94A.8070209@multiplay.co.uk> To: Steven Hartland X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 02:26:51 -0000 > On Jan 15, 2016, at 18:22, Steven Hartland = wrote: >=20 > The main params change seems a bit odd, wouldn't have expected that to = be valid, shouldn't they just be flagged __unused? `int main(void)` is an acceptable function definition in ANSI C =E2=80=94 = I don=E2=80=99t see why adding __unused should be done. $ grep arg tools/regression/sockets/zerosend/zerosend.c || echo not = found not found The next step is to convert these tests over to ATF, but I wanted to fix = all of the warnings/issues so I could backport them to stable/9, then = convert them to ATF. Thanks! -NGie= From owner-svn-src-head@freebsd.org Sat Jan 16 04:41:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9427A6D9E6; Sat, 16 Jan 2016 04:41:41 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA8921EDD; Sat, 16 Jan 2016 04:41:41 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G4fehR014131; Sat, 16 Jan 2016 04:41:40 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G4fem1014130; Sat, 16 Jan 2016 04:41:40 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201601160441.u0G4fem1014130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 16 Jan 2016 04:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294130 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 04:41:41 -0000 Author: alc Date: Sat Jan 16 04:41:40 2016 New Revision: 294130 URL: https://svnweb.freebsd.org/changeset/base/294130 Log: A fix to r292469: Iterate over the physical segments in descending rather than ascending order in vm_phys_alloc_contig() so that, for example, a sequence of contigmalloc(low=0, high=4GB) calls doesn't exhaust the supply of low physical memory resulting in a later contigmalloc(low=0, high=1MB) failure. Reported by: cy Tested by: cy Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Sat Jan 16 02:28:07 2016 (r294129) +++ head/sys/vm/vm_phys.c Sat Jan 16 04:41:40 2016 (r294130) @@ -1372,12 +1372,12 @@ restartdom: return (NULL); } m_run = NULL; - for (segind = 0; segind < vm_phys_nsegs; segind++) { + for (segind = vm_phys_nsegs - 1; segind >= 0; segind--) { seg = &vm_phys_segs[segind]; - if (seg->start >= high) - break; - if (low >= seg->end || seg->domain != domain) + if (seg->start >= high || seg->domain != domain) continue; + if (low >= seg->end) + break; if (low <= seg->start) pa_start = seg->start; else From owner-svn-src-head@freebsd.org Sat Jan 16 04:47:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 795E2A6DB30; Sat, 16 Jan 2016 04:47:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 348B41180; Sat, 16 Jan 2016 04:47:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G4lXqf014984; Sat, 16 Jan 2016 04:47:33 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G4lWn6014980; Sat, 16 Jan 2016 04:47:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601160447.u0G4lWn6014980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 16 Jan 2016 04:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294131 - in head/sys: arm/at91 conf dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 04:47:34 -0000 Author: imp Date: Sat Jan 16 04:47:32 2016 New Revision: 294131 URL: https://svnweb.freebsd.org/changeset/base/294131 Log: Move ohci files to their proper place in the tree for atmel. Fix when it is included (we don't have a at91rm9200 device). From a similar patch in the PR, with tweaked names. PR: 206229 Added: head/sys/arm/at91/at91_ohci.c - copied, changed from r294122, head/sys/dev/usb/controller/ohci_atmelarm.c head/sys/arm/at91/at91_ohci_fdt.c - copied, changed from r294122, head/sys/dev/usb/controller/ohci_fdt.c Deleted: head/sys/dev/usb/controller/ohci_atmelarm.c head/sys/dev/usb/controller/ohci_fdt.c Modified: head/sys/arm/at91/files.at91 head/sys/conf/files Copied and modified: head/sys/arm/at91/at91_ohci.c (from r294122, head/sys/dev/usb/controller/ohci_atmelarm.c) ============================================================================== Copied and modified: head/sys/arm/at91/at91_ohci_fdt.c (from r294122, head/sys/dev/usb/controller/ohci_fdt.c) ============================================================================== Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Sat Jan 16 04:41:40 2016 (r294130) +++ head/sys/arm/at91/files.at91 Sat Jan 16 04:47:32 2016 (r294131) @@ -9,6 +9,8 @@ arm/at91/at91_smc.c standard arm/at91/at91_cfata.c optional at91_cfata arm/at91/at91_common.c optional fdt arm/at91/at91_mci.c optional at91_mci +arm/at91/at91_ohci.c optional ohci ! fdt +arm/at91/at91_ohci_fdt.c optional ohci fdt arm/at91/at91_pinctrl.c optional fdt fdt_pinctrl arm/at91/at91_pit.c optional at91sam9 arm/at91/at91_reset.S optional at91sam9 @@ -58,8 +60,11 @@ arm/at91/board_tsc4370.c optional at91_b # # usb # +# XXX these should likely move to sys/at91 as well. They are also +# XXX slightly inconsistent with sys/conf/files and that ambiguity +# XXX should be fixed when this can be tested on real kit. The dci +# XXX code has hard-coded GPIO pins which is almost certainly wrong. dev/usb/controller/at91dci.c optional at91_dci -dev/usb/controller/at91dci_atmelarm.c optional at91_dci !fdt -dev/usb/controller/ohci_atmelarm.c optional ohci !fdt +dev/usb/controller/at91dci_atmelarm.c optional at91_dci ! fdt dev/usb/controller/at91dci_fdt.c optional at91_dci fdt -dev/usb/controller/ohci_fdt.c optional ohci fdt + Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jan 16 04:41:40 2016 (r294130) +++ head/sys/conf/files Sat Jan 16 04:47:32 2016 (r294131) @@ -2561,7 +2561,6 @@ dev/usb/controller/dwc_otg_fdt.c optiona dev/usb/controller/ehci.c optional ehci dev/usb/controller/ehci_pci.c optional ehci pci dev/usb/controller/ohci.c optional ohci -dev/usb/controller/ohci_atmelarm.c optional ohci at91rm9200 dev/usb/controller/ohci_pci.c optional ohci pci dev/usb/controller/uhci.c optional uhci dev/usb/controller/uhci_pci.c optional uhci pci From owner-svn-src-head@freebsd.org Sat Jan 16 05:35:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5CEDA83989; Sat, 16 Jan 2016 05:35:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 720751169; Sat, 16 Jan 2016 05:35:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G5ZgIw029185; Sat, 16 Jan 2016 05:35:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G5Zgov029184; Sat, 16 Jan 2016 05:35:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601160535.u0G5Zgov029184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 16 Jan 2016 05:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294132 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 05:35:43 -0000 Author: ngie Date: Sat Jan 16 05:35:42 2016 New Revision: 294132 URL: https://svnweb.freebsd.org/changeset/base/294132 Log: Bump .Dd for the content changes Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Sat Jan 16 04:47:32 2016 (r294131) +++ head/share/man/man4/ddb.4 Sat Jan 16 05:35:42 2016 (r294132) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2016 +.Dd January 15, 2016 .Dt DDB 4 .Os .Sh NAME From owner-svn-src-head@freebsd.org Sat Jan 16 05:47:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2F9DA83D62; Sat, 16 Jan 2016 05:47:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7244715EE; Sat, 16 Jan 2016 05:47:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G5lZkD032086; Sat, 16 Jan 2016 05:47:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G5lZuI032080; Sat, 16 Jan 2016 05:47:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601160547.u0G5lZuI032080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 16 Jan 2016 05:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294133 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 05:47:36 -0000 Author: imp Date: Sat Jan 16 05:47:34 2016 New Revision: 294133 URL: https://svnweb.freebsd.org/changeset/base/294133 Log: We don't need at91_bs_tag. arm_base_bs_tag works now that we have better dynamic device mapping that didn't exit when we started this port. Remove it, since everything works w/o it. Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91_common.c head/sys/arm/at91/at91_machdep.c head/sys/arm/at91/files.at91 head/sys/arm/at91/uart_cpu_at91usart.c Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Sat Jan 16 05:35:42 2016 (r294132) +++ head/sys/arm/at91/at91.c Sat Jan 16 05:47:34 2016 (r294133) @@ -54,54 +54,6 @@ __FBSDID("$FreeBSD$"); uint32_t at91_master_clock; -static int -at91_bs_map(bus_space_tag_t tag, bus_addr_t bpa, bus_size_t size, int flags, - bus_space_handle_t *bshp) -{ - vm_paddr_t pa, endpa; - - pa = trunc_page(bpa); - if (pa >= AT91_PA_BASE + 0xff00000) { - *bshp = bpa - AT91_PA_BASE + AT91_BASE; - return (0); - } - if (pa >= AT91_BASE + 0xff00000) { - *bshp = bpa; - return (0); - } - endpa = round_page(bpa + size); - - *bshp = (vm_offset_t)pmap_mapdev(pa, endpa - pa) + (bpa - pa); - - return (0); -} - -static void -at91_bs_unmap(bus_space_tag_t tag, bus_space_handle_t h, bus_size_t size) -{ - vm_offset_t va; - - va = (vm_offset_t)h; - if (va >= AT91_BASE && va <= AT91_BASE + 0xff00000) - return; - pmap_unmapdev(va, size); -} - -static int -at91_bs_subregion(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t size, bus_space_handle_t *nbshp) -{ - - *nbshp = bsh + offset; - return (0); -} - -static void -at91_barrier(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t size, bus_size_t b, - int a) -{ -} - struct arm32_dma_range * bus_dma_get_range(void) { @@ -115,115 +67,6 @@ bus_dma_get_range_nb(void) return (0); } -bs_protos(generic); - -struct bus_space at91_bs_tag = { - /* privdata is whatever the implementer wants; unused in base tag */ - .bs_privdata = NULL, - - /* mapping/unmapping */ - .bs_map = at91_bs_map, - .bs_unmap = at91_bs_unmap, - .bs_subregion = at91_bs_subregion, - - /* allocation/deallocation */ - .bs_alloc = generic_bs_alloc, - .bs_free = generic_bs_free, - - /* barrier */ - .bs_barrier = at91_barrier, - - /* read (single) */ - .bs_r_1 = NULL, /* Use inline code in bus.h */ - .bs_r_2 = NULL, /* Use inline code in bus.h */ - .bs_r_4 = NULL, /* Use inline code in bus.h */ - .bs_r_8 = NULL, /* Use inline code in bus.h */ - - /* read multiple */ - .bs_rm_1 = generic_bs_rm_1, - .bs_rm_2 = generic_bs_rm_2, - .bs_rm_4 = generic_bs_rm_4, - .bs_rm_8 = BS_UNIMPLEMENTED, - - /* read region */ - .bs_rr_1 = generic_bs_rr_1, - .bs_rr_2 = generic_bs_rr_2, - .bs_rr_4 = generic_bs_rr_4, - .bs_rr_8 = BS_UNIMPLEMENTED, - - /* write (single) */ - .bs_w_1 = NULL, /* Use inline code in bus.h */ - .bs_w_2 = NULL, /* Use inline code in bus.h */ - .bs_w_4 = NULL, /* Use inline code in bus.h */ - .bs_w_8 = NULL, /* Use inline code in bus.h */ - - /* write multiple */ - .bs_wm_1 = generic_bs_wm_1, - .bs_wm_2 = generic_bs_wm_2, - .bs_wm_4 = generic_bs_wm_4, - .bs_wm_8 = BS_UNIMPLEMENTED, - - /* write region */ - .bs_wr_1 = generic_bs_wr_1, - .bs_wr_2 = generic_bs_wr_2, - .bs_wr_4 = generic_bs_wr_4, - .bs_wr_8 = BS_UNIMPLEMENTED, - - /* set multiple */ - .bs_sm_1 = BS_UNIMPLEMENTED, - .bs_sm_2 = BS_UNIMPLEMENTED, - .bs_sm_4 = BS_UNIMPLEMENTED, - .bs_sm_8 = BS_UNIMPLEMENTED, - - /* set region */ - .bs_sr_1 = generic_bs_sr_1, - .bs_sr_2 = generic_bs_sr_2, - .bs_sr_4 = generic_bs_sr_4, - .bs_sr_8 = BS_UNIMPLEMENTED, - - /* copy */ - .bs_c_1 = BS_UNIMPLEMENTED, - .bs_c_2 = generic_bs_c_2, - .bs_c_4 = BS_UNIMPLEMENTED, - .bs_c_8 = BS_UNIMPLEMENTED, - - /* read stream (single) */ - .bs_r_1_s = NULL, /* Use inline code in bus.h */ - .bs_r_2_s = NULL, /* Use inline code in bus.h */ - .bs_r_4_s = NULL, /* Use inline code in bus.h */ - .bs_r_8_s = NULL, /* Use inline code in bus.h */ - - /* read multiple stream */ - .bs_rm_1_s = generic_bs_rm_1, - .bs_rm_2_s = generic_bs_rm_2, - .bs_rm_4_s = generic_bs_rm_4, - .bs_rm_8_s = BS_UNIMPLEMENTED, - - /* read region stream */ - .bs_rr_1_s = generic_bs_rr_1, - .bs_rr_2_s = generic_bs_rr_2, - .bs_rr_4_s = generic_bs_rr_4, - .bs_rr_8_s = BS_UNIMPLEMENTED, - - /* write stream (single) */ - .bs_w_1_s = NULL, /* Use inline code in bus.h */ - .bs_w_2_s = NULL, /* Use inline code in bus.h */ - .bs_w_4_s = NULL, /* Use inline code in bus.h */ - .bs_w_8_s = NULL, /* Use inline code in bus.h */ - - /* write multiple stream */ - .bs_wm_1_s = generic_bs_wm_1, - .bs_wm_2_s = generic_bs_wm_2, - .bs_wm_4_s = generic_bs_wm_4, - .bs_wm_8_s = BS_UNIMPLEMENTED, - - /* write region stream */ - .bs_wr_1_s = generic_bs_wr_1, - .bs_wr_2_s = generic_bs_wr_2, - .bs_wr_4_s = generic_bs_wr_4, - .bs_wr_8_s = BS_UNIMPLEMENTED, -}; - #ifndef FDT static struct at91_softc *at91_softc; @@ -265,7 +108,7 @@ at91_attach(device_t dev) arm_post_filter = at91_eoi; at91_softc = sc; - sc->sc_st = &at91_bs_tag; + sc->sc_st = arm_base_bs_tag; sc->sc_sh = AT91_BASE; sc->sc_aic_sh = AT91_BASE + AT91_SYS_BASE; sc->dev = dev; @@ -336,9 +179,9 @@ at91_alloc_resource(device_t dev, device rle->res = rman_reserve_resource(&sc->sc_mem_rman, start, end, count, flags, child); if (rle->res != NULL) { - bus_space_map(&at91_bs_tag, start, + bus_space_map(arm_base_bs_tag, start, rman_get_size(rle->res), 0, &bsh); - rman_set_bustag(rle->res, &at91_bs_tag); + rman_set_bustag(rle->res, arm_base_bs_tag); rman_set_bushandle(rle->res, bsh); } break; Modified: head/sys/arm/at91/at91_common.c ============================================================================== --- head/sys/arm/at91/at91_common.c Sat Jan 16 05:35:42 2016 (r294132) +++ head/sys/arm/at91/at91_common.c Sat Jan 16 05:47:34 2016 (r294133) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include extern const struct arm_devmap_entry at91_devmap[]; -extern struct bus_space at91_bs_tag; -bus_space_tag_t fdtbus_bs_tag = &at91_bs_tag; struct fdt_fixup_entry fdt_fixup_table[] = { { NULL, NULL } Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Sat Jan 16 05:35:42 2016 (r294132) +++ head/sys/arm/at91/at91_machdep.c Sat Jan 16 05:47:34 2016 (r294133) @@ -114,8 +114,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -extern struct bus_space at91_bs_tag; - struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; /* Static device mappings. */ Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Sat Jan 16 05:35:42 2016 (r294132) +++ head/sys/arm/at91/files.at91 Sat Jan 16 05:47:34 2016 (r294133) @@ -68,3 +68,6 @@ dev/usb/controller/at91dci.c optional a dev/usb/controller/at91dci_atmelarm.c optional at91_dci ! fdt dev/usb/controller/at91dci_fdt.c optional at91_dci fdt +# We need this for both FDT and !FDT since we use arm_base_bs_ta +# files.arm picks it up for FDT. +arm/arm/bus_space_base.c optional !fdt Modified: head/sys/arm/at91/uart_cpu_at91usart.c ============================================================================== --- head/sys/arm/at91/uart_cpu_at91usart.c Sat Jan 16 05:35:42 2016 (r294132) +++ head/sys/arm/at91/uart_cpu_at91usart.c Sat Jan 16 05:47:34 2016 (r294133) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); bus_space_tag_t uart_bus_space_io; bus_space_tag_t uart_bus_space_mem; -extern struct bus_space at91_bs_tag; extern struct uart_class at91_usart_class; int @@ -69,7 +68,7 @@ uart_cpu_getdev(int devtype, struct uart class->uc_rclk = at91_master_clock; di->ops = uart_getops(class); di->bas.chan = 0; - di->bas.bst = &at91_bs_tag; + di->bas.bst = arm_base_bs_tag; /* * XXX: Not pretty, but will work because we map the needed addresses * early. At least we probed this so that the console will work on @@ -82,7 +81,7 @@ uart_cpu_getdev(int devtype, struct uart di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; - uart_bus_space_io = &at91_bs_tag; + uart_bus_space_io = arm_base_bs_tag; uart_bus_space_mem = NULL; /* Check the environment for overrides */ uart_getenv(devtype, di, class); From owner-svn-src-head@freebsd.org Sat Jan 16 05:58:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46E6EA84055; Sat, 16 Jan 2016 05:58:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AF3A1AC8; Sat, 16 Jan 2016 05:58:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0G5wIXe035128; Sat, 16 Jan 2016 05:58:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0G5wISn035127; Sat, 16 Jan 2016 05:58:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601160558.u0G5wISn035127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 16 Jan 2016 05:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294134 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 05:58:19 -0000 Author: imp Date: Sat Jan 16 05:58:17 2016 New Revision: 294134 URL: https://svnweb.freebsd.org/changeset/base/294134 Log: Compile for specific cortex model inside the RPi 2. It's closer to working, and might actually work... Modified: head/tools/tools/nanobsd/embedded/rpi2.cfg Modified: head/tools/tools/nanobsd/embedded/rpi2.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/rpi2.cfg Sat Jan 16 05:47:34 2016 (r294133) +++ head/tools/tools/nanobsd/embedded/rpi2.cfg Sat Jan 16 05:58:17 2016 (r294134) @@ -31,6 +31,6 @@ NANO_KERNEL=RPI2 NANO_DRIVE=mmcsd0 NANO_NAME=rpi2 NANO_BOOT_PKG=u-boot-rpi2 -# NANO_CPUTYPE=cortex-a7 +NANO_CPUTYPE=cortex-a7 . common # Pull in common definitions, keep last From owner-svn-src-head@freebsd.org Sat Jan 16 10:06:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57EF4A835E6; Sat, 16 Jan 2016 10:06:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3280A176F; Sat, 16 Jan 2016 10:06:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0GA6XNe009257; Sat, 16 Jan 2016 10:06:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0GA6XS3009256; Sat, 16 Jan 2016 10:06:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601161006.u0GA6XS3009256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 16 Jan 2016 10:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294137 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 10:06:34 -0000 Author: kib Date: Sat Jan 16 10:06:33 2016 New Revision: 294137 URL: https://svnweb.freebsd.org/changeset/base/294137 Log: Busy the mount point which is the owner of the audit vnode, around audit_record_write(). This is important so that VFS_STATFS() is not done on the NULL or freed mp and the check for free space is consistent with the vnode used for write. Add vn_start_write() braces around VOP_FSYNC() calls on the audit vnode. Move repeated code to fsync vnode and panic to the helper audit_worker_sync_vp(). Reviewed by: rwatson Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/security/audit/audit_worker.c Modified: head/sys/security/audit/audit_worker.c ============================================================================== --- head/sys/security/audit/audit_worker.c Sat Jan 16 07:56:49 2016 (r294136) +++ head/sys/security/audit/audit_worker.c Sat Jan 16 10:06:33 2016 (r294137) @@ -71,6 +71,8 @@ __FBSDID("$FreeBSD$"); #include +#include + /* * Worker thread that will schedule disk I/O, etc. */ @@ -98,6 +100,26 @@ static struct sx audit_worker_lock; #define AUDIT_WORKER_LOCK() sx_xlock(&audit_worker_lock) #define AUDIT_WORKER_UNLOCK() sx_xunlock(&audit_worker_lock) +static void +audit_worker_sync_vp(struct vnode *vp, struct mount *mp, const char *fmt, ...) +{ + struct mount *mp1; + int error; + va_list va; + + va_start(va, fmt); + error = vn_start_write(vp, &mp1, 0); + if (error == 0) { + VOP_LOCK(vp, LK_EXCLUSIVE | LK_RETRY); + (void)VOP_FSYNC(vp, MNT_WAIT, curthread); + VOP_UNLOCK(vp, 0); + vn_finished_write(mp1); + } + vfs_unbusy(mp); + vpanic(fmt, va); + va_end(va); +} + /* * Write an audit record to a file, performed as the last stage after both * preselection and BSM conversion. Both space management and write failures @@ -114,6 +136,7 @@ audit_record_write(struct vnode *vp, str static struct timeval last_fail; static int cur_lowspace_trigger; struct statfs *mnt_stat; + struct mount *mp; int error; static int cur_fail; long temp; @@ -123,15 +146,25 @@ audit_record_write(struct vnode *vp, str if (vp == NULL) return; - mnt_stat = &vp->v_mount->mnt_stat; + mp = vp->v_mount; + if (mp == NULL) { + error = EINVAL; + goto fail; + } + error = vfs_busy(mp, 0); + if (error != 0) { + mp = NULL; + goto fail; + } + mnt_stat = &mp->mnt_stat; /* * First, gather statistics on the audit log file and file system so * that we know how we're doing on space. Consider failure of these * operations to indicate a future inability to write to the file. */ - error = VFS_STATFS(vp->v_mount, mnt_stat); - if (error) + error = VFS_STATFS(mp, mnt_stat); + if (error != 0) goto fail; /* @@ -246,13 +279,12 @@ audit_record_write(struct vnode *vp, str */ if (audit_in_failure) { if (audit_q_len == 0 && audit_pre_q_len == 0) { - VOP_LOCK(vp, LK_EXCLUSIVE | LK_RETRY); - (void)VOP_FSYNC(vp, MNT_WAIT, curthread); - VOP_UNLOCK(vp, 0); - panic("Audit store overflow; record queue drained."); + audit_worker_sync_vp(vp, mp, + "Audit store overflow; record queue drained."); } } + vfs_unbusy(mp); return; fail_enospc: @@ -262,10 +294,8 @@ fail_enospc: * space, or ENOSPC returned by the vnode write call. */ if (audit_fail_stop) { - VOP_LOCK(vp, LK_EXCLUSIVE | LK_RETRY); - (void)VOP_FSYNC(vp, MNT_WAIT, curthread); - VOP_UNLOCK(vp, 0); - panic("Audit log space exhausted and fail-stop set."); + audit_worker_sync_vp(vp, mp, + "Audit log space exhausted and fail-stop set."); } (void)audit_send_trigger(AUDIT_TRIGGER_NO_SPACE); audit_suspended = 1; @@ -277,12 +307,12 @@ fail: * lost, which may require an immediate system halt. */ if (audit_panic_on_write_fail) { - VOP_LOCK(vp, LK_EXCLUSIVE | LK_RETRY); - (void)VOP_FSYNC(vp, MNT_WAIT, curthread); - VOP_UNLOCK(vp, 0); - panic("audit_worker: write error %d\n", error); + audit_worker_sync_vp(vp, mp, + "audit_worker: write error %d\n", error); } else if (ppsratecheck(&last_fail, &cur_fail, 1)) printf("audit_worker: write error %d\n", error); + if (mp != NULL) + vfs_unbusy(mp); } /* From owner-svn-src-head@freebsd.org Sat Jan 16 10:12:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBC67A839C3; Sat, 16 Jan 2016 10:12:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8E441CDF; Sat, 16 Jan 2016 10:12:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0GACoMg011969; Sat, 16 Jan 2016 10:12:50 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0GACoq1011968; Sat, 16 Jan 2016 10:12:50 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601161012.u0GACoq1011968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 16 Jan 2016 10:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294138 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 10:12:52 -0000 Author: andrew Date: Sat Jan 16 10:12:50 2016 New Revision: 294138 URL: https://svnweb.freebsd.org/changeset/base/294138 Log: Use __ARM_ARCH to decide when ARM_TP_ADDRESS needs to be set. This fixes an issue with clang 3.8.0 where none of the __ARM_ARCH_*__ macros were defined on some ARMv6 kernel configs. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/include/sysarch.h Modified: head/sys/arm/include/sysarch.h ============================================================================== --- head/sys/arm/include/sysarch.h Sat Jan 16 10:06:33 2016 (r294137) +++ head/sys/arm/include/sysarch.h Sat Jan 16 10:12:50 2016 (r294138) @@ -37,7 +37,9 @@ #ifndef _ARM_SYSARCH_H_ #define _ARM_SYSARCH_H_ +#include #include + /* * The ARM_TP_ADDRESS points to a special purpose page, which is used as local * store for the ARM per-thread data and Restartable Atomic Sequences support. @@ -53,11 +55,7 @@ /* ARM_TP_ADDRESS is needed for processors that don't support * the exclusive-access opcodes introduced with ARMv6K. */ -/* TODO: #if !defined(_HAVE_ARMv6K_INSTRUCTIONS) */ -#if !defined (__ARM_ARCH_7__) && \ - !defined (__ARM_ARCH_7A__) && \ - !defined (__ARM_ARCH_6K__) && \ - !defined (__ARM_ARCH_6ZK__) +#if __ARM_ARCH <= 5 #define ARM_TP_ADDRESS (ARM_VECTORS_HIGH + 0x1000) #define ARM_RAS_START (ARM_TP_ADDRESS + 4) #define ARM_RAS_END (ARM_TP_ADDRESS + 8) From owner-svn-src-head@freebsd.org Sat Jan 16 13:08:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7DF0A84EBE; Sat, 16 Jan 2016 13:08:56 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 780AD182D; Sat, 16 Jan 2016 13:08:55 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club (dchagin.static.corbina.ru [78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u0GD8ilE009122 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 16 Jan 2016 13:08:46 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host dchagin.static.corbina.ru [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u0GD8hF6037757 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 16 Jan 2016 16:08:44 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.1/Submit) id u0GD8hfJ037756; Sat, 16 Jan 2016 16:08:43 +0300 (MSK) (envelope-from dchagin) Date: Sat, 16 Jan 2016 16:08:42 +0300 From: Chagin Dmitry To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r289769 - in head/sys: amd64/linux amd64/linux32 cddl/dev/systrace kern modules/dtrace modules/dtrace/systrace_linux modules/dtrace/systrace_linux32 Message-ID: <20160116130842.GA37748@chd.heemeyer.club> References: <201510222128.t9MLSLpI056145@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201510222128.t9MLSLpI056145@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 13:08:56 -0000 On Thu, Oct 22, 2015 at 09:28:21PM +0000, John Baldwin wrote: > Author: jhb > Date: Thu Oct 22 21:28:20 2015 > New Revision: 289769 > URL: https://svnweb.freebsd.org/changeset/base/289769 > > Log: > Rename remaining linux32 symbols such as linux_sysent[] and > linux_syscallnames[] from linux_* to linux32_* to avoid conflicts with > linux64.ko. While here, add support for linux64 binaries to systrace. > - Update NOPROTO entries in amd64/linux/syscalls.master to match the > main table to fix systrace build. > - Add a special case for union l_semun arguments to the systrace > generation. > - The systrace_linux32 module now only builds the systrace_linux32.ko. > module on amd64. > - Add a new systrace_linux module that builds on both i386 and amd64. > For i386 it builds the existing systrace_linux.ko. For amd64 it > builds a systrace_linux.ko for 64-bit binaries. Hi, John. is it possible to merge to the stable/10 a set of r289769, regen, r289822, r290143 and r290144? thanks From owner-svn-src-head@freebsd.org Sat Jan 16 17:28:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F34C3A851C3; Sat, 16 Jan 2016 17:28:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A88931DDD; Sat, 16 Jan 2016 17:28:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0GHSbev043565; Sat, 16 Jan 2016 17:28:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0GHSbPn043564; Sat, 16 Jan 2016 17:28:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601161728.u0GHSbPn043564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 16 Jan 2016 17:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294168 - head/sys/cddl/contrib/opensolaris X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 17:28:39 -0000 Author: dim Date: Sat Jan 16 17:28:37 2016 New Revision: 294168 URL: https://svnweb.freebsd.org/changeset/base/294168 Log: Fix up mergeinfo after r294102. Modified: Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) From owner-svn-src-head@freebsd.org Sat Jan 16 18:13:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9EEBA8453A; Sat, 16 Jan 2016 18:13:29 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AC5B14A4; Sat, 16 Jan 2016 18:13:29 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0GIDSrB060109; Sat, 16 Jan 2016 18:13:28 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0GIDSeD060108; Sat, 16 Jan 2016 18:13:28 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201601161813.u0GIDSeD060108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Sat, 16 Jan 2016 18:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294183 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 18:13:29 -0000 Author: jamie Date: Sat Jan 16 18:13:28 2016 New Revision: 294183 URL: https://svnweb.freebsd.org/changeset/base/294183 Log: Clear errno before calling getpw*. Modified: head/usr.sbin/jail/command.c Modified: head/usr.sbin/jail/command.c ============================================================================== --- head/usr.sbin/jail/command.c Sat Jan 16 18:11:17 2016 (r294182) +++ head/usr.sbin/jail/command.c Sat Jan 16 18:13:28 2016 (r294183) @@ -877,6 +877,7 @@ get_user_info(struct cfjail *j, const ch { const struct passwd *pwd; + errno = 0; *pwdp = pwd = username ? getpwnam(username) : getpwuid(getuid()); if (pwd == NULL) { if (errno) From owner-svn-src-head@freebsd.org Sat Jan 16 19:25:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9208EA8410D; Sat, 16 Jan 2016 19:25:17 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60B281625; Sat, 16 Jan 2016 19:25:17 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0GJPGlA082463; Sat, 16 Jan 2016 19:25:16 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0GJPGwa082462; Sat, 16 Jan 2016 19:25:16 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201601161925.u0GJPGwa082462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 16 Jan 2016 19:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294191 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 19:25:17 -0000 Author: allanjude Date: Sat Jan 16 19:25:16 2016 New Revision: 294191 URL: https://svnweb.freebsd.org/changeset/base/294191 Log: Never 4k align the MBR bootpool because zfsldr can not deal with a gap If the bootpool does not start at the first sector of the BSD partition then zfsldr seeks to the wrong offset inside the ZFS vdev label, and is unable to find zfsboot, so the system does not boot If 4k alignment is requested, align the BSD partition in the MBR table, and align the swap and data pool, but the bootpool must start at sector 1 While here, if 4k alignment is requested, disable MBR CHS alignment, as this results in not-4k aligned partitions. Reported by: Alex Wilkinson MFC after: 5 days Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Sat Jan 16 19:06:12 2016 (r294190) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sat Jan 16 19:25:16 2016 (r294191) @@ -825,6 +825,7 @@ zfs_create_diskpart() if [ "$ZFSBOOT_FORCE_4K_SECTORS" ]; then align_small="-a 4k" align_big="-a 1m" + sysctl kern.geom.part.mbr.enforce_chs=0 fi case "$ZFSBOOT_PARTITION_SCHEME" in @@ -940,11 +941,12 @@ zfs_create_diskpart() # # Always prepare a boot pool on MBR + # Do not align this partition, there must not be a gap # ZFSBOOT_BOOT_POOL=1 f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_INDEX_WITH_SIZE" \ - "$align_small" 1 freebsd-zfs ${bootsize}b ${disk}s1 || + "" 1 freebsd-zfs ${bootsize}b ${disk}s1 || return $FAILURE # Pedantically nuke any old labels f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ From owner-svn-src-head@freebsd.org Sat Jan 16 21:24:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 709A5A84B7B; Sat, 16 Jan 2016 21:24:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42713106D; Sat, 16 Jan 2016 21:24:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0GLOCnQ018072; Sat, 16 Jan 2016 21:24:12 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0GLOCMc018071; Sat, 16 Jan 2016 21:24:12 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601162124.u0GLOCMc018071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 16 Jan 2016 21:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294195 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 21:24:13 -0000 Author: jhibbits Date: Sat Jan 16 21:24:12 2016 New Revision: 294195 URL: https://svnweb.freebsd.org/changeset/base/294195 Log: Partially revert r294055. This part was a botched revert of a test change. Spotted by: alc Modified: head/sys/powerpc/include/vmparam.h Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Sat Jan 16 20:24:02 2016 (r294194) +++ head/sys/powerpc/include/vmparam.h Sat Jan 16 21:24:12 2016 (r294195) @@ -129,7 +129,7 @@ struct pmap_physseg { * The physical address space is densely populated on 32-bit systems, * but may not be on 64-bit ones. */ -#ifdef __powerpc__ +#ifdef __powerpc64__ #define VM_PHYSSEG_SPARSE #else #define VM_PHYSSEG_DENSE From owner-svn-src-head@freebsd.org Sat Jan 16 22:32:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA97FA84239; Sat, 16 Jan 2016 22:32:58 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAC7B110A; Sat, 16 Jan 2016 22:32:58 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0GMWvdb038492; Sat, 16 Jan 2016 22:32:57 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0GMWvsf038491; Sat, 16 Jan 2016 22:32:57 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201601162232.u0GMWvsf038491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Sat, 16 Jan 2016 22:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294196 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 22:32:59 -0000 Author: jamie Date: Sat Jan 16 22:32:57 2016 New Revision: 294196 URL: https://svnweb.freebsd.org/changeset/base/294196 Log: Don't bother checking an ip[46].addr netmask/prefixlen. This is already handled by ifconfig, and it was doing it wrong when the paramater included extra ifconfig options. PR: 205926 MFC after: 5 days Modified: head/usr.sbin/jail/config.c Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Sat Jan 16 21:24:12 2016 (r294195) +++ head/usr.sbin/jail/config.c Sat Jan 16 22:32:57 2016 (r294196) @@ -454,7 +454,7 @@ check_intparams(struct cfjail *j) struct addrinfo hints; struct addrinfo *ai0, *ai; const char *hostname; - int gicode, defif, prefix; + int gicode, defif; #endif #ifdef INET struct in_addr addr4; @@ -597,15 +597,7 @@ check_intparams(struct cfjail *j) strcpy(s->s, cs + 1); s->len -= cs + 1 - s->s; } - if ((cs = strchr(s->s, '/'))) { - prefix = strtol(cs + 1, &ep, 10); - if (*ep == '.' - ? inet_pton(AF_INET, cs + 1, &addr4) != 1 - : *ep || prefix < 0 || prefix > 32) { - jail_warnx(j, - "ip4.addr: bad netmask \"%s\"", cs); - error = -1; - } + if ((cs = strchr(s->s, '/')) != NULL) { *cs = '\0'; s->len = cs - s->s; } @@ -626,14 +618,7 @@ check_intparams(struct cfjail *j) strcpy(s->s, cs + 1); s->len -= cs + 1 - s->s; } - if ((cs = strchr(s->s, '/'))) { - prefix = strtol(cs + 1, &ep, 10); - if (*ep || prefix < 0 || prefix > 128) { - jail_warnx(j, - "ip6.addr: bad prefixlen \"%s\"", - cs); - error = -1; - } + if ((cs = strchr(s->s, '/')) != NULL) { *cs = '\0'; s->len = cs - s->s; }