From owner-svn-src-head@FreeBSD.ORG Sun May 31 02:21:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CE791B3; Sun, 31 May 2015 02:21:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 706151B99; Sun, 31 May 2015 02:21:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4V2Lb9j092608; Sun, 31 May 2015 02:21:37 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4V2LaMo092604; Sun, 31 May 2015 02:21:36 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201505310221.t4V2LaMo092604@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Sun, 31 May 2015 02:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283801 - head/contrib/netbsd-tests/lib/libc/c063 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, 31 May 2015 02:21:37 -0000 Author: araujo (ports committer) Date: Sun May 31 02:21:35 2015 New Revision: 283801 URL: https://svnweb.freebsd.org/changeset/base/283801 Log: Fix warning of implicit declaration of function 'mkdir'. Differential Revision: D2662 Reviewed by: rodrigc, ngie Modified: head/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c head/contrib/netbsd-tests/lib/libc/c063/t_openat.c head/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c head/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c Modified: head/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c Sun May 31 02:15:22 2015 (r283800) +++ head/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c Sun May 31 02:21:35 2015 (r283801) @@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_faccessat.c,v 1.2 20 #include #include #include +#ifdef __FreeBSD__ +#include +#endif #define DIR "dir" #define FILE "dir/faccessat" Modified: head/contrib/netbsd-tests/lib/libc/c063/t_openat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_openat.c Sun May 31 02:15:22 2015 (r283800) +++ head/contrib/netbsd-tests/lib/libc/c063/t_openat.c Sun May 31 02:21:35 2015 (r283801) @@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_openat.c,v 1.2 2013/ #include #include #include +#ifdef __FreeBSD__ +#include +#endif #define DIR "dir" #define FILE "dir/openat" Modified: head/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c Sun May 31 02:15:22 2015 (r283800) +++ head/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c Sun May 31 02:21:35 2015 (r283801) @@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_readlinkat.c,v 1.3 2 #include #include #include +#ifdef __FreeBSD__ +#include +#endif #define DIR "dir" #define FILE "dir/readlinkat" Modified: head/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c Sun May 31 02:15:22 2015 (r283800) +++ head/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c Sun May 31 02:21:35 2015 (r283801) @@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_unlinkat.c,v 1.2 201 #include #include #include +#ifdef __FreeBSD__ +#include +#endif #define DIR "dir" #define FILE "dir/unlinkat" From owner-svn-src-head@FreeBSD.ORG Sun May 31 06:07:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6AFA1B7 for ; Sun, 31 May 2015 06:07:57 +0000 (UTC) (envelope-from agh@fastmail.fm) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (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 98C531BAA for ; Sun, 31 May 2015 06:07:57 +0000 (UTC) (envelope-from agh@fastmail.fm) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D2396208F7; Sun, 31 May 2015 02:01:07 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Sun, 31 May 2015 02:01:07 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=2rxJV AFCItVbpu+CmxlhRdZVJfM=; b=jaGrGCTRCqPPxd0pI7gvX6xD/9NWC20XqDiBz Ipsu3i7rE4U/NPCsAui+aIcuC4yvOBZsxYyI1jhsFZRZIHM+T99uLy0XXBw4Ftf5 RTVvniqvVsKrwcrI4WXQ/Y5RqpI69kAiUpyrINYEdB+xxdcPb6uijOMRAf1pslHy hqlWw0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=2rxJVAFCItVbpu+CmxlhRdZVJfM=; b=m2mUK bjBSxmQxfhYuPV9a7Jidkap8/QQn/X+oZsf1mqcLli0kA7H4kjKT9PD7+6yS7s2E KghTlw2DvpfV1vbCuE1YASVVj7CI5f1SQ2T0z+IkyA9BFH7recqEDbIquVljC5y+ H8N7b6kWQkqvz+W65QO2hG/YgYk5qlqRJdDapk= X-Sasl-enc: B2BiHu6YO+qdI9Wkoc5OG1wYbME9nT2/MkEwIXhOkQku 1433052067 Received: from kropotkin.auxio (unknown [223.252.30.161]) by mail.messagingengine.com (Postfix) with ESMTPA id 2B034C00015; Sun, 31 May 2015 02:01:05 -0400 (EDT) Date: Sun, 31 May 2015 14:01:02 +0800 From: Alastair Hogge To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283572 - head Message-ID: <20150531060102.GS55490@kropotkin.auxio> References: <201505261625.t4QGPTot039810@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201505261625.t4QGPTot039810@svn.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, 31 May 2015 06:07:57 -0000 On 2015-05-26 Tue 16:25:29 +0000 Baptiste Daroussin , wrote: > Author: bapt > Date: Tue May 26 16:25:28 2015 > New Revision: 283572 > URL: https://svnweb.freebsd.org/changeset/base/283572 > > Log: > Fix build WITHOUT_CDDL by unconditionnaly adding libproc and librtld_db > on supported arches to the prebuild libs Thank you. -- "I keep seeing spots in front of my eyes." "Did you ever see a doctor?" "No, just spots." From owner-svn-src-head@FreeBSD.ORG Sun May 31 07:28:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 553E7BFE; Sun, 31 May 2015 07:28:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4355C1D1B; Sun, 31 May 2015 07:28:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4V7SZh3050272; Sun, 31 May 2015 07:28:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4V7SZVA050271; Sun, 31 May 2015 07:28:35 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505310728.t4V7SZVA050271@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 31 May 2015 07:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283804 - head/contrib/gcc/config/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, 31 May 2015 07:28:35 -0000 Author: andrew Date: Sun May 31 07:28:34 2015 New Revision: 283804 URL: https://svnweb.freebsd.org/changeset/base/283804 Log: Use a spelling of .thumb clang understands. Modified: head/contrib/gcc/config/arm/lib1funcs.asm Modified: head/contrib/gcc/config/arm/lib1funcs.asm ============================================================================== --- head/contrib/gcc/config/arm/lib1funcs.asm Sun May 31 07:16:31 2015 (r283803) +++ head/contrib/gcc/config/arm/lib1funcs.asm Sun May 31 07:28:34 2015 (r283804) @@ -252,7 +252,7 @@ SYM (\name): #ifdef __thumb__ #define THUMB_FUNC .thumb_func -#define THUMB_CODE .force_thumb +#define THUMB_CODE .thumb #else #define THUMB_FUNC #define THUMB_CODE From owner-svn-src-head@FreeBSD.ORG Sun May 31 07:31:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35570E47; Sun, 31 May 2015 07:31:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 23CB71E80; Sun, 31 May 2015 07:31:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4V7VLH9052643; Sun, 31 May 2015 07:31:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4V7VKB5052642; Sun, 31 May 2015 07:31:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505310731.t4V7VKB5052642@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 31 May 2015 07:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283805 - head/sys/libkern/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, 31 May 2015 07:31:21 -0000 Author: andrew Date: Sun May 31 07:31:20 2015 New Revision: 283805 URL: https://svnweb.freebsd.org/changeset/base/283805 Log: Add more __aeabi_memcpy functions, later versions of clang generate calls to these functions. Modified: head/sys/libkern/arm/memcpy.S Modified: head/sys/libkern/arm/memcpy.S ============================================================================== --- head/sys/libkern/arm/memcpy.S Sun May 31 07:28:34 2015 (r283804) +++ head/sys/libkern/arm/memcpy.S Sun May 31 07:31:20 2015 (r283805) @@ -31,7 +31,11 @@ __FBSDID("$FreeBSD$"); #ifdef __ARM_EABI__ ENTRY_NP(__aeabi_memcpy) +EENTRY_NP(__aeabi_memcpy4) +EENTRY_NP(__aeabi_memcpy8) b memcpy +EEND(__aeabi_memcpy8) +EEND(__aeabi_memcpy4) END(__aeabi_memcpy) #endif From owner-svn-src-head@FreeBSD.ORG Sun May 31 08:10:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE526468; Sun, 31 May 2015 08:10:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DB673164C; Sun, 31 May 2015 08:10:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4V8AZlZ074649; Sun, 31 May 2015 08:10:35 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4V8AZWR074647; Sun, 31 May 2015 08:10:35 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505310810.t4V8AZWR074647@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 31 May 2015 08:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283806 - head/contrib/traceroute 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, 31 May 2015 08:10:36 -0000 Author: tuexen Date: Sun May 31 08:10:35 2015 New Revision: 283806 URL: https://svnweb.freebsd.org/changeset/base/283806 Log: When the packet verification fails in verbose mode, print the correct number of words in host byte order. Also remove a stray 'x'. MFC after: 3 days Modified: head/contrib/traceroute/traceroute.c Modified: head/contrib/traceroute/traceroute.c ============================================================================== --- head/contrib/traceroute/traceroute.c Sun May 31 07:31:20 2015 (r283805) +++ head/contrib/traceroute/traceroute.c Sun May 31 08:10:35 2015 (r283806) @@ -1346,8 +1346,8 @@ packet_ok(register u_char *buf, int cc, Printf("\n%d bytes from %s to ", cc, inet_ntoa(from->sin_addr)); Printf("%s: icmp type %d (%s) code %d\n", inet_ntoa(ip->ip_dst), type, pr_type(type), icp->icmp_code); - for (i = 4; i < cc ; i += sizeof(*lp)) - Printf("%2d: x%8.8x\n", i, *lp++); + for (i = 4; i <= cc - ICMP_MINLEN; i += sizeof(*lp)) + Printf("%2d: %8.8x\n", i, ntohl(*lp++)); } #endif return(0); From owner-svn-src-head@FreeBSD.ORG Sun May 31 09:07:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07973A4D; Sun, 31 May 2015 09:07:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CF4A5127A; Sun, 31 May 2015 09:07:27 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4V97Rfp003438; Sun, 31 May 2015 09:07:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4V97RLB003435; Sun, 31 May 2015 09:07:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505310907.t4V97RLB003435@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 31 May 2015 09:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283807 - head/lib/libc/arm/aeabi 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, 31 May 2015 09:07:28 -0000 Author: andrew Date: Sun May 31 09:07:26 2015 New Revision: 283807 URL: https://svnweb.freebsd.org/changeset/base/283807 Log: Use a register to set the cpsr bits. The ip register is safe to be changed within all of these functions, and is only stored in some to correctly pad the stack. This will be needed to build as Thumb-2 as, unlike with ARM instructions, the msr instruction only takes a register as the input. Modified: head/lib/libc/arm/aeabi/aeabi_asm_double.S head/lib/libc/arm/aeabi/aeabi_asm_float.S Modified: head/lib/libc/arm/aeabi/aeabi_asm_double.S ============================================================================== --- head/lib/libc/arm/aeabi/aeabi_asm_double.S Sun May 31 08:10:35 2015 (r283806) +++ head/lib/libc/arm/aeabi/aeabi_asm_double.S Sun May 31 09:07:26 2015 (r283807) @@ -56,7 +56,7 @@ ENTRY(__aeabi_cdcmple) cmp r0, #1 bne 1f /* Yes, clear Z and C */ - msr cpsr_c, #(0) + mov ip, #(0) b 99f 1: @@ -70,14 +70,15 @@ ENTRY(__aeabi_cdcmple) cmp r0, #1 bne 2f /* Yes, set Z and C */ - msr cpsr_c, #(PCR_Z | PCR_C) + mov ip, #(PCR_Z | PCR_C) b 99f 2: /* Not less than or equal, set C and clear Z */ - msr cpsr_c, #(PCR_C) + mov ip, #(PCR_C) 99: + msr cpsr_c, ip pop {r4, r5, r6, r7, ip, pc} END(__aeabi_cdcmple) @@ -112,6 +113,7 @@ ENTRY(__aeabi_cdcmpeq) RET 1: - msr cpsr_c, #(PCR_C) + mov ip, #(PCR_C) + msr cpsr_c, ip RET END(__aeabi_cdcmpeq) Modified: head/lib/libc/arm/aeabi/aeabi_asm_float.S ============================================================================== --- head/lib/libc/arm/aeabi/aeabi_asm_float.S Sun May 31 08:10:35 2015 (r283806) +++ head/lib/libc/arm/aeabi/aeabi_asm_float.S Sun May 31 09:07:26 2015 (r283807) @@ -54,7 +54,7 @@ ENTRY(__aeabi_cfcmple) cmp r0, #1 bne 1f /* Yes, clear Z and C */ - msr cpsr_c, #(0) + mov ip, #(0) b 99f 1: @@ -66,14 +66,15 @@ ENTRY(__aeabi_cfcmple) cmp r0, #1 bne 2f /* Yes, set Z and C */ - msr cpsr_c, #(PCR_Z | PCR_C) + mov ip, #(PCR_Z | PCR_C) b 99f 2: /* Not less than or equal, set C and clear Z */ - msr cpsr_c, #(PCR_C) + mov ip, #(PCR_C) 99: + msr cpsr_c, ip pop {r4, r5, ip, pc} END(__aeabi_cfcmple) @@ -103,6 +104,7 @@ ENTRY(__aeabi_cfcmpeq) RET 1: - msreq cpsr_c, #(PCR_C) + mov ip, #(PCR_C) + msr cpsr_c, ip RET END(__aeabi_cfcmpeq) From owner-svn-src-head@FreeBSD.ORG Sun May 31 09:12:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F980BFE; Sun, 31 May 2015 09:12:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5BC2214D0; Sun, 31 May 2015 09:12:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4V9Clq9007978; Sun, 31 May 2015 09:12:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4V9Ck7f007976; Sun, 31 May 2015 09:12:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505310912.t4V9Ck7f007976@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 31 May 2015 09:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283808 - head/contrib/traceroute 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, 31 May 2015 09:12:47 -0000 Author: tuexen Date: Sun May 31 09:12:46 2015 New Revision: 283808 URL: https://svnweb.freebsd.org/changeset/base/283808 Log: Don't send malformed SCTP probe packets. MFC after: 3 days Modified: head/contrib/traceroute/traceroute.8 head/contrib/traceroute/traceroute.c Modified: head/contrib/traceroute/traceroute.8 ============================================================================== --- head/contrib/traceroute/traceroute.8 Sun May 31 09:07:26 2015 (r283807) +++ head/contrib/traceroute/traceroute.8 Sun May 31 09:12:46 2015 (r283808) @@ -16,7 +16,7 @@ .\" $Id: traceroute.8,v 1.19 2000/09/21 08:44:19 leres Exp $ .\" $FreeBSD$ .\" -.Dd June 19, 2012 +.Dd May 31, 2015 .Dt TRACEROUTE 8 .Os .Sh NAME @@ -65,7 +65,7 @@ Turn on AS# lookups and use the giv default. .It Fl e Firewall evasion mode. -Use fixed destination ports for UDP and TCP probes. +Use fixed destination ports for UDP, TCP and SCTP probes. The destination port does NOT increment with each packet sent. .It Fl f Ar first_ttl Set the initial time-to-live used in the first outgoing probe packet. @@ -110,14 +110,14 @@ Print hop addresses numerically rather t path). .It Fl P Ar proto Send packets of specified IP protocol. The currently supported protocols -are: UDP, TCP, GRE and ICMP. Other protocols may also be specified (either by -name or by number), though +are: UDP, TCP, SCTP, GRE and ICMP. Other protocols may also be specified +(either by name or by number), though .Nm does not implement any special knowledge of their packet formats. This option is useful for determining which router along a path may be blocking packets based on IP protocol number. But see BUGS below. .It Fl p Ar port -Protocol specific. For UDP and TCP, sets +Protocol specific. For UDP, TCP and SCTP, sets the base .Ar port number used in probes (default is 33434). Modified: head/contrib/traceroute/traceroute.c ============================================================================== --- head/contrib/traceroute/traceroute.c Sun May 31 09:07:26 2015 (r283807) +++ head/contrib/traceroute/traceroute.c Sun May 31 09:12:46 2015 (r283808) @@ -219,6 +219,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -367,6 +368,7 @@ void freehostinfo(struct hostinfo *); void getaddr(u_int32_t *, char *); struct hostinfo *gethostinfo(char *); u_short in_cksum(u_short *, int); +u_int32_t sctp_crc32c(const void *, u_int32_t); char *inetname(struct in_addr); int main(int, char **); u_short p_cksum(struct ip *, u_short *, int); @@ -391,6 +393,8 @@ void udp_prep(struct outdata *); int udp_check(const u_char *, int); void tcp_prep(struct outdata *); int tcp_check(const u_char *, int); +void sctp_prep(struct outdata *); +int sctp_check(const u_char *, int); void gre_prep(struct outdata *); int gre_check(const u_char *, int); void gen_prep(struct outdata *); @@ -433,6 +437,15 @@ struct outproto protos[] = { tcp_check }, { + "sctp", + "spt dpt vtag crc tyfllen tyfllen ", + IPPROTO_SCTP, + sizeof(struct sctphdr), + 32768 + 666, + sctp_prep, + sctp_check + }, + { "gre", "flg pro len clid", IPPROTO_GRE, @@ -707,6 +720,11 @@ main(int argc, char **argv) #endif protlen = packlen - sizeof(*outip) - optlen; + if ((proto->num == IPPROTO_SCTP) && (packlen & 3)) { + Fprintf(stderr, "%s: packet length must be a multiple of 4\n", + prog); + exit(1); + } outip = (struct ip *)malloc((unsigned)packlen); if (outip == NULL) { @@ -1432,6 +1450,47 @@ tcp_check(const u_char *data, int seq) } void +sctp_prep(struct outdata *outdata) +{ + struct sctphdr *const sctp = (struct sctphdr *) outp; + struct sctp_chunkhdr *chk; + + sctp->src_port = htons(ident); + sctp->dest_port = htons(port + (fixedPort ? 0 : outdata->seq)); + sctp->v_tag = (sctp->src_port << 16) | sctp->dest_port; + sctp->checksum = htonl(0); + if (protlen >= + (int)(sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))) { + chk = (struct sctp_chunkhdr *)(sctp + 1); + chk->chunk_type = SCTP_SHUTDOWN_ACK; + chk->chunk_flags = 0; + chk->chunk_length = htons(4); + } + if (protlen >= + (int)(sizeof(struct sctphdr) + 2 * sizeof(struct sctp_chunkhdr))) { + chk = chk + 1; + chk->chunk_type = SCTP_PAD_CHUNK; + chk->chunk_flags = 0; + chk->chunk_length = htons(protlen - + (sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))); + } + if (doipcksum) { + sctp->checksum = sctp_crc32c(sctp, protlen); + } +} + +int +sctp_check(const u_char *data, int seq) +{ + struct sctphdr *const sctp = (struct sctphdr *) data; + + return (ntohs(sctp->src_port) == ident + && ntohs(sctp->dest_port) == port + (fixedPort ? 0 : seq) + && sctp->v_tag == + (u_int32_t)((sctp->src_port << 16) | sctp->dest_port)); +} + +void gre_prep(struct outdata *outdata) { struct grehdr *const gre = (struct grehdr *) outp; @@ -1550,6 +1609,98 @@ in_cksum(register u_short *addr, registe } /* + * CRC32C routine for the Stream Control Transmission Protocol + */ + +#define CRC32C(c, d) (c = (c>>8) ^ crc_c[(c^(d))&0xFF]) + +static u_int32_t crc_c[256] = { + 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, + 0xC79A971F, 0x35F1141C, 0x26A1E7E8, 0xD4CA64EB, + 0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B, + 0x4D43CFD0, 0xBF284CD3, 0xAC78BF27, 0x5E133C24, + 0x105EC76F, 0xE235446C, 0xF165B798, 0x030E349B, + 0xD7C45070, 0x25AFD373, 0x36FF2087, 0xC494A384, + 0x9A879FA0, 0x68EC1CA3, 0x7BBCEF57, 0x89D76C54, + 0x5D1D08BF, 0xAF768BBC, 0xBC267848, 0x4E4DFB4B, + 0x20BD8EDE, 0xD2D60DDD, 0xC186FE29, 0x33ED7D2A, + 0xE72719C1, 0x154C9AC2, 0x061C6936, 0xF477EA35, + 0xAA64D611, 0x580F5512, 0x4B5FA6E6, 0xB93425E5, + 0x6DFE410E, 0x9F95C20D, 0x8CC531F9, 0x7EAEB2FA, + 0x30E349B1, 0xC288CAB2, 0xD1D83946, 0x23B3BA45, + 0xF779DEAE, 0x05125DAD, 0x1642AE59, 0xE4292D5A, + 0xBA3A117E, 0x4851927D, 0x5B016189, 0xA96AE28A, + 0x7DA08661, 0x8FCB0562, 0x9C9BF696, 0x6EF07595, + 0x417B1DBC, 0xB3109EBF, 0xA0406D4B, 0x522BEE48, + 0x86E18AA3, 0x748A09A0, 0x67DAFA54, 0x95B17957, + 0xCBA24573, 0x39C9C670, 0x2A993584, 0xD8F2B687, + 0x0C38D26C, 0xFE53516F, 0xED03A29B, 0x1F682198, + 0x5125DAD3, 0xA34E59D0, 0xB01EAA24, 0x42752927, + 0x96BF4DCC, 0x64D4CECF, 0x77843D3B, 0x85EFBE38, + 0xDBFC821C, 0x2997011F, 0x3AC7F2EB, 0xC8AC71E8, + 0x1C661503, 0xEE0D9600, 0xFD5D65F4, 0x0F36E6F7, + 0x61C69362, 0x93AD1061, 0x80FDE395, 0x72966096, + 0xA65C047D, 0x5437877E, 0x4767748A, 0xB50CF789, + 0xEB1FCBAD, 0x197448AE, 0x0A24BB5A, 0xF84F3859, + 0x2C855CB2, 0xDEEEDFB1, 0xCDBE2C45, 0x3FD5AF46, + 0x7198540D, 0x83F3D70E, 0x90A324FA, 0x62C8A7F9, + 0xB602C312, 0x44694011, 0x5739B3E5, 0xA55230E6, + 0xFB410CC2, 0x092A8FC1, 0x1A7A7C35, 0xE811FF36, + 0x3CDB9BDD, 0xCEB018DE, 0xDDE0EB2A, 0x2F8B6829, + 0x82F63B78, 0x709DB87B, 0x63CD4B8F, 0x91A6C88C, + 0x456CAC67, 0xB7072F64, 0xA457DC90, 0x563C5F93, + 0x082F63B7, 0xFA44E0B4, 0xE9141340, 0x1B7F9043, + 0xCFB5F4A8, 0x3DDE77AB, 0x2E8E845F, 0xDCE5075C, + 0x92A8FC17, 0x60C37F14, 0x73938CE0, 0x81F80FE3, + 0x55326B08, 0xA759E80B, 0xB4091BFF, 0x466298FC, + 0x1871A4D8, 0xEA1A27DB, 0xF94AD42F, 0x0B21572C, + 0xDFEB33C7, 0x2D80B0C4, 0x3ED04330, 0xCCBBC033, + 0xA24BB5A6, 0x502036A5, 0x4370C551, 0xB11B4652, + 0x65D122B9, 0x97BAA1BA, 0x84EA524E, 0x7681D14D, + 0x2892ED69, 0xDAF96E6A, 0xC9A99D9E, 0x3BC21E9D, + 0xEF087A76, 0x1D63F975, 0x0E330A81, 0xFC588982, + 0xB21572C9, 0x407EF1CA, 0x532E023E, 0xA145813D, + 0x758FE5D6, 0x87E466D5, 0x94B49521, 0x66DF1622, + 0x38CC2A06, 0xCAA7A905, 0xD9F75AF1, 0x2B9CD9F2, + 0xFF56BD19, 0x0D3D3E1A, 0x1E6DCDEE, 0xEC064EED, + 0xC38D26C4, 0x31E6A5C7, 0x22B65633, 0xD0DDD530, + 0x0417B1DB, 0xF67C32D8, 0xE52CC12C, 0x1747422F, + 0x49547E0B, 0xBB3FFD08, 0xA86F0EFC, 0x5A048DFF, + 0x8ECEE914, 0x7CA56A17, 0x6FF599E3, 0x9D9E1AE0, + 0xD3D3E1AB, 0x21B862A8, 0x32E8915C, 0xC083125F, + 0x144976B4, 0xE622F5B7, 0xF5720643, 0x07198540, + 0x590AB964, 0xAB613A67, 0xB831C993, 0x4A5A4A90, + 0x9E902E7B, 0x6CFBAD78, 0x7FAB5E8C, 0x8DC0DD8F, + 0xE330A81A, 0x115B2B19, 0x020BD8ED, 0xF0605BEE, + 0x24AA3F05, 0xD6C1BC06, 0xC5914FF2, 0x37FACCF1, + 0x69E9F0D5, 0x9B8273D6, 0x88D28022, 0x7AB90321, + 0xAE7367CA, 0x5C18E4C9, 0x4F48173D, 0xBD23943E, + 0xF36E6F75, 0x0105EC76, 0x12551F82, 0xE03E9C81, + 0x34F4F86A, 0xC69F7B69, 0xD5CF889D, 0x27A40B9E, + 0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E, + 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351 +}; + +u_int32_t +sctp_crc32c(const void *packet, u_int32_t len) +{ + u_int32_t i, crc32c; + u_int8_t byte0, byte1, byte2, byte3; + const u_int8_t *buf = (const u_int8_t *)packet; + + crc32c = ~0; + for (i = 0; i < len; i++) + CRC32C(crc32c, buf[i]); + crc32c = ~crc32c; + byte0 = crc32c & 0xff; + byte1 = (crc32c>>8) & 0xff; + byte2 = (crc32c>>16) & 0xff; + byte3 = (crc32c>>24) & 0xff; + crc32c = ((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3); + return htonl(crc32c); +} + +/* * Subtract 2 timeval structs: out = out - in. * Out is assumed to be within about LONG_MAX seconds of in. */ From owner-svn-src-head@FreeBSD.ORG Sun May 31 10:02:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BC8192E; Sun, 31 May 2015 10:02:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 29D551FF5; Sun, 31 May 2015 10:02:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VA22sL034663; Sun, 31 May 2015 10:02:02 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VA22fM034662; Sun, 31 May 2015 10:02:02 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505311002.t4VA22fM034662@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 31 May 2015 10:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283809 - head/usr.sbin/pw 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, 31 May 2015 10:02:02 -0000 Author: bapt Date: Sun May 31 10:02:01 2015 New Revision: 283809 URL: https://svnweb.freebsd.org/changeset/base/283809 Log: Use asprintf instead of malloc + snprintf and test the memory allocation Modified: head/usr.sbin/pw/pw.c Modified: head/usr.sbin/pw/pw.c ============================================================================== --- head/usr.sbin/pw/pw.c Sun May 31 09:12:46 2015 (r283808) +++ head/usr.sbin/pw/pw.c Sun May 31 10:02:01 2015 (r283809) @@ -221,8 +221,9 @@ main(int argc, char *argv[]) char * etcpath = getarg(&arglist, 'V')->val; if (*etcpath) { if (config == NULL) { /* Only override config location if -C not specified */ - config = malloc(MAXPATHLEN); - snprintf(config, MAXPATHLEN, "%s/pw.conf", etcpath); + asprintf(&config, "%s/pw.conf", etcpath); + if (config == NULL) + errx(EX_OSERR, "out of memory"); } memcpy(&PWF, &VPWF, sizeof PWF); setpwdir(etcpath); From owner-svn-src-head@FreeBSD.ORG Sun May 31 10:14:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C7D7BDE; Sun, 31 May 2015 10:14:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 69DA3122C; Sun, 31 May 2015 10:14:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VAEEWe040386; Sun, 31 May 2015 10:14:14 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VAEEvY040385; Sun, 31 May 2015 10:14:14 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505311014.t4VAEEvY040385@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 31 May 2015 10:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283810 - head/usr.sbin/pw 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, 31 May 2015 10:14:14 -0000 Author: bapt Date: Sun May 31 10:14:13 2015 New Revision: 283810 URL: https://svnweb.freebsd.org/changeset/base/283810 Log: Remove uneeded intermediate variable Modified: head/usr.sbin/pw/grupd.c Modified: head/usr.sbin/pw/grupd.c ============================================================================== --- head/usr.sbin/pw/grupd.c Sun May 31 10:02:01 2015 (r283809) +++ head/usr.sbin/pw/grupd.c Sun May 31 10:14:13 2015 (r283810) @@ -116,9 +116,6 @@ chggrent(char const * login, struct grou int delgrent(struct group * grp) { - char group[MAXLOGNAME]; - strlcpy(group, grp->gr_name, MAXLOGNAME); - - return gr_update(NULL, group); + return (gr_update(NULL, grp->gr_name)); } From owner-svn-src-head@FreeBSD.ORG Sun May 31 10:18:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72909E8D; Sun, 31 May 2015 10:18:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5FDB51253; Sun, 31 May 2015 10:18:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VAIB2F041260; Sun, 31 May 2015 10:18:11 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VAIBJN041259; Sun, 31 May 2015 10:18:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505311018.t4VAIBJN041259@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 31 May 2015 10:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283811 - head/usr.sbin/pw 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, 31 May 2015 10:18:11 -0000 Author: bapt Date: Sun May 31 10:18:10 2015 New Revision: 283811 URL: https://svnweb.freebsd.org/changeset/base/283811 Log: Remove uneeded intermediate variable Modified: head/usr.sbin/pw/pwupd.c Modified: head/usr.sbin/pw/pwupd.c ============================================================================== --- head/usr.sbin/pw/pwupd.c Sun May 31 10:14:13 2015 (r283810) +++ head/usr.sbin/pw/pwupd.c Sun May 31 10:18:10 2015 (r283811) @@ -162,9 +162,6 @@ chgpwent(char const * login, struct pass int delpwent(struct passwd * pwd) { - char login[MAXLOGNAME]; - - strlcpy(login, pwd->pw_name, MAXLOGNAME); - return (pw_update(NULL, login)); + return (pw_update(NULL, pwd->pw_name)); } From owner-svn-src-head@FreeBSD.ORG Sun May 31 10:51:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCAD336B; Sun, 31 May 2015 10:51:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8FFF719CC; Sun, 31 May 2015 10:51:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VAp7CE060747; Sun, 31 May 2015 10:51:07 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VAp6Kc060744; Sun, 31 May 2015 10:51:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505311051.t4VAp6Kc060744@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 31 May 2015 10:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283812 - 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: Sun, 31 May 2015 10:51:07 -0000 Author: andrew Date: Sun May 31 10:51:06 2015 New Revision: 283812 URL: https://svnweb.freebsd.org/changeset/base/283812 Log: We only support the ARM EABI in head, remove the check on __ARM_EABI__. Modified: head/sys/arm/include/_types.h head/sys/arm/include/asm.h head/sys/arm/include/proc.h Modified: head/sys/arm/include/_types.h ============================================================================== --- head/sys/arm/include/_types.h Sun May 31 10:18:10 2015 (r283811) +++ head/sys/arm/include/_types.h Sun May 31 10:51:06 2015 (r283812) @@ -105,15 +105,9 @@ typedef __uint32_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint32_t __vm_size_t; -#ifdef __ARM_EABI__ typedef unsigned int ___wchar_t; #define __WCHAR_MIN 0 /* min value for a wchar_t */ #define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ -#else -typedef int ___wchar_t; -#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ -#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ -#endif /* * Unusual type definitions. Modified: head/sys/arm/include/asm.h ============================================================================== --- head/sys/arm/include/asm.h Sun May 31 10:18:10 2015 (r283811) +++ head/sys/arm/include/asm.h Sun May 31 10:51:06 2015 (r283812) @@ -49,7 +49,7 @@ # define _ALIGN_TEXT .align 2 #endif -#if defined(__ARM_EABI__) && !defined(_STANDALONE) +#ifndef _STANDALONE #define STOP_UNWINDING .cantunwind #define _FNSTART .fnstart #define _FNEND .fnend Modified: head/sys/arm/include/proc.h ============================================================================== --- head/sys/arm/include/proc.h Sun May 31 10:18:10 2015 (r283811) +++ head/sys/arm/include/proc.h Sun May 31 10:51:06 2015 (r283812) @@ -61,11 +61,7 @@ struct mdproc { void *md_sigtramp; }; -#ifdef __ARM_EABI__ #define KINFO_PROC_SIZE 816 -#else -#define KINFO_PROC_SIZE 792 -#endif #define MAXARGS 8 /* From owner-svn-src-head@FreeBSD.ORG Sun May 31 10:51:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D24834AA; Sun, 31 May 2015 10:51:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BFB3F1AC6; Sun, 31 May 2015 10:51:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VApbBp061368; Sun, 31 May 2015 10:51:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VApbNU061367; Sun, 31 May 2015 10:51:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505311051.t4VApbNU061367@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 31 May 2015 10:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283813 - head/contrib/traceroute 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, 31 May 2015 10:51:37 -0000 Author: tuexen Date: Sun May 31 10:51:36 2015 New Revision: 283813 URL: https://svnweb.freebsd.org/changeset/base/283813 Log: Use an empty string for field descriptions of unknown protocols. MFC after: 3 days Modified: head/contrib/traceroute/traceroute.c Modified: head/contrib/traceroute/traceroute.c ============================================================================== --- head/contrib/traceroute/traceroute.c Sun May 31 10:51:06 2015 (r283812) +++ head/contrib/traceroute/traceroute.c Sun May 31 10:51:36 2015 (r283813) @@ -465,7 +465,7 @@ struct outproto protos[] = { }, { NULL, - NULL, + "", 0, 2 * sizeof(u_short), 0, From owner-svn-src-head@FreeBSD.ORG Sun May 31 11:23:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FBBB877; Sun, 31 May 2015 11:23:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 103491170; Sun, 31 May 2015 11:23:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VBNJSS077774; Sun, 31 May 2015 11:23:19 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VBNJd3077772; Sun, 31 May 2015 11:23:19 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505311123.t4VBNJd3077772@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 31 May 2015 11:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283814 - head/usr.sbin/pw 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, 31 May 2015 11:23:20 -0000 Author: bapt Date: Sun May 31 11:23:19 2015 New Revision: 283814 URL: https://svnweb.freebsd.org/changeset/base/283814 Log: Make pw_user()/pw_group() more consitent about errors Some of errors were returned to the main function, some others caused a direct exit via err(3). The main function is only interested in EXIT_SUCCESS, so in all other cases replace warn(3) + return err by err(3) Modified: head/usr.sbin/pw/pw_group.c head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sun May 31 10:51:36 2015 (r283813) +++ head/usr.sbin/pw/pw_group.c Sun May 31 11:23:19 2015 (r283814) @@ -135,8 +135,7 @@ pw_group(struct userconf * cnf, int mode if (rc == -1) err(EX_IOERR, "group '%s' not available (NIS?)", grp->gr_name); else if (rc != 0) { - warn("group update"); - return EX_IOERR; + err(EX_IOERR, "group update"); } pw_log(cnf, mode, W_GROUP, "%s(%ld) removed", a_name->val, (long) gid); return EXIT_SUCCESS; @@ -201,10 +200,8 @@ pw_group(struct userconf * cnf, int mode fputc('\n', stdout); fflush(stdout); } - if (b < 0) { - warn("-h file descriptor"); - return EX_OSERR; - } + if (b < 0) + err(EX_OSERR, "-h file descriptor"); line[b] = '\0'; if ((p = strpbrk(line, " \t\r\n")) != NULL) *p = '\0'; @@ -265,16 +262,16 @@ pw_group(struct userconf * cnf, int mode if (mode == M_ADD && (rc = addgrent(grp)) != 0) { if (rc == -1) - warnx("group '%s' already exists", grp->gr_name); + errx(EX_IOERR, "group '%s' already exists", + grp->gr_name); else - warn("group update"); - return EX_IOERR; + err(EX_IOERR, "group update"); } else if (mode == M_UPDATE && (rc = chggrent(a_name->val, grp)) != 0) { if (rc == -1) - warnx("group '%s' not available (NIS?)", grp->gr_name); + errx(EX_IOERR, "group '%s' not available (NIS?)", + grp->gr_name); else - warn("group update"); - return EX_IOERR; + err(EX_IOERR, "group update"); } arg = a_newname != NULL ? a_newname : a_name; Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sun May 31 10:51:36 2015 (r283813) +++ head/usr.sbin/pw/pw_user.c Sun May 31 11:23:19 2015 (r283814) @@ -286,8 +286,7 @@ pw_user(struct userconf * cnf, int mode, arg = getarg(args, 'C'); if (write_userconfig(arg ? arg->val : NULL)) return EXIT_SUCCESS; - warn("config update"); - return EX_IOERR; + err(EX_IOERR, "config udpate"); } if (mode == M_PRINT && getarg(args, 'a')) { @@ -416,10 +415,8 @@ pw_user(struct userconf * cnf, int mode, rc = delpwent(pwd); if (rc == -1) err(EX_IOERR, "user '%s' does not exist", pwd->pw_name); - else if (rc != 0) { - warn("passwd update"); - return EX_IOERR; - } + else if (rc != 0) + err(EX_IOERR, "passwd update"); if (cnf->nispasswd && *cnf->nispasswd=='/') { rc = delnispwent(cnf->nispasswd, a_name->val); @@ -672,11 +669,9 @@ pw_user(struct userconf * cnf, int mode, fputc('\n', stdout); fflush(stdout); } - if (b < 0) { - warn("-%c file descriptor", precrypt ? 'H' : - 'h'); - return EX_IOERR; - } + if (b < 0) + err(EX_IOERR, "-%c file descriptor", + precrypt ? 'H' : 'h'); line[b] = '\0'; if ((p = strpbrk(line, "\r\n")) != NULL) *p = '\0'; @@ -709,13 +704,11 @@ pw_user(struct userconf * cnf, int mode, if (mode == M_ADD) { edited = 1; /* Always */ rc = addpwent(pwd); - if (rc == -1) { - warnx("user '%s' already exists", pwd->pw_name); - return EX_IOERR; - } else if (rc != 0) { - warn("passwd file update"); - return EX_IOERR; - } + if (rc == -1) + errx(EX_IOERR, "user '%s' already exists", + pwd->pw_name); + else if (rc != 0) + err(EX_IOERR, "passwd file update"); if (cnf->nispasswd && *cnf->nispasswd=='/') { rc = addnispwent(cnf->nispasswd, pwd); if (rc == -1) @@ -727,13 +720,10 @@ pw_user(struct userconf * cnf, int mode, } else if (mode == M_UPDATE || mode == M_LOCK || mode == M_UNLOCK) { if (edited) { /* Only updated this if required */ rc = chgpwent(a_name->val, pwd); - if (rc == -1) { - warnx("user '%s' does not exist (NIS?)", pwd->pw_name); - return EX_IOERR; - } else if (rc != 0) { - warn("passwd file update"); - return EX_IOERR; - } + if (rc == -1) + errx(EX_IOERR, "user '%s' does not exist (NIS?)", pwd->pw_name); + else if (rc != 0) + err(EX_IOERR, "passwd file update"); if ( cnf->nispasswd && *cnf->nispasswd=='/') { rc = chgnispwent(cnf->nispasswd, a_name->val, pwd); if (rc == -1) From owner-svn-src-head@FreeBSD.ORG Sun May 31 11:55:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F07ECB9; Sun, 31 May 2015 11:55:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7FF631844; Sun, 31 May 2015 11:55:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VBtTw1094107; Sun, 31 May 2015 11:55:29 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VBtT2u094106; Sun, 31 May 2015 11:55:29 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505311155.t4VBtT2u094106@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 31 May 2015 11:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283815 - head/usr.sbin/pw 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, 31 May 2015 11:55:29 -0000 Author: bapt Date: Sun May 31 11:55:28 2015 New Revision: 283815 URL: https://svnweb.freebsd.org/changeset/base/283815 Log: Return early in case we cannot read the configuration file This drops one level of indentation Modified: head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sun May 31 11:23:19 2015 (r283814) +++ head/usr.sbin/pw/pw_conf.c Sun May 31 11:55:28 2015 (r283815) @@ -241,126 +241,127 @@ read_userconfig(char const * file) if (file == NULL) file = _PATH_PW_CONF; - if ((fp = fopen(file, "r")) != NULL) { - while ((linelen = getline(&buf, &linecap, fp)) > 0) { - if (*buf && (p = strtok(buf, " \t\r\n=")) != NULL && *p != '#') { - static char const toks[] = " \t\r\n,="; - char *q = strtok(NULL, toks); - int i = 0; - mode_t *modeset; + if ((fp = fopen(file, "r")) == NULL) + return (&config); - while (i < _UC_FIELDS && strcmp(p, kwds[i]) != 0) - ++i; + while ((linelen = getline(&buf, &linecap, fp)) > 0) { + if (*buf && (p = strtok(buf, " \t\r\n=")) != NULL && *p != '#') { + static char const toks[] = " \t\r\n,="; + char *q = strtok(NULL, toks); + int i = 0; + mode_t *modeset; + + while (i < _UC_FIELDS && strcmp(p, kwds[i]) != 0) + ++i; #if debugging - if (i == _UC_FIELDS) - printf("Got unknown kwd `%s' val=`%s'\n", p, q ? q : ""); - else - printf("Got kwd[%s]=%s\n", p, q); + if (i == _UC_FIELDS) + printf("Got unknown kwd `%s' val=`%s'\n", p, q ? q : ""); + else + printf("Got kwd[%s]=%s\n", p, q); #endif - switch (i) { - case _UC_DEFAULTPWD: - config.default_password = boolean_val(q, 1); - break; - case _UC_REUSEUID: - config.reuse_uids = boolean_val(q, 0); - break; - case _UC_REUSEGID: - config.reuse_gids = boolean_val(q, 0); - break; - case _UC_NISPASSWD: - config.nispasswd = (q == NULL || !boolean_val(q, 1)) - ? NULL : newstr(q); - break; - case _UC_DOTDIR: - config.dotdir = (q == NULL || !boolean_val(q, 1)) - ? NULL : newstr(q); - break; + switch (i) { + case _UC_DEFAULTPWD: + config.default_password = boolean_val(q, 1); + break; + case _UC_REUSEUID: + config.reuse_uids = boolean_val(q, 0); + break; + case _UC_REUSEGID: + config.reuse_gids = boolean_val(q, 0); + break; + case _UC_NISPASSWD: + config.nispasswd = (q == NULL || !boolean_val(q, 1)) + ? NULL : newstr(q); + break; + case _UC_DOTDIR: + config.dotdir = (q == NULL || !boolean_val(q, 1)) + ? NULL : newstr(q); + break; case _UC_NEWMAIL: - config.newmail = (q == NULL || !boolean_val(q, 1)) - ? NULL : newstr(q); - break; - case _UC_LOGFILE: - config.logfile = (q == NULL || !boolean_val(q, 1)) - ? NULL : newstr(q); - break; - case _UC_HOMEROOT: - config.home = (q == NULL || !boolean_val(q, 1)) - ? "/home" : newstr(q); - break; - case _UC_HOMEMODE: - modeset = setmode(q); - config.homemode = (q == NULL || !boolean_val(q, 1)) - ? _DEF_DIRMODE : getmode(modeset, _DEF_DIRMODE); - free(modeset); - break; - case _UC_SHELLPATH: - config.shelldir = (q == NULL || !boolean_val(q, 1)) - ? "/bin" : newstr(q); - break; - case _UC_SHELLS: - for (i = 0; i < _UC_MAXSHELLS && q != NULL; i++, q = strtok(NULL, toks)) - system_shells[i] = newstr(q); - if (i > 0) - while (i < _UC_MAXSHELLS) - system_shells[i++] = NULL; - break; - case _UC_DEFAULTSHELL: - config.shell_default = (q == NULL || !boolean_val(q, 1)) - ? (char *) bourne_shell : newstr(q); - break; - case _UC_DEFAULTGROUP: - q = unquote(q); - config.default_group = (q == NULL || !boolean_val(q, 1) || GETGRNAM(q) == NULL) - ? NULL : newstr(q); - break; - case _UC_EXTRAGROUPS: - for (i = 0; q != NULL; q = strtok(NULL, toks)) { - if (extendarray(&config.groups, &config.numgroups, i + 2) != -1) - config.groups[i++] = newstr(q); - } - if (i > 0) - while (i < config.numgroups) - config.groups[i++] = NULL; - break; - case _UC_DEFAULTCLASS: - config.default_class = (q == NULL || !boolean_val(q, 1)) - ? NULL : newstr(q); - break; - case _UC_MINUID: - if ((q = unquote(q)) != NULL && isdigit(*q)) - config.min_uid = (uid_t) atol(q); - break; - case _UC_MAXUID: - if ((q = unquote(q)) != NULL && isdigit(*q)) - config.max_uid = (uid_t) atol(q); - break; - case _UC_MINGID: - if ((q = unquote(q)) != NULL && isdigit(*q)) - config.min_gid = (gid_t) atol(q); - break; - case _UC_MAXGID: - if ((q = unquote(q)) != NULL && isdigit(*q)) - config.max_gid = (gid_t) atol(q); - break; - case _UC_EXPIRE: - if ((q = unquote(q)) != NULL && isdigit(*q)) - config.expire_days = atoi(q); - break; - case _UC_PASSWORD: - if ((q = unquote(q)) != NULL && isdigit(*q)) - config.password_days = atoi(q); - break; - case _UC_FIELDS: - case _UC_NONE: - break; + config.newmail = (q == NULL || !boolean_val(q, 1)) + ? NULL : newstr(q); + break; + case _UC_LOGFILE: + config.logfile = (q == NULL || !boolean_val(q, 1)) + ? NULL : newstr(q); + break; + case _UC_HOMEROOT: + config.home = (q == NULL || !boolean_val(q, 1)) + ? "/home" : newstr(q); + break; + case _UC_HOMEMODE: + modeset = setmode(q); + config.homemode = (q == NULL || !boolean_val(q, 1)) + ? _DEF_DIRMODE : getmode(modeset, _DEF_DIRMODE); + free(modeset); + break; + case _UC_SHELLPATH: + config.shelldir = (q == NULL || !boolean_val(q, 1)) + ? "/bin" : newstr(q); + break; + case _UC_SHELLS: + for (i = 0; i < _UC_MAXSHELLS && q != NULL; i++, q = strtok(NULL, toks)) + system_shells[i] = newstr(q); + if (i > 0) + while (i < _UC_MAXSHELLS) + system_shells[i++] = NULL; + break; + case _UC_DEFAULTSHELL: + config.shell_default = (q == NULL || !boolean_val(q, 1)) + ? (char *) bourne_shell : newstr(q); + break; + case _UC_DEFAULTGROUP: + q = unquote(q); + config.default_group = (q == NULL || !boolean_val(q, 1) || GETGRNAM(q) == NULL) + ? NULL : newstr(q); + break; + case _UC_EXTRAGROUPS: + for (i = 0; q != NULL; q = strtok(NULL, toks)) { + if (extendarray(&config.groups, &config.numgroups, i + 2) != -1) + config.groups[i++] = newstr(q); } + if (i > 0) + while (i < config.numgroups) + config.groups[i++] = NULL; + break; + case _UC_DEFAULTCLASS: + config.default_class = (q == NULL || !boolean_val(q, 1)) + ? NULL : newstr(q); + break; + case _UC_MINUID: + if ((q = unquote(q)) != NULL && isdigit(*q)) + config.min_uid = (uid_t) atol(q); + break; + case _UC_MAXUID: + if ((q = unquote(q)) != NULL && isdigit(*q)) + config.max_uid = (uid_t) atol(q); + break; + case _UC_MINGID: + if ((q = unquote(q)) != NULL && isdigit(*q)) + config.min_gid = (gid_t) atol(q); + break; + case _UC_MAXGID: + if ((q = unquote(q)) != NULL && isdigit(*q)) + config.max_gid = (gid_t) atol(q); + break; + case _UC_EXPIRE: + if ((q = unquote(q)) != NULL && isdigit(*q)) + config.expire_days = atoi(q); + break; + case _UC_PASSWORD: + if ((q = unquote(q)) != NULL && isdigit(*q)) + config.password_days = atoi(q); + break; + case _UC_FIELDS: + case _UC_NONE: + break; } } if (linecap > 0) free(buf); fclose(fp); } - return &config; + return (&config); } From owner-svn-src-head@FreeBSD.ORG Sun May 31 11:57:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30835E24; Sun, 31 May 2015 11:57:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1F0271858; Sun, 31 May 2015 11:57:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VBux7t094404; Sun, 31 May 2015 11:56:59 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VBux9n094402; Sun, 31 May 2015 11:56:59 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505311156.t4VBux9n094402@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 31 May 2015 11:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283816 - head/usr.sbin/pw 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, 31 May 2015 11:57:00 -0000 Author: bapt Date: Sun May 31 11:56:59 2015 New Revision: 283816 URL: https://svnweb.freebsd.org/changeset/base/283816 Log: Remove useless test before free() Modified: head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sun May 31 11:55:28 2015 (r283815) +++ head/usr.sbin/pw/pw_conf.c Sun May 31 11:56:59 2015 (r283816) @@ -357,8 +357,7 @@ read_userconfig(char const * file) break; } } - if (linecap > 0) - free(buf); + free(buf); fclose(fp); } return (&config); From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:03:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 989D61BF; Sun, 31 May 2015 12:03:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 78F791A61; Sun, 31 May 2015 12:03:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VC3dfY099306; Sun, 31 May 2015 12:03:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VC3d4Y099302; Sun, 31 May 2015 12:03:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505311203.t4VC3d4Y099302@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 31 May 2015 12:03:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283817 - head/contrib/traceroute 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, 31 May 2015 12:03:39 -0000 Author: tuexen Date: Sun May 31 12:03:38 2015 New Revision: 283817 URL: https://svnweb.freebsd.org/changeset/base/283817 Log: Don't send illegal packets when using UDP-Lite. MFC after: 3 days Modified: head/contrib/traceroute/traceroute.8 head/contrib/traceroute/traceroute.c Modified: head/contrib/traceroute/traceroute.8 ============================================================================== --- head/contrib/traceroute/traceroute.8 Sun May 31 11:56:59 2015 (r283816) +++ head/contrib/traceroute/traceroute.8 Sun May 31 12:03:38 2015 (r283817) @@ -65,7 +65,7 @@ Turn on AS# lookups and use the giv default. .It Fl e Firewall evasion mode. -Use fixed destination ports for UDP, TCP and SCTP probes. +Use fixed destination ports for UDP, UDP-Lite, TCP and SCTP probes. The destination port does NOT increment with each packet sent. .It Fl f Ar first_ttl Set the initial time-to-live used in the first outgoing probe packet. @@ -110,18 +110,21 @@ Print hop addresses numerically rather t path). .It Fl P Ar proto Send packets of specified IP protocol. The currently supported protocols -are: UDP, TCP, SCTP, GRE and ICMP. Other protocols may also be specified -(either by name or by number), though +are: UDP, UDP-Lite, TCP, SCTP, GRE and ICMP. Other protocols may also be +specified (either by name or by number), though .Nm does not implement any special knowledge of their packet formats. This option is useful for determining which router along a path may be blocking packets based on IP protocol number. But see BUGS below. .It Fl p Ar port -Protocol specific. For UDP, TCP and SCTP, sets +Protocol specific. For UDP, UDP-Lite, TCP and SCTP, sets the base .Ar port number used in probes (default is 33434). -Traceroute hopes that nothing is listening on UDP ports +Traceroute hopes that nothing is listening on UDP ports (or UDP-Lite ports +if used by +.Nm +and supported by the peer) .Em base to .Em base + nhops * nprobes - 1 Modified: head/contrib/traceroute/traceroute.c ============================================================================== --- head/contrib/traceroute/traceroute.c Sun May 31 11:56:59 2015 (r283816) +++ head/contrib/traceroute/traceroute.c Sun May 31 12:03:38 2015 (r283817) @@ -371,7 +371,7 @@ u_short in_cksum(u_short *, int); u_int32_t sctp_crc32c(const void *, u_int32_t); char *inetname(struct in_addr); int main(int, char **); -u_short p_cksum(struct ip *, u_short *, int); +u_short p_cksum(struct ip *, u_short *, int, int); int packet_ok(u_char *, int, struct sockaddr_in *, int); char *pr_type(u_char); void print(u_char *, int, struct sockaddr_in *); @@ -391,6 +391,8 @@ int usleep(u_int); void udp_prep(struct outdata *); int udp_check(const u_char *, int); +void udplite_prep(struct outdata *); +int udplite_check(const u_char *, int); void tcp_prep(struct outdata *); int tcp_check(const u_char *, int); void sctp_prep(struct outdata *); @@ -428,6 +430,15 @@ struct outproto protos[] = { udp_check }, { + "udplite", + "spt dpt cov sum", + IPPROTO_UDPLITE, + sizeof(struct udphdr), + 32768 + 666, + udplite_prep, + udplite_check + }, + { "tcp", "spt dpt seq ack xxflwin sum urp", IPPROTO_TCP, @@ -1404,7 +1415,7 @@ udp_prep(struct outdata *outdata) outudp->uh_ulen = htons((u_short)protlen); outudp->uh_sum = 0; if (doipcksum) { - u_short sum = p_cksum(outip, (u_short*)outudp, protlen); + u_short sum = p_cksum(outip, (u_short*)outudp, protlen, protlen); outudp->uh_sum = (sum) ? sum : 0xffff; } @@ -1421,6 +1432,32 @@ udp_check(const u_char *data, int seq) } void +udplite_prep(struct outdata *outdata) +{ + struct udphdr *const outudp = (struct udphdr *) outp; + + outudp->uh_sport = htons(ident + (fixedPort ? outdata->seq : 0)); + outudp->uh_dport = htons(port + (fixedPort ? 0 : outdata->seq)); + outudp->uh_ulen = htons(8); + outudp->uh_sum = 0; + if (doipcksum) { + u_short sum = p_cksum(outip, (u_short*)outudp, protlen, 8); + outudp->uh_sum = (sum) ? sum : 0xffff; + } + + return; +} + +int +udplite_check(const u_char *data, int seq) +{ + struct udphdr *const udp = (struct udphdr *) data; + + return (ntohs(udp->uh_sport) == ident + (fixedPort ? seq : 0) && + ntohs(udp->uh_dport) == port + (fixedPort ? 0 : seq)); +} + +void tcp_prep(struct outdata *outdata) { struct tcphdr *const tcp = (struct tcphdr *) outp; @@ -1434,7 +1471,7 @@ tcp_prep(struct outdata *outdata) tcp->th_sum = 0; if (doipcksum) { - u_short sum = p_cksum(outip, (u_short*)tcp, protlen); + u_short sum = p_cksum(outip, (u_short*)tcp, protlen, protlen); tcp->th_sum = (sum) ? sum : 0xffff; } } @@ -1557,7 +1594,7 @@ print(register u_char *buf, register int * Checksum routine for UDP and TCP headers. */ u_short -p_cksum(struct ip *ip, u_short *data, int len) +p_cksum(struct ip *ip, u_short *data, int len, int cov) { static struct ipovly ipo; u_short sum[2]; @@ -1568,7 +1605,7 @@ p_cksum(struct ip *ip, u_short *data, in ipo.ih_dst = ip->ip_dst; sum[1] = in_cksum((u_short*)&ipo, sizeof(ipo)); /* pseudo ip hdr cksum */ - sum[0] = in_cksum(data, len); /* payload data cksum */ + sum[0] = in_cksum(data, cov); /* payload data cksum */ return ~in_cksum(sum, sizeof(sum)); } From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:04:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7DC5306; Sun, 31 May 2015 12:04:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D5FF81A67; Sun, 31 May 2015 12:04:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VC46WG099442; Sun, 31 May 2015 12:04:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VC46A6099441; Sun, 31 May 2015 12:04:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505311204.t4VC46A6099441@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 31 May 2015 12:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283818 - head/usr.sbin/pw 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, 31 May 2015 12:04:07 -0000 Author: bapt Date: Sun May 31 12:04:06 2015 New Revision: 283818 URL: https://svnweb.freebsd.org/changeset/base/283818 Log: Move cleanup functions to the right place Modified: head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sun May 31 12:03:38 2015 (r283817) +++ head/usr.sbin/pw/pw_conf.c Sun May 31 12:04:06 2015 (r283818) @@ -357,9 +357,10 @@ read_userconfig(char const * file) break; } } - free(buf); - fclose(fp); } + free(buf); + fclose(fp); + return (&config); } From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:11:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 042CB4DE; Sun, 31 May 2015 12:11:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E5CEF1BEB; Sun, 31 May 2015 12:11:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VCB5wS003480; Sun, 31 May 2015 12:11:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VCB53x003479; Sun, 31 May 2015 12:11:05 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505311211.t4VCB53x003479@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 31 May 2015 12:11:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283819 - head/contrib/traceroute 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, 31 May 2015 12:11:06 -0000 Author: tuexen Date: Sun May 31 12:11:05 2015 New Revision: 283819 URL: https://svnweb.freebsd.org/changeset/base/283819 Log: A TCP checksum of 0 is completely valid. Mapping 0 to 0xffff only applies to UDP and UDP-Lite. MFC after: 3 days Modified: head/contrib/traceroute/traceroute.c Modified: head/contrib/traceroute/traceroute.c ============================================================================== --- head/contrib/traceroute/traceroute.c Sun May 31 12:04:06 2015 (r283818) +++ head/contrib/traceroute/traceroute.c Sun May 31 12:11:05 2015 (r283819) @@ -1470,10 +1470,8 @@ tcp_prep(struct outdata *outdata) tcp->th_flags = TH_SYN; tcp->th_sum = 0; - if (doipcksum) { - u_short sum = p_cksum(outip, (u_short*)tcp, protlen, protlen); - tcp->th_sum = (sum) ? sum : 0xffff; - } + if (doipcksum) + tcp->th_sum = p_cksum(outip, (u_short*)tcp, protlen, protlen); } int From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:18:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A115365E; Sun, 31 May 2015 12:18:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8F1361CBF; Sun, 31 May 2015 12:18:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VCIVi1005847; Sun, 31 May 2015 12:18:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VCIVow005846; Sun, 31 May 2015 12:18:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505311218.t4VCIVow005846@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 31 May 2015 12:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283820 - head/contrib/traceroute 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, 31 May 2015 12:18:31 -0000 Author: tuexen Date: Sun May 31 12:18:30 2015 New Revision: 283820 URL: https://svnweb.freebsd.org/changeset/base/283820 Log: The code starts with base + 1 as the first port. Fix to documentation to match that. MFC after: 3 days Modified: head/contrib/traceroute/traceroute.8 Modified: head/contrib/traceroute/traceroute.8 ============================================================================== --- head/contrib/traceroute/traceroute.8 Sun May 31 12:11:05 2015 (r283819) +++ head/contrib/traceroute/traceroute.8 Sun May 31 12:18:30 2015 (r283820) @@ -125,9 +125,9 @@ Traceroute hopes that nothing is listeni if used by .Nm and supported by the peer) -.Em base +.Em base + 1 to -.Em base + nhops * nprobes - 1 +.Em base + nhops * nprobes at the destination host (so an ICMP PORT_UNREACHABLE message will be returned to terminate the route tracing). If something is listening on a port in the default range, this option can be used From owner-svn-src-head@FreeBSD.ORG Sun May 31 12:53:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD444E12; Sun, 31 May 2015 12:53:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BAB57153B; Sun, 31 May 2015 12:53:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VCrBQS026173; Sun, 31 May 2015 12:53:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VCrBG1026166; Sun, 31 May 2015 12:53:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505311253.t4VCrBG1026166@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 31 May 2015 12:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283824 - in head/lib/libc/arm: . gen 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, 31 May 2015 12:53:12 -0000 Author: andrew Date: Sun May 31 12:53:10 2015 New Revision: 283824 URL: https://svnweb.freebsd.org/changeset/base/283824 Log: Remove __ARM_EABI__ from more places in libc as this is the only ARM ABI we support. Modified: head/lib/libc/arm/SYS.h head/lib/libc/arm/gen/_setjmp.S head/lib/libc/arm/gen/setjmp.S Modified: head/lib/libc/arm/SYS.h ============================================================================== --- head/lib/libc/arm/SYS.h Sun May 31 12:50:10 2015 (r283823) +++ head/lib/libc/arm/SYS.h Sun May 31 12:53:10 2015 (r283824) @@ -39,15 +39,11 @@ #include #include -#ifdef __ARM_EABI__ #define SYSTRAP(x) \ mov ip, r7; \ ldr r7, =SYS_ ## x; \ swi 0; \ mov r7, ip -#else -#define SYSTRAP(x) swi 0 | SYS_ ## x -#endif #define CERROR _C_LABEL(cerror) #define CURBRK _C_LABEL(curbrk) Modified: head/lib/libc/arm/gen/_setjmp.S ============================================================================== --- head/lib/libc/arm/gen/_setjmp.S Sun May 31 12:50:10 2015 (r283823) +++ head/lib/libc/arm/gen/_setjmp.S Sun May 31 12:53:10 2015 (r283824) @@ -36,7 +36,7 @@ #error FPA is not supported anymore #endif -#if defined(__ARM_EABI__) && !defined(_STANDALONE) +#if !defined(_STANDALONE) .fpu vfp #endif @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); ENTRY(_setjmp) ldr r1, .L_setjmp_magic -#if defined(__ARM_EABI__) && !defined(_STANDALONE) +#if !defined(_STANDALONE) ldr r2, .Lfpu_present #ifdef PIC GOT_INIT(r3, .L_setjmp_got, .L_setjmp_gotinit) @@ -79,7 +79,7 @@ ENTRY(_setjmp) vmrs r2, fpscr str r2, [r0, #(_JB_REG_FPSCR * 4)] 1: -#endif /* __ARM_EABI__ */ +#endif /* !_STANDALONE */ str r1, [r0] @@ -99,11 +99,11 @@ END(_setjmp) .L_setjmp_magic: .word _JB_MAGIC__SETJMP -#if defined(__ARM_EABI__) && !defined(_STANDALONE) +#if !defined(_STANDALONE) GOT_INITSYM(.L_setjmp_got, .L_setjmp_gotinit) .Lfpu_present: .word PIC_SYM(_libc_arm_fpu_present, GOTOFF) -#endif /* __ARM_EABI__ */ +#endif /* !_STANDALONE */ WEAK_ALIAS(___longjmp, _longjmp) ENTRY(_longjmp) @@ -114,7 +114,7 @@ ENTRY(_longjmp) teq ip, r3 /* magic correct? */ bne botch /* no, botch */ -#if defined(__ARM_EABI__) && !defined(_STANDALONE) +#if !defined(_STANDALONE) teq r3, r2 /* did magic change? */ beq 1f /* no, don't restore VFP */ add ip, r0, #(_JB_REG_D8 * 4) @@ -122,7 +122,7 @@ ENTRY(_longjmp) ldr ip, [r0, #(_JB_REG_FPSCR * 4)] vmsr fpscr, ip 1: -#endif /* __ARM_EABI__ */ +#endif /* !_STANDALONE */ add r0, r0, #(_JB_REG_R4 * 4) /* Restore integer registers */ Modified: head/lib/libc/arm/gen/setjmp.S ============================================================================== --- head/lib/libc/arm/gen/setjmp.S Sun May 31 12:50:10 2015 (r283823) +++ head/lib/libc/arm/gen/setjmp.S Sun May 31 12:53:10 2015 (r283824) @@ -36,9 +36,7 @@ #error FPA is not supported anymore #endif -#ifdef __ARM_EABI__ .fpu vfp -#endif #include #include @@ -66,7 +64,6 @@ ENTRY(setjmp) ldr r1, .Lsetjmp_magic -#ifdef __ARM_EABI__ ldr r2, .Lfpu_present #ifdef PIC GOT_INIT(r3, .Lsetjmp_got, .Lsetjmp_gotinit) @@ -84,7 +81,6 @@ ENTRY(setjmp) vmrs r2, fpscr str r2, [r0, #(_JB_REG_FPSCR * 4)] 1: -#endif /* __ARM_EABI__ */ str r1, [r0] /* store magic */ @@ -102,11 +98,9 @@ ENTRY(setjmp) .Lsetjmp_magic: .word _JB_MAGIC_SETJMP -#ifdef __ARM_EABI__ GOT_INITSYM(.Lsetjmp_got, .Lsetjmp_gotinit) .Lfpu_present: .word PIC_SYM(_libc_arm_fpu_present, GOTOFF) -#endif /* __ARM_EABI__ */ END(setjmp) .weak _C_LABEL(longjmp) @@ -126,7 +120,6 @@ ENTRY(__longjmp) bl PIC_SYM(_C_LABEL(sigprocmask), PLT) ldmfd sp!, {r0-r2, r14} -#ifdef __ARM_EABI__ tst r2, #(_JB_MAGIC_SETJMP ^ _JB_MAGIC_SETJMP_VFP) /* is this a VFP magic? */ beq 1f /* no, don't restore VFP */ @@ -135,7 +128,6 @@ ENTRY(__longjmp) ldr ip, [r0, #(_JB_REG_FPSCR * 4)] vmsr fpscr, ip 1: -#endif /* __ARM_EABI__ */ add r0, r0, #(_JB_REG_R4 * 4) /* Restore integer registers */ From owner-svn-src-head@FreeBSD.ORG Sun May 31 14:04:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78554FD0; Sun, 31 May 2015 14:04:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6607015C2; Sun, 31 May 2015 14:04:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VE4DJn065689; Sun, 31 May 2015 14:04:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VE4BAF065678; Sun, 31 May 2015 14:04:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505311404.t4VE4BAF065678@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 31 May 2015 14:04:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283831 - head/lib/libc/arm/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: Sun, 31 May 2015 14:04:13 -0000 Author: andrew Date: Sun May 31 14:04:11 2015 New Revision: 283831 URL: https://svnweb.freebsd.org/changeset/base/283831 Log: Add the needed if-then instructions to build as Thumb-2. Modified: head/lib/libc/arm/string/ffs.S head/lib/libc/arm/string/memmove.S head/lib/libc/arm/string/memset.S head/lib/libc/arm/string/strcmp.S head/lib/libc/arm/string/strlen.S head/lib/libc/arm/string/strncmp.S Modified: head/lib/libc/arm/string/ffs.S ============================================================================== --- head/lib/libc/arm/string/ffs.S Sun May 31 13:07:22 2015 (r283830) +++ head/lib/libc/arm/string/ffs.S Sun May 31 14:04:11 2015 (r283831) @@ -78,6 +78,7 @@ ENTRY(ffs) .byte 31, 0, 0, 0, 0, 24, 0, 20 /* 48-55 */ .byte 30, 0, 23, 19, 29, 18, 17, 0 /* 56-63 */ #else + itt ne clzne r0, r0 rsbne r0, r0, #32 RET Modified: head/lib/libc/arm/string/memmove.S ============================================================================== --- head/lib/libc/arm/string/memmove.S Sun May 31 13:07:22 2015 (r283830) +++ head/lib/libc/arm/string/memmove.S Sun May 31 14:04:11 2015 (r283831) @@ -48,7 +48,9 @@ ENTRY(bcopy) #endif /* Do the buffers overlap? */ cmp r0, r1 + it eq RETeq /* Bail now if src/dst are the same */ + ite cc subcc r3, r0, r1 /* if (dst > src) r3 = dst - src */ subcs r3, r1, r0 /* if (src > dsr) r3 = src - dst */ cmp r3, r2 /* if (r3 < len) we have an overlap */ @@ -56,8 +58,10 @@ ENTRY(bcopy) /* Determine copy direction */ cmp r1, r0 + it cc bcc .Lmemmove_backwards + itt eq moveq r0, #0 /* Quick abort for len=0 */ RETeq @@ -88,6 +92,7 @@ ENTRY(bcopy) bge .Lmemmove_floop32 cmn r2, #0x10 + ittt ge ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ stmiage r0!, {r3, r4, r12, lr} subge r2, r2, #0x10 @@ -98,6 +103,7 @@ ENTRY(bcopy) /* blat 12 bytes at a time */ .Lmemmove_floop12: + ittt ge ldmiage r1!, {r3, r12, lr} stmiage r0!, {r3, r12, lr} subsge r2, r2, #0x0c @@ -108,8 +114,10 @@ ENTRY(bcopy) blt .Lmemmove_fl4 subs r2, r2, #4 + itt lt ldrlt r3, [r1], #4 strlt r3, [r0], #4 + ittt ge ldmiage r1!, {r3, r12} stmiage r0!, {r3, r12} subge r2, r2, #4 @@ -117,14 +125,17 @@ ENTRY(bcopy) .Lmemmove_fl4: /* less than 4 bytes to go */ adds r2, r2, #4 + it eq ldmiaeq sp!, {r0, pc} /* done */ /* copy the crud byte at a time */ cmp r2, #2 ldrb r3, [r1], #1 strb r3, [r0], #1 + itt ge ldrbge r3, [r1], #1 strbge r3, [r0], #1 + itt gt ldrbgt r3, [r1], #1 strbgt r3, [r0], #1 ldmia sp!, {r0, pc} @@ -137,8 +148,10 @@ ENTRY(bcopy) /* align destination with byte copies */ ldrb r3, [r1], #1 strb r3, [r0], #1 + itt ge ldrbge r3, [r1], #1 strbge r3, [r0], #1 + itt gt ldrbgt r3, [r1], #1 strbgt r3, [r0], #1 subs r2, r2, r12 @@ -355,10 +368,12 @@ ENTRY(bcopy) .Lmemmove_bl32: cmn r2, #0x10 + ittt ge ldmdbge r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ stmdbge r0!, {r3, r4, r12, lr} subge r2, r2, #0x10 adds r2, r2, #0x14 + ittt ge ldmdbge r1!, {r3, r12, lr} /* blat a remaining 12 bytes */ stmdbge r0!, {r3, r12, lr} subge r2, r2, #0x0c @@ -368,8 +383,10 @@ ENTRY(bcopy) adds r2, r2, #8 blt .Lmemmove_bl4 subs r2, r2, #4 + itt lt ldrlt r3, [r1, #-4]! strlt r3, [r0, #-4]! + ittt ge ldmdbge r1!, {r3, r12} stmdbge r0!, {r3, r12} subge r2, r2, #4 @@ -377,14 +394,17 @@ ENTRY(bcopy) .Lmemmove_bl4: /* less than 4 bytes to go */ adds r2, r2, #4 + it eq RETeq /* done */ /* copy the crud byte at a time */ cmp r2, #2 ldrb r3, [r1, #-1]! strb r3, [r0, #-1]! + itt ge ldrbge r3, [r1, #-1]! strbge r3, [r0, #-1]! + itt gt ldrbgt r3, [r1, #-1]! strbgt r3, [r0, #-1]! RET @@ -396,8 +416,10 @@ ENTRY(bcopy) /* align destination with byte copies */ ldrb r3, [r1, #-1]! strb r3, [r0, #-1]! + itt ge ldrbge r3, [r1, #-1]! strbge r3, [r0, #-1]! + itt gt ldrbgt r3, [r1, #-1]! strbgt r3, [r0, #-1]! subs r2, r2, r12 Modified: head/lib/libc/arm/string/memset.S ============================================================================== --- head/lib/libc/arm/string/memset.S Sun May 31 13:07:22 2015 (r283830) +++ head/lib/libc/arm/string/memset.S Sun May 31 14:04:11 2015 (r283831) @@ -114,6 +114,7 @@ ENTRY(memset) orr r3, r3, r3, lsl #16 /* Extend value to 32-bits */ #endif #ifdef _ARM_ARCH_5E + itt ne subne r1, r1, #0x04 /* Quad-align if necessary */ strne r3, [ip], #0x04 cmp r1, #0x10 @@ -127,18 +128,22 @@ ENTRY(memset) .Lmemset_loop128: subs r1, r1, #0x80 #ifdef _ARM_ARCH_5E + itttt ge strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 + itttt ge strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 + itttt ge strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 + itttt ge strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 @@ -162,6 +167,7 @@ ENTRY(memset) stmiage ip!, {r2-r3} #endif bgt .Lmemset_loop128 + it eq RETeq /* Zero length so just exit */ add r1, r1, #0x80 /* Adjust for extra sub */ @@ -169,6 +175,7 @@ ENTRY(memset) /* Do 32 bytes at a time */ .Lmemset_loop32: subs r1, r1, #0x20 + itttt ge #ifdef _ARM_ARCH_5E strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 @@ -181,11 +188,13 @@ ENTRY(memset) stmiage ip!, {r2-r3} #endif bgt .Lmemset_loop32 + it eq RETeq /* Zero length so just exit */ adds r1, r1, #0x10 /* Partially adjust for extra sub */ /* Deal with 16 bytes or more */ + itt ge #ifdef _ARM_ARCH_5E strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 @@ -193,20 +202,25 @@ ENTRY(memset) stmiage ip!, {r2-r3} stmiage ip!, {r2-r3} #endif + it eq RETeq /* Zero length so just exit */ + it lt addlt r1, r1, #0x10 /* Possibly adjust for extra sub */ /* We have at least 4 bytes so copy as words */ .Lmemset_loop4: subs r1, r1, #0x04 + it ge strge r3, [ip], #0x04 bgt .Lmemset_loop4 + it eq RETeq /* Zero length so just exit */ #ifdef _ARM_ARCH_5E /* Compensate for 64-bit alignment check */ adds r1, r1, #0x04 + it eq RETeq cmp r1, #2 #else @@ -214,7 +228,9 @@ ENTRY(memset) #endif strb r3, [ip], #0x01 /* Set 1 byte */ + it ge strbge r3, [ip], #0x01 /* Set another byte */ + it gt strbgt r3, [ip] /* and a third */ RET /* Exit */ @@ -222,18 +238,24 @@ ENTRY(memset) rsb r2, r2, #0x004 strb r3, [ip], #0x01 /* Set 1 byte */ cmp r2, #0x02 + it ge strbge r3, [ip], #0x01 /* Set another byte */ sub r1, r1, r2 + it gt strbgt r3, [ip], #0x01 /* and a third */ cmp r1, #0x04 /* More than 4 bytes left? */ + it ge bge .Lmemset_wordaligned /* Yup */ .Lmemset_lessthanfour: cmp r1, #0x00 + it eq RETeq /* Zero length so exit */ strb r3, [ip], #0x01 /* Set 1 byte */ cmp r1, #0x02 + it ge strbge r3, [ip], #0x01 /* Set another byte */ + it gt strbgt r3, [ip] /* and a third */ RET /* Exit */ #ifdef _BZERO Modified: head/lib/libc/arm/string/strcmp.S ============================================================================== --- head/lib/libc/arm/string/strcmp.S Sun May 31 13:07:22 2015 (r283830) +++ head/lib/libc/arm/string/strcmp.S Sun May 31 14:04:11 2015 (r283831) @@ -37,6 +37,7 @@ ENTRY(strcmp) ldrb r2, [r0], #1 ldrb r3, [r1], #1 cmp r2, #1 + it cs cmpcs r2, r3 beq 1b sub r0, r2, r3 Modified: head/lib/libc/arm/string/strlen.S ============================================================================== --- head/lib/libc/arm/string/strlen.S Sun May 31 13:07:22 2015 (r283830) +++ head/lib/libc/arm/string/strlen.S Sun May 31 14:04:11 2015 (r283831) @@ -52,8 +52,10 @@ ENTRY(strlen) #else ands r3, r2, #0xff000000 #endif + it ne addne r1, r1, #1 .Ldo_3: + itt ne #ifndef __ARMEB__ andsne r3, r2, #0x0000ff00 #else @@ -61,6 +63,7 @@ ENTRY(strlen) #endif addne r1, r1, #1 .Ldo_2: + itt ne #ifndef __ARMEB__ andsne r3, r2, #0x00ff0000 #else @@ -68,6 +71,7 @@ ENTRY(strlen) #endif addne r1, r1, #1 .Ldo_1: + ittt ne #ifndef __ARMEB__ andsne r3, r2, #0xff000000 #else Modified: head/lib/libc/arm/string/strncmp.S ============================================================================== --- head/lib/libc/arm/string/strncmp.S Sun May 31 13:07:22 2015 (r283830) +++ head/lib/libc/arm/string/strncmp.S Sun May 31 14:04:11 2015 (r283831) @@ -35,18 +35,21 @@ __FBSDID("$FreeBSD$"); ENTRY(strncmp) /* if (len == 0) return 0 */ cmp r2, #0 + itt eq moveq r0, #0 moveq pc, lr /* ip == last src address to compare */ adds ip, r0, r2 /* Use last possible address on overflow. */ + it cs movcs ip, #0 sub ip, ip, #1 1: ldrb r2, [r0], #1 ldrb r3, [r1], #1 cmp ip, r0 + itt cs cmpcs r2, #1 cmpcs r2, r3 beq 1b From owner-svn-src-head@FreeBSD.ORG Sun May 31 15:50:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CE01E47; Sun, 31 May 2015 15:50:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1BCB31CAC; Sun, 31 May 2015 15:50:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VFosRr020152; Sun, 31 May 2015 15:50:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VFos0w020151; Sun, 31 May 2015 15:50:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505311550.t4VFos0w020151@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 31 May 2015 15:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283832 - head/sys/ufs/ffs 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, 31 May 2015 15:50:55 -0000 Author: kib Date: Sun May 31 15:50:54 2015 New Revision: 283832 URL: https://svnweb.freebsd.org/changeset/base/283832 Log: Remove unused variable. When deallocate_dependencies() is performed, softdep_journal_freeblocks() already called cancel_allocdirect() which should have eliminated direct dependencies for all truncated full blocks. The indirect dependencies are allowed above, since second- and third-level dependencies are only dealt with by the code which frees indirect block, which happens after the inode write. Discussed with: mckusick, jeff Reviewed by: jeff Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sun May 31 14:04:11 2015 (r283831) +++ head/sys/ufs/ffs/ffs_softdep.c Sun May 31 15:50:54 2015 (r283832) @@ -7208,7 +7208,6 @@ deallocate_dependencies(bp, freeblks, of { struct indirdep *indirdep; struct pagedep *pagedep; - struct allocdirect *adp; struct worklist *wk, *wkn; struct ufsmount *ump; @@ -7255,7 +7254,6 @@ deallocate_dependencies(bp, freeblks, of break; case D_ALLOCDIRECT: - adp = WK_ALLOCDIRECT(wk); if (off != 0) continue; /* FALLTHROUGH */ From owner-svn-src-head@FreeBSD.ORG Sun May 31 18:09:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFDE6563; Sun, 31 May 2015 18:09:00 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DC5BA1BBB; Sun, 31 May 2015 18:09:00 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VI90jo089137; Sun, 31 May 2015 18:09:00 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VI8wFp089119; Sun, 31 May 2015 18:08:58 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201505311808.t4VI8wFp089119@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Sun, 31 May 2015 18:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283833 - head/lib/libc/xdr 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, 31 May 2015 18:09:01 -0000 Author: rodrigc Date: Sun May 31 18:08:58 2015 New Revision: 283833 URL: https://svnweb.freebsd.org/changeset/base/283833 Log: Use ANSI C prototypes. Modified: head/lib/libc/xdr/xdr.c head/lib/libc/xdr/xdr_array.c head/lib/libc/xdr/xdr_float.c head/lib/libc/xdr/xdr_mem.c head/lib/libc/xdr/xdr_rec.c head/lib/libc/xdr/xdr_reference.c head/lib/libc/xdr/xdr_sizeof.c head/lib/libc/xdr/xdr_stdio.c Modified: head/lib/libc/xdr/xdr.c ============================================================================== --- head/lib/libc/xdr/xdr.c Sun May 31 15:50:54 2015 (r283832) +++ head/lib/libc/xdr/xdr.c Sun May 31 18:08:58 2015 (r283833) @@ -76,9 +76,7 @@ static const char xdr_zero[BYTES_PER_XDR * Not a filter, but a convenient utility nonetheless */ void -xdr_free(proc, objp) - xdrproc_t proc; - void *objp; +xdr_free(xdrproc_t proc, void *objp) { XDR x; @@ -101,9 +99,7 @@ xdr_void(void) * XDR integers */ bool_t -xdr_int(xdrs, ip) - XDR *xdrs; - int *ip; +xdr_int(XDR *xdrs, int *ip) { long l; @@ -131,9 +127,7 @@ xdr_int(xdrs, ip) * XDR unsigned integers */ bool_t -xdr_u_int(xdrs, up) - XDR *xdrs; - u_int *up; +xdr_u_int(XDR *xdrs, u_int *up) { u_long l; @@ -163,9 +157,7 @@ xdr_u_int(xdrs, up) * same as xdr_u_long - open coded to save a proc call! */ bool_t -xdr_long(xdrs, lp) - XDR *xdrs; - long *lp; +xdr_long(XDR *xdrs, long *lp) { switch (xdrs->x_op) { case XDR_ENCODE: @@ -184,9 +176,7 @@ xdr_long(xdrs, lp) * same as xdr_long - open coded to save a proc call! */ bool_t -xdr_u_long(xdrs, ulp) - XDR *xdrs; - u_long *ulp; +xdr_u_long(XDR *xdrs, u_long *ulp) { switch (xdrs->x_op) { case XDR_ENCODE: @@ -206,9 +196,7 @@ xdr_u_long(xdrs, ulp) * same as xdr_u_int32_t - open coded to save a proc call! */ bool_t -xdr_int32_t(xdrs, int32_p) - XDR *xdrs; - int32_t *int32_p; +xdr_int32_t(XDR *xdrs, int32_t *int32_p) { long l; @@ -237,9 +225,7 @@ xdr_int32_t(xdrs, int32_p) * same as xdr_int32_t - open coded to save a proc call! */ bool_t -xdr_u_int32_t(xdrs, u_int32_p) - XDR *xdrs; - u_int32_t *u_int32_p; +xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p) { u_long l; @@ -268,9 +254,7 @@ xdr_u_int32_t(xdrs, u_int32_p) * same as xdr_int32_t - open coded to save a proc call! */ bool_t -xdr_uint32_t(xdrs, u_int32_p) - XDR *xdrs; - uint32_t *u_int32_p; +xdr_uint32_t(XDR *xdrs, uint32_t *u_int32_p) { u_long l; @@ -298,9 +282,7 @@ xdr_uint32_t(xdrs, u_int32_p) * XDR short integers */ bool_t -xdr_short(xdrs, sp) - XDR *xdrs; - short *sp; +xdr_short(XDR *xdrs, short *sp) { long l; @@ -328,9 +310,7 @@ xdr_short(xdrs, sp) * XDR unsigned short integers */ bool_t -xdr_u_short(xdrs, usp) - XDR *xdrs; - u_short *usp; +xdr_u_short(XDR *xdrs, u_short *usp) { u_long l; @@ -359,9 +339,7 @@ xdr_u_short(xdrs, usp) * XDR 16-bit integers */ bool_t -xdr_int16_t(xdrs, int16_p) - XDR *xdrs; - int16_t *int16_p; +xdr_int16_t(XDR *xdrs, int16_t *int16_p) { long l; @@ -389,9 +367,7 @@ xdr_int16_t(xdrs, int16_p) * XDR unsigned 16-bit integers */ bool_t -xdr_u_int16_t(xdrs, u_int16_p) - XDR *xdrs; - u_int16_t *u_int16_p; +xdr_u_int16_t(XDR *xdrs, u_int16_t *u_int16_p) { u_long l; @@ -419,9 +395,7 @@ xdr_u_int16_t(xdrs, u_int16_p) * XDR unsigned 16-bit integers */ bool_t -xdr_uint16_t(xdrs, u_int16_p) - XDR *xdrs; - uint16_t *u_int16_p; +xdr_uint16_t(XDR *xdrs, uint16_t *u_int16_p) { u_long l; @@ -450,9 +424,7 @@ xdr_uint16_t(xdrs, u_int16_p) * XDR a char */ bool_t -xdr_char(xdrs, cp) - XDR *xdrs; - char *cp; +xdr_char(XDR *xdrs, char *cp) { int i; @@ -468,9 +440,7 @@ xdr_char(xdrs, cp) * XDR an unsigned char */ bool_t -xdr_u_char(xdrs, cp) - XDR *xdrs; - u_char *cp; +xdr_u_char(XDR *xdrs, u_char *cp) { u_int u; @@ -486,9 +456,7 @@ xdr_u_char(xdrs, cp) * XDR booleans */ bool_t -xdr_bool(xdrs, bp) - XDR *xdrs; - bool_t *bp; +xdr_bool(XDR *xdrs, bool_t *bp) { long lb; @@ -516,9 +484,7 @@ xdr_bool(xdrs, bp) * XDR enumerations */ bool_t -xdr_enum(xdrs, ep) - XDR *xdrs; - enum_t *ep; +xdr_enum(XDR *xdrs, enum_t *ep) { enum sizecheck { SIZEVAL }; /* used to find the size of an enum */ @@ -542,10 +508,7 @@ xdr_enum(xdrs, ep) * cp points to the opaque object and cnt gives the byte length. */ bool_t -xdr_opaque(xdrs, cp, cnt) - XDR *xdrs; - caddr_t cp; - u_int cnt; +xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt) { u_int rndup; static int crud[BYTES_PER_XDR_UNIT]; @@ -594,11 +557,7 @@ xdr_opaque(xdrs, cp, cnt) * If *cpp is NULL maxsize bytes are allocated */ bool_t -xdr_bytes(xdrs, cpp, sizep, maxsize) - XDR *xdrs; - char **cpp; - u_int *sizep; - u_int maxsize; +xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize) { char *sp = *cpp; /* sp is the actual string pointer */ u_int nodesize; @@ -650,9 +609,7 @@ xdr_bytes(xdrs, cpp, sizep, maxsize) * Implemented here due to commonality of the object. */ bool_t -xdr_netobj(xdrs, np) - XDR *xdrs; - struct netobj *np; +xdr_netobj(XDR *xdrs, struct netobj *np) { return (xdr_bytes(xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ)); @@ -670,12 +627,14 @@ xdr_netobj(xdrs, np) * If there is no specific or default routine an error is returned. */ bool_t -xdr_union(xdrs, dscmp, unp, choices, dfault) - XDR *xdrs; - enum_t *dscmp; /* enum to decide which arm to work on */ - char *unp; /* the union itself */ - const struct xdr_discrim *choices; /* [value, xdr proc] for each arm */ - xdrproc_t dfault; /* default xdr routine */ +xdr_union(XDR *xdrs, enum_t *dscmp, char *unp, const struct xdr_discrim *choices, xdrproc_t dfault) +/* + * XDR *xdrs; + * enum_t *dscmp; // enum to decide which arm to work on + * char *unp; // the union itself + * const struct xdr_discrim *choices; // [value, xdr proc] for each arm + * xdrproc_t dfault; // default xdr routine + */ { enum_t dscm; @@ -719,10 +678,7 @@ xdr_union(xdrs, dscmp, unp, choices, dfa * of the string as specified by a protocol. */ bool_t -xdr_string(xdrs, cpp, maxsize) - XDR *xdrs; - char **cpp; - u_int maxsize; +xdr_string(XDR *xdrs, char **cpp, u_int maxsize) { char *sp = *cpp; /* sp is the actual string pointer */ u_int size; @@ -786,9 +742,7 @@ xdr_string(xdrs, cpp, maxsize) * routines like clnt_call */ bool_t -xdr_wrapstring(xdrs, cpp) - XDR *xdrs; - char **cpp; +xdr_wrapstring(XDR *xdrs, char **cpp) { return xdr_string(xdrs, cpp, LASTUNSIGNED); } @@ -805,9 +759,7 @@ xdr_wrapstring(xdrs, cpp) * XDR 64-bit integers */ bool_t -xdr_int64_t(xdrs, llp) - XDR *xdrs; - int64_t *llp; +xdr_int64_t(XDR *xdrs, int64_t *llp) { u_long ul[2]; @@ -838,9 +790,7 @@ xdr_int64_t(xdrs, llp) * XDR unsigned 64-bit integers */ bool_t -xdr_u_int64_t(xdrs, ullp) - XDR *xdrs; - u_int64_t *ullp; +xdr_u_int64_t(XDR *xdrs, u_int64_t *ullp) { u_long ul[2]; @@ -870,9 +820,7 @@ xdr_u_int64_t(xdrs, ullp) * XDR unsigned 64-bit integers */ bool_t -xdr_uint64_t(xdrs, ullp) - XDR *xdrs; - uint64_t *ullp; +xdr_uint64_t(XDR *xdrs, uint64_t *ullp) { u_long ul[2]; @@ -903,9 +851,7 @@ xdr_uint64_t(xdrs, ullp) * XDR hypers */ bool_t -xdr_hyper(xdrs, llp) - XDR *xdrs; - longlong_t *llp; +xdr_hyper(XDR *xdrs, longlong_t *llp) { /* @@ -920,9 +866,7 @@ xdr_hyper(xdrs, llp) * XDR unsigned hypers */ bool_t -xdr_u_hyper(xdrs, ullp) - XDR *xdrs; - u_longlong_t *ullp; +xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp) { /* @@ -937,9 +881,7 @@ xdr_u_hyper(xdrs, ullp) * XDR longlong_t's */ bool_t -xdr_longlong_t(xdrs, llp) - XDR *xdrs; - longlong_t *llp; +xdr_longlong_t(XDR *xdrs, longlong_t *llp) { /* @@ -954,9 +896,7 @@ xdr_longlong_t(xdrs, llp) * XDR u_longlong_t's */ bool_t -xdr_u_longlong_t(xdrs, ullp) - XDR *xdrs; - u_longlong_t *ullp; +xdr_u_longlong_t(XDR *xdrs, u_longlong_t *ullp) { /* Modified: head/lib/libc/xdr/xdr_array.c ============================================================================== --- head/lib/libc/xdr/xdr_array.c Sun May 31 15:50:54 2015 (r283832) +++ head/lib/libc/xdr/xdr_array.c Sun May 31 18:08:58 2015 (r283833) @@ -64,13 +64,15 @@ __FBSDID("$FreeBSD$"); * xdr procedure to call to handle each element of the array. */ bool_t -xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) - XDR *xdrs; - caddr_t *addrp; /* array pointer */ - u_int *sizep; /* number of elements */ - u_int maxsize; /* max numberof elements */ - u_int elsize; /* size in bytes of each element */ - xdrproc_t elproc; /* xdr routine to handle each element */ +xdr_array(XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsize, xdrproc_t elproc) +/* + * XDR *xdrs; + * caddr_t *addrp; // array pointer + * u_int *sizep; // number of elements + * u_int maxsize; // max numberof elements + * u_int elsize; // size in bytes of each element + * xdrproc_t elproc; // xdr routine to handle each element + */ { u_int i; caddr_t target = *addrp; @@ -142,12 +144,7 @@ xdr_array(xdrs, addrp, sizep, maxsize, e * > xdr_elem: routine to XDR each element */ bool_t -xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem) - XDR *xdrs; - char *basep; - u_int nelem; - u_int elemsize; - xdrproc_t xdr_elem; +xdr_vector(XDR *xdrs, char *basep, u_int nelem, u_int elemsize, xdrproc_t xdr_elem) { u_int i; char *elptr; Modified: head/lib/libc/xdr/xdr_float.c ============================================================================== --- head/lib/libc/xdr/xdr_float.c Sun May 31 15:50:54 2015 (r283832) +++ head/lib/libc/xdr/xdr_float.c Sun May 31 18:08:58 2015 (r283833) @@ -204,9 +204,7 @@ static struct dbl_limits { bool_t -xdr_double(xdrs, dp) - XDR *xdrs; - double *dp; +xdr_double(XDR *xdrs, double *dp) { #ifdef IEEEFP int32_t *i32p; Modified: head/lib/libc/xdr/xdr_mem.c ============================================================================== --- head/lib/libc/xdr/xdr_mem.c Sun May 31 15:50:54 2015 (r283832) +++ head/lib/libc/xdr/xdr_mem.c Sun May 31 18:08:58 2015 (r283833) @@ -98,11 +98,7 @@ static const struct xdr_ops xdrmem_ops_u * memory buffer. */ void -xdrmem_create(xdrs, addr, size, op) - XDR *xdrs; - char *addr; - u_int size; - enum xdr_op op; +xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op) { xdrs->x_op = op; @@ -114,16 +110,13 @@ xdrmem_create(xdrs, addr, size, op) /*ARGSUSED*/ static void -xdrmem_destroy(xdrs) - XDR *xdrs; +xdrmem_destroy(XDR *xdrs) { } static bool_t -xdrmem_getlong_aligned(xdrs, lp) - XDR *xdrs; - long *lp; +xdrmem_getlong_aligned(XDR *xdrs, long *lp) { if (xdrs->x_handy < sizeof(int32_t)) @@ -135,9 +128,7 @@ xdrmem_getlong_aligned(xdrs, lp) } static bool_t -xdrmem_putlong_aligned(xdrs, lp) - XDR *xdrs; - const long *lp; +xdrmem_putlong_aligned(XDR *xdrs, const long *lp) { if (xdrs->x_handy < sizeof(int32_t)) @@ -149,9 +140,7 @@ xdrmem_putlong_aligned(xdrs, lp) } static bool_t -xdrmem_getlong_unaligned(xdrs, lp) - XDR *xdrs; - long *lp; +xdrmem_getlong_unaligned(XDR *xdrs, long *lp) { u_int32_t l; @@ -165,9 +154,7 @@ xdrmem_getlong_unaligned(xdrs, lp) } static bool_t -xdrmem_putlong_unaligned(xdrs, lp) - XDR *xdrs; - const long *lp; +xdrmem_putlong_unaligned(XDR *xdrs, const long *lp) { u_int32_t l; @@ -181,10 +168,7 @@ xdrmem_putlong_unaligned(xdrs, lp) } static bool_t -xdrmem_getbytes(xdrs, addr, len) - XDR *xdrs; - char *addr; - u_int len; +xdrmem_getbytes(XDR *xdrs, char *addr, u_int len) { if (xdrs->x_handy < len) @@ -196,10 +180,7 @@ xdrmem_getbytes(xdrs, addr, len) } static bool_t -xdrmem_putbytes(xdrs, addr, len) - XDR *xdrs; - const char *addr; - u_int len; +xdrmem_putbytes(XDR *xdrs, const char *addr, u_int len) { if (xdrs->x_handy < len) @@ -211,8 +192,7 @@ xdrmem_putbytes(xdrs, addr, len) } static u_int -xdrmem_getpos(xdrs) - XDR *xdrs; +xdrmem_getpos(XDR *xdrs) { /* XXX w/64-bit pointers, u_int not enough! */ @@ -220,9 +200,7 @@ xdrmem_getpos(xdrs) } static bool_t -xdrmem_setpos(xdrs, pos) - XDR *xdrs; - u_int pos; +xdrmem_setpos(XDR *xdrs, u_int pos) { char *newaddr = xdrs->x_base + pos; char *lastaddr = (char *)xdrs->x_private + xdrs->x_handy; @@ -235,9 +213,7 @@ xdrmem_setpos(xdrs, pos) } static int32_t * -xdrmem_inline_aligned(xdrs, len) - XDR *xdrs; - u_int len; +xdrmem_inline_aligned(XDR *xdrs, u_int len) { int32_t *buf = 0; @@ -251,9 +227,7 @@ xdrmem_inline_aligned(xdrs, len) /* ARGSUSED */ static int32_t * -xdrmem_inline_unaligned(xdrs, len) - XDR *xdrs; - u_int len; +xdrmem_inline_unaligned(XDR *xdrs, u_int len) { return (0); Modified: head/lib/libc/xdr/xdr_rec.c ============================================================================== --- head/lib/libc/xdr/xdr_rec.c Sun May 31 15:50:54 2015 (r283832) +++ head/lib/libc/xdr/xdr_rec.c Sun May 31 18:08:58 2015 (r283833) @@ -161,15 +161,18 @@ static bool_t realloc_stream(RECSTREAM * * calls expect that they take an opaque handle rather than an fd. */ void -xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit) - XDR *xdrs; - u_int sendsize; - u_int recvsize; - void *tcp_handle; - /* like read, but pass it a tcp_handle, not sock */ - int (*readit)(void *, void *, int); - /* like write, but pass it a tcp_handle, not sock */ - int (*writeit)(void *, void *, int); +xdrrec_create(XDR *xdrs, u_int sendsize, u_int recvsize, void *tcp_handle, + int (*readit)(void *, void *, int), int (*writeit)(void *, void *, int)) +/* + * XDR *xdrs; + * u_int sendsize; + * u_int recvsize; + * void *tcp_handle; + * // like read, but pass it a tcp_handle, not sock + * int (*readit)(void *, void *, int); + * // like write, but pass it a tcp_handle, not sock + * int (*writeit)(void *, void *, int); + */ { RECSTREAM *rstrm = mem_alloc(sizeof(RECSTREAM)); @@ -229,9 +232,7 @@ xdrrec_create(xdrs, sendsize, recvsize, */ static bool_t -xdrrec_getlong(xdrs, lp) - XDR *xdrs; - long *lp; +xdrrec_getlong(XDR *xdrs, long *lp) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); int32_t *buflp = (int32_t *)(void *)(rstrm->in_finger); @@ -253,9 +254,7 @@ xdrrec_getlong(xdrs, lp) } static bool_t -xdrrec_putlong(xdrs, lp) - XDR *xdrs; - const long *lp; +xdrrec_putlong(XDR *xdrs, const long *lp) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); int32_t *dest_lp = ((int32_t *)(void *)(rstrm->out_finger)); @@ -277,10 +276,7 @@ xdrrec_putlong(xdrs, lp) } static bool_t /* must manage buffers, fragments, and records */ -xdrrec_getbytes(xdrs, addr, len) - XDR *xdrs; - char *addr; - u_int len; +xdrrec_getbytes(XDR *xdrs, char *addr, u_int len) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); int current; @@ -305,10 +301,7 @@ xdrrec_getbytes(xdrs, addr, len) } static bool_t -xdrrec_putbytes(xdrs, addr, len) - XDR *xdrs; - const char *addr; - u_int len; +xdrrec_putbytes(XDR *xdrs, const char *addr, u_int len) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); size_t current; @@ -331,8 +324,7 @@ xdrrec_putbytes(xdrs, addr, len) } static u_int -xdrrec_getpos(xdrs) - XDR *xdrs; +xdrrec_getpos(XDR *xdrs) { RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; off_t pos; @@ -358,9 +350,7 @@ xdrrec_getpos(xdrs) } static bool_t -xdrrec_setpos(xdrs, pos) - XDR *xdrs; - u_int pos; +xdrrec_setpos(XDR *xdrs, u_int pos) { RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; u_int currpos = xdrrec_getpos(xdrs); @@ -397,9 +387,7 @@ xdrrec_setpos(xdrs, pos) } static int32_t * -xdrrec_inline(xdrs, len) - XDR *xdrs; - u_int len; +xdrrec_inline(XDR *xdrs, u_int len) { RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; int32_t *buf = NULL; @@ -429,8 +417,7 @@ xdrrec_inline(xdrs, len) } static void -xdrrec_destroy(xdrs) - XDR *xdrs; +xdrrec_destroy(XDR *xdrs) { RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; @@ -449,8 +436,7 @@ xdrrec_destroy(xdrs) * this procedure to guarantee proper record alignment. */ bool_t -xdrrec_skiprecord(xdrs) - XDR *xdrs; +xdrrec_skiprecord(XDR *xdrs) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); enum xprt_stat xstat; @@ -485,8 +471,7 @@ xdrrec_skiprecord(xdrs) * after consuming the rest of the current record. */ bool_t -xdrrec_eof(xdrs) - XDR *xdrs; +xdrrec_eof(XDR *xdrs) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); @@ -509,9 +494,7 @@ xdrrec_eof(xdrs) * pipelined procedure calls.) TRUE => immmediate flush to tcp connection. */ bool_t -xdrrec_endofrecord(xdrs, sendnow) - XDR *xdrs; - bool_t sendnow; +xdrrec_endofrecord(XDR *xdrs, bool_t sendnow) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); u_long len; /* fragment length */ @@ -535,10 +518,7 @@ xdrrec_endofrecord(xdrs, sendnow) * Return true if a record is available in the buffer, false if not. */ bool_t -__xdrrec_getrec(xdrs, statp, expectdata) - XDR *xdrs; - enum xprt_stat *statp; - bool_t expectdata; +__xdrrec_getrec(XDR *xdrs, enum xprt_stat *statp, bool_t expectdata) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); ssize_t n; @@ -618,9 +598,7 @@ __xdrrec_getrec(xdrs, statp, expectdata) } bool_t -__xdrrec_setnonblock(xdrs, maxrec) - XDR *xdrs; - int maxrec; +__xdrrec_setnonblock(XDR *xdrs, int maxrec) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); @@ -635,9 +613,7 @@ __xdrrec_setnonblock(xdrs, maxrec) * Internal useful routines */ static bool_t -flush_out(rstrm, eor) - RECSTREAM *rstrm; - bool_t eor; +flush_out(RECSTREAM *rstrm, bool_t eor) { u_int32_t eormask = (eor == TRUE) ? LAST_FRAG : 0; u_int32_t len = (u_int32_t)((u_long)(rstrm->out_finger) - @@ -655,8 +631,7 @@ flush_out(rstrm, eor) } static bool_t /* knows nothing about records! Only about input buffers */ -fill_input_buf(rstrm) - RECSTREAM *rstrm; +fill_input_buf(RECSTREAM *rstrm) { char *where; u_int32_t i; @@ -678,10 +653,7 @@ fill_input_buf(rstrm) } static bool_t /* knows nothing about records! Only about input buffers */ -get_input_bytes(rstrm, addr, len) - RECSTREAM *rstrm; - char *addr; - int len; +get_input_bytes(RECSTREAM *rstrm, char *addr, int len) { size_t current; @@ -711,8 +683,7 @@ get_input_bytes(rstrm, addr, len) } static bool_t /* next two bytes of the input stream are treated as a header */ -set_input_fragment(rstrm) - RECSTREAM *rstrm; +set_input_fragment(RECSTREAM *rstrm) { u_int32_t header; @@ -737,9 +708,7 @@ set_input_fragment(rstrm) } static bool_t /* consumes input bytes; knows nothing about records! */ -skip_input_bytes(rstrm, cnt) - RECSTREAM *rstrm; - long cnt; +skip_input_bytes(RECSTREAM *rstrm, long cnt) { u_int32_t current; @@ -759,8 +728,7 @@ skip_input_bytes(rstrm, cnt) } static u_int -fix_buf_size(s) - u_int s; +fix_buf_size(u_int s) { if (s < 100) @@ -772,9 +740,7 @@ fix_buf_size(s) * Reallocate the input buffer for a non-block stream. */ static bool_t -realloc_stream(rstrm, size) - RECSTREAM *rstrm; - int size; +realloc_stream(RECSTREAM *rstrm, int size) { ptrdiff_t diff; char *buf; Modified: head/lib/libc/xdr/xdr_reference.c ============================================================================== --- head/lib/libc/xdr/xdr_reference.c Sun May 31 15:50:54 2015 (r283832) +++ head/lib/libc/xdr/xdr_reference.c Sun May 31 18:08:58 2015 (r283833) @@ -65,11 +65,13 @@ __FBSDID("$FreeBSD$"); * proc is the routine to handle the referenced structure. */ bool_t -xdr_reference(xdrs, pp, size, proc) - XDR *xdrs; - caddr_t *pp; /* the pointer to work on */ - u_int size; /* size of the object pointed to */ - xdrproc_t proc; /* xdr routine to handle the object */ +xdr_reference(XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc) +/* + * XDR *xdrs; + * caddr_t *pp; // the pointer to work on + * u_int size; // size of the object pointed to + * xdrproc_t proc; // xdr routine to handle the object + */ { caddr_t loc = *pp; bool_t stat; @@ -122,11 +124,7 @@ xdr_reference(xdrs, pp, size, proc) * */ bool_t -xdr_pointer(xdrs,objpp,obj_size,xdr_obj) - XDR *xdrs; - char **objpp; - u_int obj_size; - xdrproc_t xdr_obj; +xdr_pointer(XDR *xdrs, char **objpp, u_int obj_size, xdrproc_t xdr_obj) { bool_t more_data; Modified: head/lib/libc/xdr/xdr_sizeof.c ============================================================================== --- head/lib/libc/xdr/xdr_sizeof.c Sun May 31 15:50:54 2015 (r283832) +++ head/lib/libc/xdr/xdr_sizeof.c Sun May 31 18:08:58 2015 (r283833) @@ -47,9 +47,7 @@ __FBSDID("$FreeBSD$"); /* ARGSUSED */ static bool_t -x_putlong(xdrs, longp) - XDR *xdrs; - long *longp; +x_putlong(XDR *xdrs, long *longp) { xdrs->x_handy += BYTES_PER_XDR_UNIT; return (TRUE); @@ -57,36 +55,28 @@ x_putlong(xdrs, longp) /* ARGSUSED */ static bool_t -x_putbytes(xdrs, bp, len) - XDR *xdrs; - char *bp; - u_int len; +x_putbytes(XDR *xdrs, char *bp, u_int len) { xdrs->x_handy += len; return (TRUE); } static u_int -x_getpostn(xdrs) - XDR *xdrs; +x_getpostn(XDR *xdrs) { return (xdrs->x_handy); } /* ARGSUSED */ static bool_t -x_setpostn(xdrs, pos) - XDR *xdrs; - u_int pos; +x_setpostn(XDR *xdrs, u_int pos) { /* This is not allowed */ return (FALSE); } static int32_t * -x_inline(xdrs, len) - XDR *xdrs; - u_int len; +x_inline(XDR *xdrs, u_int len) { if (len == 0) { return (NULL); @@ -120,8 +110,7 @@ harmless() } static void -x_destroy(xdrs) - XDR *xdrs; +x_destroy(XDR *xdrs) { xdrs->x_handy = 0; xdrs->x_base = 0; @@ -133,9 +122,7 @@ x_destroy(xdrs) } unsigned long -xdr_sizeof(func, data) - xdrproc_t func; - void *data; +xdr_sizeof(xdrproc_t func, void *data) { XDR x; struct xdr_ops ops; Modified: head/lib/libc/xdr/xdr_stdio.c ============================================================================== --- head/lib/libc/xdr/xdr_stdio.c Sun May 31 15:50:54 2015 (r283832) +++ head/lib/libc/xdr/xdr_stdio.c Sun May 31 18:08:58 2015 (r283833) @@ -83,10 +83,7 @@ static const struct xdr_ops xdrstdio_ops * Operation flag is set to op. */ void -xdrstdio_create(xdrs, file, op) - XDR *xdrs; - FILE *file; - enum xdr_op op; +xdrstdio_create(XDR *xdrs, FILE *file, enum xdr_op op) { xdrs->x_op = op; @@ -101,17 +98,14 @@ xdrstdio_create(xdrs, file, op) * Cleans up the xdr stream handle xdrs previously set up by xdrstdio_create. */ static void -xdrstdio_destroy(xdrs) - XDR *xdrs; +xdrstdio_destroy(XDR *xdrs) { (void)fflush((FILE *)xdrs->x_private); /* XXX: should we close the file ?? */ } static bool_t -xdrstdio_getlong(xdrs, lp) - XDR *xdrs; - long *lp; +xdrstdio_getlong(XDR *xdrs, long *lp) { u_int32_t temp; @@ -122,9 +116,7 @@ xdrstdio_getlong(xdrs, lp) } static bool_t -xdrstdio_putlong(xdrs, lp) - XDR *xdrs; - const long *lp; +xdrstdio_putlong(XDR *xdrs, const long *lp) { int32_t mycopy = htonl((u_int32_t)*lp); @@ -134,10 +126,7 @@ xdrstdio_putlong(xdrs, lp) } static bool_t -xdrstdio_getbytes(xdrs, addr, len) - XDR *xdrs; - char *addr; - u_int len; +xdrstdio_getbytes(XDR *xdrs, char *addr, u_int len) { if ((len != 0) && (fread(addr, (size_t)len, 1, (FILE *)xdrs->x_private) != 1)) @@ -146,10 +135,7 @@ xdrstdio_getbytes(xdrs, addr, len) } static bool_t -xdrstdio_putbytes(xdrs, addr, len) - XDR *xdrs; - const char *addr; - u_int len; +xdrstdio_putbytes(XDR *xdrs, const char *addr, u_int len) { if ((len != 0) && (fwrite(addr, (size_t)len, 1, @@ -159,17 +145,14 @@ xdrstdio_putbytes(xdrs, addr, len) } static u_int -xdrstdio_getpos(xdrs) - XDR *xdrs; +xdrstdio_getpos(XDR *xdrs) { return ((u_int) ftell((FILE *)xdrs->x_private)); } static bool_t -xdrstdio_setpos(xdrs, pos) - XDR *xdrs; - u_int pos; +xdrstdio_setpos(XDR *xdrs, u_int pos) { return ((fseek((FILE *)xdrs->x_private, (long)pos, 0) < 0) ? @@ -178,9 +161,7 @@ xdrstdio_setpos(xdrs, pos) /* ARGSUSED */ static int32_t * -xdrstdio_inline(xdrs, len) - XDR *xdrs; - u_int len; +xdrstdio_inline(XDR *xdrs, u_int len) { /* From owner-svn-src-head@FreeBSD.ORG Sun May 31 18:11:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C03B771F; Sun, 31 May 2015 18:11:21 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 AE4751CB6; Sun, 31 May 2015 18:11:21 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VIBL1l091990; Sun, 31 May 2015 18:11:21 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VIBLDK091988; Sun, 31 May 2015 18:11:21 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201505311811.t4VIBLDK091988@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Sun, 31 May 2015 18:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283834 - head/lib/libc/xdr 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, 31 May 2015 18:11:21 -0000 Author: rodrigc Date: Sun May 31 18:11:20 2015 New Revision: 283834 URL: https://svnweb.freebsd.org/changeset/base/283834 Log: Make x_putlong() and x_putbytes() prototypes match the prototypes in Modified: head/lib/libc/xdr/xdr_sizeof.c Modified: head/lib/libc/xdr/xdr_sizeof.c ============================================================================== --- head/lib/libc/xdr/xdr_sizeof.c Sun May 31 18:08:58 2015 (r283833) +++ head/lib/libc/xdr/xdr_sizeof.c Sun May 31 18:11:20 2015 (r283834) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); /* ARGSUSED */ static bool_t -x_putlong(XDR *xdrs, long *longp) +x_putlong(XDR *xdrs, const long *longp) { xdrs->x_handy += BYTES_PER_XDR_UNIT; return (TRUE); @@ -55,7 +55,7 @@ x_putlong(XDR *xdrs, long *longp) /* ARGSUSED */ static bool_t -x_putbytes(XDR *xdrs, char *bp, u_int len) +x_putbytes(XDR *xdrs, const char *bp, u_int len) { xdrs->x_handy += len; return (TRUE); From owner-svn-src-head@FreeBSD.ORG Sun May 31 18:59:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E2A5E4D; Sun, 31 May 2015 18:59:00 +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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07F9E177D; Sun, 31 May 2015 18:58:59 +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 ESMTPSA id 14CC9110C92; Sun, 31 May 2015 11:58:53 -0700 (PDT) Date: Sun, 31 May 2015 11:58:52 -0700 From: hiren panchasara To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283806 - head/contrib/traceroute Message-ID: <20150531185852.GA20409@strugglingcoder.info> References: <201505310810.t4V8AZWR074647@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DocE+STaALJfprDB" Content-Disposition: inline In-Reply-To: <201505310810.t4V8AZWR074647@svn.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, 31 May 2015 18:59:00 -0000 --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 05/31/15 at 08:10P, Michael Tuexen wrote: > Author: tuexen > Date: Sun May 31 08:10:35 2015 > New Revision: 283806 > URL: https://svnweb.freebsd.org/changeset/base/283806 >=20 > Log: > When the packet verification fails in verbose mode, print the correct > number of words in host byte order. Also remove a stray 'x'. > =20 > MFC after: 3 days >=20 > Modified: > head/contrib/traceroute/traceroute.c Picking up a random traceroute commit here. I am not sure of the history but don't we try to upstream the fixes for contrib/* things, in general?=20 I am just curious. Thanks for the fixes, btw. Cheers, Hiren --DocE+STaALJfprDB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF8BAEBCgBmBQJVa1nsXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/l8+AH/Rf9qHWn3yehoESinqVp3pbr 7Kurk4nW439wyesMaBtNFD2y1zpMFxt5xt+bmCrT2W5jJH4asgKHp8GGFwk8vuM7 D9Iwq5y8jbhANybnk7sRKfbb20NXDaHw6pdJIz8V9YbJqX1VL3pa9TpDV8kxfJzZ 2+IR3KtBW4m4ea9SfW+MWezt8E4uZ0J2dxOBcbJsi+NgvGFrq40mnC+6+5PcptCL kHVe438ljr3eQyA97GMNpFDUgD77zY6FQZvNy2FDmgoLO8v8VPHm4rbwlPt/ia7Y wCQt8cudu/3L9rFMqyp5gehbga/T8NS4kbWAB3c7QVMG5AULd7I6h79QVBqYxIk= =E7uE -----END PGP SIGNATURE----- --DocE+STaALJfprDB-- From owner-svn-src-head@FreeBSD.ORG Sun May 31 19:09:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49C5738D; Sun, 31 May 2015 19:09:25 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3738D19D5; Sun, 31 May 2015 19:09:25 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VJ9PRL019409; Sun, 31 May 2015 19:09:25 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VJ9Pi0019408; Sun, 31 May 2015 19:09:25 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201505311909.t4VJ9Pi0019408@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Sun, 31 May 2015 19:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283835 - head/lib/libc/xdr 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, 31 May 2015 19:09:25 -0000 Author: rodrigc Date: Sun May 31 19:09:24 2015 New Revision: 283835 URL: https://svnweb.freebsd.org/changeset/base/283835 Log: Use proper prototype for harmless(). Modified: head/lib/libc/xdr/xdr_sizeof.c Modified: head/lib/libc/xdr/xdr_sizeof.c ============================================================================== --- head/lib/libc/xdr/xdr_sizeof.c Sun May 31 18:11:20 2015 (r283834) +++ head/lib/libc/xdr/xdr_sizeof.c Sun May 31 19:09:24 2015 (r283835) @@ -103,7 +103,7 @@ x_inline(XDR *xdrs, u_int len) } static int -harmless() +harmless(void) { /* Always return FALSE/NULL, as the case may be */ return (0); From owner-svn-src-head@FreeBSD.ORG Sun May 31 19:43:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B480818F; Sun, 31 May 2015 19:43:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A20DA12B9; Sun, 31 May 2015 19:43:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VJhaDA041979; Sun, 31 May 2015 19:43:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VJhand041978; Sun, 31 May 2015 19:43:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505311943.t4VJhand041978@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 31 May 2015 19:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283836 - head/tests/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: Sun, 31 May 2015 19:43:36 -0000 Author: jhb Date: Sun May 31 19:43:35 2015 New Revision: 283836 URL: https://svnweb.freebsd.org/changeset/base/283836 Log: Consistently only use one end of the pipe in the parent and debugger processes and do not rely on EOF due to a close() in the debugger. PR: 200489 Differential Revision: https://reviews.freebsd.org/D2674 Reviewed by: kib, ngie, rodrigc Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Sun May 31 19:09:24 2015 (r283835) +++ head/tests/sys/kern/ptrace_test.c Sun May 31 19:43:35 2015 (r283836) @@ -304,7 +304,7 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft ATF_REQUIRE(write(dpipe[1], &c, sizeof(c)) == sizeof(c)); /* Wait for parent's failed wait. */ - ATF_REQUIRE(read(dpipe[1], &c, sizeof(c)) == 0); + ATF_REQUIRE(read(dpipe[1], &c, sizeof(c)) == sizeof(c)); wpid = waitpid(child, &status, 0); ATF_REQUIRE(wpid == child); @@ -313,6 +313,7 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft exit(0); } + close(dpipe[1]); /* Parent process. */ @@ -365,10 +366,11 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft ATF_REQUIRE(wpid == 0); /* Signal the debugger to wait for the child. */ - close(dpipe[0]); + ATF_REQUIRE(write(dpipe[0], &c, sizeof(c)) == sizeof(c)); /* Wait for the debugger. */ - ATF_REQUIRE(read(dpipe[1], &c, sizeof(c)) == 0); + ATF_REQUIRE(read(dpipe[0], &c, sizeof(c)) == 0); + close(dpipe[0]); /* The child process should now be ready. */ wpid = waitpid(child, &status, WNOHANG); From owner-svn-src-head@FreeBSD.ORG Sun May 31 19:45:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 185B92FE; Sun, 31 May 2015 19:45:44 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CFA2512D4; Sun, 31 May 2015 19:45:43 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.200] (p508F0B72.dip0.t-ipconnect.de [80.143.11.114]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id BD9F01C104347; Sun, 31 May 2015 21:45:39 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: svn commit: r283806 - head/contrib/traceroute From: Michael Tuexen In-Reply-To: <20150531185852.GA20409@strugglingcoder.info> Date: Sun, 31 May 2015 21:45:38 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4E05B479-A012-4219-822A-68DF72CCAACF@freebsd.org> References: <201505310810.t4V8AZWR074647@svn.freebsd.org> <20150531185852.GA20409@strugglingcoder.info> To: hiren panchasara X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 May 2015 19:45:44 -0000 > On 31 May 2015, at 20:58, hiren panchasara = wrote: >=20 > On 05/31/15 at 08:10P, Michael Tuexen wrote: >> Author: tuexen >> Date: Sun May 31 08:10:35 2015 >> New Revision: 283806 >> URL: https://svnweb.freebsd.org/changeset/base/283806 >>=20 >> Log: >> When the packet verification fails in verbose mode, print the = correct >> number of words in host byte order. Also remove a stray 'x'. >>=20 >> MFC after: 3 days >>=20 >> Modified: >> head/contrib/traceroute/traceroute.c >=20 > Picking up a random traceroute commit here. I am not sure of the = history > but don't we try to upstream the fixes for contrib/* things, in = general?=20 The last version was release 12 years ago. They where integrated in https://svnweb.freebsd.org/base?view=3Drevision&revision=3D100787 I can submit the patches also to traceroute@ee.lbl.gov as indicated in = https://svnweb.freebsd.org/base/head/contrib/traceroute/FREEBSD-upgrade?vi= ew=3Dmarkup Thanks for making me aware of it. Best regards Michael >=20 > I am just curious. Thanks for the fixes, btw. >=20 > Cheers, > Hiren From owner-svn-src-head@FreeBSD.ORG Sun May 31 20:20:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 494BFCF8; Sun, 31 May 2015 20:20:25 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1CA7B1AC5; Sun, 31 May 2015 20:20:25 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VKKOOt059127; Sun, 31 May 2015 20:20:24 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VKKOrE059125; Sun, 31 May 2015 20:20:24 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201505312020.t4VKKOrE059125@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Sun, 31 May 2015 20:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283837 - head/usr.sbin/yppoll 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, 31 May 2015 20:20:25 -0000 Author: rodrigc Date: Sun May 31 20:20:24 2015 New Revision: 283837 URL: https://svnweb.freebsd.org/changeset/base/283837 Log: yppoll(8): Comment out -h option. The implementation of it is missing (see e.g. NetBSD or OpenBSD). Until someone works on it, comment out the existing code to silence a warning about 'hostname' being set but unused. Found-by: gcc47 Submitted by: Sascha Wildner Obtained from: DragonFlyBSD (commit e455855db) Modified: head/usr.sbin/yppoll/yppoll.8 head/usr.sbin/yppoll/yppoll.c Modified: head/usr.sbin/yppoll/yppoll.8 ============================================================================== --- head/usr.sbin/yppoll/yppoll.8 Sun May 31 19:43:35 2015 (r283836) +++ head/usr.sbin/yppoll/yppoll.8 Sun May 31 20:20:24 2015 (r283837) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 1994 +.Dd May 31, 2015 .Dt YPPOLL 8 .Os .Sh NAME @@ -35,7 +35,7 @@ .Nd ask version of YP map from YP server .Sh SYNOPSIS .Nm -.Op Fl h Ar host +.\".Op Fl h Ar host .Op Fl d Ar domain .Ar mapname .Sh DESCRIPTION @@ -48,15 +48,15 @@ server for .Pp The options are as follows: .Bl -tag -width indent -.It Fl h Ar host -Ask the YP server process running on -.Ar host -for information about -.Ar mapname . -If -.Ar host -is not specified, the server polled is the default server returned by -.Xr ypwhich 1 . +.\".It Fl h Ar host +.\"Ask the YP server process running on +.\".Ar host +.\"for information about +.\".Ar mapname . +.\"If +.\".Ar host +.\"is not specified, the server polled is the default server returned by +.\".Xr ypwhich 1 . .It Fl d Ar domain Use the YP domain .Ar domain Modified: head/usr.sbin/yppoll/yppoll.c ============================================================================== --- head/usr.sbin/yppoll/yppoll.c Sun May 31 19:43:35 2015 (r283836) +++ head/usr.sbin/yppoll/yppoll.c Sun May 31 20:20:24 2015 (r283837) @@ -49,7 +49,11 @@ __FBSDID("$FreeBSD$"); static void usage(void) { +#if 0 fprintf(stderr, "usage: yppoll [-h host] [-d domainname] mapname\n"); +#else + fprintf(stderr, "usage: yppoll [-d domainname] mapname\n"); +#endif exit(1); } @@ -57,7 +61,9 @@ int main(int argc, char *argv[]) { char *domainname; +#if 0 char *hostname = "localhost"; +#endif char *inmap, *master; int order; int c, r; @@ -71,7 +77,11 @@ main(int argc, char *argv[]) domainname = optarg; break; case 'h': +#if 0 hostname = optarg; +#else + /* does nothing */ +#endif break; case '?': usage(); From owner-svn-src-head@FreeBSD.ORG Sun May 31 20:45:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D9667C; Sun, 31 May 2015 20:45:36 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4B2B4104B; Sun, 31 May 2015 20:45:36 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VKja42072709; Sun, 31 May 2015 20:45:36 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VKjaIw072707; Sun, 31 May 2015 20:45:36 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201505312045.t4VKjaIw072707@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Sun, 31 May 2015 20:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283838 - head/usr.sbin/yppush 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, 31 May 2015 20:45:36 -0000 Author: rodrigc Date: Sun May 31 20:45:35 2015 New Revision: 283838 URL: https://svnweb.freebsd.org/changeset/base/283838 Log: Fix some gcc compiler warnings. Submitted by: Sascha Wildner Obtained from: DragonFlyBSD (commit 51798e10f3dd) Modified: head/usr.sbin/yppush/yppush_main.c Modified: head/usr.sbin/yppush/yppush_main.c ============================================================================== --- head/usr.sbin/yppush/yppush_main.c Sun May 31 20:20:24 2015 (r283837) +++ head/usr.sbin/yppush/yppush_main.c Sun May 31 20:45:35 2015 (r283838) @@ -137,11 +137,11 @@ yppush_show_status(ypxfrstat status, uns job->tid); } - if (status != YPPUSH_SUCC || verbose) { + if (status != YPXFR_SUCC || verbose) { yp_error("transfer of map %s to server %s %s", - job->map, job->server, status == YPPUSH_SUCC ? + job->map, job->server, status == YPXFR_SUCC ? "succeeded" : "failed"); - yp_error("status returned by ypxfr: %s", status > YPPUSH_AGE ? + yp_error("status returned by ypxfr: %s", status > YPXFR_AGE ? yppusherr_string(status) : ypxfrerr_string(status)); } @@ -365,7 +365,7 @@ create udp handle to NIS server")); * request to the internal list, send the YPPROC_XFR request to ypserv * do other magic things. */ -int +static int yp_push(char *server, char *map, unsigned long tid) { unsigned long prognum; @@ -433,7 +433,7 @@ yp_push(char *server, char *map, unsigne * Called for each entry in the ypservers map from yp_get_map(), which * is our private yp_all() routine. */ -int +static int yppush_foreach(int status, char *key, int keylen, char *val, int vallen, char *data) { From owner-svn-src-head@FreeBSD.ORG Sun May 31 21:03:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33FAA76E; Sun, 31 May 2015 21:03:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2182115DF; Sun, 31 May 2015 21:03:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VL36Zf082937; Sun, 31 May 2015 21:03:07 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VL36rf082936; Sun, 31 May 2015 21:03:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505312103.t4VL36rf082936@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 31 May 2015 21:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283839 - 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: Sun, 31 May 2015 21:03:07 -0000 Author: andrew Date: Sun May 31 21:03:06 2015 New Revision: 283839 URL: https://svnweb.freebsd.org/changeset/base/283839 Log: Set the return value correctly on copy failure in copystr. MFC after: 1 week Modified: head/sys/arm/arm/copystr.S Modified: head/sys/arm/arm/copystr.S ============================================================================== --- head/sys/arm/arm/copystr.S Sun May 31 20:45:35 2015 (r283838) +++ head/sys/arm/arm/copystr.S Sun May 31 21:03:06 2015 (r283839) @@ -194,6 +194,7 @@ END(copyoutstr) /* A fault occurred during the copy */ .Lcopystrfault: + mov r0, #EFAULT mov r1, #0x00000000 str r1, [r4, #PCB_ONFAULT] RESTORE_REGS From owner-svn-src-head@FreeBSD.ORG Sun May 31 21:39:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACD29EE9; Sun, 31 May 2015 21:39:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 81FF01C7B; Sun, 31 May 2015 21:39:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VLd9cZ098925; Sun, 31 May 2015 21:39:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VLd9VL098924; Sun, 31 May 2015 21:39:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201505312139.t4VLd9VL098924@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 31 May 2015 21:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283840 - head/etc/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: Sun, 31 May 2015 21:39:09 -0000 Author: ngie Date: Sun May 31 21:39:08 2015 New Revision: 283840 URL: https://svnweb.freebsd.org/changeset/base/283840 Log: Remove empty tests directory X-MFC with: r282059, r283056 Deleted: head/etc/tests/ From owner-svn-src-head@FreeBSD.ORG Sun May 31 21:44:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 481AAB65; Sun, 31 May 2015 21:44:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1B6101E84; Sun, 31 May 2015 21:44:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VLiAnC005061; Sun, 31 May 2015 21:44:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VLiAM2005055; Sun, 31 May 2015 21:44:10 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505312144.t4VLiAM2005055@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 31 May 2015 21:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283841 - head/usr.sbin/pw 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, 31 May 2015 21:44:11 -0000 Author: bapt Date: Sun May 31 21:44:09 2015 New Revision: 283841 URL: https://svnweb.freebsd.org/changeset/base/283841 Log: Cast -1 to uid_t and bump WARNING level to 3 Modified: head/usr.sbin/pw/Makefile head/usr.sbin/pw/pw_group.c head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/Makefile ============================================================================== --- head/usr.sbin/pw/Makefile Sun May 31 21:39:08 2015 (r283840) +++ head/usr.sbin/pw/Makefile Sun May 31 21:44:09 2015 (r283841) @@ -6,7 +6,7 @@ SRCS= pw.c pw_conf.c pw_user.c pw_group. grupd.c pwupd.c fileupd.c psdate.c \ bitmap.c cpdir.c rm_r.c -WARNS?= 2 +WARNS?= 3 LIBADD= crypt util sbuf Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sun May 31 21:39:08 2015 (r283840) +++ head/usr.sbin/pw/pw_group.c Sun May 31 21:44:09 2015 (r283841) @@ -116,7 +116,7 @@ pw_group(struct userconf * cnf, int mode char *fmems[1]; fmems[0] = NULL; fakegroup.gr_name = a_name ? a_name->val : "nogroup"; - fakegroup.gr_gid = a_gid ? (gid_t) atol(a_gid->val) : -1; + fakegroup.gr_gid = a_gid ? (gid_t) atol(a_gid->val) : (uid_t)-1; fakegroup.gr_mem = fmems; return print_group(&fakegroup, getarg(args, 'P') != NULL); } Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sun May 31 21:39:08 2015 (r283840) +++ head/usr.sbin/pw/pw_user.c Sun May 31 21:44:09 2015 (r283841) @@ -335,7 +335,7 @@ pw_user(struct userconf * cnf, int mode, if (pwd == NULL) { if (mode == M_PRINT && getarg(args, 'F')) { fakeuser.pw_name = a_name ? a_name->val : "nouser"; - fakeuser.pw_uid = a_uid ? (uid_t) atol(a_uid->val) : -1; + fakeuser.pw_uid = a_uid ? (uid_t) atol(a_uid->val) : (uid_t) -1; return print_user(&fakeuser, getarg(args, 'P') != NULL, getarg(args, '7') != NULL); @@ -791,7 +791,7 @@ pw_user(struct userconf * cnf, int mode, grp = GETGRGID(pwd->pw_gid); pw_log(cnf, mode, W_USER, "%s(%ld):%s(%ld):%s:%s:%s", pwd->pw_name, (long) pwd->pw_uid, - grp ? grp->gr_name : "unknown", (long) (grp ? grp->gr_gid : -1), + grp ? grp->gr_name : "unknown", (long) (grp ? grp->gr_gid : (uid_t)-1), pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell); /* From owner-svn-src-head@FreeBSD.ORG Sun May 31 22:07:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A06D3E67; Sun, 31 May 2015 22:07:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8DC32130F; Sun, 31 May 2015 22:07:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VM74d6015388; Sun, 31 May 2015 22:07:04 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VM73Vh015383; Sun, 31 May 2015 22:07:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505312207.t4VM73Vh015383@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 31 May 2015 22:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283842 - head/usr.sbin/pw 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, 31 May 2015 22:07:04 -0000 Author: bapt Date: Sun May 31 22:07:03 2015 New Revision: 283842 URL: https://svnweb.freebsd.org/changeset/base/283842 Log: Remove useless cast in printf and printf-like functions: use %u for uid_t and gid_t Modified: head/usr.sbin/pw/pw_conf.c head/usr.sbin/pw/pw_group.c head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sun May 31 21:44:09 2015 (r283841) +++ head/usr.sbin/pw/pw_conf.c Sun May 31 22:07:03 2015 (r283842) @@ -453,19 +453,19 @@ write_userconfig(char const * file) config.default_class : ""); break; case _UC_MINUID: - sbuf_printf(buf, "%lu", (unsigned long) config.min_uid); + sbuf_printf(buf, "%u", config.min_uid); quote = 0; break; case _UC_MAXUID: - sbuf_printf(buf, "%lu", (unsigned long) config.max_uid); + sbuf_printf(buf, "%u", config.max_uid); quote = 0; break; case _UC_MINGID: - sbuf_printf(buf, "%lu", (unsigned long) config.min_gid); + sbuf_printf(buf, "%u", config.min_gid); quote = 0; break; case _UC_MAXGID: - sbuf_printf(buf, "%lu", (unsigned long) config.max_gid); + sbuf_printf(buf, "%u", config.max_gid); quote = 0; break; case _UC_EXPIRE: Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sun May 31 21:44:09 2015 (r283841) +++ head/usr.sbin/pw/pw_group.c Sun May 31 22:07:03 2015 (r283842) @@ -83,7 +83,7 @@ pw_group(struct userconf * cnf, int mode gid_t next = gr_gidpolicy(cnf, args); if (getarg(args, 'q')) return next; - printf("%ld\n", (long)next); + printf("%u\n", next); return EXIT_SUCCESS; } @@ -137,7 +137,7 @@ pw_group(struct userconf * cnf, int mode else if (rc != 0) { err(EX_IOERR, "group update"); } - pw_log(cnf, mode, W_GROUP, "%s(%ld) removed", a_name->val, (long) gid); + pw_log(cnf, mode, W_GROUP, "%s(%u) removed", a_name->val, gid); return EXIT_SUCCESS; } else if (mode == M_PRINT) return print_group(grp, getarg(args, 'P') != NULL); @@ -279,7 +279,7 @@ pw_group(struct userconf * cnf, int mode if ((grp = GETGRNAM(arg->val)) == NULL) errx(EX_SOFTWARE, "group disappeared during update"); - pw_log(cnf, mode, W_GROUP, "%s(%ld)", grp->gr_name, (long) grp->gr_gid); + pw_log(cnf, mode, W_GROUP, "%s(%u)", grp->gr_name, grp->gr_gid); free(members); @@ -361,7 +361,7 @@ gr_gidpolicy(struct userconf * cnf, stru gid = (gid_t) atol(a_gid->val); if ((grp = GETGRGID(gid)) != NULL && getarg(args, 'o') == NULL) - errx(EX_DATAERR, "gid `%ld' has already been allocated", (long) grp->gr_gid); + errx(EX_DATAERR, "gid `%u' has already been allocated", grp->gr_gid); } else { struct bitmap bm; Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sun May 31 21:44:09 2015 (r283841) +++ head/usr.sbin/pw/pw_user.c Sun May 31 22:07:03 2015 (r283842) @@ -139,7 +139,7 @@ pw_user(struct userconf * cnf, int mode, uid_t next = pw_uidpolicy(cnf, args); if (getarg(args, 'q')) return next; - printf("%ld:", (long)next); + printf("%u:", next); pw_group(cnf, mode, args); return EXIT_SUCCESS; } @@ -449,7 +449,7 @@ pw_user(struct userconf * cnf, int mode, } ENDGRENT(); - pw_log(cnf, mode, W_USER, "%s(%ld) account removed", a_name->val, (long) uid); + pw_log(cnf, mode, W_USER, "%s(%u) account removed", a_name->val, uid); if (!PWALTDIR()) { /* @@ -469,8 +469,8 @@ pw_user(struct userconf * cnf, int mode, if (getarg(args, 'r') != NULL && *home == '/' && getpwuid(uid) == NULL) { if (stat(home, &st) != -1) { rm_r(home, uid); - pw_log(cnf, mode, W_USER, "%s(%ld) home '%s' %sremoved", - a_name->val, (long) uid, home, + pw_log(cnf, mode, W_USER, "%s(%u) home '%s' %sremoved", + a_name->val, uid, home, stat(home, &st) == -1 ? "" : "not completely "); } } @@ -789,9 +789,9 @@ pw_user(struct userconf * cnf, int mode, errx(EX_NOUSER, "user '%s' disappeared during update", a_name->val); grp = GETGRGID(pwd->pw_gid); - pw_log(cnf, mode, W_USER, "%s(%ld):%s(%ld):%s:%s:%s", - pwd->pw_name, (long) pwd->pw_uid, - grp ? grp->gr_name : "unknown", (long) (grp ? grp->gr_gid : (uid_t)-1), + pw_log(cnf, mode, W_USER, "%s(%u):%s(%u):%s:%s:%s", + pwd->pw_name, pwd->pw_uid, + grp ? grp->gr_name : "unknown", (grp ? grp->gr_gid : (uid_t)-1), pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell); /* @@ -815,8 +815,8 @@ pw_user(struct userconf * cnf, int mode, */ if (!PWALTDIR() && getarg(args, 'm') != NULL && pwd->pw_dir && *pwd->pw_dir == '/' && pwd->pw_dir[1]) { copymkdir(pwd->pw_dir, cnf->dotdir, cnf->homemode, pwd->pw_uid, pwd->pw_gid); - pw_log(cnf, mode, W_USER, "%s(%ld) home %s made", - pwd->pw_name, (long) pwd->pw_uid, pwd->pw_dir); + pw_log(cnf, mode, W_USER, "%s(%u) home %s made", + pwd->pw_name, pwd->pw_uid, pwd->pw_dir); } @@ -835,8 +835,8 @@ pw_user(struct userconf * cnf, int mode, fputs(line, pfp); } pclose(pfp); - pw_log(cnf, mode, W_USER, "%s(%ld) new user mail sent", - pwd->pw_name, (long) pwd->pw_uid); + pw_log(cnf, mode, W_USER, "%s(%u) new user mail sent", + pwd->pw_name, pwd->pw_uid); } fclose(fp); } @@ -859,7 +859,7 @@ pw_uidpolicy(struct userconf * cnf, stru uid = (uid_t) atol(a_uid->val); if ((pwd = GETPWUID(uid)) != NULL && getarg(args, 'o') == NULL) - errx(EX_DATAERR, "uid `%ld' has already been allocated", (long) pwd->pw_uid); + errx(EX_DATAERR, "uid `%u' has already been allocated", pwd->pw_uid); } else { struct bitmap bm; @@ -1183,14 +1183,14 @@ print_user(struct passwd * pwd, int pret strftime(acexpire, sizeof acexpire, "%c", tptr); if (pwd->pw_change > (time_t)0 && (tptr = localtime(&pwd->pw_change)) != NULL) strftime(pwexpire, sizeof pwexpire, "%c", tptr); - printf("Login Name: %-15s #%-12ld Group: %-15s #%ld\n" + printf("Login Name: %-15s #%-12u Group: %-15s #%u\n" " Full Name: %s\n" " Home: %-26.26s Class: %s\n" " Shell: %-26.26s Office: %s\n" "Work Phone: %-26.26s Home Phone: %s\n" "Acc Expire: %-26.26s Pwd Expire: %s\n", - pwd->pw_name, (long) pwd->pw_uid, - grp ? grp->gr_name : "(invalid)", (long) pwd->pw_gid, + pwd->pw_name, pwd->pw_uid, + grp ? grp->gr_name : "(invalid)", pwd->pw_gid, uname, pwd->pw_dir, pwd->pw_class, pwd->pw_shell, office, wphone, hphone, acexpire, pwexpire); From owner-svn-src-head@FreeBSD.ORG Sun May 31 22:12:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD4DA6E; Sun, 31 May 2015 22:12:32 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 AB2CC157A; Sun, 31 May 2015 22:12:32 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VMCWGv019767; Sun, 31 May 2015 22:12:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VMCW8B019766; Sun, 31 May 2015 22:12:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505312212.t4VMCW8B019766@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 31 May 2015 22:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283843 - head/usr.sbin/pw 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, 31 May 2015 22:12:32 -0000 Author: bapt Date: Sun May 31 22:12:31 2015 New Revision: 283843 URL: https://svnweb.freebsd.org/changeset/base/283843 Log: Cast to gid_t for groups not uid_t Modified: head/usr.sbin/pw/pw_group.c Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sun May 31 22:07:03 2015 (r283842) +++ head/usr.sbin/pw/pw_group.c Sun May 31 22:12:31 2015 (r283843) @@ -116,7 +116,7 @@ pw_group(struct userconf * cnf, int mode char *fmems[1]; fmems[0] = NULL; fakegroup.gr_name = a_name ? a_name->val : "nogroup"; - fakegroup.gr_gid = a_gid ? (gid_t) atol(a_gid->val) : (uid_t)-1; + fakegroup.gr_gid = a_gid ? (gid_t) atol(a_gid->val) : (gid_t)-1; fakegroup.gr_mem = fmems; return print_group(&fakegroup, getarg(args, 'P') != NULL); } From owner-svn-src-head@FreeBSD.ORG Sun May 31 22:20:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A590239; Sun, 31 May 2015 22:20:37 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0839B16B9; Sun, 31 May 2015 22:20:37 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VMKaXG021097; Sun, 31 May 2015 22:20:36 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VMKaaB021096; Sun, 31 May 2015 22:20:36 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201505312220.t4VMKaaB021096@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Sun, 31 May 2015 22:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283844 - head/libexec/ypxfr 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, 31 May 2015 22:20:37 -0000 Author: rodrigc Date: Sun May 31 22:20:36 2015 New Revision: 283844 URL: https://svnweb.freebsd.org/changeset/base/283844 Log: ypxfr(8): Use the correct enum member for checking yp_errno. Found-by: gcc47 Submitted by: Sascha Wildner Obtained from: DragonFlyBSD (commit d0b3a17c3c6) Modified: head/libexec/ypxfr/ypxfr_main.c Modified: head/libexec/ypxfr/ypxfr_main.c ============================================================================== --- head/libexec/ypxfr/ypxfr_main.c Sun May 31 22:12:31 2015 (r283843) +++ head/libexec/ypxfr/ypxfr_main.c Sun May 31 22:20:36 2015 (r283844) @@ -357,7 +357,7 @@ the local domain name isn't set"); ypxfr_mapname, ypxfr_master, 0)) == 0) { yp_error("failed to get order number of %s: %s", - ypxfr_mapname, yp_errno == YPXFR_SUCC ? + ypxfr_mapname, yp_errno == YP_TRUE ? "map has order 0" : ypxfrerr_string((ypxfrstat)yp_errno)); ypxfr_exit(YPXFR_YPERR,NULL); @@ -533,7 +533,7 @@ leave: ypxfr_mapname, ypxfr_master, 0)) == 0) { yp_error("failed to get order number of %s: %s", - ypxfr_mapname, yp_errno == YPXFR_SUCC ? + ypxfr_mapname, yp_errno == YP_TRUE ? "map has order 0" : ypxfrerr_string((ypxfrstat)yp_errno)); ypxfr_exit(YPXFR_YPERR,ypxfr_temp_map); From owner-svn-src-head@FreeBSD.ORG Sun May 31 22:24:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6788D39D; Sun, 31 May 2015 22:24:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 55F7017AB; Sun, 31 May 2015 22:24:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VMOUqc025263; Sun, 31 May 2015 22:24:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VMOU5g025262; Sun, 31 May 2015 22:24:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201505312224.t4VMOU5g025262@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 31 May 2015 22:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283845 - head/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: Sun, 31 May 2015 22:24:30 -0000 Author: ngie Date: Sun May 31 22:24:29 2015 New Revision: 283845 URL: https://svnweb.freebsd.org/changeset/base/283845 Log: Append to SUBDIR, not set it Pointyhat to: ngie Modified: head/tests/Makefile Modified: head/tests/Makefile ============================================================================== --- head/tests/Makefile Sun May 31 22:20:36 2015 (r283844) +++ head/tests/Makefile Sun May 31 22:24:29 2015 (r283845) @@ -2,8 +2,8 @@ .include -SUBDIR= etc -SUBDIR= sys +SUBDIR+= etc +SUBDIR+= sys TESTSDIR= ${TESTSBASE} KYUAFILE= yes From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 00:55:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 685984B7; Mon, 1 Jun 2015 00:55:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5679218C6; Mon, 1 Jun 2015 00:55:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t510tGmQ001804; Mon, 1 Jun 2015 00:55:16 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t510tG6K001803; Mon, 1 Jun 2015 00:55:16 GMT (envelope-from np@FreeBSD.org) Message-Id: <201506010055.t510tG6K001803@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 1 Jun 2015 00:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283858 - 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, 01 Jun 2015 00:55:16 -0000 Author: np Date: Mon Jun 1 00:55:15 2015 New Revision: 283858 URL: https://svnweb.freebsd.org/changeset/base/283858 Log: cxgbe: set minimum burst size when fetching freelist buffers to 128B. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Jun 1 00:09:21 2015 (r283857) +++ head/sys/dev/cxgbe/t4_sge.c Mon Jun 1 00:55:15 2015 (r283858) @@ -2665,7 +2665,7 @@ alloc_iq_fl(struct port_info *pi, struct F_FW_IQ_CMD_FL0CONGEN); } c.fl0dcaen_to_fl0cidxfthresh = - htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_64B) | + htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_128B) | V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B)); c.fl0size = htobe16(fl->qsize); c.fl0addr = htobe64(fl->ba); From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 02:06:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60640D74; Mon, 1 Jun 2015 02:06:58 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4F2EA1843; Mon, 1 Jun 2015 02:06:58 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5126win038642; Mon, 1 Jun 2015 02:06:58 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5126w7m038641; Mon, 1 Jun 2015 02:06:58 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201506010206.t5126w7m038641@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 1 Jun 2015 02:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283863 - 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: Mon, 01 Jun 2015 02:06:58 -0000 Author: dteske Date: Mon Jun 1 02:06:57 2015 New Revision: 283863 URL: https://svnweb.freebsd.org/changeset/base/283863 Log: Fix a debug statement. Only the callback function (performing the incrementing of dpv_overall_oread) knows what its purpose is (and often times it was bytes, not lines). MFC after: 3 days X-MFC-to: stable/10 Modified: head/lib/libdpv/dpv.c Modified: head/lib/libdpv/dpv.c ============================================================================== --- head/lib/libdpv/dpv.c Mon Jun 1 01:54:21 2015 (r283862) +++ head/lib/libdpv/dpv.c Mon Jun 1 02:06:57 2015 (r283863) @@ -692,7 +692,7 @@ dpv(struct dpv_config *config, struct dp if (!dpv_interrupt) printf("\n"); } else - warnx("%s: %lli lines read", __func__, dpv_overall_read); + warnx("%s: %lli overall read", __func__, dpv_overall_read); if (dpv_interrupt || dpv_abort) return (-1); From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 03:24:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADBC06EF; Mon, 1 Jun 2015 03:24:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9CA2A1B05; Mon, 1 Jun 2015 03:24:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t513Oelj078373; Mon, 1 Jun 2015 03:24:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t513OePZ078372; Mon, 1 Jun 2015 03:24:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201506010324.t513OePZ078372@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 1 Jun 2015 03:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283864 - 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, 01 Jun 2015 03:24:40 -0000 Author: np Date: Mon Jun 1 03:24:39 2015 New Revision: 283864 URL: https://svnweb.freebsd.org/changeset/base/283864 Log: cxgbe: no need to display the per-lane GT/s rating of the pcie link. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jun 1 02:06:57 2015 (r283863) +++ head/sys/dev/cxgbe/t4_main.c Mon Jun 1 03:24:39 2015 (r283864) @@ -582,7 +582,6 @@ t4_attach(device_t dev) #ifdef DEV_NETMAP int nm_rqidx, nm_tqidx; #endif - const char *pcie_ts; sc = device_get_softc(dev); sc->dev = dev; @@ -905,25 +904,10 @@ t4_attach(device_t dev) goto done; } - switch (sc->params.pci.speed) { - case 0x1: - pcie_ts = "2.5"; - break; - case 0x2: - pcie_ts = "5.0"; - break; - case 0x3: - pcie_ts = "8.0"; - break; - default: - pcie_ts = "??"; - break; - } device_printf(dev, - "PCIe x%d (%s GTS/s) (%d), %d ports, %d %s interrupt%s, %d eq, %d iq\n", - sc->params.pci.width, pcie_ts, sc->params.pci.speed, - sc->params.nports, sc->intr_count, - sc->intr_type == INTR_MSIX ? "MSI-X" : + "PCIe gen%d x%d, %d ports, %d %s interrupt%s, %d eq, %d iq\n", + sc->params.pci.speed, sc->params.pci.width, sc->params.nports, + sc->intr_count, sc->intr_type == INTR_MSIX ? "MSI-X" : (sc->intr_type == INTR_MSI ? "MSI" : "INTx"), sc->intr_count > 1 ? "s" : "", sc->sge.neq, sc->sge.niq); From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 05:37:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DB2F6BB; Mon, 1 Jun 2015 05:37:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 765FF1015; Mon, 1 Jun 2015 05:37:03 +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 mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 93B3142157E; Mon, 1 Jun 2015 15:36:59 +1000 (AEST) Date: Mon, 1 Jun 2015 15:36:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Baptiste Daroussin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283842 - head/usr.sbin/pw In-Reply-To: <201505312207.t4VM73Vh015383@svn.freebsd.org> Message-ID: <20150601143951.J863@besplex.bde.org> References: <201505312207.t4VM73Vh015383@svn.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=QeFf4Krv c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=xqHopV17G1f5rAXcRQkA:9 a=fZT5EF8Kno1c1QlV:21 a=XF-A_rSnECe766qY: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: Mon, 01 Jun 2015 05:37:04 -0000 On Sun, 31 May 2015, Baptiste Daroussin wrote: > Log: > Remove useless cast in printf and printf-like functions: > use %u for uid_t and gid_t The cast was not useless. It was to avoid the assumption that the default promotion of uid_t and gid_t is anything in particular. Now it is assumed that the default promotion is unsigned (int works too, but this is subtler). uids and gids are only guaranteed to have non-negative values. In POSIX before about 2001, uid_t and gid_t can be any type that can represent all the values taken on, so can be floating point. Floating point was rarely used for POSIX types, and most programs make too many assumptions about types, so POSIX now requires uid_t and gid_t to be integer types. Then can still be signed integer types IIRC. Nornally it is a bug to print signed integer types with unsigned integer formats, but since uids and gids are guaranteed to be non-negative both formats work. (pids require different handling since they are overloaded to hold process group ids as negative values, so pid_t is signed and %u format is very broken for printing general pids.) The program assumed that uids and gids are not too large to be represented by unsigned long. This was the only way to print them in C90 and before. C99 broke this by breaking the promise that unsigned long is the largest unsigned integer type. This broke all code that does careful casts to unsigned long. However, unsigned long is usually large enough in practice. Careful code now has to cast to uintmax_t, but that is usually excessive (but doesn't actually work for __uint128_t). Even plain unsigned usually works on vaxes. > Modified: > head/usr.sbin/pw/pw_conf.c > head/usr.sbin/pw/pw_group.c > head/usr.sbin/pw/pw_user.c > > Modified: head/usr.sbin/pw/pw_conf.c > ============================================================================== > --- head/usr.sbin/pw/pw_conf.c Sun May 31 21:44:09 2015 (r283841) > +++ head/usr.sbin/pw/pw_conf.c Sun May 31 22:07:03 2015 (r283842) > @@ -453,19 +453,19 @@ write_userconfig(char const * file) > config.default_class : ""); > break; > case _UC_MINUID: > - sbuf_printf(buf, "%lu", (unsigned long) config.min_uid); > + sbuf_printf(buf, "%u", config.min_uid); This works accidentally even on some non-vaxes. All supported arches in FreeBSD have 32-bit unsigned's, and POSIX was broken in about 2007 to disallow 16-bit unsigned's. uid_t is uint32_t in FreeBSD. However, it is planned to change ino_t and some other types to 64 bits. I forget if the plans include uid_t. Even 64-bit ino_t is too large for me. The version with the cast to unsigned long is not really better. Suppose uid_t is expanded to 16 bits. Then without the cast, the size mismatch is detected. With it, everything still works if unsigned long is 64 bits, but if unsigned long is 32 bits then the cast just breaks detection of the mismatch and gives wrong results for values that actually need 64 bits. > Modified: head/usr.sbin/pw/pw_group.c > ============================================================================== > --- head/usr.sbin/pw/pw_group.c Sun May 31 21:44:09 2015 (r283841) > +++ head/usr.sbin/pw/pw_group.c Sun May 31 22:07:03 2015 (r283842) > @@ -83,7 +83,7 @@ pw_group(struct userconf * cnf, int mode > gid_t next = gr_gidpolicy(cnf, args); > if (getarg(args, 'q')) > return next; > - printf("%ld\n", (long)next); > + printf("%u\n", next); > return EXIT_SUCCESS; > } > This also has sign changes. gids are supposed to be non-negative, so using signed long was probably a bug. However, the program is elsewhere clueless about types, and I think you did't change the parts where it uses atol() to misparse input. atol() can't even handle 32-bit uids on 32-bit arches. It truncates large positive ones to LONG_MAX. It returns negative values (truncated to LONG_MIN if necessary). The misparsing then doesn't detect the error of negative ids, but blindly casts to uid_t or gid_t, of course using lexical style bugs in the casts. The magic ids -1 and -2 are sometimes needed (perhaps not as input in pw, but -1 is used as an error value and this value can be input). These values don't really exist as ids. They must be cast before use. The actual values just cannot be entered, since atol() misparses them (it truncates large values, and also doesn't support hex, so (uid_t)-2 must be written as a long decimal number to input it for misparsing. > @@ -137,7 +137,7 @@ pw_group(struct userconf * cnf, int mode > else if (rc != 0) { > err(EX_IOERR, "group update"); > } > - pw_log(cnf, mode, W_GROUP, "%s(%ld) removed", a_name->val, (long) gid); > + pw_log(cnf, mode, W_GROUP, "%s(%u) removed", a_name->val, gid); > return EXIT_SUCCESS; > } else if (mode == M_PRINT) > return print_group(grp, getarg(args, 'P') != NULL); If the error gid (gid_t)-1 is ever printed, now %u format prints it as a cryptic decimal number where %ld format printed it as -1. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 06:00:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A78D5D05; Mon, 1 Jun 2015 06:00:05 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 95BF515BC; Mon, 1 Jun 2015 06:00:05 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t516056K053798; Mon, 1 Jun 2015 06:00:05 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51605uF053797; Mon, 1 Jun 2015 06:00:05 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201506010600.t51605uF053797@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 1 Jun 2015 06:00:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283867 - head/bin/ps 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, 01 Jun 2015 06:00:05 -0000 Author: araujo (ports committer) Date: Mon Jun 1 06:00:04 2015 New Revision: 283867 URL: https://svnweb.freebsd.org/changeset/base/283867 Log: Remove unused variable, this variable fmtstr was introduced at revision r225868 and it is not used anymore after the convertion to use libxo at revision r283304. Differential Revision: D2678 Reviewed by: marcel Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Mon Jun 1 05:56:43 2015 (r283866) +++ head/bin/ps/ps.c Mon Jun 1 06:00:04 2015 (r283867) @@ -180,7 +180,7 @@ main(int argc, char *argv[]) KINFO_STR *ks; struct varent *vent; struct winsize ws = { .ws_row = 0 }; - const char *nlistf, *memf, *fmtstr, *str; + const char *nlistf, *memf, *str; char *cols; int all, ch, elem, flag, _fmt, i, lineno, linelen, left; int descendancy, nentries, nkept, nselectors; @@ -649,11 +649,6 @@ main(int argc, char *argv[]) linelen = 0; xo_open_instance("process"); STAILQ_FOREACH(vent, &varlist, next_ve) { - if (vent->var->flag & LJUST) - fmtstr = "%-*s"; - else - fmtstr = "%*s"; - ks = STAILQ_FIRST(&kinfo[i].ki_ks); STAILQ_REMOVE_HEAD(&kinfo[i].ki_ks, ks_next); /* Truncate rightmost column if necessary. */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 06:14:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CF28209; Mon, 1 Jun 2015 06:14:18 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 EF35619CC; Mon, 1 Jun 2015 06:14:17 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t516EHwf062794; Mon, 1 Jun 2015 06:14:17 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t516EHBC062793; Mon, 1 Jun 2015 06:14:17 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201506010614.t516EHBC062793@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 1 Jun 2015 06:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283869 - head/contrib/diff/src 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, 01 Jun 2015 06:14:18 -0000 Author: araujo (ports committer) Date: Mon Jun 1 06:14:17 2015 New Revision: 283869 URL: https://svnweb.freebsd.org/changeset/base/283869 Log: Fix the wrong format, format specifies type 'int' but the argument has type 'long', it was spotted by clang. Differential Revision: D2663 Reviewed by: imp, rodrigc Modified: head/contrib/diff/src/context.c Modified: head/contrib/diff/src/context.c ============================================================================== --- head/contrib/diff/src/context.c Mon Jun 1 06:05:53 2015 (r283868) +++ head/contrib/diff/src/context.c Mon Jun 1 06:14:17 2015 (r283869) @@ -62,7 +62,7 @@ print_context_label (char const *mark, { time_t sec = inf->stat.st_mtime; verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec); - sprintf (buf, "%jd.%.9d", (intmax_t)sec, nsec); + sprintf (buf, "%jd.%.9ld", (intmax_t)sec, nsec); } fprintf (outfile, "%s %s\t%s\n", mark, inf->name, buf); } From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 06:05:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC12DF48; Mon, 1 Jun 2015 06:05:53 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DA2F117A1; Mon, 1 Jun 2015 06:05:53 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5165rhJ057841; Mon, 1 Jun 2015 06:05:53 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5165rio057840; Mon, 1 Jun 2015 06:05:53 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201506010605.t5165rio057840@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 1 Jun 2015 06:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283868 - head/lib/libprocstat 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, 01 Jun 2015 06:05:54 -0000 Author: araujo (ports committer) Date: Mon Jun 1 06:05:53 2015 New Revision: 283868 URL: https://svnweb.freebsd.org/changeset/base/283868 Log: Remove unused variable spotted by clang. Differential Revision: D2685 Reviewed by: rodrigc, stas Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Mon Jun 1 06:00:04 2015 (r283867) +++ head/lib/libprocstat/libprocstat.c Mon Jun 1 06:05:53 2015 (r283868) @@ -1235,7 +1235,7 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s struct vnode vnode; char tagstr[12]; void *vp; - int error, found; + int error; unsigned int i; assert(kd); @@ -1264,7 +1264,7 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s /* * Find appropriate handler. */ - for (i = 0, found = 0; i < NTYPES; i++) + for (i = 0; i < NTYPES; i++) if (!strcmp(fstypes[i].tag, tagstr)) { if (fstypes[i].handler(kd, &vnode, vn) != 0) { goto fail; From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 06:50:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A29D77CD; Mon, 1 Jun 2015 06:50:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 90DC3119C; Mon, 1 Jun 2015 06:50:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t516oeNg080403; Mon, 1 Jun 2015 06:50:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t516oeNY080402; Mon, 1 Jun 2015 06:50:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201506010650.t516oeNY080402@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 1 Jun 2015 06:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283870 - 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: Mon, 01 Jun 2015 06:50:40 -0000 Author: dim Date: Mon Jun 1 06:50:39 2015 New Revision: 283870 URL: https://svnweb.freebsd.org/changeset/base/283870 Log: Remove unneeded NULL checks in amd64's trap_fatal(). Since td_name is an array member of struct thread, it can never be NULL, so the check can be removed. In addition, curproc can never be NULL, so remove the if statement, and splice the two printfs() together. While here, remove the u_long cast, and use the correct printf format specifier curproc->p_pid. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D2695 Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Mon Jun 1 06:14:17 2015 (r283869) +++ head/sys/amd64/amd64/trap.c Mon Jun 1 06:50:39 2015 (r283870) @@ -840,14 +840,8 @@ trap_fatal(frame, eva) if (frame->tf_rflags & PSL_RF) printf("resume, "); printf("IOPL = %ld\n", (frame->tf_rflags & PSL_IOPL) >> 12); - printf("current process = "); - if (curproc) { - printf("%lu (%s)\n", - (u_long)curproc->p_pid, curthread->td_name ? - curthread->td_name : ""); - } else { - printf("Idle\n"); - } + printf("current process = %d (%s)\n", + curproc->p_pid, curthread->td_name); #ifdef KDB if (debugger_on_panic || kdb_active) From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 07:59:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F13EB910; Mon, 1 Jun 2015 07:59:16 +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 ABC931305; Mon, 1 Jun 2015 07:59:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YzKcr-000MNA-FB; Mon, 01 Jun 2015 10:59:13 +0300 Date: Mon, 1 Jun 2015 10:59:13 +0300 From: Slawa Olhovchenkov To: Bruce Evans Cc: Baptiste Daroussin , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r283842 - head/usr.sbin/pw Message-ID: <20150601075913.GA58397@zxy.spb.ru> References: <201505312207.t4VM73Vh015383@svn.freebsd.org> <20150601143951.J863@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150601143951.J863@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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: Mon, 01 Jun 2015 07:59:17 -0000 On Mon, Jun 01, 2015 at 03:36:58PM +1000, Bruce Evans wrote: > On Sun, 31 May 2015, Baptiste Daroussin wrote: > > > Log: > > Remove useless cast in printf and printf-like functions: > > use %u for uid_t and gid_t > > The cast was not useless. It was to avoid the assumption that the default > promotion of uid_t and gid_t is anything in particular. Now it is assumed > that the default promotion is unsigned (int works too, but this is subtler). > > uids and gids are only guaranteed to have non-negative values. In > POSIX before about 2001, uid_t and gid_t can be any type that can > represent all the values taken on, so can be floating point. Floating > point was rarely used for POSIX types, and most programs make too many > assumptions about types, so POSIX now requires uid_t and gid_t to be > integer types. Then can still be signed integer types IIRC. Nornally > it is a bug to print signed integer types with unsigned integer formats, > but since uids and gids are guaranteed to be non-negative both formats > work. (pids require different handling since they are overloaded to > hold process group ids as negative values, so pid_t is signed and %u > format is very broken for printing general pids.) > > The program assumed that uids and gids are not too large to be represented > by unsigned long. This was the only way to print them in C90 and before. > C99 broke this by breaking the promise that unsigned long is the largest > unsigned integer type. This broke all code that does careful casts to > unsigned long. However, unsigned long is usually large enough in practice. > Careful code now has to cast to uintmax_t, but that is usually excessive > (but doesn't actually work for __uint128_t). Even plain unsigned usually > works on vaxes. And I again remind about negative uids in some system parts https://lists.freebsd.org/pipermail/svn-src-all/2015-January/098144.html From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 08:49:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97688420; Mon, 1 Jun 2015 08:49:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 5BF3C1F6A; Mon, 1 Jun 2015 08:49:24 +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 mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 4E26E42635E; Mon, 1 Jun 2015 18:49:22 +1000 (AEST) Date: Mon, 1 Jun 2015 18:49:21 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcelo Araujo cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283869 - head/contrib/diff/src In-Reply-To: <201506010614.t516EHBC062793@svn.freebsd.org> Message-ID: <20150601183442.O1517@besplex.bde.org> References: <201506010614.t516EHBC062793@svn.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=F6tuKMRN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=GoYidzk2Mr_8KV2Xt_AA: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: Mon, 01 Jun 2015 08:49:25 -0000 On Mon, 1 Jun 2015, Marcelo Araujo wrote: > Log: > Fix the wrong format, format specifies type 'int' but the argument has type > 'long', it was spotted by clang. > ... > Modified: head/contrib/diff/src/context.c > ============================================================================== > --- head/contrib/diff/src/context.c Mon Jun 1 06:05:53 2015 (r283868) > +++ head/contrib/diff/src/context.c Mon Jun 1 06:14:17 2015 (r283869) > @@ -62,7 +62,7 @@ print_context_label (char const *mark, > { > time_t sec = inf->stat.st_mtime; > verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec); > - sprintf (buf, "%jd.%.9d", (intmax_t)sec, nsec); > + sprintf (buf, "%jd.%.9ld", (intmax_t)sec, nsec); It is still a garbage format. It doesn't even misprint 1 second + 3 nanoseconds as 1.3, which looks like 1 second + 300 million nanoseconds. It pads the nanoseconds field with leading spaces, so it misprints 1 second + 3 nanoseconds as "1. 3", which is unparsable. Nanoseconds resolution is too precise for human-readable times, but the times here are unsuitable for human readingfor other reasons. They are apparently for machine reading, but never read. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 09:48:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A2143AE; Mon, 1 Jun 2015 09:48:56 +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 3EA111E2A; Mon, 1 Jun 2015 09:48:55 +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 74EF61046CAC; Mon, 1 Jun 2015 19:48:46 +1000 (AEST) Date: Mon, 1 Jun 2015 19:48:45 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283870 - head/sys/amd64/amd64 In-Reply-To: <201506010650.t516oeNY080402@svn.freebsd.org> Message-ID: <20150601185112.V1517@besplex.bde.org> References: <201506010650.t516oeNY080402@svn.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=F6tuKMRN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=rJR28oaXwkWIq0TRBBkA: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: Mon, 01 Jun 2015 09:48:56 -0000 On Mon, 1 Jun 2015, Dimitry Andric wrote: > Log: > Remove unneeded NULL checks in amd64's trap_fatal(). > > Since td_name is an array member of struct thread, it can never be NULL, > so the check can be removed. In addition, curproc can never be NULL, > so remove the if statement, and splice the two printfs() together. I fixed the first part of this in my version (for p_comm) for i386 long ago. > While here, remove the u_long cast, and use the correct printf format > specifier curproc->p_pid. This was correct, modulo a harmless sign error. Now it assumes that pid_t is int. Careful code elsewhere, and in my i386 version here, casts pid_t to signed long for printing. More careful code would cast pid_t to intmax_t, but that would be excessive. The less careful code here was copied from i386. amd64 and i386 are MD, so can hard-code assumptions about type sizes, but this is still fragile. In FreeBSD-1 (and presumably Net/2), pid_t was signed short and PID_MAX was 30000. Signed short is just barely enough to hold 30000, and 30000 is just small enough to fit in signed short. In 4.4BSD-Lite1, pid_t was expanded to signed long, although PID_MAX was not expanded. pid_t was apparently expanded for portability. If PID_MAX is expanded above 32767 then it is too large for a portable signed short, and also too large for a portable signed int, so before existed, then only portable type for pid_t was signed long and 4.4BSD used this. But in practice, signed long is the most unportable type, since is usually actually longer than int on 64-bit systems, so using it mainly gives binary compatibility problems. These problem for pid_t and most of the other long types were fixed in NetBSD and merged into 4.4BSD-Lite2, or vice versa, and merged into FreeBSD a few years later (1997). So pid_t now has type int32_t in FreeBSD. Code that was careful about printing pid_t's always cast to long for printing and never noticed the 2 previous type changes and wouldn't notice any further ones, except C99 broke the promise that long is the longest signed integer type, so the careful code might be broken by future expansion of pid_t. > Modified: head/sys/amd64/amd64/trap.c > ============================================================================== > --- head/sys/amd64/amd64/trap.c Mon Jun 1 06:14:17 2015 (r283869) > +++ head/sys/amd64/amd64/trap.c Mon Jun 1 06:50:39 2015 (r283870) > @@ -840,14 +840,8 @@ trap_fatal(frame, eva) > if (frame->tf_rflags & PSL_RF) > printf("resume, "); > printf("IOPL = %ld\n", (frame->tf_rflags & PSL_IOPL) >> 12); > - printf("current process = "); > - if (curproc) { > - printf("%lu (%s)\n", > - (u_long)curproc->p_pid, curthread->td_name ? > - curthread->td_name : ""); > - } else { > - printf("Idle\n"); > - } > + printf("current process = %d (%s)\n", > + curproc->p_pid, curthread->td_name); Technically, it is still an error to print int32_t's using %d format. This assumes that ints are at least 32 bits. The amd64 and i386 can safely assume this. Also, POSIX started requiring at least 32-bit ints in about 2007. But it is easier not to assume this. In FreeBSD-1, the i386 code correspoding to the above was: X if (curproc) { X printf("%d (%s)\n", X curproc->p_pid, curproc->p_comm ? X curproc->p_comm : ""); X } else { X printf("Idle\n"); X } In this, the curproc check was correct (curproc was sometimes NULL), the %d format was correct (pid_t was signed short), and the p_comm check was garbage as now (p_comm was an array, and even if it was a null pointer it is feature to let printf() print it as "(null)" since it is unexpected for it to be either empty or null). The %d format broke in FreeBSD-2 when FreeBSD was forced to merge with 4.4BSD-Lite-1, and the (wrong but adequate) fix for this was to cast to unsigned long and change the format to %lu. The sign mismatches from this are harmless, but it is easier to not have any mismatches than to verify that mismatches are harmless. Casting to int and keeping the %d format would also have worked, but again it was easier to not change the type, or to upcast the type (casting to long would have become an upcast when pid_t was reduced to int32_t a few years later). C99's breakage of long, and impending problems with intmax_t, made it not so clear that upcasting is right or what the upcast should be to. Upcasting to intmax_t is now only to 64 bits, but even that is excessive for pid_t on 32-bit arches. 128-bit integers will require intmax_t to be 128 bits, and that will be excessive for pid_t on on 64 bit arches. C99 also has the PRI* formats, but those are worse than what they fix. They are harder to use than upcasts, and just fix runtime space+time bloat from larger than necessary types. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 10:40:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FC906D9; Mon, 1 Jun 2015 10:40:05 +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 3B4DC1A99; Mon, 1 Jun 2015 10:40:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 38182B953; Mon, 1 Jun 2015 06:40:03 -0400 (EDT) From: John Baldwin To: Dimitry Andric Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283870 - head/sys/amd64/amd64 Date: Mon, 01 Jun 2015 06:28:53 -0400 Message-ID: <14276941.3c2kAXm4xn@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201506010650.t516oeNY080402@svn.freebsd.org> References: <201506010650.t516oeNY080402@svn.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); Mon, 01 Jun 2015 06:40:03 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 01 Jun 2015 10:40:05 -0000 On Monday, June 01, 2015 06:50:40 AM Dimitry Andric wrote: > Author: dim > Date: Mon Jun 1 06:50:39 2015 > New Revision: 283870 > URL: https://svnweb.freebsd.org/changeset/base/283870 > > Log: > Remove unneeded NULL checks in amd64's trap_fatal(). > > Since td_name is an array member of struct thread, it can never be NULL, > so the check can be removed. In addition, curproc can never be NULL, > so remove the if statement, and splice the two printfs() together. > > While here, remove the u_long cast, and use the correct printf format > specifier curproc->p_pid. > > Reviewed by: kib > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D2695 i386 has the curproc check and pid cast (it dates from < 5 when curproc was NULL when a CPU was idle (we didn't have idle threads)). Can you fix it as well? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 11:24:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A25EF108; Mon, 1 Jun 2015 11:24:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8E9E316D6; Mon, 1 Jun 2015 11:24:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t51BOaCI018167; Mon, 1 Jun 2015 11:24:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51BOYVP018161; Mon, 1 Jun 2015 11:24:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201506011124.t51BOYVP018161@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 1 Jun 2015 11:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283879 - in head/sys: conf dev/usb dev/usb/template modules/usb/template 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, 01 Jun 2015 11:24:36 -0000 Author: hselasky Date: Mon Jun 1 11:24:34 2015 New Revision: 283879 URL: https://svnweb.freebsd.org/changeset/base/283879 Log: Add USB MIDI template for USB device side mode. Added: head/sys/dev/usb/template/usb_template_midi.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/template/usb_template.h head/sys/dev/usb/usb_ioctl.h head/sys/modules/usb/template/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jun 1 10:29:50 2015 (r283878) +++ head/sys/conf/files Mon Jun 1 11:24:34 2015 (r283879) @@ -2561,6 +2561,7 @@ dev/usb/template/usb_template_msc.c opti dev/usb/template/usb_template_mtp.c optional usb_template dev/usb/template/usb_template_phone.c optional usb_template dev/usb/template/usb_template_serialnet.c optional usb_template +dev/usb/template/usb_template_midi.c optional usb_template # # USB video drivers # Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Mon Jun 1 10:29:50 2015 (r283878) +++ head/sys/dev/usb/template/usb_template.c Mon Jun 1 11:24:34 2015 (r283879) @@ -1374,6 +1374,9 @@ usb_temp_setup_by_index(struct usb_devic case USB_TEMP_SERIALNET: err = usb_temp_setup(udev, &usb_template_serialnet); break; + case USB_TEMP_MIDI: + err = usb_temp_setup(udev, &usb_template_midi); + break; default: return (USB_ERR_INVAL); } Modified: head/sys/dev/usb/template/usb_template.h ============================================================================== --- head/sys/dev/usb/template/usb_template.h Mon Jun 1 10:29:50 2015 (r283878) +++ head/sys/dev/usb/template/usb_template.h Mon Jun 1 11:24:34 2015 (r283879) @@ -107,6 +107,7 @@ extern const struct usb_temp_device_desc extern const struct usb_temp_device_desc usb_template_mtp; extern const struct usb_temp_device_desc usb_template_phone; extern const struct usb_temp_device_desc usb_template_serialnet; +extern const struct usb_temp_device_desc usb_template_midi; usb_error_t usb_temp_setup(struct usb_device *, const struct usb_temp_device_desc *); Added: head/sys/dev/usb/template/usb_template_midi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/template/usb_template_midi.c Mon Jun 1 11:24:34 2015 (r283879) @@ -0,0 +1,240 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2015 Hans Petter Selasky. 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. + */ + +/* + * This file contains the USB template for an USB MIDI Device. + */ + +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + +enum { + INDEX_MIDI_LANG, + INDEX_MIDI_IF, + INDEX_MIDI_PRODUCT, + INDEX_MIDI_MAX, +}; + +#define STRING_MIDI_PRODUCT \ + "M\0I\0D\0I\0 \0T\0e\0s\0t\0 \0D\0e\0v\0i\0c\0e" + +#define STRING_MIDI_IF \ + "M\0I\0D\0I\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" + +/* make the real string descriptors */ + +USB_MAKE_STRING_DESC(STRING_MIDI_IF, string_midi_if); +USB_MAKE_STRING_DESC(STRING_MIDI_PRODUCT, string_midi_product); + +/* prototypes */ + +static const uint8_t midi_desc_raw_0[9] = { + 0x09, 0x24, 0x01, 0x00, 0x01, 0x09, 0x00, 0x01, 0x01 +}; + +static const void *midi_descs_0[] = { + &midi_desc_raw_0, + NULL +}; + +static const struct usb_temp_interface_desc midi_iface_0 = { + .ppEndpoints = NULL, /* no endpoints */ + .ppRawDesc = midi_descs_0, + .bInterfaceClass = 1, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .iInterface = INDEX_MIDI_IF, +}; + +static const struct usb_temp_packet_size midi_mps = { + .mps[USB_SPEED_LOW] = 8, + .mps[USB_SPEED_FULL] = 64, + .mps[USB_SPEED_HIGH] = 512, +}; + +static const uint8_t midi_desc_raw_7[5] = { + 0x05, 0x25, 0x01, 0x01, 0x01 +}; + +static const void *midi_descs_2[] = { + &midi_desc_raw_7, + NULL +}; + +static const struct usb_temp_endpoint_desc midi_bulk_out_ep = { + .ppRawDesc = midi_descs_2, + .pPacketSize = &midi_mps, + .bEndpointAddress = UE_DIR_OUT, + .bmAttributes = UE_BULK, +}; + +static const uint8_t midi_desc_raw_6[5] = { + 0x05, 0x25, 0x01, 0x01, 0x03, +}; + +static const void *midi_descs_3[] = { + &midi_desc_raw_6, + NULL +}; + +static const struct usb_temp_endpoint_desc midi_bulk_in_ep = { + .ppRawDesc = midi_descs_3, + .pPacketSize = &midi_mps, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_BULK, +}; + +static const struct usb_temp_endpoint_desc *midi_iface_1_ep[] = { + &midi_bulk_out_ep, + &midi_bulk_in_ep, + NULL, +}; + +static const uint8_t midi_desc_raw_1[7] = { + 0x07, 0x24, 0x01, 0x00, 0x01, /* wTotalLength: */ 0x41, 0x00 +}; + +static const uint8_t midi_desc_raw_2[6] = { + 0x06, 0x24, 0x02, 0x01, 0x01, 0x00 +}; + +static const uint8_t midi_desc_raw_3[6] = { + 0x06, 0x24, 0x02, 0x02, 0x02, 0x00 +}; + +static const uint8_t midi_desc_raw_4[9] = { + 0x09, 0x24, 0x03, 0x01, 0x03, 0x01, 0x02, 0x01, 0x00 +}; + +static const uint8_t midi_desc_raw_5[9] = { + 0x09, 0x24, 0x03, 0x02, 0x04, 0x01, 0x01, 0x01, 0x00 +}; + +static const void *midi_descs_1[] = { + &midi_desc_raw_1, + &midi_desc_raw_2, + &midi_desc_raw_3, + &midi_desc_raw_4, + &midi_desc_raw_5, + NULL +}; + +static const struct usb_temp_interface_desc midi_iface_1 = { + .ppRawDesc = midi_descs_1, + .ppEndpoints = midi_iface_1_ep, + .bInterfaceClass = 0x01, /* Midi */ + .bInterfaceSubClass = 3, /* MIDI streaming */ + .bInterfaceProtocol = 0, + .iInterface = INDEX_MIDI_IF, +}; + +static const struct usb_temp_interface_desc *midi_interfaces[] = { + &midi_iface_0, + &midi_iface_1, + NULL, +}; + +static const struct usb_temp_config_desc midi_config_desc = { + .ppIfaceDesc = midi_interfaces, + .bmAttributes = UC_BUS_POWERED, + .bMaxPower = 25, /* 50 mA */ + .iConfiguration = INDEX_MIDI_PRODUCT, +}; + +static const struct usb_temp_config_desc *midi_configs[] = { + &midi_config_desc, + NULL, +}; + +static usb_temp_get_string_desc_t midi_get_string_desc; + +const struct usb_temp_device_desc usb_template_midi = { + .getStringDesc = &midi_get_string_desc, + .ppConfigDesc = midi_configs, + .idVendor = USB_TEMPLATE_VENDOR, + .idProduct = 0x00BB, + .bcdDevice = 0x0100, + .bDeviceClass = 0, + .bDeviceSubClass = 0, + .bDeviceProtocol = 0, + .iManufacturer = 0, + .iProduct = INDEX_MIDI_PRODUCT, + .iSerialNumber = 0, +}; + +/*------------------------------------------------------------------------* + * midi_get_string_desc + * + * Return values: + * NULL: Failure. No such string. + * Else: Success. Pointer to string descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +midi_get_string_desc(uint16_t lang_id, uint8_t string_index) +{ + static const void *ptr[INDEX_MIDI_MAX] = { + [INDEX_MIDI_LANG] = &usb_string_lang_en, + [INDEX_MIDI_IF] = &string_midi_if, + [INDEX_MIDI_PRODUCT] = &string_midi_product, + }; + + if (string_index == 0) { + return (&usb_string_lang_en); + } + if (lang_id != 0x0409) { + return (NULL); + } + if (string_index < INDEX_MIDI_MAX) { + return (ptr[string_index]); + } + return (NULL); +} Modified: head/sys/dev/usb/usb_ioctl.h ============================================================================== --- head/sys/dev/usb/usb_ioctl.h Mon Jun 1 10:29:50 2015 (r283878) +++ head/sys/dev/usb/usb_ioctl.h Mon Jun 1 11:24:34 2015 (r283879) @@ -66,6 +66,7 @@ enum { USB_TEMP_MOUSE, /* USB Mouse */ USB_TEMP_PHONE, /* USB Phone */ USB_TEMP_SERIALNET, /* USB CDC Ethernet and Modem */ + USB_TEMP_MIDI, /* USB MIDI */ USB_TEMP_MAX, }; Modified: head/sys/modules/usb/template/Makefile ============================================================================== --- head/sys/modules/usb/template/Makefile Mon Jun 1 10:29:50 2015 (r283878) +++ head/sys/modules/usb/template/Makefile Mon Jun 1 11:24:34 2015 (r283879) @@ -40,6 +40,7 @@ SRCS= opt_bus.h opt_usb.h device_if.h bu usb_template_msc.c \ usb_template_mtp.c \ usb_template_phone.c \ - usb_template_serialnet.c + usb_template_serialnet.c \ + usb_template_midi.c .include From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 17:15:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF50058F; Mon, 1 Jun 2015 17:15:25 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BC8B91E67; Mon, 1 Jun 2015 17:15:25 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t51HFPeY094576; Mon, 1 Jun 2015 17:15:25 GMT (envelope-from jfv@FreeBSD.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51HFPCZ094574; Mon, 1 Jun 2015 17:15:25 GMT (envelope-from jfv@FreeBSD.org) Message-Id: <201506011715.t51HFPCZ094574@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jfv set sender to jfv@FreeBSD.org using -f From: Jack F Vogel Date: Mon, 1 Jun 2015 17:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283881 - in head: head head/sys head/sys/dev head/sys/dev/ixgbe head/sys/modules head/sys/modules/ixv sys/dev/ixgbe sys/modules/ixv 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, 01 Jun 2015 17:15:25 -0000 Author: jfv Date: Mon Jun 1 17:15:25 2015 New Revision: 283881 URL: https://svnweb.freebsd.org/changeset/base/283881 Log: Delta D2489 - Add SRIOV support to the Intel 10G driver. NOTE: This is a technology preview, while it has undergone development tests, Intel has not yet completed full validation of the feature. It is being integrated for early access and customer testing. Added: head/head/ head/head/sys/ head/head/sys/dev/ head/head/sys/dev/ixgbe/ head/head/sys/modules/ head/head/sys/modules/ixv/ Modified: head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ix_txrx.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixgbe_mbx.h head/sys/dev/ixgbe/ixgbe_vf.c head/sys/modules/ixv/Makefile Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Mon Jun 1 16:46:51 2015 (r283880) +++ head/sys/dev/ixgbe/if_ix.c Mon Jun 1 17:15:25 2015 (r283881) @@ -54,7 +54,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.8.3"; +char ixgbe_driver_version[] = "3.1.0"; /********************************************************************* * PCI Device ID Table @@ -138,6 +138,7 @@ static int ixgbe_setup_msix(struct adapt static void ixgbe_free_pci_resources(struct adapter *); static void ixgbe_local_timer(void *); static int ixgbe_setup_interface(device_t, struct adapter *); +static void ixgbe_config_gpie(struct adapter *); static void ixgbe_config_dmac(struct adapter *); static void ixgbe_config_delay_values(struct adapter *); static void ixgbe_config_link(struct adapter *); @@ -204,6 +205,18 @@ static void ixgbe_handle_phy(void *, int static void ixgbe_reinit_fdir(void *, int); #endif +#ifdef PCI_IOV +static void ixgbe_ping_all_vfs(struct adapter *); +static void ixgbe_handle_mbx(void *, int); +static int ixgbe_init_iov(device_t, u16, const nvlist_t *); +static void ixgbe_uninit_iov(device_t); +static int ixgbe_add_vf(device_t, u16, const nvlist_t *); +static void ixgbe_initialize_iov(struct adapter *); +static void ixgbe_recalculate_max_frame(struct adapter *); +static void ixgbe_init_vf(struct adapter *, struct ixgbe_vf *); +#endif /* PCI_IOV */ + + /********************************************************************* * FreeBSD Device Interface Entry Points *********************************************************************/ @@ -216,6 +229,11 @@ static device_method_t ix_methods[] = { DEVMETHOD(device_shutdown, ixgbe_shutdown), DEVMETHOD(device_suspend, ixgbe_suspend), DEVMETHOD(device_resume, ixgbe_resume), +#ifdef PCI_IOV + DEVMETHOD(pci_init_iov, ixgbe_init_iov), + DEVMETHOD(pci_uninit_iov, ixgbe_uninit_iov), + DEVMETHOD(pci_add_vf, ixgbe_add_vf), +#endif /* PCI_IOV */ DEVMETHOD_END }; @@ -341,6 +359,8 @@ static int fdir_pballoc = 1; #include #endif /* DEV_NETMAP */ +static MALLOC_DEFINE(M_IXGBE, "ix", "ix driver allocations"); + /********************************************************************* * Device identification routine * @@ -472,7 +492,7 @@ ixgbe_attach(device_t dev) } /* Allocate multicast array memory. */ - adapter->mta = malloc(sizeof(u8) * IXGBE_ETH_LENGTH_OF_ADDRESS * + adapter->mta = malloc(sizeof(*adapter->mta) * MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT); if (adapter->mta == NULL) { device_printf(dev, "Can not allocate multicast setup array\n"); @@ -558,6 +578,28 @@ ixgbe_attach(device_t dev) /* Set an initial default flow control value */ adapter->fc = ixgbe_fc_full; +#ifdef PCI_IOV + if ((hw->mac.type != ixgbe_mac_82598EB) && (adapter->msix > 1)) { + nvlist_t *pf_schema, *vf_schema; + + hw->mbx.ops.init_params(hw); + pf_schema = pci_iov_schema_alloc_node(); + vf_schema = pci_iov_schema_alloc_node(); + pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL); + pci_iov_schema_add_bool(vf_schema, "mac-anti-spoof", + IOV_SCHEMA_HASDEFAULT, TRUE); + pci_iov_schema_add_bool(vf_schema, "allow-set-mac", + IOV_SCHEMA_HASDEFAULT, FALSE); + pci_iov_schema_add_bool(vf_schema, "allow-promisc", + IOV_SCHEMA_HASDEFAULT, FALSE); + error = pci_iov_attach(dev, pf_schema, vf_schema); + if (error != 0) { + device_printf(dev, + "Error %d setting up SR-IOV\n", error); + } + } +#endif /* PCI_IOV */ + /* Check for certain supported features */ ixgbe_check_wol_support(adapter); ixgbe_check_eee_support(adapter); @@ -614,6 +656,13 @@ ixgbe_detach(device_t dev) return (EBUSY); } +#ifdef PCI_IOV + if (pci_iov_detach(dev) != 0) { + device_printf(dev, "SR-IOV in use; detach first.\n"); + return (EBUSY); + } +#endif /* PCI_IOV */ + /* Stop the adapter */ IXGBE_CORE_LOCK(adapter); ixgbe_setup_low_power_mode(adapter); @@ -634,6 +683,9 @@ ixgbe_detach(device_t dev) taskqueue_drain(adapter->tq, &adapter->link_task); taskqueue_drain(adapter->tq, &adapter->mod_task); taskqueue_drain(adapter->tq, &adapter->msf_task); +#ifdef PCI_IOV + taskqueue_drain(adapter->tq, &adapter->mbx_task); +#endif taskqueue_drain(adapter->tq, &adapter->phy_task); #ifdef IXGBE_FDIR taskqueue_drain(adapter->tq, &adapter->fdir_task); @@ -810,6 +862,9 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c adapter->max_frame_size = ifp->if_mtu + IXGBE_MTU_HDR; ixgbe_init_locked(adapter); +#ifdef PCI_IOV + ixgbe_recalculate_max_frame(adapter); +#endif IXGBE_CORE_UNLOCK(adapter); } break; @@ -925,22 +980,36 @@ ixgbe_init_locked(struct adapter *adapte struct ifnet *ifp = adapter->ifp; device_t dev = adapter->dev; struct ixgbe_hw *hw = &adapter->hw; - u32 k, txdctl, mhadd, gpie; + struct tx_ring *txr; + struct rx_ring *rxr; + u32 txdctl, mhadd; u32 rxdctl, rxctrl; +#ifdef PCI_IOV + enum ixgbe_iov_mode mode; +#endif mtx_assert(&adapter->core_mtx, MA_OWNED); INIT_DEBUGOUT("ixgbe_init_locked: begin"); + hw->adapter_stopped = FALSE; ixgbe_stop_adapter(hw); callout_stop(&adapter->timer); +#ifdef PCI_IOV + mode = ixgbe_get_iov_mode(adapter); + adapter->pool = ixgbe_max_vfs(mode); + /* Queue indices may change with IOV mode */ + for (int i = 0; i < adapter->num_queues; i++) { + adapter->rx_rings[i].me = ixgbe_pf_que_index(mode, i); + adapter->tx_rings[i].me = ixgbe_pf_que_index(mode, i); + } +#endif /* reprogram the RAR[0] in case user changed it. */ - ixgbe_set_rar(hw, 0, adapter->hw.mac.addr, 0, IXGBE_RAH_AV); + ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, IXGBE_RAH_AV); /* Get the latest mac address, User can use a LAA */ - bcopy(IF_LLADDR(adapter->ifp), hw->mac.addr, - IXGBE_ETH_LENGTH_OF_ADDRESS); - ixgbe_set_rar(hw, 0, hw->mac.addr, 0, 1); + bcopy(IF_LLADDR(ifp), hw->mac.addr, IXGBE_ETH_LENGTH_OF_ADDRESS); + ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, 1); hw->addr_ctrl.rar_used_count = 1; /* Set the various hardware offload abilities */ @@ -963,6 +1032,9 @@ ixgbe_init_locked(struct adapter *adapte } ixgbe_init_hw(hw); +#ifdef PCI_IOV + ixgbe_initialize_iov(adapter); +#endif ixgbe_initialize_transmit_units(adapter); /* Setup Multicast table */ @@ -972,14 +1044,10 @@ ixgbe_init_locked(struct adapter *adapte ** Determine the correct mbuf pool ** for doing jumbo frames */ - if (adapter->max_frame_size <= 2048) + if (adapter->max_frame_size <= MCLBYTES) adapter->rx_mbuf_sz = MCLBYTES; - else if (adapter->max_frame_size <= 4096) - adapter->rx_mbuf_sz = MJUMPAGESIZE; - else if (adapter->max_frame_size <= 9216) - adapter->rx_mbuf_sz = MJUM9BYTES; else - adapter->rx_mbuf_sz = MJUM16BYTES; + adapter->rx_mbuf_sz = MJUMPAGESIZE; /* Prepare receive descriptors and buffers */ if (ixgbe_setup_receive_structures(adapter)) { @@ -991,31 +1059,8 @@ ixgbe_init_locked(struct adapter *adapte /* Configure RX settings */ ixgbe_initialize_receive_units(adapter); - gpie = IXGBE_READ_REG(&adapter->hw, IXGBE_GPIE); - - /* Enable Fan Failure Interrupt */ - gpie |= IXGBE_SDP1_GPIEN_BY_MAC(hw); - - /* Add for Module detection */ - if (hw->mac.type == ixgbe_mac_82599EB) - gpie |= IXGBE_SDP2_GPIEN; - - /* - * Thermal Failure Detection (X540) - * Link Detection (X552) - */ - if (hw->mac.type == ixgbe_mac_X540 || - hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP || - hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) - gpie |= IXGBE_SDP0_GPIEN_X540; - - if (adapter->msix > 1) { - /* Enable Enhanced MSIX mode */ - gpie |= IXGBE_GPIE_MSIX_MODE; - gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT | - IXGBE_GPIE_OCD; - } - IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); + /* Enable SDP & MSIX interrupts based on adapter */ + ixgbe_config_gpie(adapter); /* Set MTU size */ if (ifp->if_mtu > ETHERMTU) { @@ -1028,7 +1073,8 @@ ixgbe_init_locked(struct adapter *adapte /* Now enable all the queues */ for (int i = 0; i < adapter->num_queues; i++) { - txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(i)); + txr = &adapter->tx_rings[i]; + txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(txr->me)); txdctl |= IXGBE_TXDCTL_ENABLE; /* Set WTHRESH to 8, burst writeback */ txdctl |= (8 << 16); @@ -1040,11 +1086,12 @@ ixgbe_init_locked(struct adapter *adapte * Prefetching enables tx line rate even with 1 queue. */ txdctl |= (32 << 0) | (1 << 8); - IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl); + IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(txr->me), txdctl); } - for (int i = 0; i < adapter->num_queues; i++) { - rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); + for (int i = 0, j = 0; i < adapter->num_queues; i++) { + rxr = &adapter->rx_rings[i]; + rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)); if (hw->mac.type == ixgbe_mac_82598EB) { /* ** PTHRESH = 21 @@ -1055,9 +1102,9 @@ ixgbe_init_locked(struct adapter *adapte rxdctl |= 0x080420; } rxdctl |= IXGBE_RXDCTL_ENABLE; - IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), rxdctl); - for (k = 0; k < 10; k++) { - if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)) & + IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), rxdctl); + for (; j < 10; j++) { + if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)) & IXGBE_RXDCTL_ENABLE) break; else @@ -1086,10 +1133,10 @@ ixgbe_init_locked(struct adapter *adapte struct netmap_kring *kring = &na->rx_rings[i]; int t = na->num_rx_desc - 1 - nm_kr_rxspace(kring); - IXGBE_WRITE_REG(hw, IXGBE_RDT(i), t); + IXGBE_WRITE_REG(hw, IXGBE_RDT(rxr->me), t); } else #endif /* DEV_NETMAP */ - IXGBE_WRITE_REG(hw, IXGBE_RDT(i), adapter->num_rx_desc - 1); + IXGBE_WRITE_REG(hw, IXGBE_RDT(rxr->me), adapter->num_rx_desc - 1); } /* Enable Receive engine */ @@ -1128,9 +1175,9 @@ ixgbe_init_locked(struct adapter *adapte #endif /* - ** Check on any SFP devices that - ** need to be kick-started - */ + * Check on any SFP devices that + * need to be kick-started + */ if (hw->phy.type == ixgbe_phy_none) { int err = hw->phy.ops.identify(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { @@ -1144,8 +1191,7 @@ ixgbe_init_locked(struct adapter *adapte IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR); /* Configure Energy Efficient Ethernet for supported devices */ - if (adapter->eee_support) - ixgbe_setup_eee(hw, adapter->eee_enabled); + ixgbe_setup_eee(hw, adapter->eee_enabled); /* Config/Enable Link */ ixgbe_config_link(adapter); @@ -1165,6 +1211,15 @@ ixgbe_init_locked(struct adapter *adapte /* And now turn on interrupts */ ixgbe_enable_intr(adapter); +#ifdef PCI_IOV + /* Enable the use of the MBX by the VF's */ + { + u32 reg = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); + reg |= IXGBE_CTRL_EXT_PFRSTD; + IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, reg); + } +#endif + /* Now inform the stack we're ready */ ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -1183,6 +1238,51 @@ ixgbe_init(void *arg) } static void +ixgbe_config_gpie(struct adapter *adapter) +{ + struct ixgbe_hw *hw = &adapter->hw; + u32 gpie; + + gpie = IXGBE_READ_REG(hw, IXGBE_GPIE); + + /* Fan Failure Interrupt */ + if (hw->device_id == IXGBE_DEV_ID_82598AT) + gpie |= IXGBE_SDP1_GPIEN; + + /* + * Module detection (SDP2) + * Media ready (SDP1) + */ + if (hw->mac.type == ixgbe_mac_82599EB) { + gpie |= IXGBE_SDP2_GPIEN; + if (hw->device_id != IXGBE_DEV_ID_82599_QSFP_SF_QP) + gpie |= IXGBE_SDP1_GPIEN; + } + + /* + * Thermal Failure Detection (X540) + * Link Detection (X557) + */ + if (hw->mac.type == ixgbe_mac_X540 || + hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP || + hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) + gpie |= IXGBE_SDP0_GPIEN_X540; + + if (adapter->msix > 1) { + /* Enable Enhanced MSIX mode */ + gpie |= IXGBE_GPIE_MSIX_MODE; + gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT | + IXGBE_GPIE_OCD; + } + + IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); + return; +} + +/* + * Requires adapter->max_frame_size to be set. + */ +static void ixgbe_config_delay_values(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; @@ -1276,10 +1376,9 @@ ixgbe_handle_que(void *context, int pend struct adapter *adapter = que->adapter; struct tx_ring *txr = que->txr; struct ifnet *ifp = adapter->ifp; - bool more; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - more = ixgbe_rxeof(que); + ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); ixgbe_txeof(txr); #ifndef IXGBE_LEGACY_TX @@ -1341,8 +1440,8 @@ ixgbe_legacy_irq(void *arg) IXGBE_TX_UNLOCK(txr); /* Check for fan failure */ - if ((hw->phy.media_type == ixgbe_media_type_copper) && - (reg_eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw))) { + if ((hw->device_id == IXGBE_DEV_ID_82598AT) && + (reg_eicr & IXGBE_EICR_GPI_SDP1)) { device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! " "REPLACE IMMEDIATELY!!\n"); IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); @@ -1381,6 +1480,7 @@ ixgbe_msix_que(void *arg) bool more; u32 newitr = 0; + /* Protect against spurious interrupts */ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; @@ -1504,6 +1604,10 @@ ixgbe_msix_link(void *arg) device_printf(adapter->dev, "System shutdown required!\n"); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_TS); } +#ifdef PCI_IOV + if (reg_eicr & IXGBE_EICR_MAILBOX) + taskqueue_enqueue(adapter->tq, &adapter->mbx_task); +#endif } /* Pluggable optics-related interrupt */ @@ -1569,7 +1673,7 @@ ixgbe_media_status(struct ifnet * ifp, s } ifmr->ifm_status |= IFM_ACTIVE; - layer = ixgbe_get_supported_physical_layer(hw); + layer = adapter->phy_layer; if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T || layer & IXGBE_PHYSICAL_LAYER_1000BASE_T || @@ -1802,18 +1906,17 @@ ixgbe_set_promisc(struct adapter *adapte static void ixgbe_set_multi(struct adapter *adapter) { - u32 fctrl; - u8 *mta; - u8 *update_ptr; - struct ifmultiaddr *ifma; - int mcnt = 0; - struct ifnet *ifp = adapter->ifp; + u32 fctrl; + u8 *update_ptr; + struct ifmultiaddr *ifma; + struct ixgbe_mc_addr *mta; + int mcnt = 0; + struct ifnet *ifp = adapter->ifp; IOCTL_DEBUGOUT("ixgbe_set_multi: begin"); mta = adapter->mta; - bzero(mta, sizeof(u8) * IXGBE_ETH_LENGTH_OF_ADDRESS * - MAX_NUM_MULTICAST_ADDRESSES); + bzero(mta, sizeof(*mta) * MAX_NUM_MULTICAST_ADDRESSES); #if __FreeBSD_version < 800000 IF_ADDR_LOCK(ifp); @@ -1826,8 +1929,8 @@ ixgbe_set_multi(struct adapter *adapter) if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) break; bcopy(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), - &mta[mcnt * IXGBE_ETH_LENGTH_OF_ADDRESS], - IXGBE_ETH_LENGTH_OF_ADDRESS); + mta[mcnt].addr, IXGBE_ETH_LENGTH_OF_ADDRESS); + mta[mcnt].vmdq = adapter->pool; mcnt++; } #if __FreeBSD_version < 800000 @@ -1850,7 +1953,7 @@ ixgbe_set_multi(struct adapter *adapter) IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl); if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) { - update_ptr = mta; + update_ptr = (u8 *)mta; ixgbe_update_mc_addr_list(&adapter->hw, update_ptr, mcnt, ixgbe_mc_array_itr, TRUE); } @@ -1866,13 +1969,13 @@ ixgbe_set_multi(struct adapter *adapter) static u8 * ixgbe_mc_array_itr(struct ixgbe_hw *hw, u8 **update_ptr, u32 *vmdq) { - u8 *addr = *update_ptr; - u8 *newptr; - *vmdq = 0; - - newptr = addr + IXGBE_ETH_LENGTH_OF_ADDRESS; - *update_ptr = newptr; - return addr; + struct ixgbe_mc_addr *mta; + + mta = (struct ixgbe_mc_addr *)*update_ptr; + *vmdq = mta->vmdq; + + *update_ptr = (u8*)(mta + 1);; + return (mta->addr); } @@ -1954,6 +2057,7 @@ watchdog: ixgbe_init_locked(adapter); } + /* ** Note: this routine updates the OS on the link state ** the real check of the hardware only happens with @@ -1977,6 +2081,9 @@ ixgbe_update_link_status(struct adapter /* Update DMA coalescing config */ ixgbe_config_dmac(adapter); if_link_state_change(ifp, LINK_STATE_UP); +#ifdef PCI_IOV + ixgbe_ping_all_vfs(adapter); +#endif } } else { /* Link down */ if (adapter->link_active == TRUE) { @@ -1984,6 +2091,9 @@ ixgbe_update_link_status(struct adapter device_printf(dev,"Link is Down\n"); if_link_state_change(ifp, LINK_STATE_DOWN); adapter->link_active = FALSE; +#ifdef PCI_IOV + ixgbe_ping_all_vfs(adapter); +#endif } } @@ -2083,7 +2193,7 @@ ixgbe_setup_optics(struct adapter *adapt struct ixgbe_hw *hw = &adapter->hw; int layer; - layer = ixgbe_get_supported_physical_layer(hw); + layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) { adapter->optics = IFM_10G_T; @@ -2281,17 +2391,19 @@ ixgbe_allocate_msix(struct adapter *adap #endif if (adapter->num_queues > 1) bus_bind_intr(dev, que->res, cpu_id); - +#ifdef IXGBE_DEBUG #ifdef RSS device_printf(dev, "Bound RSS bucket %d to CPU %d\n", i, cpu_id); #else - if (bootverbose) - device_printf(dev, - "Bound queue %d to cpu %d\n", - i, cpu_id); + device_printf(dev, + "Bound queue %d to cpu %d\n", + i, cpu_id); #endif +#endif /* IXGBE_DEBUG */ + + #ifndef IXGBE_LEGACY_TX TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); #endif @@ -2337,6 +2449,9 @@ ixgbe_allocate_msix(struct adapter *adap TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); TASK_INIT(&adapter->mod_task, 0, ixgbe_handle_mod, adapter); TASK_INIT(&adapter->msf_task, 0, ixgbe_handle_msf, adapter); +#ifdef PCI_IOV + TASK_INIT(&adapter->mbx_task, 0, ixgbe_handle_mbx, adapter); +#endif TASK_INIT(&adapter->phy_task, 0, ixgbe_handle_phy, adapter); #ifdef IXGBE_FDIR TASK_INIT(&adapter->fdir_task, 0, ixgbe_reinit_fdir, adapter); @@ -2630,7 +2745,7 @@ ixgbe_add_media_types(struct adapter *ad device_t dev = adapter->dev; int layer; - layer = ixgbe_get_supported_physical_layer(hw); + layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); /* Media types with matching FreeBSD media defines */ if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) @@ -2741,19 +2856,20 @@ ixgbe_initialize_transmit_units(struct a for (int i = 0; i < adapter->num_queues; i++, txr++) { u64 tdba = txr->txdma.dma_paddr; u32 txctrl = 0; + int j = txr->me; - IXGBE_WRITE_REG(hw, IXGBE_TDBAL(i), + IXGBE_WRITE_REG(hw, IXGBE_TDBAL(j), (tdba & 0x00000000ffffffffULL)); - IXGBE_WRITE_REG(hw, IXGBE_TDBAH(i), (tdba >> 32)); - IXGBE_WRITE_REG(hw, IXGBE_TDLEN(i), + IXGBE_WRITE_REG(hw, IXGBE_TDBAH(j), (tdba >> 32)); + IXGBE_WRITE_REG(hw, IXGBE_TDLEN(j), adapter->num_tx_desc * sizeof(union ixgbe_adv_tx_desc)); /* Setup the HW Tx Head and Tail descriptor pointers */ - IXGBE_WRITE_REG(hw, IXGBE_TDH(i), 0); - IXGBE_WRITE_REG(hw, IXGBE_TDT(i), 0); + IXGBE_WRITE_REG(hw, IXGBE_TDH(j), 0); + IXGBE_WRITE_REG(hw, IXGBE_TDT(j), 0); /* Cache the tail address */ - txr->tail = IXGBE_TDT(txr->me); + txr->tail = IXGBE_TDT(j); /* Set the processing limit */ txr->process_limit = ixgbe_tx_process_limit; @@ -2761,23 +2877,23 @@ ixgbe_initialize_transmit_units(struct a /* Disable Head Writeback */ switch (hw->mac.type) { case ixgbe_mac_82598EB: - txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i)); + txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(j)); break; case ixgbe_mac_82599EB: case ixgbe_mac_X540: default: - txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i)); + txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(j)); break; } txctrl &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN; switch (hw->mac.type) { case ixgbe_mac_82598EB: - IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), txctrl); + IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(j), txctrl); break; case ixgbe_mac_82599EB: case ixgbe_mac_X540: default: - IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(i), txctrl); + IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(j), txctrl); break; } @@ -2785,6 +2901,9 @@ ixgbe_initialize_transmit_units(struct a if (hw->mac.type != ixgbe_mac_82598EB) { u32 dmatxctl, rttdcs; +#ifdef PCI_IOV + enum ixgbe_iov_mode mode = ixgbe_get_iov_mode(adapter); +#endif dmatxctl = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); dmatxctl |= IXGBE_DMATXCTL_TE; IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, dmatxctl); @@ -2792,7 +2911,11 @@ ixgbe_initialize_transmit_units(struct a rttdcs = IXGBE_READ_REG(hw, IXGBE_RTTDCS); rttdcs |= IXGBE_RTTDCS_ARBDIS; IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); +#ifdef PCI_IOV + IXGBE_WRITE_REG(hw, IXGBE_MTQC, ixgbe_get_mtqc(mode)); +#else IXGBE_WRITE_REG(hw, IXGBE_MTQC, IXGBE_MTQC_64Q_1PB); +#endif rttdcs &= ~IXGBE_RTTDCS_ARBDIS; IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); } @@ -2804,17 +2927,14 @@ static void ixgbe_initialise_rss_mapping(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; - uint32_t reta; - int i, j, queue_id, table_size; - int index_mult; - uint32_t rss_key[10]; - uint32_t mrqc; + u32 reta = 0, mrqc, rss_key[10]; + int queue_id, table_size, index_mult; #ifdef RSS - uint32_t rss_hash_config; + u32 rss_hash_config; +#endif +#ifdef PCI_IOV + enum ixgbe_iov_mode mode; #endif - - /* Setup RSS */ - reta = 0; #ifdef RSS /* Fetch the configured RSS key */ @@ -2840,7 +2960,7 @@ ixgbe_initialise_rss_mapping(struct adap } /* Set up the redirection table */ - for (i = 0, j = 0; i < table_size; i++, j++) { + for (int i = 0, j = 0; i < table_size; i++, j++) { if (j == adapter->num_queues) j = 0; #ifdef RSS /* @@ -2907,19 +3027,16 @@ ixgbe_initialise_rss_mapping(struct adap mrqc = IXGBE_MRQC_RSSEN | IXGBE_MRQC_RSS_FIELD_IPV4 | IXGBE_MRQC_RSS_FIELD_IPV4_TCP -#if 0 - | IXGBE_MRQC_RSS_FIELD_IPV4_UDP -#endif | IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP | IXGBE_MRQC_RSS_FIELD_IPV6_EX | IXGBE_MRQC_RSS_FIELD_IPV6 | IXGBE_MRQC_RSS_FIELD_IPV6_TCP -#if 0 - | IXGBE_MRQC_RSS_FIELD_IPV6_UDP - | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP -#endif ; #endif /* RSS */ +#ifdef PCI_IOV + mode = ixgbe_get_iov_mode(adapter); + mrqc |= ixgbe_get_mrqc(mode); +#endif IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc); } @@ -2978,16 +3095,17 @@ ixgbe_initialize_receive_units(struct ad for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 rdba = rxr->rxdma.dma_paddr; + int j = rxr->me; /* Setup the Base and Length of the Rx Descriptor Ring */ - IXGBE_WRITE_REG(hw, IXGBE_RDBAL(i), + IXGBE_WRITE_REG(hw, IXGBE_RDBAL(j), (rdba & 0x00000000ffffffffULL)); - IXGBE_WRITE_REG(hw, IXGBE_RDBAH(i), (rdba >> 32)); - IXGBE_WRITE_REG(hw, IXGBE_RDLEN(i), + IXGBE_WRITE_REG(hw, IXGBE_RDBAH(j), (rdba >> 32)); + IXGBE_WRITE_REG(hw, IXGBE_RDLEN(j), adapter->num_rx_desc * sizeof(union ixgbe_adv_rx_desc)); /* Set up the SRRCTL register */ - srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i)); + srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(j)); srrctl &= ~IXGBE_SRRCTL_BSIZEHDR_MASK; srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK; srrctl |= bufsz; @@ -2999,18 +3117,16 @@ ixgbe_initialize_receive_units(struct ad * so we do not need to clear the bit, but do it just in case * this code is moved elsewhere. */ - if (adapter->num_queues > 1 && - adapter->hw.fc.requested_mode == ixgbe_fc_none) { + if (adapter->num_queues > 1 && adapter->fc == ixgbe_fc_none) srrctl |= IXGBE_SRRCTL_DROP_EN; - } else { + else srrctl &= ~IXGBE_SRRCTL_DROP_EN; - } - IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(j), srrctl); /* Setup the HW Rx Head and Tail Descriptor Pointers */ - IXGBE_WRITE_REG(hw, IXGBE_RDH(i), 0); - IXGBE_WRITE_REG(hw, IXGBE_RDT(i), 0); + IXGBE_WRITE_REG(hw, IXGBE_RDH(j), 0); + IXGBE_WRITE_REG(hw, IXGBE_RDT(j), 0); /* Set the processing limit */ rxr->process_limit = ixgbe_rx_process_limit; @@ -3126,9 +3242,9 @@ ixgbe_setup_vlan_hw_support(struct adapt rxr = &adapter->rx_rings[i]; /* On 82599 the VLAN enable is per/queue in RXDCTL */ if (hw->mac.type != ixgbe_mac_82598EB) { - ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); + ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)); ctrl |= IXGBE_RXDCTL_VME; - IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl); + IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), ctrl); } rxr->vtag_strip = TRUE; } @@ -3178,6 +3294,9 @@ ixgbe_enable_intr(struct adapter *adapte #ifdef IXGBE_FDIR mask |= IXGBE_EIMS_FLOW_DIR; #endif +#ifdef PCI_IOV + mask |= IXGBE_EIMS_MAILBOX; +#endif break; case ixgbe_mac_X540: /* Detect if Thermal Sensor is enabled */ @@ -3201,6 +3320,9 @@ ixgbe_enable_intr(struct adapter *adapte #ifdef IXGBE_FDIR mask |= IXGBE_EIMS_FLOW_DIR; #endif +#ifdef PCI_IOV + mask |= IXGBE_EIMS_MAILBOX; +#endif /* falls through */ default: break; @@ -3214,6 +3336,9 @@ ixgbe_enable_intr(struct adapter *adapte /* Don't autoclear Link */ mask &= ~IXGBE_EIMS_OTHER; mask &= ~IXGBE_EIMS_LSC; +#ifdef PCI_IOV + mask &= ~IXGBE_EIMS_MAILBOX; +#endif IXGBE_WRITE_REG(hw, IXGBE_EIAC, mask); } @@ -3412,8 +3537,8 @@ ixgbe_set_ivar(struct adapter *adapter, static void ixgbe_configure_ivars(struct adapter *adapter) { - struct ix_queue *que = adapter->queues; - u32 newitr; + struct ix_queue *que = adapter->queues; + u32 newitr; if (ixgbe_max_interrupt_rate > 0) newitr = (4000000 / ixgbe_max_interrupt_rate) & 0x0FF8; @@ -3427,10 +3552,12 @@ ixgbe_configure_ivars(struct adapter *ad } for (int i = 0; i < adapter->num_queues; i++, que++) { + struct rx_ring *rxr = &adapter->rx_rings[i]; + struct tx_ring *txr = &adapter->tx_rings[i]; /* First the RX queue entry */ - ixgbe_set_ivar(adapter, i, que->msix, 0); + ixgbe_set_ivar(adapter, rxr->me, que->msix, 0); /* ... and the TX */ - ixgbe_set_ivar(adapter, i, que->msix, 1); + ixgbe_set_ivar(adapter, txr->me, que->msix, 1); /* Set an Initial EITR value */ IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(que->msix), newitr); @@ -3444,7 +3571,8 @@ ixgbe_configure_ivars(struct adapter *ad ** ixgbe_sfp_probe - called in the local timer to ** determine if a port had optics inserted. */ -static bool ixgbe_sfp_probe(struct adapter *adapter) +static bool +ixgbe_sfp_probe(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; device_t dev = adapter->dev; @@ -3504,6 +3632,7 @@ ixgbe_handle_mod(void *context, int pend "Unsupported SFP+ module type was detected.\n"); return; } + err = hw->mac.ops.setup_sfp(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, @@ -3626,9 +3755,7 @@ ixgbe_check_eee_support(struct adapter * { struct ixgbe_hw *hw = &adapter->hw; - adapter->eee_support = adapter->eee_enabled = - (hw->device_id == IXGBE_DEV_ID_X550T || - hw->device_id == IXGBE_DEV_ID_X550EM_X_KR); + adapter->eee_enabled = !!(hw->mac.ops.setup_eee); } /* @@ -4004,8 +4131,7 @@ ixgbe_add_device_sysctls(struct adapter ixgbe_sysctl_dmac, "I", "DMA Coalesce"); /* for X550T and X550EM backplane devices */ - if (hw->device_id == IXGBE_DEV_ID_X550T || - hw->device_id == IXGBE_DEV_ID_X550EM_X_KR) { + if (hw->mac.ops.setup_eee) { struct sysctl_oid *eee_node; struct sysctl_oid_list *eee_list; @@ -4625,6 +4751,7 @@ static int ixgbe_sysctl_eee_enable(SYSCTL_HANDLER_ARGS) { struct adapter *adapter = (struct adapter *) arg1; + struct ixgbe_hw *hw = &adapter->hw; struct ifnet *ifp = adapter->ifp; int new_eee_enabled, error = 0; @@ -4635,7 +4762,7 @@ ixgbe_sysctl_eee_enable(SYSCTL_HANDLER_A if (new_eee_enabled == adapter->eee_enabled) return (0); - if (new_eee_enabled > 0 && !adapter->eee_support) + if (new_eee_enabled > 0 && !hw->mac.ops.setup_eee) return (ENODEV); else adapter->eee_enabled = !!(new_eee_enabled); @@ -4751,10 +4878,19 @@ ixgbe_enable_rx_drop(struct adapter *ada struct ixgbe_hw *hw = &adapter->hw; for (int i = 0; i < adapter->num_queues; i++) { - u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i)); + struct rx_ring *rxr = &adapter->rx_rings[i]; + u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(rxr->me)); srrctl |= IXGBE_SRRCTL_DROP_EN; - IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(rxr->me), srrctl); + } +#ifdef PCI_IOV + /* enable drop for each vf */ + for (int i = 0; i < adapter->num_vfs; i++) { + IXGBE_WRITE_REG(hw, IXGBE_QDE, + (IXGBE_QDE_WRITE | (i << IXGBE_QDE_IDX_SHIFT) | + IXGBE_QDE_ENABLE)); } +#endif } static void @@ -4763,10 +4899,18 @@ ixgbe_disable_rx_drop(struct adapter *ad struct ixgbe_hw *hw = &adapter->hw; for (int i = 0; i < adapter->num_queues; i++) { - u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i)); + struct rx_ring *rxr = &adapter->rx_rings[i]; + u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(rxr->me)); srrctl &= ~IXGBE_SRRCTL_DROP_EN; - IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(rxr->me), srrctl); } +#ifdef PCI_IOV + /* disable drop for each vf */ + for (int i = 0; i < adapter->num_vfs; i++) { + IXGBE_WRITE_REG(hw, IXGBE_QDE, + (IXGBE_QDE_WRITE | (i << IXGBE_QDE_IDX_SHIFT))); + } +#endif } static void @@ -4793,4 +4937,722 @@ ixgbe_rearm_queues(struct adapter *adapt } } +#ifdef PCI_IOV + +/* +** Support functions for SRIOV/VF management +*/ + +static void +ixgbe_ping_all_vfs(struct adapter *adapter) +{ + struct ixgbe_vf *vf; + + for (int i = 0; i < adapter->num_vfs; i++) { + vf = &adapter->vfs[i]; + if (vf->flags & IXGBE_VF_ACTIVE) + ixgbe_send_vf_msg(adapter, vf, IXGBE_PF_CONTROL_MSG); + } +} + + +static void +ixgbe_vf_set_default_vlan(struct adapter *adapter, struct ixgbe_vf *vf, + uint16_t tag) +{ + struct ixgbe_hw *hw; + uint32_t vmolr, vmvir; + + hw = &adapter->hw; + + vf->vlan_tag = tag; + + vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf->pool)); + + /* Do not receive packets that pass inexact filters. */ + vmolr &= ~(IXGBE_VMOLR_ROMPE | IXGBE_VMOLR_ROPE); + + /* Disable Multicast Promicuous Mode. */ + vmolr &= ~IXGBE_VMOLR_MPE; + + /* Accept broadcasts. */ + vmolr |= IXGBE_VMOLR_BAM; + + if (tag == 0) { + /* Accept non-vlan tagged traffic. */ + //vmolr |= IXGBE_VMOLR_AUPE; + + /* Allow VM to tag outgoing traffic; no default tag. */ + vmvir = 0; + } else { + /* Require vlan-tagged traffic. */ + vmolr &= ~IXGBE_VMOLR_AUPE; + + /* Tag all traffic with provided vlan tag. */ + vmvir = (tag | IXGBE_VMVIR_VLANA_DEFAULT); + } + IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf->pool), vmolr); + IXGBE_WRITE_REG(hw, IXGBE_VMVIR(vf->pool), vmvir); +} + + +static boolean_t +ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf) +{ + + /* + * Frame size compatibility between PF and VF is only a problem on + * 82599-based cards. X540 and later support any combination of jumbo + * frames on PFs and VFs. + */ + if (adapter->hw.mac.type != ixgbe_mac_82599EB) + return (TRUE); + + switch (vf->api_ver) { + case IXGBE_API_VER_1_0: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 17:18:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB90070E; Mon, 1 Jun 2015 17:18:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 1 Jun 2015 17:18:05 +0000 From: Glen Barber To: Jack F Vogel Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283881 - in head: head head/sys head/sys/dev head/sys/dev/ixgbe head/sys/modules head/sys/modules/ixv sys/dev/ixgbe sys/modules/ixv Message-ID: <20150601171805.GF1534@hub.FreeBSD.org> References: <201506011715.t51HFPCZ094574@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NQTVMVnDVuULnIzU" Content-Disposition: inline In-Reply-To: <201506011715.t51HFPCZ094574@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer 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: Mon, 01 Jun 2015 17:18:09 -0000 --NQTVMVnDVuULnIzU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 01, 2015 at 05:15:25PM +0000, Jack F Vogel wrote: > Author: jfv > Date: Mon Jun 1 17:15:25 2015 > New Revision: 283881 > URL: https://svnweb.freebsd.org/changeset/base/283881 >=20 > Log: > Delta D2489 - Add SRIOV support to the Intel 10G driver. > =20 > NOTE: This is a technology preview, while it has undergone development > tests, Intel has not yet completed full validation of the feature. > It is being integrated for early access and customer testing. >=20 > Added: > head/head/ > head/head/sys/ > head/head/sys/dev/ > head/head/sys/dev/ixgbe/ > head/head/sys/modules/ > head/head/sys/modules/ixv/ This is wrong. Glen --NQTVMVnDVuULnIzU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVbJPNAAoJEAMUWKVHj+KTLr8P/2QbOHznonfsv5c2PfMC3a7H J37S2zBK81eRmjk1HHpXws83dYPbFW24BGBCTxuWHjWZ1mwSIlBdbl02VlpT3wdc R3YZM8esz+JGlJH66kNmR7NHNBNb1e0np9WrHcGx76zC5QLPu5DK08tAkU1sQKMb 0O87uREcnMsVdAK/aet1GHE2GI2yVsr5FlpOPvyiRRLBLH8qW7hDE20EU26tj+qI U6p4kwRjntSo2Zv2GB+llDsfO+5x+7v/DaNNrzKBHfW7FkbtRBJMyOzFFpO6gb2T CAMcwDFeTpST9tqbeXnN0Cub2QIdDbMCP2CdIRTbitgPKN7BcDIxFYEPCmqD2YHR 4KyRFrJAREGPX+49ZWCIMAD8yO52mjTAP+uGW041Cb/Eig9JogUNssrz1T94SsTt xEefhGyORw0oPrOLTWozOKeSlnC5rXZ6LIj/AUk8a1XGtOQS3GjqGOiK9FuAi/Gq hdm/92/BcY9bybbTpcMtPwY5cgf+DsRzIEtduPWNEmO5nQA+YbC/gb28OYvxUw8Z hI4cZ8P3LnnykUA1CNJOvseF9khCN8p3aBPwoJfZ1iGwoRWANmDWpcnx4NDM5hJ7 P2adxeILtDRojDUuIuvclYJA4MPVL2r9J6Wmazra+Ad37z1owIcO5gzHRjKbSBVH zsRKFQscHC476OLgBP8a =pYFP -----END PGP SIGNATURE----- --NQTVMVnDVuULnIzU-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 17:35:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E878C11; Mon, 1 Jun 2015 17:35:30 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5C7F4135D; Mon, 1 Jun 2015 17:35:30 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t51HZU4g006707; Mon, 1 Jun 2015 17:35:30 GMT (envelope-from jfv@FreeBSD.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51HZURp006704; Mon, 1 Jun 2015 17:35:30 GMT (envelope-from jfv@FreeBSD.org) Message-Id: <201506011735.t51HZURp006704@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jfv set sender to jfv@FreeBSD.org using -f From: Jack F Vogel Date: Mon, 1 Jun 2015 17:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283882 - in head: head sys/dev/ixgbe sys/modules/ixv 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, 01 Jun 2015 17:35:30 -0000 Author: jfv Date: Mon Jun 1 17:35:29 2015 New Revision: 283882 URL: https://svnweb.freebsd.org/changeset/base/283882 Log: Revert last commit, to remove added skeleton tree. Deleted: head/head/ Modified: head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ix_txrx.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixgbe_mbx.h head/sys/dev/ixgbe/ixgbe_vf.c head/sys/modules/ixv/Makefile Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Mon Jun 1 17:15:25 2015 (r283881) +++ head/sys/dev/ixgbe/if_ix.c Mon Jun 1 17:35:29 2015 (r283882) @@ -54,7 +54,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "3.1.0"; +char ixgbe_driver_version[] = "2.8.3"; /********************************************************************* * PCI Device ID Table @@ -138,7 +138,6 @@ static int ixgbe_setup_msix(struct adapt static void ixgbe_free_pci_resources(struct adapter *); static void ixgbe_local_timer(void *); static int ixgbe_setup_interface(device_t, struct adapter *); -static void ixgbe_config_gpie(struct adapter *); static void ixgbe_config_dmac(struct adapter *); static void ixgbe_config_delay_values(struct adapter *); static void ixgbe_config_link(struct adapter *); @@ -205,18 +204,6 @@ static void ixgbe_handle_phy(void *, int static void ixgbe_reinit_fdir(void *, int); #endif -#ifdef PCI_IOV -static void ixgbe_ping_all_vfs(struct adapter *); -static void ixgbe_handle_mbx(void *, int); -static int ixgbe_init_iov(device_t, u16, const nvlist_t *); -static void ixgbe_uninit_iov(device_t); -static int ixgbe_add_vf(device_t, u16, const nvlist_t *); -static void ixgbe_initialize_iov(struct adapter *); -static void ixgbe_recalculate_max_frame(struct adapter *); -static void ixgbe_init_vf(struct adapter *, struct ixgbe_vf *); -#endif /* PCI_IOV */ - - /********************************************************************* * FreeBSD Device Interface Entry Points *********************************************************************/ @@ -229,11 +216,6 @@ static device_method_t ix_methods[] = { DEVMETHOD(device_shutdown, ixgbe_shutdown), DEVMETHOD(device_suspend, ixgbe_suspend), DEVMETHOD(device_resume, ixgbe_resume), -#ifdef PCI_IOV - DEVMETHOD(pci_init_iov, ixgbe_init_iov), - DEVMETHOD(pci_uninit_iov, ixgbe_uninit_iov), - DEVMETHOD(pci_add_vf, ixgbe_add_vf), -#endif /* PCI_IOV */ DEVMETHOD_END }; @@ -359,8 +341,6 @@ static int fdir_pballoc = 1; #include #endif /* DEV_NETMAP */ -static MALLOC_DEFINE(M_IXGBE, "ix", "ix driver allocations"); - /********************************************************************* * Device identification routine * @@ -492,7 +472,7 @@ ixgbe_attach(device_t dev) } /* Allocate multicast array memory. */ - adapter->mta = malloc(sizeof(*adapter->mta) * + adapter->mta = malloc(sizeof(u8) * IXGBE_ETH_LENGTH_OF_ADDRESS * MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT); if (adapter->mta == NULL) { device_printf(dev, "Can not allocate multicast setup array\n"); @@ -578,28 +558,6 @@ ixgbe_attach(device_t dev) /* Set an initial default flow control value */ adapter->fc = ixgbe_fc_full; -#ifdef PCI_IOV - if ((hw->mac.type != ixgbe_mac_82598EB) && (adapter->msix > 1)) { - nvlist_t *pf_schema, *vf_schema; - - hw->mbx.ops.init_params(hw); - pf_schema = pci_iov_schema_alloc_node(); - vf_schema = pci_iov_schema_alloc_node(); - pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL); - pci_iov_schema_add_bool(vf_schema, "mac-anti-spoof", - IOV_SCHEMA_HASDEFAULT, TRUE); - pci_iov_schema_add_bool(vf_schema, "allow-set-mac", - IOV_SCHEMA_HASDEFAULT, FALSE); - pci_iov_schema_add_bool(vf_schema, "allow-promisc", - IOV_SCHEMA_HASDEFAULT, FALSE); - error = pci_iov_attach(dev, pf_schema, vf_schema); - if (error != 0) { - device_printf(dev, - "Error %d setting up SR-IOV\n", error); - } - } -#endif /* PCI_IOV */ - /* Check for certain supported features */ ixgbe_check_wol_support(adapter); ixgbe_check_eee_support(adapter); @@ -656,13 +614,6 @@ ixgbe_detach(device_t dev) return (EBUSY); } -#ifdef PCI_IOV - if (pci_iov_detach(dev) != 0) { - device_printf(dev, "SR-IOV in use; detach first.\n"); - return (EBUSY); - } -#endif /* PCI_IOV */ - /* Stop the adapter */ IXGBE_CORE_LOCK(adapter); ixgbe_setup_low_power_mode(adapter); @@ -683,9 +634,6 @@ ixgbe_detach(device_t dev) taskqueue_drain(adapter->tq, &adapter->link_task); taskqueue_drain(adapter->tq, &adapter->mod_task); taskqueue_drain(adapter->tq, &adapter->msf_task); -#ifdef PCI_IOV - taskqueue_drain(adapter->tq, &adapter->mbx_task); -#endif taskqueue_drain(adapter->tq, &adapter->phy_task); #ifdef IXGBE_FDIR taskqueue_drain(adapter->tq, &adapter->fdir_task); @@ -862,9 +810,6 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c adapter->max_frame_size = ifp->if_mtu + IXGBE_MTU_HDR; ixgbe_init_locked(adapter); -#ifdef PCI_IOV - ixgbe_recalculate_max_frame(adapter); -#endif IXGBE_CORE_UNLOCK(adapter); } break; @@ -980,36 +925,22 @@ ixgbe_init_locked(struct adapter *adapte struct ifnet *ifp = adapter->ifp; device_t dev = adapter->dev; struct ixgbe_hw *hw = &adapter->hw; - struct tx_ring *txr; - struct rx_ring *rxr; - u32 txdctl, mhadd; + u32 k, txdctl, mhadd, gpie; u32 rxdctl, rxctrl; -#ifdef PCI_IOV - enum ixgbe_iov_mode mode; -#endif mtx_assert(&adapter->core_mtx, MA_OWNED); INIT_DEBUGOUT("ixgbe_init_locked: begin"); - hw->adapter_stopped = FALSE; ixgbe_stop_adapter(hw); callout_stop(&adapter->timer); -#ifdef PCI_IOV - mode = ixgbe_get_iov_mode(adapter); - adapter->pool = ixgbe_max_vfs(mode); - /* Queue indices may change with IOV mode */ - for (int i = 0; i < adapter->num_queues; i++) { - adapter->rx_rings[i].me = ixgbe_pf_que_index(mode, i); - adapter->tx_rings[i].me = ixgbe_pf_que_index(mode, i); - } -#endif /* reprogram the RAR[0] in case user changed it. */ - ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, IXGBE_RAH_AV); + ixgbe_set_rar(hw, 0, adapter->hw.mac.addr, 0, IXGBE_RAH_AV); /* Get the latest mac address, User can use a LAA */ - bcopy(IF_LLADDR(ifp), hw->mac.addr, IXGBE_ETH_LENGTH_OF_ADDRESS); - ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, 1); + bcopy(IF_LLADDR(adapter->ifp), hw->mac.addr, + IXGBE_ETH_LENGTH_OF_ADDRESS); + ixgbe_set_rar(hw, 0, hw->mac.addr, 0, 1); hw->addr_ctrl.rar_used_count = 1; /* Set the various hardware offload abilities */ @@ -1032,9 +963,6 @@ ixgbe_init_locked(struct adapter *adapte } ixgbe_init_hw(hw); -#ifdef PCI_IOV - ixgbe_initialize_iov(adapter); -#endif ixgbe_initialize_transmit_units(adapter); /* Setup Multicast table */ @@ -1044,10 +972,14 @@ ixgbe_init_locked(struct adapter *adapte ** Determine the correct mbuf pool ** for doing jumbo frames */ - if (adapter->max_frame_size <= MCLBYTES) + if (adapter->max_frame_size <= 2048) adapter->rx_mbuf_sz = MCLBYTES; - else + else if (adapter->max_frame_size <= 4096) adapter->rx_mbuf_sz = MJUMPAGESIZE; + else if (adapter->max_frame_size <= 9216) + adapter->rx_mbuf_sz = MJUM9BYTES; + else + adapter->rx_mbuf_sz = MJUM16BYTES; /* Prepare receive descriptors and buffers */ if (ixgbe_setup_receive_structures(adapter)) { @@ -1059,8 +991,31 @@ ixgbe_init_locked(struct adapter *adapte /* Configure RX settings */ ixgbe_initialize_receive_units(adapter); - /* Enable SDP & MSIX interrupts based on adapter */ - ixgbe_config_gpie(adapter); + gpie = IXGBE_READ_REG(&adapter->hw, IXGBE_GPIE); + + /* Enable Fan Failure Interrupt */ + gpie |= IXGBE_SDP1_GPIEN_BY_MAC(hw); + + /* Add for Module detection */ + if (hw->mac.type == ixgbe_mac_82599EB) + gpie |= IXGBE_SDP2_GPIEN; + + /* + * Thermal Failure Detection (X540) + * Link Detection (X552) + */ + if (hw->mac.type == ixgbe_mac_X540 || + hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP || + hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) + gpie |= IXGBE_SDP0_GPIEN_X540; + + if (adapter->msix > 1) { + /* Enable Enhanced MSIX mode */ + gpie |= IXGBE_GPIE_MSIX_MODE; + gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT | + IXGBE_GPIE_OCD; + } + IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); /* Set MTU size */ if (ifp->if_mtu > ETHERMTU) { @@ -1073,8 +1028,7 @@ ixgbe_init_locked(struct adapter *adapte /* Now enable all the queues */ for (int i = 0; i < adapter->num_queues; i++) { - txr = &adapter->tx_rings[i]; - txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(txr->me)); + txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(i)); txdctl |= IXGBE_TXDCTL_ENABLE; /* Set WTHRESH to 8, burst writeback */ txdctl |= (8 << 16); @@ -1086,12 +1040,11 @@ ixgbe_init_locked(struct adapter *adapte * Prefetching enables tx line rate even with 1 queue. */ txdctl |= (32 << 0) | (1 << 8); - IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(txr->me), txdctl); + IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl); } - for (int i = 0, j = 0; i < adapter->num_queues; i++) { - rxr = &adapter->rx_rings[i]; - rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)); + for (int i = 0; i < adapter->num_queues; i++) { + rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); if (hw->mac.type == ixgbe_mac_82598EB) { /* ** PTHRESH = 21 @@ -1102,9 +1055,9 @@ ixgbe_init_locked(struct adapter *adapte rxdctl |= 0x080420; } rxdctl |= IXGBE_RXDCTL_ENABLE; - IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), rxdctl); - for (; j < 10; j++) { - if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)) & + IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), rxdctl); + for (k = 0; k < 10; k++) { + if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)) & IXGBE_RXDCTL_ENABLE) break; else @@ -1133,10 +1086,10 @@ ixgbe_init_locked(struct adapter *adapte struct netmap_kring *kring = &na->rx_rings[i]; int t = na->num_rx_desc - 1 - nm_kr_rxspace(kring); - IXGBE_WRITE_REG(hw, IXGBE_RDT(rxr->me), t); + IXGBE_WRITE_REG(hw, IXGBE_RDT(i), t); } else #endif /* DEV_NETMAP */ - IXGBE_WRITE_REG(hw, IXGBE_RDT(rxr->me), adapter->num_rx_desc - 1); + IXGBE_WRITE_REG(hw, IXGBE_RDT(i), adapter->num_rx_desc - 1); } /* Enable Receive engine */ @@ -1175,9 +1128,9 @@ ixgbe_init_locked(struct adapter *adapte #endif /* - * Check on any SFP devices that - * need to be kick-started - */ + ** Check on any SFP devices that + ** need to be kick-started + */ if (hw->phy.type == ixgbe_phy_none) { int err = hw->phy.ops.identify(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { @@ -1191,7 +1144,8 @@ ixgbe_init_locked(struct adapter *adapte IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR); /* Configure Energy Efficient Ethernet for supported devices */ - ixgbe_setup_eee(hw, adapter->eee_enabled); + if (adapter->eee_support) + ixgbe_setup_eee(hw, adapter->eee_enabled); /* Config/Enable Link */ ixgbe_config_link(adapter); @@ -1211,15 +1165,6 @@ ixgbe_init_locked(struct adapter *adapte /* And now turn on interrupts */ ixgbe_enable_intr(adapter); -#ifdef PCI_IOV - /* Enable the use of the MBX by the VF's */ - { - u32 reg = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); - reg |= IXGBE_CTRL_EXT_PFRSTD; - IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, reg); - } -#endif - /* Now inform the stack we're ready */ ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -1238,51 +1183,6 @@ ixgbe_init(void *arg) } static void -ixgbe_config_gpie(struct adapter *adapter) -{ - struct ixgbe_hw *hw = &adapter->hw; - u32 gpie; - - gpie = IXGBE_READ_REG(hw, IXGBE_GPIE); - - /* Fan Failure Interrupt */ - if (hw->device_id == IXGBE_DEV_ID_82598AT) - gpie |= IXGBE_SDP1_GPIEN; - - /* - * Module detection (SDP2) - * Media ready (SDP1) - */ - if (hw->mac.type == ixgbe_mac_82599EB) { - gpie |= IXGBE_SDP2_GPIEN; - if (hw->device_id != IXGBE_DEV_ID_82599_QSFP_SF_QP) - gpie |= IXGBE_SDP1_GPIEN; - } - - /* - * Thermal Failure Detection (X540) - * Link Detection (X557) - */ - if (hw->mac.type == ixgbe_mac_X540 || - hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP || - hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) - gpie |= IXGBE_SDP0_GPIEN_X540; - - if (adapter->msix > 1) { - /* Enable Enhanced MSIX mode */ - gpie |= IXGBE_GPIE_MSIX_MODE; - gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT | - IXGBE_GPIE_OCD; - } - - IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); - return; -} - -/* - * Requires adapter->max_frame_size to be set. - */ -static void ixgbe_config_delay_values(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; @@ -1376,9 +1276,10 @@ ixgbe_handle_que(void *context, int pend struct adapter *adapter = que->adapter; struct tx_ring *txr = que->txr; struct ifnet *ifp = adapter->ifp; + bool more; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - ixgbe_rxeof(que); + more = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); ixgbe_txeof(txr); #ifndef IXGBE_LEGACY_TX @@ -1440,8 +1341,8 @@ ixgbe_legacy_irq(void *arg) IXGBE_TX_UNLOCK(txr); /* Check for fan failure */ - if ((hw->device_id == IXGBE_DEV_ID_82598AT) && - (reg_eicr & IXGBE_EICR_GPI_SDP1)) { + if ((hw->phy.media_type == ixgbe_media_type_copper) && + (reg_eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw))) { device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! " "REPLACE IMMEDIATELY!!\n"); IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); @@ -1480,7 +1381,6 @@ ixgbe_msix_que(void *arg) bool more; u32 newitr = 0; - /* Protect against spurious interrupts */ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; @@ -1604,10 +1504,6 @@ ixgbe_msix_link(void *arg) device_printf(adapter->dev, "System shutdown required!\n"); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_TS); } -#ifdef PCI_IOV - if (reg_eicr & IXGBE_EICR_MAILBOX) - taskqueue_enqueue(adapter->tq, &adapter->mbx_task); -#endif } /* Pluggable optics-related interrupt */ @@ -1673,7 +1569,7 @@ ixgbe_media_status(struct ifnet * ifp, s } ifmr->ifm_status |= IFM_ACTIVE; - layer = adapter->phy_layer; + layer = ixgbe_get_supported_physical_layer(hw); if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T || layer & IXGBE_PHYSICAL_LAYER_1000BASE_T || @@ -1906,17 +1802,18 @@ ixgbe_set_promisc(struct adapter *adapte static void ixgbe_set_multi(struct adapter *adapter) { - u32 fctrl; - u8 *update_ptr; - struct ifmultiaddr *ifma; - struct ixgbe_mc_addr *mta; - int mcnt = 0; - struct ifnet *ifp = adapter->ifp; + u32 fctrl; + u8 *mta; + u8 *update_ptr; + struct ifmultiaddr *ifma; + int mcnt = 0; + struct ifnet *ifp = adapter->ifp; IOCTL_DEBUGOUT("ixgbe_set_multi: begin"); mta = adapter->mta; - bzero(mta, sizeof(*mta) * MAX_NUM_MULTICAST_ADDRESSES); + bzero(mta, sizeof(u8) * IXGBE_ETH_LENGTH_OF_ADDRESS * + MAX_NUM_MULTICAST_ADDRESSES); #if __FreeBSD_version < 800000 IF_ADDR_LOCK(ifp); @@ -1929,8 +1826,8 @@ ixgbe_set_multi(struct adapter *adapter) if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) break; bcopy(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), - mta[mcnt].addr, IXGBE_ETH_LENGTH_OF_ADDRESS); - mta[mcnt].vmdq = adapter->pool; + &mta[mcnt * IXGBE_ETH_LENGTH_OF_ADDRESS], + IXGBE_ETH_LENGTH_OF_ADDRESS); mcnt++; } #if __FreeBSD_version < 800000 @@ -1953,7 +1850,7 @@ ixgbe_set_multi(struct adapter *adapter) IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl); if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) { - update_ptr = (u8 *)mta; + update_ptr = mta; ixgbe_update_mc_addr_list(&adapter->hw, update_ptr, mcnt, ixgbe_mc_array_itr, TRUE); } @@ -1969,13 +1866,13 @@ ixgbe_set_multi(struct adapter *adapter) static u8 * ixgbe_mc_array_itr(struct ixgbe_hw *hw, u8 **update_ptr, u32 *vmdq) { - struct ixgbe_mc_addr *mta; - - mta = (struct ixgbe_mc_addr *)*update_ptr; - *vmdq = mta->vmdq; - - *update_ptr = (u8*)(mta + 1);; - return (mta->addr); + u8 *addr = *update_ptr; + u8 *newptr; + *vmdq = 0; + + newptr = addr + IXGBE_ETH_LENGTH_OF_ADDRESS; + *update_ptr = newptr; + return addr; } @@ -2057,7 +1954,6 @@ watchdog: ixgbe_init_locked(adapter); } - /* ** Note: this routine updates the OS on the link state ** the real check of the hardware only happens with @@ -2081,9 +1977,6 @@ ixgbe_update_link_status(struct adapter /* Update DMA coalescing config */ ixgbe_config_dmac(adapter); if_link_state_change(ifp, LINK_STATE_UP); -#ifdef PCI_IOV - ixgbe_ping_all_vfs(adapter); -#endif } } else { /* Link down */ if (adapter->link_active == TRUE) { @@ -2091,9 +1984,6 @@ ixgbe_update_link_status(struct adapter device_printf(dev,"Link is Down\n"); if_link_state_change(ifp, LINK_STATE_DOWN); adapter->link_active = FALSE; -#ifdef PCI_IOV - ixgbe_ping_all_vfs(adapter); -#endif } } @@ -2193,7 +2083,7 @@ ixgbe_setup_optics(struct adapter *adapt struct ixgbe_hw *hw = &adapter->hw; int layer; - layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); + layer = ixgbe_get_supported_physical_layer(hw); if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) { adapter->optics = IFM_10G_T; @@ -2391,19 +2281,17 @@ ixgbe_allocate_msix(struct adapter *adap #endif if (adapter->num_queues > 1) bus_bind_intr(dev, que->res, cpu_id); -#ifdef IXGBE_DEBUG + #ifdef RSS device_printf(dev, "Bound RSS bucket %d to CPU %d\n", i, cpu_id); #else - device_printf(dev, - "Bound queue %d to cpu %d\n", - i, cpu_id); + if (bootverbose) + device_printf(dev, + "Bound queue %d to cpu %d\n", + i, cpu_id); #endif -#endif /* IXGBE_DEBUG */ - - #ifndef IXGBE_LEGACY_TX TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); #endif @@ -2449,9 +2337,6 @@ ixgbe_allocate_msix(struct adapter *adap TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); TASK_INIT(&adapter->mod_task, 0, ixgbe_handle_mod, adapter); TASK_INIT(&adapter->msf_task, 0, ixgbe_handle_msf, adapter); -#ifdef PCI_IOV - TASK_INIT(&adapter->mbx_task, 0, ixgbe_handle_mbx, adapter); -#endif TASK_INIT(&adapter->phy_task, 0, ixgbe_handle_phy, adapter); #ifdef IXGBE_FDIR TASK_INIT(&adapter->fdir_task, 0, ixgbe_reinit_fdir, adapter); @@ -2745,7 +2630,7 @@ ixgbe_add_media_types(struct adapter *ad device_t dev = adapter->dev; int layer; - layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); + layer = ixgbe_get_supported_physical_layer(hw); /* Media types with matching FreeBSD media defines */ if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) @@ -2856,20 +2741,19 @@ ixgbe_initialize_transmit_units(struct a for (int i = 0; i < adapter->num_queues; i++, txr++) { u64 tdba = txr->txdma.dma_paddr; u32 txctrl = 0; - int j = txr->me; - IXGBE_WRITE_REG(hw, IXGBE_TDBAL(j), + IXGBE_WRITE_REG(hw, IXGBE_TDBAL(i), (tdba & 0x00000000ffffffffULL)); - IXGBE_WRITE_REG(hw, IXGBE_TDBAH(j), (tdba >> 32)); - IXGBE_WRITE_REG(hw, IXGBE_TDLEN(j), + IXGBE_WRITE_REG(hw, IXGBE_TDBAH(i), (tdba >> 32)); + IXGBE_WRITE_REG(hw, IXGBE_TDLEN(i), adapter->num_tx_desc * sizeof(union ixgbe_adv_tx_desc)); /* Setup the HW Tx Head and Tail descriptor pointers */ - IXGBE_WRITE_REG(hw, IXGBE_TDH(j), 0); - IXGBE_WRITE_REG(hw, IXGBE_TDT(j), 0); + IXGBE_WRITE_REG(hw, IXGBE_TDH(i), 0); + IXGBE_WRITE_REG(hw, IXGBE_TDT(i), 0); /* Cache the tail address */ - txr->tail = IXGBE_TDT(j); + txr->tail = IXGBE_TDT(txr->me); /* Set the processing limit */ txr->process_limit = ixgbe_tx_process_limit; @@ -2877,23 +2761,23 @@ ixgbe_initialize_transmit_units(struct a /* Disable Head Writeback */ switch (hw->mac.type) { case ixgbe_mac_82598EB: - txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(j)); + txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i)); break; case ixgbe_mac_82599EB: case ixgbe_mac_X540: default: - txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(j)); + txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i)); break; } txctrl &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN; switch (hw->mac.type) { case ixgbe_mac_82598EB: - IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(j), txctrl); + IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), txctrl); break; case ixgbe_mac_82599EB: case ixgbe_mac_X540: default: - IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(j), txctrl); + IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(i), txctrl); break; } @@ -2901,9 +2785,6 @@ ixgbe_initialize_transmit_units(struct a if (hw->mac.type != ixgbe_mac_82598EB) { u32 dmatxctl, rttdcs; -#ifdef PCI_IOV - enum ixgbe_iov_mode mode = ixgbe_get_iov_mode(adapter); -#endif dmatxctl = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); dmatxctl |= IXGBE_DMATXCTL_TE; IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, dmatxctl); @@ -2911,11 +2792,7 @@ ixgbe_initialize_transmit_units(struct a rttdcs = IXGBE_READ_REG(hw, IXGBE_RTTDCS); rttdcs |= IXGBE_RTTDCS_ARBDIS; IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); -#ifdef PCI_IOV - IXGBE_WRITE_REG(hw, IXGBE_MTQC, ixgbe_get_mtqc(mode)); -#else IXGBE_WRITE_REG(hw, IXGBE_MTQC, IXGBE_MTQC_64Q_1PB); -#endif rttdcs &= ~IXGBE_RTTDCS_ARBDIS; IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); } @@ -2927,15 +2804,18 @@ static void ixgbe_initialise_rss_mapping(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; - u32 reta = 0, mrqc, rss_key[10]; - int queue_id, table_size, index_mult; + uint32_t reta; + int i, j, queue_id, table_size; + int index_mult; + uint32_t rss_key[10]; + uint32_t mrqc; #ifdef RSS - u32 rss_hash_config; -#endif -#ifdef PCI_IOV - enum ixgbe_iov_mode mode; + uint32_t rss_hash_config; #endif + /* Setup RSS */ + reta = 0; + #ifdef RSS /* Fetch the configured RSS key */ rss_getkey((uint8_t *) &rss_key); @@ -2960,7 +2840,7 @@ ixgbe_initialise_rss_mapping(struct adap } /* Set up the redirection table */ - for (int i = 0, j = 0; i < table_size; i++, j++) { + for (i = 0, j = 0; i < table_size; i++, j++) { if (j == adapter->num_queues) j = 0; #ifdef RSS /* @@ -3027,16 +2907,19 @@ ixgbe_initialise_rss_mapping(struct adap mrqc = IXGBE_MRQC_RSSEN | IXGBE_MRQC_RSS_FIELD_IPV4 | IXGBE_MRQC_RSS_FIELD_IPV4_TCP +#if 0 + | IXGBE_MRQC_RSS_FIELD_IPV4_UDP +#endif | IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP | IXGBE_MRQC_RSS_FIELD_IPV6_EX | IXGBE_MRQC_RSS_FIELD_IPV6 | IXGBE_MRQC_RSS_FIELD_IPV6_TCP +#if 0 + | IXGBE_MRQC_RSS_FIELD_IPV6_UDP + | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP +#endif ; #endif /* RSS */ -#ifdef PCI_IOV - mode = ixgbe_get_iov_mode(adapter); - mrqc |= ixgbe_get_mrqc(mode); -#endif IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc); } @@ -3095,17 +2978,16 @@ ixgbe_initialize_receive_units(struct ad for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 rdba = rxr->rxdma.dma_paddr; - int j = rxr->me; /* Setup the Base and Length of the Rx Descriptor Ring */ - IXGBE_WRITE_REG(hw, IXGBE_RDBAL(j), + IXGBE_WRITE_REG(hw, IXGBE_RDBAL(i), (rdba & 0x00000000ffffffffULL)); - IXGBE_WRITE_REG(hw, IXGBE_RDBAH(j), (rdba >> 32)); - IXGBE_WRITE_REG(hw, IXGBE_RDLEN(j), + IXGBE_WRITE_REG(hw, IXGBE_RDBAH(i), (rdba >> 32)); + IXGBE_WRITE_REG(hw, IXGBE_RDLEN(i), adapter->num_rx_desc * sizeof(union ixgbe_adv_rx_desc)); /* Set up the SRRCTL register */ - srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(j)); + srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i)); srrctl &= ~IXGBE_SRRCTL_BSIZEHDR_MASK; srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK; srrctl |= bufsz; @@ -3117,16 +2999,18 @@ ixgbe_initialize_receive_units(struct ad * so we do not need to clear the bit, but do it just in case * this code is moved elsewhere. */ - if (adapter->num_queues > 1 && adapter->fc == ixgbe_fc_none) + if (adapter->num_queues > 1 && + adapter->hw.fc.requested_mode == ixgbe_fc_none) { srrctl |= IXGBE_SRRCTL_DROP_EN; - else + } else { srrctl &= ~IXGBE_SRRCTL_DROP_EN; + } - IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(j), srrctl); + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); /* Setup the HW Rx Head and Tail Descriptor Pointers */ - IXGBE_WRITE_REG(hw, IXGBE_RDH(j), 0); - IXGBE_WRITE_REG(hw, IXGBE_RDT(j), 0); + IXGBE_WRITE_REG(hw, IXGBE_RDH(i), 0); + IXGBE_WRITE_REG(hw, IXGBE_RDT(i), 0); /* Set the processing limit */ rxr->process_limit = ixgbe_rx_process_limit; @@ -3242,9 +3126,9 @@ ixgbe_setup_vlan_hw_support(struct adapt rxr = &adapter->rx_rings[i]; /* On 82599 the VLAN enable is per/queue in RXDCTL */ if (hw->mac.type != ixgbe_mac_82598EB) { - ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)); + ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); ctrl |= IXGBE_RXDCTL_VME; - IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), ctrl); + IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl); } rxr->vtag_strip = TRUE; } @@ -3294,9 +3178,6 @@ ixgbe_enable_intr(struct adapter *adapte #ifdef IXGBE_FDIR mask |= IXGBE_EIMS_FLOW_DIR; #endif -#ifdef PCI_IOV - mask |= IXGBE_EIMS_MAILBOX; -#endif break; case ixgbe_mac_X540: /* Detect if Thermal Sensor is enabled */ @@ -3320,9 +3201,6 @@ ixgbe_enable_intr(struct adapter *adapte #ifdef IXGBE_FDIR mask |= IXGBE_EIMS_FLOW_DIR; #endif -#ifdef PCI_IOV - mask |= IXGBE_EIMS_MAILBOX; -#endif /* falls through */ default: break; @@ -3336,9 +3214,6 @@ ixgbe_enable_intr(struct adapter *adapte /* Don't autoclear Link */ mask &= ~IXGBE_EIMS_OTHER; mask &= ~IXGBE_EIMS_LSC; -#ifdef PCI_IOV - mask &= ~IXGBE_EIMS_MAILBOX; -#endif IXGBE_WRITE_REG(hw, IXGBE_EIAC, mask); } @@ -3537,8 +3412,8 @@ ixgbe_set_ivar(struct adapter *adapter, static void ixgbe_configure_ivars(struct adapter *adapter) { - struct ix_queue *que = adapter->queues; - u32 newitr; + struct ix_queue *que = adapter->queues; + u32 newitr; if (ixgbe_max_interrupt_rate > 0) newitr = (4000000 / ixgbe_max_interrupt_rate) & 0x0FF8; @@ -3552,12 +3427,10 @@ ixgbe_configure_ivars(struct adapter *ad } for (int i = 0; i < adapter->num_queues; i++, que++) { - struct rx_ring *rxr = &adapter->rx_rings[i]; - struct tx_ring *txr = &adapter->tx_rings[i]; /* First the RX queue entry */ - ixgbe_set_ivar(adapter, rxr->me, que->msix, 0); + ixgbe_set_ivar(adapter, i, que->msix, 0); /* ... and the TX */ - ixgbe_set_ivar(adapter, txr->me, que->msix, 1); + ixgbe_set_ivar(adapter, i, que->msix, 1); /* Set an Initial EITR value */ IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(que->msix), newitr); @@ -3571,8 +3444,7 @@ ixgbe_configure_ivars(struct adapter *ad ** ixgbe_sfp_probe - called in the local timer to ** determine if a port had optics inserted. */ -static bool -ixgbe_sfp_probe(struct adapter *adapter) +static bool ixgbe_sfp_probe(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; device_t dev = adapter->dev; @@ -3632,7 +3504,6 @@ ixgbe_handle_mod(void *context, int pend "Unsupported SFP+ module type was detected.\n"); return; } - err = hw->mac.ops.setup_sfp(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, @@ -3755,7 +3626,9 @@ ixgbe_check_eee_support(struct adapter * { struct ixgbe_hw *hw = &adapter->hw; - adapter->eee_enabled = !!(hw->mac.ops.setup_eee); + adapter->eee_support = adapter->eee_enabled = + (hw->device_id == IXGBE_DEV_ID_X550T || + hw->device_id == IXGBE_DEV_ID_X550EM_X_KR); } /* @@ -4131,7 +4004,8 @@ ixgbe_add_device_sysctls(struct adapter ixgbe_sysctl_dmac, "I", "DMA Coalesce"); /* for X550T and X550EM backplane devices */ - if (hw->mac.ops.setup_eee) { + if (hw->device_id == IXGBE_DEV_ID_X550T || + hw->device_id == IXGBE_DEV_ID_X550EM_X_KR) { struct sysctl_oid *eee_node; struct sysctl_oid_list *eee_list; @@ -4751,7 +4625,6 @@ static int ixgbe_sysctl_eee_enable(SYSCTL_HANDLER_ARGS) { struct adapter *adapter = (struct adapter *) arg1; - struct ixgbe_hw *hw = &adapter->hw; struct ifnet *ifp = adapter->ifp; int new_eee_enabled, error = 0; @@ -4762,7 +4635,7 @@ ixgbe_sysctl_eee_enable(SYSCTL_HANDLER_A if (new_eee_enabled == adapter->eee_enabled) return (0); - if (new_eee_enabled > 0 && !hw->mac.ops.setup_eee) + if (new_eee_enabled > 0 && !adapter->eee_support) return (ENODEV); else adapter->eee_enabled = !!(new_eee_enabled); @@ -4878,19 +4751,10 @@ ixgbe_enable_rx_drop(struct adapter *ada struct ixgbe_hw *hw = &adapter->hw; for (int i = 0; i < adapter->num_queues; i++) { - struct rx_ring *rxr = &adapter->rx_rings[i]; - u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(rxr->me)); + u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i)); srrctl |= IXGBE_SRRCTL_DROP_EN; - IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(rxr->me), srrctl); - } -#ifdef PCI_IOV - /* enable drop for each vf */ - for (int i = 0; i < adapter->num_vfs; i++) { - IXGBE_WRITE_REG(hw, IXGBE_QDE, - (IXGBE_QDE_WRITE | (i << IXGBE_QDE_IDX_SHIFT) | - IXGBE_QDE_ENABLE)); + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); } -#endif } static void @@ -4899,18 +4763,10 @@ ixgbe_disable_rx_drop(struct adapter *ad struct ixgbe_hw *hw = &adapter->hw; for (int i = 0; i < adapter->num_queues; i++) { - struct rx_ring *rxr = &adapter->rx_rings[i]; - u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(rxr->me)); + u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i)); srrctl &= ~IXGBE_SRRCTL_DROP_EN; - IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(rxr->me), srrctl); + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); } -#ifdef PCI_IOV - /* disable drop for each vf */ - for (int i = 0; i < adapter->num_vfs; i++) { - IXGBE_WRITE_REG(hw, IXGBE_QDE, - (IXGBE_QDE_WRITE | (i << IXGBE_QDE_IDX_SHIFT))); - } -#endif } static void @@ -4937,722 +4793,4 @@ ixgbe_rearm_queues(struct adapter *adapt } } -#ifdef PCI_IOV - -/* -** Support functions for SRIOV/VF management -*/ - -static void -ixgbe_ping_all_vfs(struct adapter *adapter) -{ - struct ixgbe_vf *vf; - - for (int i = 0; i < adapter->num_vfs; i++) { - vf = &adapter->vfs[i]; - if (vf->flags & IXGBE_VF_ACTIVE) - ixgbe_send_vf_msg(adapter, vf, IXGBE_PF_CONTROL_MSG); - } -} - - -static void -ixgbe_vf_set_default_vlan(struct adapter *adapter, struct ixgbe_vf *vf, - uint16_t tag) -{ - struct ixgbe_hw *hw; - uint32_t vmolr, vmvir; - - hw = &adapter->hw; - - vf->vlan_tag = tag; - - vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf->pool)); - - /* Do not receive packets that pass inexact filters. */ - vmolr &= ~(IXGBE_VMOLR_ROMPE | IXGBE_VMOLR_ROPE); - - /* Disable Multicast Promicuous Mode. */ - vmolr &= ~IXGBE_VMOLR_MPE; - - /* Accept broadcasts. */ - vmolr |= IXGBE_VMOLR_BAM; - - if (tag == 0) { - /* Accept non-vlan tagged traffic. */ - //vmolr |= IXGBE_VMOLR_AUPE; - - /* Allow VM to tag outgoing traffic; no default tag. */ - vmvir = 0; - } else { - /* Require vlan-tagged traffic. */ - vmolr &= ~IXGBE_VMOLR_AUPE; - - /* Tag all traffic with provided vlan tag. */ - vmvir = (tag | IXGBE_VMVIR_VLANA_DEFAULT); - } - IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf->pool), vmolr); - IXGBE_WRITE_REG(hw, IXGBE_VMVIR(vf->pool), vmvir); -} - - -static boolean_t -ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf) -{ - - /* - * Frame size compatibility between PF and VF is only a problem on - * 82599-based cards. X540 and later support any combination of jumbo - * frames on PFs and VFs. - */ - if (adapter->hw.mac.type != ixgbe_mac_82599EB) - return (TRUE); - - switch (vf->api_ver) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 17:43:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A50BF5F; Mon, 1 Jun 2015 17:43:35 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8828F161E; Mon, 1 Jun 2015 17:43:35 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t51HhZjn011381; Mon, 1 Jun 2015 17:43:35 GMT (envelope-from jfv@FreeBSD.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51HhZUP011379; Mon, 1 Jun 2015 17:43:35 GMT (envelope-from jfv@FreeBSD.org) Message-Id: <201506011743.t51HhZUP011379@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jfv set sender to jfv@FreeBSD.org using -f From: Jack F Vogel Date: Mon, 1 Jun 2015 17:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283883 - in head/sys: dev/ixgbe modules/ixv 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, 01 Jun 2015 17:43:35 -0000 Author: jfv Date: Mon Jun 1 17:43:34 2015 New Revision: 283883 URL: https://svnweb.freebsd.org/changeset/base/283883 Log: Delta D2489 - Add SRIOV support to the Intel 10G driver. NOTE: This is a technology preview, while it has undergone development testing, Intel has not yet completed full validation of the feature. It is being integrated for early access and customer testing. Modified: head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ix_txrx.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixgbe_mbx.h head/sys/dev/ixgbe/ixgbe_vf.c head/sys/modules/ixv/Makefile Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Mon Jun 1 17:35:29 2015 (r283882) +++ head/sys/dev/ixgbe/if_ix.c Mon Jun 1 17:43:34 2015 (r283883) @@ -54,7 +54,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.8.3"; +char ixgbe_driver_version[] = "3.1.0"; /********************************************************************* * PCI Device ID Table @@ -138,6 +138,7 @@ static int ixgbe_setup_msix(struct adapt static void ixgbe_free_pci_resources(struct adapter *); static void ixgbe_local_timer(void *); static int ixgbe_setup_interface(device_t, struct adapter *); +static void ixgbe_config_gpie(struct adapter *); static void ixgbe_config_dmac(struct adapter *); static void ixgbe_config_delay_values(struct adapter *); static void ixgbe_config_link(struct adapter *); @@ -204,6 +205,18 @@ static void ixgbe_handle_phy(void *, int static void ixgbe_reinit_fdir(void *, int); #endif +#ifdef PCI_IOV +static void ixgbe_ping_all_vfs(struct adapter *); +static void ixgbe_handle_mbx(void *, int); +static int ixgbe_init_iov(device_t, u16, const nvlist_t *); +static void ixgbe_uninit_iov(device_t); +static int ixgbe_add_vf(device_t, u16, const nvlist_t *); +static void ixgbe_initialize_iov(struct adapter *); +static void ixgbe_recalculate_max_frame(struct adapter *); +static void ixgbe_init_vf(struct adapter *, struct ixgbe_vf *); +#endif /* PCI_IOV */ + + /********************************************************************* * FreeBSD Device Interface Entry Points *********************************************************************/ @@ -216,6 +229,11 @@ static device_method_t ix_methods[] = { DEVMETHOD(device_shutdown, ixgbe_shutdown), DEVMETHOD(device_suspend, ixgbe_suspend), DEVMETHOD(device_resume, ixgbe_resume), +#ifdef PCI_IOV + DEVMETHOD(pci_init_iov, ixgbe_init_iov), + DEVMETHOD(pci_uninit_iov, ixgbe_uninit_iov), + DEVMETHOD(pci_add_vf, ixgbe_add_vf), +#endif /* PCI_IOV */ DEVMETHOD_END }; @@ -341,6 +359,8 @@ static int fdir_pballoc = 1; #include #endif /* DEV_NETMAP */ +static MALLOC_DEFINE(M_IXGBE, "ix", "ix driver allocations"); + /********************************************************************* * Device identification routine * @@ -472,7 +492,7 @@ ixgbe_attach(device_t dev) } /* Allocate multicast array memory. */ - adapter->mta = malloc(sizeof(u8) * IXGBE_ETH_LENGTH_OF_ADDRESS * + adapter->mta = malloc(sizeof(*adapter->mta) * MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT); if (adapter->mta == NULL) { device_printf(dev, "Can not allocate multicast setup array\n"); @@ -558,6 +578,28 @@ ixgbe_attach(device_t dev) /* Set an initial default flow control value */ adapter->fc = ixgbe_fc_full; +#ifdef PCI_IOV + if ((hw->mac.type != ixgbe_mac_82598EB) && (adapter->msix > 1)) { + nvlist_t *pf_schema, *vf_schema; + + hw->mbx.ops.init_params(hw); + pf_schema = pci_iov_schema_alloc_node(); + vf_schema = pci_iov_schema_alloc_node(); + pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL); + pci_iov_schema_add_bool(vf_schema, "mac-anti-spoof", + IOV_SCHEMA_HASDEFAULT, TRUE); + pci_iov_schema_add_bool(vf_schema, "allow-set-mac", + IOV_SCHEMA_HASDEFAULT, FALSE); + pci_iov_schema_add_bool(vf_schema, "allow-promisc", + IOV_SCHEMA_HASDEFAULT, FALSE); + error = pci_iov_attach(dev, pf_schema, vf_schema); + if (error != 0) { + device_printf(dev, + "Error %d setting up SR-IOV\n", error); + } + } +#endif /* PCI_IOV */ + /* Check for certain supported features */ ixgbe_check_wol_support(adapter); ixgbe_check_eee_support(adapter); @@ -614,6 +656,13 @@ ixgbe_detach(device_t dev) return (EBUSY); } +#ifdef PCI_IOV + if (pci_iov_detach(dev) != 0) { + device_printf(dev, "SR-IOV in use; detach first.\n"); + return (EBUSY); + } +#endif /* PCI_IOV */ + /* Stop the adapter */ IXGBE_CORE_LOCK(adapter); ixgbe_setup_low_power_mode(adapter); @@ -634,6 +683,9 @@ ixgbe_detach(device_t dev) taskqueue_drain(adapter->tq, &adapter->link_task); taskqueue_drain(adapter->tq, &adapter->mod_task); taskqueue_drain(adapter->tq, &adapter->msf_task); +#ifdef PCI_IOV + taskqueue_drain(adapter->tq, &adapter->mbx_task); +#endif taskqueue_drain(adapter->tq, &adapter->phy_task); #ifdef IXGBE_FDIR taskqueue_drain(adapter->tq, &adapter->fdir_task); @@ -810,6 +862,9 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c adapter->max_frame_size = ifp->if_mtu + IXGBE_MTU_HDR; ixgbe_init_locked(adapter); +#ifdef PCI_IOV + ixgbe_recalculate_max_frame(adapter); +#endif IXGBE_CORE_UNLOCK(adapter); } break; @@ -925,22 +980,36 @@ ixgbe_init_locked(struct adapter *adapte struct ifnet *ifp = adapter->ifp; device_t dev = adapter->dev; struct ixgbe_hw *hw = &adapter->hw; - u32 k, txdctl, mhadd, gpie; + struct tx_ring *txr; + struct rx_ring *rxr; + u32 txdctl, mhadd; u32 rxdctl, rxctrl; +#ifdef PCI_IOV + enum ixgbe_iov_mode mode; +#endif mtx_assert(&adapter->core_mtx, MA_OWNED); INIT_DEBUGOUT("ixgbe_init_locked: begin"); + hw->adapter_stopped = FALSE; ixgbe_stop_adapter(hw); callout_stop(&adapter->timer); +#ifdef PCI_IOV + mode = ixgbe_get_iov_mode(adapter); + adapter->pool = ixgbe_max_vfs(mode); + /* Queue indices may change with IOV mode */ + for (int i = 0; i < adapter->num_queues; i++) { + adapter->rx_rings[i].me = ixgbe_pf_que_index(mode, i); + adapter->tx_rings[i].me = ixgbe_pf_que_index(mode, i); + } +#endif /* reprogram the RAR[0] in case user changed it. */ - ixgbe_set_rar(hw, 0, adapter->hw.mac.addr, 0, IXGBE_RAH_AV); + ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, IXGBE_RAH_AV); /* Get the latest mac address, User can use a LAA */ - bcopy(IF_LLADDR(adapter->ifp), hw->mac.addr, - IXGBE_ETH_LENGTH_OF_ADDRESS); - ixgbe_set_rar(hw, 0, hw->mac.addr, 0, 1); + bcopy(IF_LLADDR(ifp), hw->mac.addr, IXGBE_ETH_LENGTH_OF_ADDRESS); + ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, 1); hw->addr_ctrl.rar_used_count = 1; /* Set the various hardware offload abilities */ @@ -963,6 +1032,9 @@ ixgbe_init_locked(struct adapter *adapte } ixgbe_init_hw(hw); +#ifdef PCI_IOV + ixgbe_initialize_iov(adapter); +#endif ixgbe_initialize_transmit_units(adapter); /* Setup Multicast table */ @@ -972,14 +1044,10 @@ ixgbe_init_locked(struct adapter *adapte ** Determine the correct mbuf pool ** for doing jumbo frames */ - if (adapter->max_frame_size <= 2048) + if (adapter->max_frame_size <= MCLBYTES) adapter->rx_mbuf_sz = MCLBYTES; - else if (adapter->max_frame_size <= 4096) - adapter->rx_mbuf_sz = MJUMPAGESIZE; - else if (adapter->max_frame_size <= 9216) - adapter->rx_mbuf_sz = MJUM9BYTES; else - adapter->rx_mbuf_sz = MJUM16BYTES; + adapter->rx_mbuf_sz = MJUMPAGESIZE; /* Prepare receive descriptors and buffers */ if (ixgbe_setup_receive_structures(adapter)) { @@ -991,31 +1059,8 @@ ixgbe_init_locked(struct adapter *adapte /* Configure RX settings */ ixgbe_initialize_receive_units(adapter); - gpie = IXGBE_READ_REG(&adapter->hw, IXGBE_GPIE); - - /* Enable Fan Failure Interrupt */ - gpie |= IXGBE_SDP1_GPIEN_BY_MAC(hw); - - /* Add for Module detection */ - if (hw->mac.type == ixgbe_mac_82599EB) - gpie |= IXGBE_SDP2_GPIEN; - - /* - * Thermal Failure Detection (X540) - * Link Detection (X552) - */ - if (hw->mac.type == ixgbe_mac_X540 || - hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP || - hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) - gpie |= IXGBE_SDP0_GPIEN_X540; - - if (adapter->msix > 1) { - /* Enable Enhanced MSIX mode */ - gpie |= IXGBE_GPIE_MSIX_MODE; - gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT | - IXGBE_GPIE_OCD; - } - IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); + /* Enable SDP & MSIX interrupts based on adapter */ + ixgbe_config_gpie(adapter); /* Set MTU size */ if (ifp->if_mtu > ETHERMTU) { @@ -1028,7 +1073,8 @@ ixgbe_init_locked(struct adapter *adapte /* Now enable all the queues */ for (int i = 0; i < adapter->num_queues; i++) { - txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(i)); + txr = &adapter->tx_rings[i]; + txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(txr->me)); txdctl |= IXGBE_TXDCTL_ENABLE; /* Set WTHRESH to 8, burst writeback */ txdctl |= (8 << 16); @@ -1040,11 +1086,12 @@ ixgbe_init_locked(struct adapter *adapte * Prefetching enables tx line rate even with 1 queue. */ txdctl |= (32 << 0) | (1 << 8); - IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl); + IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(txr->me), txdctl); } - for (int i = 0; i < adapter->num_queues; i++) { - rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); + for (int i = 0, j = 0; i < adapter->num_queues; i++) { + rxr = &adapter->rx_rings[i]; + rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)); if (hw->mac.type == ixgbe_mac_82598EB) { /* ** PTHRESH = 21 @@ -1055,9 +1102,9 @@ ixgbe_init_locked(struct adapter *adapte rxdctl |= 0x080420; } rxdctl |= IXGBE_RXDCTL_ENABLE; - IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), rxdctl); - for (k = 0; k < 10; k++) { - if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)) & + IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), rxdctl); + for (; j < 10; j++) { + if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)) & IXGBE_RXDCTL_ENABLE) break; else @@ -1086,10 +1133,10 @@ ixgbe_init_locked(struct adapter *adapte struct netmap_kring *kring = &na->rx_rings[i]; int t = na->num_rx_desc - 1 - nm_kr_rxspace(kring); - IXGBE_WRITE_REG(hw, IXGBE_RDT(i), t); + IXGBE_WRITE_REG(hw, IXGBE_RDT(rxr->me), t); } else #endif /* DEV_NETMAP */ - IXGBE_WRITE_REG(hw, IXGBE_RDT(i), adapter->num_rx_desc - 1); + IXGBE_WRITE_REG(hw, IXGBE_RDT(rxr->me), adapter->num_rx_desc - 1); } /* Enable Receive engine */ @@ -1128,9 +1175,9 @@ ixgbe_init_locked(struct adapter *adapte #endif /* - ** Check on any SFP devices that - ** need to be kick-started - */ + * Check on any SFP devices that + * need to be kick-started + */ if (hw->phy.type == ixgbe_phy_none) { int err = hw->phy.ops.identify(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { @@ -1144,8 +1191,7 @@ ixgbe_init_locked(struct adapter *adapte IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR); /* Configure Energy Efficient Ethernet for supported devices */ - if (adapter->eee_support) - ixgbe_setup_eee(hw, adapter->eee_enabled); + ixgbe_setup_eee(hw, adapter->eee_enabled); /* Config/Enable Link */ ixgbe_config_link(adapter); @@ -1165,6 +1211,15 @@ ixgbe_init_locked(struct adapter *adapte /* And now turn on interrupts */ ixgbe_enable_intr(adapter); +#ifdef PCI_IOV + /* Enable the use of the MBX by the VF's */ + { + u32 reg = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); + reg |= IXGBE_CTRL_EXT_PFRSTD; + IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, reg); + } +#endif + /* Now inform the stack we're ready */ ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -1183,6 +1238,51 @@ ixgbe_init(void *arg) } static void +ixgbe_config_gpie(struct adapter *adapter) +{ + struct ixgbe_hw *hw = &adapter->hw; + u32 gpie; + + gpie = IXGBE_READ_REG(hw, IXGBE_GPIE); + + /* Fan Failure Interrupt */ + if (hw->device_id == IXGBE_DEV_ID_82598AT) + gpie |= IXGBE_SDP1_GPIEN; + + /* + * Module detection (SDP2) + * Media ready (SDP1) + */ + if (hw->mac.type == ixgbe_mac_82599EB) { + gpie |= IXGBE_SDP2_GPIEN; + if (hw->device_id != IXGBE_DEV_ID_82599_QSFP_SF_QP) + gpie |= IXGBE_SDP1_GPIEN; + } + + /* + * Thermal Failure Detection (X540) + * Link Detection (X557) + */ + if (hw->mac.type == ixgbe_mac_X540 || + hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP || + hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) + gpie |= IXGBE_SDP0_GPIEN_X540; + + if (adapter->msix > 1) { + /* Enable Enhanced MSIX mode */ + gpie |= IXGBE_GPIE_MSIX_MODE; + gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT | + IXGBE_GPIE_OCD; + } + + IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); + return; +} + +/* + * Requires adapter->max_frame_size to be set. + */ +static void ixgbe_config_delay_values(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; @@ -1276,10 +1376,9 @@ ixgbe_handle_que(void *context, int pend struct adapter *adapter = que->adapter; struct tx_ring *txr = que->txr; struct ifnet *ifp = adapter->ifp; - bool more; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - more = ixgbe_rxeof(que); + ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); ixgbe_txeof(txr); #ifndef IXGBE_LEGACY_TX @@ -1341,8 +1440,8 @@ ixgbe_legacy_irq(void *arg) IXGBE_TX_UNLOCK(txr); /* Check for fan failure */ - if ((hw->phy.media_type == ixgbe_media_type_copper) && - (reg_eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw))) { + if ((hw->device_id == IXGBE_DEV_ID_82598AT) && + (reg_eicr & IXGBE_EICR_GPI_SDP1)) { device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! " "REPLACE IMMEDIATELY!!\n"); IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); @@ -1381,6 +1480,7 @@ ixgbe_msix_que(void *arg) bool more; u32 newitr = 0; + /* Protect against spurious interrupts */ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; @@ -1504,6 +1604,10 @@ ixgbe_msix_link(void *arg) device_printf(adapter->dev, "System shutdown required!\n"); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_TS); } +#ifdef PCI_IOV + if (reg_eicr & IXGBE_EICR_MAILBOX) + taskqueue_enqueue(adapter->tq, &adapter->mbx_task); +#endif } /* Pluggable optics-related interrupt */ @@ -1569,7 +1673,7 @@ ixgbe_media_status(struct ifnet * ifp, s } ifmr->ifm_status |= IFM_ACTIVE; - layer = ixgbe_get_supported_physical_layer(hw); + layer = adapter->phy_layer; if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T || layer & IXGBE_PHYSICAL_LAYER_1000BASE_T || @@ -1802,18 +1906,17 @@ ixgbe_set_promisc(struct adapter *adapte static void ixgbe_set_multi(struct adapter *adapter) { - u32 fctrl; - u8 *mta; - u8 *update_ptr; - struct ifmultiaddr *ifma; - int mcnt = 0; - struct ifnet *ifp = adapter->ifp; + u32 fctrl; + u8 *update_ptr; + struct ifmultiaddr *ifma; + struct ixgbe_mc_addr *mta; + int mcnt = 0; + struct ifnet *ifp = adapter->ifp; IOCTL_DEBUGOUT("ixgbe_set_multi: begin"); mta = adapter->mta; - bzero(mta, sizeof(u8) * IXGBE_ETH_LENGTH_OF_ADDRESS * - MAX_NUM_MULTICAST_ADDRESSES); + bzero(mta, sizeof(*mta) * MAX_NUM_MULTICAST_ADDRESSES); #if __FreeBSD_version < 800000 IF_ADDR_LOCK(ifp); @@ -1826,8 +1929,8 @@ ixgbe_set_multi(struct adapter *adapter) if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) break; bcopy(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), - &mta[mcnt * IXGBE_ETH_LENGTH_OF_ADDRESS], - IXGBE_ETH_LENGTH_OF_ADDRESS); + mta[mcnt].addr, IXGBE_ETH_LENGTH_OF_ADDRESS); + mta[mcnt].vmdq = adapter->pool; mcnt++; } #if __FreeBSD_version < 800000 @@ -1850,7 +1953,7 @@ ixgbe_set_multi(struct adapter *adapter) IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl); if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) { - update_ptr = mta; + update_ptr = (u8 *)mta; ixgbe_update_mc_addr_list(&adapter->hw, update_ptr, mcnt, ixgbe_mc_array_itr, TRUE); } @@ -1866,13 +1969,13 @@ ixgbe_set_multi(struct adapter *adapter) static u8 * ixgbe_mc_array_itr(struct ixgbe_hw *hw, u8 **update_ptr, u32 *vmdq) { - u8 *addr = *update_ptr; - u8 *newptr; - *vmdq = 0; - - newptr = addr + IXGBE_ETH_LENGTH_OF_ADDRESS; - *update_ptr = newptr; - return addr; + struct ixgbe_mc_addr *mta; + + mta = (struct ixgbe_mc_addr *)*update_ptr; + *vmdq = mta->vmdq; + + *update_ptr = (u8*)(mta + 1);; + return (mta->addr); } @@ -1954,6 +2057,7 @@ watchdog: ixgbe_init_locked(adapter); } + /* ** Note: this routine updates the OS on the link state ** the real check of the hardware only happens with @@ -1977,6 +2081,9 @@ ixgbe_update_link_status(struct adapter /* Update DMA coalescing config */ ixgbe_config_dmac(adapter); if_link_state_change(ifp, LINK_STATE_UP); +#ifdef PCI_IOV + ixgbe_ping_all_vfs(adapter); +#endif } } else { /* Link down */ if (adapter->link_active == TRUE) { @@ -1984,6 +2091,9 @@ ixgbe_update_link_status(struct adapter device_printf(dev,"Link is Down\n"); if_link_state_change(ifp, LINK_STATE_DOWN); adapter->link_active = FALSE; +#ifdef PCI_IOV + ixgbe_ping_all_vfs(adapter); +#endif } } @@ -2083,7 +2193,7 @@ ixgbe_setup_optics(struct adapter *adapt struct ixgbe_hw *hw = &adapter->hw; int layer; - layer = ixgbe_get_supported_physical_layer(hw); + layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) { adapter->optics = IFM_10G_T; @@ -2281,17 +2391,19 @@ ixgbe_allocate_msix(struct adapter *adap #endif if (adapter->num_queues > 1) bus_bind_intr(dev, que->res, cpu_id); - +#ifdef IXGBE_DEBUG #ifdef RSS device_printf(dev, "Bound RSS bucket %d to CPU %d\n", i, cpu_id); #else - if (bootverbose) - device_printf(dev, - "Bound queue %d to cpu %d\n", - i, cpu_id); + device_printf(dev, + "Bound queue %d to cpu %d\n", + i, cpu_id); #endif +#endif /* IXGBE_DEBUG */ + + #ifndef IXGBE_LEGACY_TX TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); #endif @@ -2337,6 +2449,9 @@ ixgbe_allocate_msix(struct adapter *adap TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); TASK_INIT(&adapter->mod_task, 0, ixgbe_handle_mod, adapter); TASK_INIT(&adapter->msf_task, 0, ixgbe_handle_msf, adapter); +#ifdef PCI_IOV + TASK_INIT(&adapter->mbx_task, 0, ixgbe_handle_mbx, adapter); +#endif TASK_INIT(&adapter->phy_task, 0, ixgbe_handle_phy, adapter); #ifdef IXGBE_FDIR TASK_INIT(&adapter->fdir_task, 0, ixgbe_reinit_fdir, adapter); @@ -2630,7 +2745,7 @@ ixgbe_add_media_types(struct adapter *ad device_t dev = adapter->dev; int layer; - layer = ixgbe_get_supported_physical_layer(hw); + layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); /* Media types with matching FreeBSD media defines */ if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) @@ -2741,19 +2856,20 @@ ixgbe_initialize_transmit_units(struct a for (int i = 0; i < adapter->num_queues; i++, txr++) { u64 tdba = txr->txdma.dma_paddr; u32 txctrl = 0; + int j = txr->me; - IXGBE_WRITE_REG(hw, IXGBE_TDBAL(i), + IXGBE_WRITE_REG(hw, IXGBE_TDBAL(j), (tdba & 0x00000000ffffffffULL)); - IXGBE_WRITE_REG(hw, IXGBE_TDBAH(i), (tdba >> 32)); - IXGBE_WRITE_REG(hw, IXGBE_TDLEN(i), + IXGBE_WRITE_REG(hw, IXGBE_TDBAH(j), (tdba >> 32)); + IXGBE_WRITE_REG(hw, IXGBE_TDLEN(j), adapter->num_tx_desc * sizeof(union ixgbe_adv_tx_desc)); /* Setup the HW Tx Head and Tail descriptor pointers */ - IXGBE_WRITE_REG(hw, IXGBE_TDH(i), 0); - IXGBE_WRITE_REG(hw, IXGBE_TDT(i), 0); + IXGBE_WRITE_REG(hw, IXGBE_TDH(j), 0); + IXGBE_WRITE_REG(hw, IXGBE_TDT(j), 0); /* Cache the tail address */ - txr->tail = IXGBE_TDT(txr->me); + txr->tail = IXGBE_TDT(j); /* Set the processing limit */ txr->process_limit = ixgbe_tx_process_limit; @@ -2761,23 +2877,23 @@ ixgbe_initialize_transmit_units(struct a /* Disable Head Writeback */ switch (hw->mac.type) { case ixgbe_mac_82598EB: - txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i)); + txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(j)); break; case ixgbe_mac_82599EB: case ixgbe_mac_X540: default: - txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i)); + txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(j)); break; } txctrl &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN; switch (hw->mac.type) { case ixgbe_mac_82598EB: - IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), txctrl); + IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(j), txctrl); break; case ixgbe_mac_82599EB: case ixgbe_mac_X540: default: - IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(i), txctrl); + IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(j), txctrl); break; } @@ -2785,6 +2901,9 @@ ixgbe_initialize_transmit_units(struct a if (hw->mac.type != ixgbe_mac_82598EB) { u32 dmatxctl, rttdcs; +#ifdef PCI_IOV + enum ixgbe_iov_mode mode = ixgbe_get_iov_mode(adapter); +#endif dmatxctl = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); dmatxctl |= IXGBE_DMATXCTL_TE; IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, dmatxctl); @@ -2792,7 +2911,11 @@ ixgbe_initialize_transmit_units(struct a rttdcs = IXGBE_READ_REG(hw, IXGBE_RTTDCS); rttdcs |= IXGBE_RTTDCS_ARBDIS; IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); +#ifdef PCI_IOV + IXGBE_WRITE_REG(hw, IXGBE_MTQC, ixgbe_get_mtqc(mode)); +#else IXGBE_WRITE_REG(hw, IXGBE_MTQC, IXGBE_MTQC_64Q_1PB); +#endif rttdcs &= ~IXGBE_RTTDCS_ARBDIS; IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); } @@ -2804,17 +2927,14 @@ static void ixgbe_initialise_rss_mapping(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; - uint32_t reta; - int i, j, queue_id, table_size; - int index_mult; - uint32_t rss_key[10]; - uint32_t mrqc; + u32 reta = 0, mrqc, rss_key[10]; + int queue_id, table_size, index_mult; #ifdef RSS - uint32_t rss_hash_config; + u32 rss_hash_config; +#endif +#ifdef PCI_IOV + enum ixgbe_iov_mode mode; #endif - - /* Setup RSS */ - reta = 0; #ifdef RSS /* Fetch the configured RSS key */ @@ -2840,7 +2960,7 @@ ixgbe_initialise_rss_mapping(struct adap } /* Set up the redirection table */ - for (i = 0, j = 0; i < table_size; i++, j++) { + for (int i = 0, j = 0; i < table_size; i++, j++) { if (j == adapter->num_queues) j = 0; #ifdef RSS /* @@ -2907,19 +3027,16 @@ ixgbe_initialise_rss_mapping(struct adap mrqc = IXGBE_MRQC_RSSEN | IXGBE_MRQC_RSS_FIELD_IPV4 | IXGBE_MRQC_RSS_FIELD_IPV4_TCP -#if 0 - | IXGBE_MRQC_RSS_FIELD_IPV4_UDP -#endif | IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP | IXGBE_MRQC_RSS_FIELD_IPV6_EX | IXGBE_MRQC_RSS_FIELD_IPV6 | IXGBE_MRQC_RSS_FIELD_IPV6_TCP -#if 0 - | IXGBE_MRQC_RSS_FIELD_IPV6_UDP - | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP -#endif ; #endif /* RSS */ +#ifdef PCI_IOV + mode = ixgbe_get_iov_mode(adapter); + mrqc |= ixgbe_get_mrqc(mode); +#endif IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc); } @@ -2978,16 +3095,17 @@ ixgbe_initialize_receive_units(struct ad for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 rdba = rxr->rxdma.dma_paddr; + int j = rxr->me; /* Setup the Base and Length of the Rx Descriptor Ring */ - IXGBE_WRITE_REG(hw, IXGBE_RDBAL(i), + IXGBE_WRITE_REG(hw, IXGBE_RDBAL(j), (rdba & 0x00000000ffffffffULL)); - IXGBE_WRITE_REG(hw, IXGBE_RDBAH(i), (rdba >> 32)); - IXGBE_WRITE_REG(hw, IXGBE_RDLEN(i), + IXGBE_WRITE_REG(hw, IXGBE_RDBAH(j), (rdba >> 32)); + IXGBE_WRITE_REG(hw, IXGBE_RDLEN(j), adapter->num_rx_desc * sizeof(union ixgbe_adv_rx_desc)); /* Set up the SRRCTL register */ - srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i)); + srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(j)); srrctl &= ~IXGBE_SRRCTL_BSIZEHDR_MASK; srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK; srrctl |= bufsz; @@ -3006,11 +3124,11 @@ ixgbe_initialize_receive_units(struct ad srrctl &= ~IXGBE_SRRCTL_DROP_EN; } - IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(j), srrctl); /* Setup the HW Rx Head and Tail Descriptor Pointers */ - IXGBE_WRITE_REG(hw, IXGBE_RDH(i), 0); - IXGBE_WRITE_REG(hw, IXGBE_RDT(i), 0); + IXGBE_WRITE_REG(hw, IXGBE_RDH(j), 0); + IXGBE_WRITE_REG(hw, IXGBE_RDT(j), 0); /* Set the processing limit */ rxr->process_limit = ixgbe_rx_process_limit; @@ -3126,9 +3244,9 @@ ixgbe_setup_vlan_hw_support(struct adapt rxr = &adapter->rx_rings[i]; /* On 82599 the VLAN enable is per/queue in RXDCTL */ if (hw->mac.type != ixgbe_mac_82598EB) { - ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); + ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)); ctrl |= IXGBE_RXDCTL_VME; - IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl); + IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), ctrl); } rxr->vtag_strip = TRUE; } @@ -3178,6 +3296,9 @@ ixgbe_enable_intr(struct adapter *adapte #ifdef IXGBE_FDIR mask |= IXGBE_EIMS_FLOW_DIR; #endif +#ifdef PCI_IOV + mask |= IXGBE_EIMS_MAILBOX; +#endif break; case ixgbe_mac_X540: /* Detect if Thermal Sensor is enabled */ @@ -3201,6 +3322,9 @@ ixgbe_enable_intr(struct adapter *adapte #ifdef IXGBE_FDIR mask |= IXGBE_EIMS_FLOW_DIR; #endif +#ifdef PCI_IOV + mask |= IXGBE_EIMS_MAILBOX; +#endif /* falls through */ default: break; @@ -3214,6 +3338,9 @@ ixgbe_enable_intr(struct adapter *adapte /* Don't autoclear Link */ mask &= ~IXGBE_EIMS_OTHER; mask &= ~IXGBE_EIMS_LSC; +#ifdef PCI_IOV + mask &= ~IXGBE_EIMS_MAILBOX; +#endif IXGBE_WRITE_REG(hw, IXGBE_EIAC, mask); } @@ -3412,8 +3539,8 @@ ixgbe_set_ivar(struct adapter *adapter, static void ixgbe_configure_ivars(struct adapter *adapter) { - struct ix_queue *que = adapter->queues; - u32 newitr; + struct ix_queue *que = adapter->queues; + u32 newitr; if (ixgbe_max_interrupt_rate > 0) newitr = (4000000 / ixgbe_max_interrupt_rate) & 0x0FF8; @@ -3427,10 +3554,12 @@ ixgbe_configure_ivars(struct adapter *ad } for (int i = 0; i < adapter->num_queues; i++, que++) { + struct rx_ring *rxr = &adapter->rx_rings[i]; + struct tx_ring *txr = &adapter->tx_rings[i]; /* First the RX queue entry */ - ixgbe_set_ivar(adapter, i, que->msix, 0); + ixgbe_set_ivar(adapter, rxr->me, que->msix, 0); /* ... and the TX */ - ixgbe_set_ivar(adapter, i, que->msix, 1); + ixgbe_set_ivar(adapter, txr->me, que->msix, 1); /* Set an Initial EITR value */ IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(que->msix), newitr); @@ -3444,7 +3573,8 @@ ixgbe_configure_ivars(struct adapter *ad ** ixgbe_sfp_probe - called in the local timer to ** determine if a port had optics inserted. */ -static bool ixgbe_sfp_probe(struct adapter *adapter) +static bool +ixgbe_sfp_probe(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; device_t dev = adapter->dev; @@ -3504,6 +3634,7 @@ ixgbe_handle_mod(void *context, int pend "Unsupported SFP+ module type was detected.\n"); return; } + err = hw->mac.ops.setup_sfp(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, @@ -3626,9 +3757,7 @@ ixgbe_check_eee_support(struct adapter * { struct ixgbe_hw *hw = &adapter->hw; - adapter->eee_support = adapter->eee_enabled = - (hw->device_id == IXGBE_DEV_ID_X550T || - hw->device_id == IXGBE_DEV_ID_X550EM_X_KR); + adapter->eee_enabled = !!(hw->mac.ops.setup_eee); } /* @@ -4004,8 +4133,7 @@ ixgbe_add_device_sysctls(struct adapter ixgbe_sysctl_dmac, "I", "DMA Coalesce"); /* for X550T and X550EM backplane devices */ - if (hw->device_id == IXGBE_DEV_ID_X550T || - hw->device_id == IXGBE_DEV_ID_X550EM_X_KR) { + if (hw->mac.ops.setup_eee) { struct sysctl_oid *eee_node; struct sysctl_oid_list *eee_list; @@ -4625,6 +4753,7 @@ static int ixgbe_sysctl_eee_enable(SYSCTL_HANDLER_ARGS) { struct adapter *adapter = (struct adapter *) arg1; + struct ixgbe_hw *hw = &adapter->hw; struct ifnet *ifp = adapter->ifp; int new_eee_enabled, error = 0; @@ -4635,7 +4764,7 @@ ixgbe_sysctl_eee_enable(SYSCTL_HANDLER_A if (new_eee_enabled == adapter->eee_enabled) return (0); - if (new_eee_enabled > 0 && !adapter->eee_support) + if (new_eee_enabled > 0 && !hw->mac.ops.setup_eee) return (ENODEV); else adapter->eee_enabled = !!(new_eee_enabled); @@ -4751,10 +4880,19 @@ ixgbe_enable_rx_drop(struct adapter *ada struct ixgbe_hw *hw = &adapter->hw; for (int i = 0; i < adapter->num_queues; i++) { - u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i)); + struct rx_ring *rxr = &adapter->rx_rings[i]; + u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(rxr->me)); srrctl |= IXGBE_SRRCTL_DROP_EN; - IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(rxr->me), srrctl); + } +#ifdef PCI_IOV + /* enable drop for each vf */ + for (int i = 0; i < adapter->num_vfs; i++) { + IXGBE_WRITE_REG(hw, IXGBE_QDE, + (IXGBE_QDE_WRITE | (i << IXGBE_QDE_IDX_SHIFT) | + IXGBE_QDE_ENABLE)); } +#endif } static void @@ -4763,10 +4901,18 @@ ixgbe_disable_rx_drop(struct adapter *ad struct ixgbe_hw *hw = &adapter->hw; for (int i = 0; i < adapter->num_queues; i++) { - u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i)); + struct rx_ring *rxr = &adapter->rx_rings[i]; + u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(rxr->me)); srrctl &= ~IXGBE_SRRCTL_DROP_EN; - IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(rxr->me), srrctl); + } +#ifdef PCI_IOV + /* disable drop for each vf */ + for (int i = 0; i < adapter->num_vfs; i++) { + IXGBE_WRITE_REG(hw, IXGBE_QDE, + (IXGBE_QDE_WRITE | (i << IXGBE_QDE_IDX_SHIFT))); } +#endif } static void @@ -4793,4 +4939,722 @@ ixgbe_rearm_queues(struct adapter *adapt } } +#ifdef PCI_IOV + +/* +** Support functions for SRIOV/VF management +*/ + +static void +ixgbe_ping_all_vfs(struct adapter *adapter) +{ + struct ixgbe_vf *vf; + + for (int i = 0; i < adapter->num_vfs; i++) { + vf = &adapter->vfs[i]; + if (vf->flags & IXGBE_VF_ACTIVE) + ixgbe_send_vf_msg(adapter, vf, IXGBE_PF_CONTROL_MSG); + } +} + + +static void +ixgbe_vf_set_default_vlan(struct adapter *adapter, struct ixgbe_vf *vf, + uint16_t tag) +{ + struct ixgbe_hw *hw; + uint32_t vmolr, vmvir; + + hw = &adapter->hw; + + vf->vlan_tag = tag; + + vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf->pool)); + + /* Do not receive packets that pass inexact filters. */ + vmolr &= ~(IXGBE_VMOLR_ROMPE | IXGBE_VMOLR_ROPE); + + /* Disable Multicast Promicuous Mode. */ + vmolr &= ~IXGBE_VMOLR_MPE; + + /* Accept broadcasts. */ + vmolr |= IXGBE_VMOLR_BAM; + + if (tag == 0) { + /* Accept non-vlan tagged traffic. */ + //vmolr |= IXGBE_VMOLR_AUPE; + + /* Allow VM to tag outgoing traffic; no default tag. */ + vmvir = 0; + } else { + /* Require vlan-tagged traffic. */ + vmolr &= ~IXGBE_VMOLR_AUPE; + + /* Tag all traffic with provided vlan tag. */ + vmvir = (tag | IXGBE_VMVIR_VLANA_DEFAULT); + } + IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf->pool), vmolr); + IXGBE_WRITE_REG(hw, IXGBE_VMVIR(vf->pool), vmvir); +} + + +static boolean_t +ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf) +{ + + /* + * Frame size compatibility between PF and VF is only a problem on + * 82599-based cards. X540 and later support any combination of jumbo + * frames on PFs and VFs. + */ + if (adapter->hw.mac.type != ixgbe_mac_82599EB) + return (TRUE); + + switch (vf->api_ver) { + case IXGBE_API_VER_1_0: + case IXGBE_API_VER_UNKNOWN: + /* + * On legacy (1.0 and older) VF versions, we don't support jumbo + * frames on either the PF or the VF. + */ + if (adapter->max_frame_size > ETHER_MAX_LEN || + vf->max_frame_size > ETHER_MAX_LEN) + return (FALSE); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:05:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1F22830; Mon, 1 Jun 2015 18:05:06 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c: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 55EEC1AEC; Mon, 1 Jun 2015 18:05:06 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wizo1 with SMTP id o1so115230673wiz.1; Mon, 01 Jun 2015 11:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=2rMCil1UyGo/Y4gBwgRqYcJinf4iH8qxZWO7sC8BlQM=; b=bBFE9s8JMmPVkb1/rqhfq4Xo0AI3RRkXBNxD4LfYech65V8LfWsNwDcOMe66S5eNES WIucB60viWI84USuEmNwLZWKbEr5gubUTnIkSVYwIixCuOv3/dmDSpjkTla+0M/1PNIr aoMBOkSHkzvsgd5Yrqo6yIMJsImhbq2NYcLHaqhIaQRjD8ef/kSztmiWX3T+0GKao1nJ T5+G7Dcw4VcL9AJOSZW0jlyrNcazhl0JUTcczuITyeSf0w4f3bZx9WIYM9+lQMQcFkKL l7hGO6xkGJQSLux4f5JiBqXkVwAl6gcD4iOh3MBB6Ns+nfMmpuB64jL0fTkxlI/KfQfI Z+4A== X-Received: by 10.194.110.100 with SMTP id hz4mr43885585wjb.6.1433181904870; Mon, 01 Jun 2015 11:05:04 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id ch2sm17751242wib.18.2015.06.01.11.05.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 11:05:03 -0700 (PDT) Sender: Baptiste Daroussin Date: Mon, 1 Jun 2015 20:05:01 +0200 From: Baptiste Daroussin To: Bruce Evans Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r283842 - head/usr.sbin/pw Message-ID: <20150601180501.GA7523@ivaldir.etoilebsd.net> References: <201505312207.t4VM73Vh015383@svn.freebsd.org> <20150601143951.J863@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <20150601143951.J863@besplex.bde.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: Mon, 01 Jun 2015 18:05:06 -0000 --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 01, 2015 at 03:36:58PM +1000, Bruce Evans wrote: > On Sun, 31 May 2015, Baptiste Daroussin wrote: >=20 > > Log: > > Remove useless cast in printf and printf-like functions: > > use %u for uid_t and gid_t >=20 > The cast was not useless. It was to avoid the assumption that the default > promotion of uid_t and gid_t is anything in particular. Now it is assumed > that the default promotion is unsigned (int works too, but this is subtle= r). >=20 > uids and gids are only guaranteed to have non-negative values. In > POSIX before about 2001, uid_t and gid_t can be any type that can > represent all the values taken on, so can be floating point. Floating > point was rarely used for POSIX types, and most programs make too many > assumptions about types, so POSIX now requires uid_t and gid_t to be > integer types. Then can still be signed integer types IIRC. Nornally > it is a bug to print signed integer types with unsigned integer formats, > but since uids and gids are guaranteed to be non-negative both formats > work. (pids require different handling since they are overloaded to > hold process group ids as negative values, so pid_t is signed and %u > format is very broken for printing general pids.) Well uid_t is defined as an unsigned int (__uint32_t actually) if it is ever going to be changed to something else they at least it will now raise a war= ning. I consider using %u here is less buggy than the previous casts. >=20 > The program assumed that uids and gids are not too large to be represented > by unsigned long. This was the only way to print them in C90 and before. > C99 broke this by breaking the promise that unsigned long is the largest > unsigned integer type. This broke all code that does careful casts to > unsigned long. However, unsigned long is usually large enough in practic= e. > Careful code now has to cast to uintmax_t, but that is usually excessive > (but doesn't actually work for __uint128_t). Even plain unsigned usually > works on vaxes. >=20 > > Modified: > > head/usr.sbin/pw/pw_conf.c > > head/usr.sbin/pw/pw_group.c > > head/usr.sbin/pw/pw_user.c > > > > Modified: head/usr.sbin/pw/pw_conf.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/usr.sbin/pw/pw_conf.c Sun May 31 21:44:09 2015 (r283841) > > +++ head/usr.sbin/pw/pw_conf.c Sun May 31 22:07:03 2015 (r283842) > > @@ -453,19 +453,19 @@ write_userconfig(char const * file) > > config.default_class : ""); > > break; > > case _UC_MINUID: > > - sbuf_printf(buf, "%lu", (unsigned long) config.min_uid); > > + sbuf_printf(buf, "%u", config.min_uid); >=20 > This works accidentally even on some non-vaxes. All supported arches in > FreeBSD have 32-bit unsigned's, and POSIX was broken in about 2007 to > disallow 16-bit unsigned's. uid_t is uint32_t in FreeBSD. However, it > is planned to change ino_t and some other types to 64 bits. I forget if > the plans include uid_t. Even 64-bit ino_t is too large for me. >=20 > The version with the cast to unsigned long is not really better. Suppose > uid_t is expanded to 16 bits. Then without the cast, the size mismatch > is detected. With it, everything still works if unsigned long is 64 bits, > but if unsigned long is 32 bits then the cast just breaks detection of > the mismatch and gives wrong results for values that actually need 64 bit= s. >=20 > > Modified: head/usr.sbin/pw/pw_group.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/usr.sbin/pw/pw_group.c Sun May 31 21:44:09 2015 (r283841) > > +++ head/usr.sbin/pw/pw_group.c Sun May 31 22:07:03 2015 (r283842) > > @@ -83,7 +83,7 @@ pw_group(struct userconf * cnf, int mode > > gid_t next =3D gr_gidpolicy(cnf, args); > > if (getarg(args, 'q')) > > return next; > > - printf("%ld\n", (long)next); > > + printf("%u\n", next); > > return EXIT_SUCCESS; > > } > > >=20 > This also has sign changes. gids are supposed to be non-negative, so > using signed long was probably a bug. >=20 > However, the program is elsewhere clueless about types, and I think you > did't change the parts where it uses atol() to misparse input. atol() > can't even handle 32-bit uids on 32-bit arches. It truncates large > positive ones to LONG_MAX. It returns negative values (truncated to > LONG_MIN if necessary). The misparsing then doesn't detect the error > of negative ids, but blindly casts to uid_t or gid_t, of course using > lexical style bugs in the casts. The magic ids -1 and -2 are sometimes > needed (perhaps not as input in pw, but -1 is used as an error value > and this value can be input). These values don't really exist as ids. > They must be cast before use. The actual values just cannot be entered, > since atol() misparses them (it truncates large values, and also doesn't > support hex, so (uid_t)-2 must be written as a long decimal number to > input it for misparsing. I do plan to work on those atol as well, but I try to be very careful with pw(8). So I make small modifications one by one. >=20 > > @@ -137,7 +137,7 @@ pw_group(struct userconf * cnf, int mode > > else if (rc !=3D 0) { > > err(EX_IOERR, "group update"); > > } > > - pw_log(cnf, mode, W_GROUP, "%s(%ld) removed", a_name->val, (long) g= id); > > + pw_log(cnf, mode, W_GROUP, "%s(%u) removed", a_name->val, gid); > > return EXIT_SUCCESS; > > } else if (mode =3D=3D M_PRINT) > > return print_group(grp, getarg(args, 'P') !=3D NULL); >=20 > If the error gid (gid_t)-1 is ever printed, now %u format prints it as a > cryptic decimal number where %ld format printed it as -1. well actually this code was actually used, and I checked the output before = and after the change and it printed the same output 4294967295. Best regards, Bapt --tKW2IUtsqtDRztdT Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlVsns0ACgkQ8kTtMUmk6ExM/wCgnqGE+gb3+K6o8x8qWsIpuibc JmIAnR31xOghBTsEQ83xNzIECu2OI7rA =ZPS8 -----END PGP SIGNATURE----- --tKW2IUtsqtDRztdT-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:13:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A1F0F6D; Mon, 1 Jun 2015 18:13:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 58A651D8F; Mon, 1 Jun 2015 18:13:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t51IDXHX026960; Mon, 1 Jun 2015 18:13:33 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51IDXAO026959; Mon, 1 Jun 2015 18:13:33 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201506011813.t51IDXAO026959@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 1 Jun 2015 18:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283887 - 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: Mon, 01 Jun 2015 18:13:33 -0000 Author: andrew Date: Mon Jun 1 18:13:32 2015 New Revision: 283887 URL: https://svnweb.freebsd.org/changeset/base/283887 Log: Clear the C bit of the saved program state register when also clearing the return value. We use this bit to signal when a syscall has failed, and without this getcontext/setcontext may fail. MFC after: 1 week Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Mon Jun 1 18:08:56 2015 (r283886) +++ head/sys/arm/arm/machdep.c Mon Jun 1 18:13:32 2015 (r283887) @@ -741,10 +741,13 @@ get_mcontext(struct thread *td, mcontext struct trapframe *tf = td->td_frame; __greg_t *gr = mcp->__gregs; - if (clear_ret & GET_MC_CLEAR_RET) + if (clear_ret & GET_MC_CLEAR_RET) { gr[_REG_R0] = 0; - else + gr[_REG_CPSR] = tf->tf_spsr & ~PSR_C; + } else { gr[_REG_R0] = tf->tf_r0; + gr[_REG_CPSR] = tf->tf_spsr; + } gr[_REG_R1] = tf->tf_r1; gr[_REG_R2] = tf->tf_r2; gr[_REG_R3] = tf->tf_r3; @@ -760,7 +763,6 @@ get_mcontext(struct thread *td, mcontext gr[_REG_SP] = tf->tf_usr_sp; gr[_REG_LR] = tf->tf_usr_lr; gr[_REG_PC] = tf->tf_pc; - gr[_REG_CPSR] = tf->tf_spsr; return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:15:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC60D25F; Mon, 1 Jun 2015 18:15:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BB9FF1DB5; Mon, 1 Jun 2015 18:15:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t51IFkbh027541; Mon, 1 Jun 2015 18:15:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51IFkPv027540; Mon, 1 Jun 2015 18:15:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201506011815.t51IFkPv027540@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 1 Jun 2015 18:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283889 - 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, 01 Jun 2015 18:15:46 -0000 Author: delphij Date: Mon Jun 1 18:15:45 2015 New Revision: 283889 URL: https://svnweb.freebsd.org/changeset/base/283889 Log: Clear p_stops when doing PT_DETACH. Without this, if a process was being traced by truss(1), which uses different p_stops bits than gdb(1), the latter would misbehave because of the unexpected bits. Reported by: jceel Submitted by: sef Sponsored by: iXsystems, Inc. MFC after: 2 weeks Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Mon Jun 1 18:15:44 2015 (r283888) +++ head/sys/kern/sys_process.c Mon Jun 1 18:15:45 2015 (r283889) @@ -963,6 +963,7 @@ kern_ptrace(struct thread *td, int req, CTR1(KTR_PTRACE, "PT_DETACH: pid %d", p->p_pid); p->p_oppid = 0; p->p_flag &= ~(P_TRACED | P_WAITED | P_FOLLOWFORK); + p->p_stops = 0; /* should we send SIGCHLD? */ /* childproc_continued(p); */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:15:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0A6325E; Mon, 1 Jun 2015 18:15:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 85B851DB3; Mon, 1 Jun 2015 18:15:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t51IFjaT027500; Mon, 1 Jun 2015 18:15:45 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51IFiF1027492; Mon, 1 Jun 2015 18:15:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201506011815.t51IFiF1027492@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 1 Jun 2015 18:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283888 - 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: Mon, 01 Jun 2015 18:15:45 -0000 Author: andrew Date: Mon Jun 1 18:15:44 2015 New Revision: 283888 URL: https://svnweb.freebsd.org/changeset/base/283888 Log: Remove __ARM_EABI__ from sys/arm/arm, building for oabi is unsupported. Modified: head/sys/arm/arm/elf_trampoline.c head/sys/arm/arm/exception.S head/sys/arm/arm/stack_machdep.c Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Mon Jun 1 18:13:32 2015 (r283887) +++ head/sys/arm/arm/elf_trampoline.c Mon Jun 1 18:15:44 2015 (r283888) @@ -725,7 +725,6 @@ __start(void) (unsigned int)(&load_kernel) + 800, sp); } -#ifdef __ARM_EABI__ /* We need to provide these functions but never call them */ void __aeabi_unwind_cpp_pr0(void); void __aeabi_unwind_cpp_pr1(void); @@ -737,5 +736,3 @@ void __aeabi_unwind_cpp_pr0(void) { } -#endif - Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Mon Jun 1 18:13:32 2015 (r283887) +++ head/sys/arm/arm/exception.S Mon Jun 1 18:15:44 2015 (r283888) @@ -237,7 +237,6 @@ _C_LABEL(dtrace_invop_calltrap_addr): ldmia sp, {sp, lr, pc}^ /* Restore lr and exit */ #endif -#if defined(__ARM_EABI__) /* * Unwind hints so we can unwind past functions that use * PULLFRAMEFROMSVCANDEXIT. They are run in reverse order. @@ -249,9 +248,6 @@ _C_LABEL(dtrace_invop_calltrap_addr): .pad #(2*4); /* Skip user sp and lr */ \ .save {r0-r12}; /* Restore r0-r12 */ \ .pad #(4) /* Skip spsr */ -#else -#define UNWINDSVCFRAME -#endif #define DO_AST \ ldr r0, [sp]; /* Get the SPSR from stack */ \ Modified: head/sys/arm/arm/stack_machdep.c ============================================================================== --- head/sys/arm/arm/stack_machdep.c Mon Jun 1 18:13:32 2015 (r283887) +++ head/sys/arm/arm/stack_machdep.c Mon Jun 1 18:15:44 2015 (r283888) @@ -49,16 +49,6 @@ extern vm_offset_t kernel_vm_end; static void stack_capture(struct stack *st, u_int32_t *frame) { -#if !defined(__ARM_EABI__) && !defined(__clang__) - vm_offset_t callpc; - - while (INKERNEL(frame) && (vm_offset_t)frame < kernel_vm_end) { - callpc = frame[FR_SCP]; - if (stack_put(st, callpc) == -1) - break; - frame = (u_int32_t *)(frame[FR_RFP]); - } -#endif } void From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:26:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61CEE808; Mon, 1 Jun 2015 18:26:22 +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 3D7521016; Mon, 1 Jun 2015 18:26:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 52D2AB97E; Mon, 1 Jun 2015 14:26:21 -0400 (EDT) From: John Baldwin To: Xin LI Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283889 - head/sys/kern Date: Mon, 01 Jun 2015 14:25:17 -0400 Message-ID: <3091869.VXHGj8nhqT@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201506011815.t51IFkPv027540@svn.freebsd.org> References: <201506011815.t51IFkPv027540@svn.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); Mon, 01 Jun 2015 14:26:21 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 01 Jun 2015 18:26:22 -0000 On Monday, June 01, 2015 06:15:46 PM Xin LI wrote: > Author: delphij > Date: Mon Jun 1 18:15:45 2015 > New Revision: 283889 > URL: https://svnweb.freebsd.org/changeset/base/283889 > > Log: > Clear p_stops when doing PT_DETACH. > > Without this, if a process was being traced by truss(1), which > uses different p_stops bits than gdb(1), the latter would > misbehave because of the unexpected bits. Please also clear this for procfs detach as well. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:42:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43EE6101; Mon, 1 Jun 2015 18:42:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 1 Jun 2015 18:42:26 +0000 From: Glen Barber To: Jack F Vogel Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283883 - in head/sys: dev/ixgbe modules/ixv Message-ID: <20150601184226.GC53056@hub.FreeBSD.org> References: <201506011743.t51HhZUP011379@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZmUaFz6apKcXQszQ" Content-Disposition: inline In-Reply-To: <201506011743.t51HhZUP011379@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer 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: Mon, 01 Jun 2015 18:42:32 -0000 --ZmUaFz6apKcXQszQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 01, 2015 at 05:43:35PM +0000, Jack F Vogel wrote: > Author: jfv > Date: Mon Jun 1 17:43:34 2015 > New Revision: 283883 > URL: https://svnweb.freebsd.org/changeset/base/283883 >=20 > Log: > Delta D2489 - Add SRIOV support to the Intel 10G driver. > =20 > NOTE: This is a technology preview, while it has undergone > development testing, Intel has not yet completed full > validation of the feature. It is being integrated for > early access and customer testing. >=20 > Modified: > head/sys/dev/ixgbe/if_ix.c > head/sys/dev/ixgbe/if_ixv.c > head/sys/dev/ixgbe/ix_txrx.c > head/sys/dev/ixgbe/ixgbe.h > head/sys/dev/ixgbe/ixgbe_mbx.h > head/sys/dev/ixgbe/ixgbe_vf.c > head/sys/modules/ixv/Makefile >=20 This breaks the build. Please revert until the change is properly build-tested. /usr/src/sys/dev/ixgbe/if_ix.c:233:2: error: use of undeclared identifier '= pci_init_iov_desc' DEVMETHOD(pci_init_iov, ixgbe_init_iov), ^ /usr/src/sys/sys/bus.h:649:19: note: expanded from macro 'DEVMETHOD' #define DEVMETHOD KOBJMETHOD ^ /usr/src/sys/sys/kobj.h:98:5: note: expanded from macro 'KOBJMETHOD' { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) } ^ :48:1: note: expanded from here pci_init_iov_desc ^ /usr/src/sys/dev/ixgbe/if_ix.c:233:2: error: expected expression /usr/src/sys/sys/bus.h:649:19: note: expanded from macro 'DEVMETHOD' #define DEVMETHOD KOBJMETHOD ^ /usr/src/sys/sys/kobj.h:98:52: note: expanded from macro 'KOBJMETHOD' { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) } ^ /usr/src/sys/dev/ixgbe/if_ix.c:233:2: error: use of undeclared identifier '= pci_init_iov_t' /usr/src/sys/sys/bus.h:649:19: note: expanded from macro 'DEVMETHOD' #define DEVMETHOD KOBJMETHOD ^ /usr/src/sys/sys/kobj.h:98:42: note: expanded from macro 'KOBJMETHOD' { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) } ^ :48:1: note: expanded from here pci_init_iov_t ^ /usr/src/sys/dev/ixgbe/if_ix.c:234:2: error: use of undeclared identifier '= pci_uninit_iov_desc'; did you mean 'pci_enable_io_desc'? DEVMETHOD(pci_uninit_iov, ixgbe_uninit_iov), ^ /usr/src/sys/sys/bus.h:649:19: note: expanded from macro 'DEVMETHOD' #define DEVMETHOD KOBJMETHOD ^ /usr/src/sys/sys/kobj.h:98:5: note: expanded from macro 'KOBJMETHOD' { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) } ^ :48:1: note: expanded from here pci_uninit_iov_desc ^ =2E/pci_if.h:125:27: note: 'pci_enable_io_desc' declared here extern struct kobjop_desc pci_enable_io_desc; ^ /usr/src/sys/dev/ixgbe/if_ix.c:234:2: error: expected expression DEVMETHOD(pci_uninit_iov, ixgbe_uninit_iov), ^ /usr/src/sys/sys/bus.h:649:19: note: expanded from macro 'DEVMETHOD' #define DEVMETHOD KOBJMETHOD ^ /usr/src/sys/sys/kobj.h:98:52: note: expanded from macro 'KOBJMETHOD' { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) } /usr/src/sys/dev/ixgbe/if_ix.c:234:2: error: use of undeclared identifier '= pci_uninit_iov_t' /usr/src/sys/sys/bus.h:649:19: note: expanded from macro 'DEVMETHOD' #define DEVMETHOD KOBJMETHOD ^ /usr/src/sys/sys/kobj.h:98:42: note: expanded from macro 'KOBJMETHOD' { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) } ^ :48:1: note: expanded from here pci_uninit_iov_t ^ /usr/src/sys/dev/ixgbe/if_ix.c:235:2: error: use of undeclared identifier '= pci_add_vf_desc' DEVMETHOD(pci_add_vf, ixgbe_add_vf), ^ /usr/src/sys/sys/bus.h:649:19: note: expanded from macro 'DEVMETHOD' #define DEVMETHOD KOBJMETHOD ^ /usr/src/sys/sys/kobj.h:98:5: note: expanded from macro 'KOBJMETHOD' { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) } ^ :48:1: note: expanded from here pci_add_vf_desc ^ /usr/src/sys/dev/ixgbe/if_ix.c:235:2: error: expected expression /usr/src/sys/sys/bus.h:649:19: note: expanded from macro 'DEVMETHOD' #define DEVMETHOD KOBJMETHOD ^ /usr/src/sys/sys/kobj.h:98:52: note: expanded from macro 'KOBJMETHOD' { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) } ^ /usr/src/sys/dev/ixgbe/if_ix.c:235:2: error: use of undeclared identifier '= pci_add_vf_t' /usr/src/sys/sys/bus.h:649:19: note: expanded from macro 'DEVMETHOD' #define DEVMETHOD KOBJMETHOD ^ /usr/src/sys/sys/kobj.h:98:42: note: expanded from macro 'KOBJMETHOD' { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) } ^ :48:1: note: expanded from here pci_add_vf_t ^ /usr/src/sys/dev/ixgbe/if_ix.c:595:11: error: implicit declaration of funct= ion 'pci_iov_attach' is invalid in C99 [-Werror,-Wimplicit-function-declara= tion] error =3D pci_iov_attach(dev, pf_schema, vf_schema); ^ /usr/src/sys/dev/ixgbe/if_ix.c:660:6: error: implicit declaration of functi= on 'pci_iov_detach' is invalid in C99 [-Werror,-Wimplicit-function-declarat= ion] if (pci_iov_detach(dev) !=3D 0) { ^ /usr/src/sys/dev/ixgbe/if_ix.c:660:6: note: did you mean 'pci_iov_attach'? /usr/src/sys/dev/ixgbe/if_ix.c:595:11: note: 'pci_iov_attach' declared here error =3D pci_iov_attach(dev, pf_schema, vf_schema); ^ 11 errors generated. *** Error code 1 Stop. make[2]: stopped in /usr/obj/usr/src/sys/GENERIC *** Error code 1 Glen --ZmUaFz6apKcXQszQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVbKeSAAoJEAMUWKVHj+KTFWQP+wZD+02ZXjh8QF9P3EO8gSWg 29DTZtkVO1u8VLe1dWJ0sjX4knMYdxCD55TbURFQwLBKFqlJFvPjVJT0z437eQE6 H+deyFijrMiN8hcwJhxh7w7i/puLiW2NDTLoZR00EJth1O+hFqm23IByojuLEY/V VHOwgOVQFt/BLM0N9mm9d/fb7ko4qtL40Mr+jT2Ih5uUvxLrp6JzOCcK9lPoVT/T FVHXjxLXD37MreBqwDF+ARkFi1as0VIDF3iHlCU4t9KH+xkCdADX9BSXlOxO4e5f aSoIASSDqVH4U3rLi5oYneC6SrCiUOYgTAxUHBgS9N1mjIHgYJYLxlgfqt3NrKWO /Fpvo2hP/WbGOo6/aP3CxAziK8tbvpnBNPbLz0HIsg8jbU4OihwTTqHEUI0W+iXe C61f2aL0yF/fmeB7rqS3Hc8Wj3N6ZZ84P4sgYo5bbcDZRMfFwo2jH8uAxcXJouxU U74YlOiNuE9JI3GuQIzzAJVMQEp9mnbKVQLJ8JIzW/XG1CK0h7yUMF8g8w1yi+Bl sSC53rcHDEuTYgsQrBAAFE6cCpvJ+VRhzEvggCMioQCqr6e+FEzyKZ3dMZYU0E4U GQ6p98LZyvAztdUstRLxT0O72XCyYZsO/tOIO72o5BwTSAg606HfSdngvChiW7lh xRVFwnPHZcDuBGG36ROB =ANj7 -----END PGP SIGNATURE----- --ZmUaFz6apKcXQszQ-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:49:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7B75578; Mon, 1 Jun 2015 18:49:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C6FE915F2; Mon, 1 Jun 2015 18:49:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t51InVaj044189; Mon, 1 Jun 2015 18:49:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51InVXA044188; Mon, 1 Jun 2015 18:49:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201506011849.t51InVXA044188@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 1 Jun 2015 18:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283891 - head/sys/fs/procfs 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, 01 Jun 2015 18:49:32 -0000 Author: delphij Date: Mon Jun 1 18:49:31 2015 New Revision: 283891 URL: https://svnweb.freebsd.org/changeset/base/283891 Log: Clear p_stops upon PROCFS_CTL_DETACH, similar to r283889. Noticed by: jhb Reviewed by: sef Sponsored by: iXsystems, Inc. MFC after: 2 weeks Modified: head/sys/fs/procfs/procfs_ctl.c Modified: head/sys/fs/procfs/procfs_ctl.c ============================================================================== --- head/sys/fs/procfs/procfs_ctl.c Mon Jun 1 18:15:50 2015 (r283890) +++ head/sys/fs/procfs/procfs_ctl.c Mon Jun 1 18:49:31 2015 (r283891) @@ -235,6 +235,7 @@ out: } else PROC_LOCK(p); p->p_oppid = 0; + p->p_stops = 0; p->p_flag &= ~P_WAITED; /* XXX ? */ sx_xunlock(&proctree_lock); From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 18:50:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0C866D8; Mon, 1 Jun 2015 18:50:10 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 999F0160F; Mon, 1 Jun 2015 18:50:10 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from zeta.ixsystems.com (c-71-202-112-39.hsd1.ca.comcast.net [71.202.112.39]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 10DA14183; Mon, 1 Jun 2015 11:50:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1433184610; x=1433199010; bh=LfaqG7dkeaoMreLINOJrCKxxTggLHfC+oLL9JQQcD4o=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=TtjfbGYrl/iKjn1elksMxfgwS9pMcyVFVhdmAGjMwzzb/Avfq6VjtH2hTNmCkAJdD yec+AcaY8D1apVh6s76iEtheiucj3nE4EaERNbk5CsypGmJEMigiTVIL4llEPFIANI zPlM7kfBHeMztJ3IbPAcCU0iPzoHvJFG6bzJh2S4= Message-ID: <556CA960.3040607@delphij.net> Date: Mon, 01 Jun 2015 11:50:08 -0700 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: John Baldwin , Xin LI CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283889 - head/sys/kern References: <201506011815.t51IFkPv027540@svn.freebsd.org> <3091869.VXHGj8nhqT@ralph.baldwin.cx> In-Reply-To: <3091869.VXHGj8nhqT@ralph.baldwin.cx> 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: Mon, 01 Jun 2015 18:50:10 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 06/01/15 11:25, John Baldwin wrote: > On Monday, June 01, 2015 06:15:46 PM Xin LI wrote: >> Author: delphij Date: Mon Jun 1 18:15:45 2015 New Revision: >> 283889 URL: https://svnweb.freebsd.org/changeset/base/283889 >> >> Log: Clear p_stops when doing PT_DETACH. >> >> Without this, if a process was being traced by truss(1), which >> uses different p_stops bits than gdb(1), the latter would >> misbehave because of the unexpected bits. > > Please also clear this for procfs detach as well. Good catch! Fixed in r283891. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.1.4 (FreeBSD) iQIcBAEBCgAGBQJVbKlgAAoJEJW2GBstM+nsDvoP/0GHrHvneR2hhVogwz9uyEUE EAaxfbVtPmEw4pnvlK1spFJIJnVwlAIRMH2i+3xWiUChpYkJNCui9HMXI9G8pI/p DkPgG6XTGD7IedU17Yq0NnbaE6y9WEkTl6AR+UJY27EAohKuZgziWO3Q/npe7J4s 4LPEWmV7F2fXWxAaOaIisg+sKOhh/hJi89IlIhvpPnE9D5JmUo4uIzWZPtmxLg/u Q9dwVZCxgXN1k4Pi46eibqQGGdielNTDR7aWzi3j/fE+OmlnJWQWe9bKDOFuCgpK yzwfru7FmqnfYyfkxyfg5teFh70Y/9bunzcWWAfdRZIcnhOlwEbXuK/CCpesiuoI SPhjo9KXjpzevJoLIr+QgduQ6/FxJmgf1i44ruCATLlZ+7v/OkdQazwXY4gUPZId J/UwdC57sFTiVGVHvR94h7S/Tu1f1OHHdOi0ZKUOVqavQrtdntvR74UX29jCmOP+ 5MJx8LOKZSDoaCRrdvCA0I2XFjirW3xJvpRer3DWm+i/deNKGbBhgaKDpn/bqgQg BVROwLUdxwBJ9ES4VzCpoNZBnHRdEfFdGGvGnFFcdKC3rKqd4Gn54Y/JgiFvEct0 zW1yVsiVurVtPocBIg1aHeEe/qEHsLIEHSe7n1Y2WxyZkh0HIKXco77H1HptW1sv bZAI2tXsjktB+8pT+dmB =MUGS -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 19:15:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B813B2CD; Mon, 1 Jun 2015 19:15:45 +0000 (UTC) (envelope-from rysto32@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 80A421D7E; Mon, 1 Jun 2015 19:15:45 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by igbjd9 with SMTP id jd9so69542884igb.1; Mon, 01 Jun 2015 12:15:44 -0700 (PDT) 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=Q+cfCjD4dLFX+vOobzdvDq9cdy3srMsiEj4jtQ+QGz0=; b=t6zqA0VE3sGB62j3uj+oo/kn1q80Ym3gfbBBnirOlPtklBflcRF24KjoSVofI03vqC 9ArgQzyDaj/BsnzQ1iVHj4sdcC83Z813qCkuJTj8aiQ9QPzVz21jfkImuXVIcwZOvd+o +iB5/DmZ8mrSL3hrEjLLCWG0kcbPob8T9uTaZsLWPLTEYhJbGglDWzXis+8FPQ5AAs7Y /bT8odOA66QBQlvmGqWjjZyuuZtvhW+2MjHWp68RbAiok3uYsR06cI+adgYY/pXB/2C5 8FayyOy3z9LhYWntN+c4N+bCgM9iPEZzZ4et/tUOiyOCbsZAUM7u//EQa5FkZZl7QRDl ON3w== MIME-Version: 1.0 X-Received: by 10.50.47.50 with SMTP id a18mr8375921ign.46.1433186144834; Mon, 01 Jun 2015 12:15:44 -0700 (PDT) Received: by 10.107.40.194 with HTTP; Mon, 1 Jun 2015 12:15:44 -0700 (PDT) In-Reply-To: <20150601184226.GC53056@hub.FreeBSD.org> References: <201506011743.t51HhZUP011379@svn.freebsd.org> <20150601184226.GC53056@hub.FreeBSD.org> Date: Mon, 1 Jun 2015 15:15:44 -0400 Message-ID: Subject: Re: svn commit: r283883 - in head/sys: dev/ixgbe modules/ixv From: Ryan Stone To: Glen Barber Cc: Jack F Vogel , "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, 01 Jun 2015 19:15:45 -0000 I think that this is a conflict with r283670, which changed the interface for SR-IOV a little bit. Sorry Jack, I knew that that change was coming but it didn't occur to me that the ixgbe patch would have to be updated. I believe that this patch will fix it: diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 0c3769c..ae822f2 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -46,6 +46,10 @@ #include #endif +#ifdef PCI_IOV +#include +#endif + /********************************************************************* * Set this to one to display debug statistics *********************************************************************/ @@ -230,9 +234,9 @@ static device_method_t ix_methods[] = { DEVMETHOD(device_suspend, ixgbe_suspend), DEVMETHOD(device_resume, ixgbe_resume), #ifdef PCI_IOV - DEVMETHOD(pci_init_iov, ixgbe_init_iov), - DEVMETHOD(pci_uninit_iov, ixgbe_uninit_iov), - DEVMETHOD(pci_add_vf, ixgbe_add_vf), + DEVMETHOD(pci_iov_init, ixgbe_init_iov), + DEVMETHOD(pci_iov_uninit, ixgbe_uninit_iov), + DEVMETHOD(pci_iov_add_vf, ixgbe_add_vf), #endif /* PCI_IOV */ DEVMETHOD_END }; diff --git a/sys/modules/ix/Makefile b/sys/modules/ix/Makefile index 1f30cb0..8846f2d 100644 --- a/sys/modules/ix/Makefile +++ b/sys/modules/ix/Makefile @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../dev/ixgbe KMOD = if_ix -SRCS = device_if.h bus_if.h pci_if.h +SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h SRCS += opt_inet.h opt_inet6.h opt_rss.h SRCS += if_ix.c ix_txrx.c # Shared source From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 19:30:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F27DAD9; Mon, 1 Jun 2015 19:30:46 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FA7210A1; Mon, 1 Jun 2015 19:30:46 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from zeta.ixsystems.com (c-71-202-112-39.hsd1.ca.comcast.net [71.202.112.39]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id B5DD1441E; Mon, 1 Jun 2015 12:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1433187046; x=1433201446; bh=KOU8IKbNZd2FjQfx4r3YZCqgH9itNrF8ri+mnT3VJec=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=mKsQmZaJFsAVjqNuuZL0FVr5ui/3n5eJnwk/dXDgVNS2F1fi7PT9sR2Gdwn2BxUJx SxDSOOmputAPNCXffn7SVQ0GhqGceV6r7RXQ+M1jLsLhmEUv/AQpne6K+prvV79fkw pwWYilXhIZ6s0BHJJ6FtTz3l9e5phnm9ue/Xq3Sk= Message-ID: <556CB2E5.7070304@delphij.net> Date: Mon, 01 Jun 2015 12:30:45 -0700 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Ryan Stone , Glen Barber CC: Jack F Vogel , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r283883 - in head/sys: dev/ixgbe modules/ixv References: <201506011743.t51HhZUP011379@svn.freebsd.org> <20150601184226.GC53056@hub.FreeBSD.org> 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: Mon, 01 Jun 2015 19:30:46 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 06/01/15 12:15, Ryan Stone wrote: > I think that this is a conflict with r283670, which changed the > interface for SR-IOV a little bit. > > Sorry Jack, I knew that that change was coming but it didn't occur > to me that the ixgbe patch would have to be updated. I believe > that this patch will fix it: > > diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index > 0c3769c..ae822f2 100644 --- a/sys/dev/ixgbe/if_ix.c +++ > b/sys/dev/ixgbe/if_ix.c @@ -46,6 +46,10 @@ #include > #endif > > +#ifdef PCI_IOV +#include +#endif + > /********************************************************************* > > * Set this to one to display debug statistics > *********************************************************************/ > > @@ -230,9 +234,9 @@ static device_method_t ix_methods[] = { > DEVMETHOD(device_suspend, ixgbe_suspend), DEVMETHOD(device_resume, > ixgbe_resume), #ifdef PCI_IOV - DEVMETHOD(pci_init_iov, > ixgbe_init_iov), - DEVMETHOD(pci_uninit_iov, > ixgbe_uninit_iov), - DEVMETHOD(pci_add_vf, ixgbe_add_vf), + > DEVMETHOD(pci_iov_init, ixgbe_init_iov), + > DEVMETHOD(pci_iov_uninit, ixgbe_uninit_iov), + > DEVMETHOD(pci_iov_add_vf, ixgbe_add_vf), #endif /* PCI_IOV */ > DEVMETHOD_END }; diff --git a/sys/modules/ix/Makefile > b/sys/modules/ix/Makefile index 1f30cb0..8846f2d 100644 --- > a/sys/modules/ix/Makefile +++ b/sys/modules/ix/Makefile @@ -3,7 > +3,7 @@ .PATH: ${.CURDIR}/../../dev/ixgbe > > KMOD = if_ix -SRCS = device_if.h bus_if.h pci_if.h +SRCS = > device_if.h bus_if.h pci_if.h pci_iov_if.h SRCS += opt_inet.h > opt_inet6.h opt_rss.h SRCS += if_ix.c ix_txrx.c # Shared source I think modules/ixv also needs to be updated? In 283670 John have also renamed the [un]init_iov functions to iov_[un]init, to match the names. I think ixgbe should follow that as well. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.1.4 (FreeBSD) iQIcBAEBCgAGBQJVbLLlAAoJEJW2GBstM+nsYH8QAIfxz9MfJ3xGorc/5lZhCyQb ZvVV3kdI5Cg6cysUeyQBW2okFQ2BbfHuy+B1IlM7rNoFAbtx0nVpA7Ef12WhJEfQ 0eKt+MjkMgGxopVNy4RtUnH79MtljDcPPJZsFsMOwvqpLQD/0vSGPEAPBgToWEfp PQ2E4aznzb6ilj8KpQflO32R0dRJt0R9XTq7mVnkfaPtb3e85F3ACEPj0U3+Xpor 8qwjk9ji/vAR2TLziruZKOCm66jwusjpCM0Mr0tqwpv4KlsJh5fB1zCkBGtYMIkK yDm7glkgM0wBUS2ThPUXEbzn5vJ2Q5eB5m2EjFcNpMnjGPinClDzFOHfvrZRNhDN ZddqnpKIf1HJSD6O7Q0+MfaDxfS0UQV678OP+5maMXLdbD8Kox+Z3vazG4W4TQGC wbvp7NNgi/c/f1sE5CKRg3VIJGK3rq7DHZqnz9S2u9OdkGpIGscwzrVM29ebEXOA 7uMeyjTaB3eCObBa2Sdea8wcJzsT7OyS984aiLRxBcKSzS4l3sLI+14a6Fn4Snpr ppf0DKUg8rc3ywMJ2utAyf6vu3S57uIetJRH8IqzIvGszs55h32RwWfsFX5FeC9c FNW83PjgMrmlM2I73gkGWAYFWbs/ziuBLmLr4qVNRVdli5rmkIZaRBNfdT8HSneY q26lHAasDzROf+9W42R/ =MwRo -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:05:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66D284CB; Mon, 1 Jun 2015 20:05:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 558661A62; Mon, 1 Jun 2015 20:05:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t51K58L6087886; Mon, 1 Jun 2015 20:05:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51K57om087880; Mon, 1 Jun 2015 20:05:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201506012005.t51K57om087880@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 1 Jun 2015 20:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283893 - head/sys/dev/ixgbe 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, 01 Jun 2015 20:05:08 -0000 Author: jhb Date: Mon Jun 1 20:05:06 2015 New Revision: 283893 URL: https://svnweb.freebsd.org/changeset/base/283893 Log: Catch up to the SRIOV API changes in r283670. Modified: head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Mon Jun 1 19:26:24 2015 (r283892) +++ head/sys/dev/ixgbe/if_ix.c Mon Jun 1 20:05:06 2015 (r283893) @@ -230,9 +230,9 @@ static device_method_t ix_methods[] = { DEVMETHOD(device_suspend, ixgbe_suspend), DEVMETHOD(device_resume, ixgbe_resume), #ifdef PCI_IOV - DEVMETHOD(pci_init_iov, ixgbe_init_iov), - DEVMETHOD(pci_uninit_iov, ixgbe_uninit_iov), - DEVMETHOD(pci_add_vf, ixgbe_add_vf), + DEVMETHOD(pci_iov_init, ixgbe_init_iov), + DEVMETHOD(pci_iov_uninit, ixgbe_uninit_iov), + DEVMETHOD(pci_iov_add_vf, ixgbe_add_vf), #endif /* PCI_IOV */ DEVMETHOD_END }; Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Mon Jun 1 19:26:24 2015 (r283892) +++ head/sys/dev/ixgbe/ixgbe.h Mon Jun 1 20:05:06 2015 (r283893) @@ -95,6 +95,7 @@ #ifdef PCI_IOV #include #include +#include #endif #include "ixgbe_api.h" From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:26:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A6382EB; Mon, 1 Jun 2015 20:26:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 28E181F5D; Mon, 1 Jun 2015 20:26:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t51KQdZU099426; Mon, 1 Jun 2015 20:26:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51KQd5j099425; Mon, 1 Jun 2015 20:26:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506012026.t51KQd5j099425@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 1 Jun 2015 20:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283894 - head/release/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, 01 Jun 2015 20:26:39 -0000 Author: gjb Date: Mon Jun 1 20:26:38 2015 New Revision: 283894 URL: https://svnweb.freebsd.org/changeset/base/283894 Log: Disable arm_create_user(). As-is, this does not create the user in the userland for the target image, but creates the user in the build chroot. Before this is re-enabled, I want to figure out a clean way to do this without requiring the overhead of third-party utilities (such as qemu). MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Mon Jun 1 20:05:06 2015 (r283893) +++ head/release/tools/arm.subr Mon Jun 1 20:26:38 2015 (r283894) @@ -98,7 +98,7 @@ arm_install_base() { installworld installkernel distribution chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos - arm_create_user + #arm_create_user echo '# Custom /etc/fstab for FreeBSD embedded images' \ > ${CHROOTDIR}/${DESTDIR}/etc/fstab From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 20:59:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B19D369; Mon, 1 Jun 2015 20:59:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1991F1749; Mon, 1 Jun 2015 20:59:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t51KxISq015757; Mon, 1 Jun 2015 20:59:18 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51KxINk015756; Mon, 1 Jun 2015 20:59:18 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506012059.t51KxINk015756@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 1 Jun 2015 20:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283895 - head/release/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, 01 Jun 2015 20:59:19 -0000 Author: gjb Date: Mon Jun 1 20:59:18 2015 New Revision: 283895 URL: https://svnweb.freebsd.org/changeset/base/283895 Log: Re-enable arm_create_user(), and pass the '-V DESTDIR/etc' to pw(8) to set the correct /etc directory for the user/group files. Provided by: ian (thanks!) MFC after: 3 days X-MFC-with: r283894 Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Mon Jun 1 20:26:38 2015 (r283894) +++ head/release/tools/arm.subr Mon Jun 1 20:59:18 2015 (r283895) @@ -80,11 +80,14 @@ arm_create_disk() { arm_create_user() { # Create a default user account 'freebsd' with the password 'freebsd', # and set the default password for the 'root' user to 'root'. - chroot ${CHROOTDIR} /usr/sbin/pw groupadd freebsd -g 1001 - chroot ${CHROOTDIR} /usr/sbin/pw useradd freebsd \ + chroot ${CHROOTDIR} /usr/sbin/pw -V ${DESTDIR}/etc \ + groupadd freebsd -g 1001 + chroot ${CHROOTDIR} /usr/sbin/pw -V ${DESTDIR}/etc \ + useradd freebsd \ -m -M 0755 -w yes -n freebsd -u 1001 -g 1001 -G 0 \ -c 'FreeBSD User' -d '/home/freebsd' -s '/bin/csh' - chroot ${CHROOTDIR} /usr/sbin/pw usermod root -w yes + chroot ${CHROOTDIR} /usr/sbin/pw -V ${DESTDIR}/etc \ + usermod root -w yes return 0 } @@ -98,7 +101,7 @@ arm_install_base() { installworld installkernel distribution chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos - #arm_create_user + arm_create_user echo '# Custom /etc/fstab for FreeBSD embedded images' \ > ${CHROOTDIR}/${DESTDIR}/etc/fstab From owner-svn-src-head@FreeBSD.ORG Mon Jun 1 21:10:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C679486C; Mon, 1 Jun 2015 21:10:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B4E1F1ACD; Mon, 1 Jun 2015 21:10:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t51LAmlu024155; Mon, 1 Jun 2015 21:10:48 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51LAmq3024154; Mon, 1 Jun 2015 21:10:48 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506012110.t51LAmq3024154@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 1 Jun 2015 21:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283896 - head/release/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, 01 Jun 2015 21:10:48 -0000 Author: gjb Date: Mon Jun 1 21:10:47 2015 New Revision: 283896 URL: https://svnweb.freebsd.org/changeset/base/283896 Log: In arm_create_disk(), disable soft updates journaling. Disabling soft updates journaling appears to resolve issues with kernel panics, and may also be generally bad to have enabled for SD cards. Requested by: ian MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Mon Jun 1 20:59:18 2015 (r283895) +++ head/release/tools/arm.subr Mon Jun 1 21:10:47 2015 (r283896) @@ -72,7 +72,7 @@ arm_create_disk() { chroot ${CHROOTDIR} gpart create -s bsd ${mddev}s2 chroot ${CHROOTDIR} gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2 chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}s2a - chroot ${CHROOTDIR} tunefs -j enable -N enable /dev/${mddev}s2a + chroot ${CHROOTDIR} tunefs -N enable /dev/${mddev}s2a return 0 } From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 00:47:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3FE7780; Tue, 2 Jun 2015 00:47:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A79F41E7C; Tue, 2 Jun 2015 00:47:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t520ldLN031122; Tue, 2 Jun 2015 00:47:39 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t520ldXV031121; Tue, 2 Jun 2015 00:47:39 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201506020047.t520ldXV031121@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 2 Jun 2015 00:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283897 - 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: Tue, 02 Jun 2015 00:47:39 -0000 Author: ae Date: Tue Jun 2 00:47:38 2015 New Revision: 283897 URL: https://svnweb.freebsd.org/changeset/base/283897 Log: Add example howto configure gre(4) tunnel with the same inner and outer addresses using multiple FIBs. X-MFC after: r282809 Modified: head/share/man/man4/gre.4 Modified: head/share/man/man4/gre.4 ============================================================================== --- head/share/man/man4/gre.4 Mon Jun 1 21:10:47 2015 (r283896) +++ head/share/man/man4/gre.4 Tue Jun 2 00:47:38 2015 (r283897) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2014 +.Dd June 2, 2015 .Dt GRE 4 .Os .Sh NAME @@ -117,6 +117,44 @@ ifconfig greN inet 192.168.2.1 192.168.1 ifconfig greN inet tunnel B A route add -net 192.168.1 -netmask 255.255.255.0 192.168.1.1 .Ed +.Pp +In case when internal and external IP addresses are the same, +different routing tables (FIB) should be used. +The default FIB will be applied to IP packets before GRE encapsulation. +After encapsulation GRE interface should set different FIB number to +outgoing packet. +Then different FIB will be applied to such encapsulated packets. +According to this FIB packet should be routed to tunnel endpoint. +.Bd -literal +Host X -- Host A (198.51.100.1) ---tunnel--- Cisco D (203.0.113.1) -- Host E + \\ / + \\ / + +----- Host B ----- Host C -----+ + (198.51.100.254) +.Ed +.Pp +On Host A (FreeBSD): +.Pp +First of multiple FIBs should be configured via loader.conf: +.Bd -literal -offset indent +net.fibs=2 +net.add_addr_allfibs=0 +.Ed +.Pp +Then routes to the gateway and remote tunnel endpoint via this gateway +should be added to the second FIB: +.Bd -literal -offset indent +route add -net 198.51.100.0 -netmask 255.255.255.0 -fib 1 -iface em0 +route add -host 203.0.113.1 -fib 1 198.51.100.254 +.Ed +.Pp +And GRE tunnel should be configured to change FIB for encapsulated packets: +.Bd -literal -offset indent +ifconfig greN create +ifconfig greN inet 198.51.100.1 203.0.113.1 +ifconfig greN inet tunnel 198.51.100.1 203.0.113.1 tunnelfib 1 +.Ed +.Pp .Sh NOTES The MTU of .Nm From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 01:47:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C62AB6EC; Tue, 2 Jun 2015 01:47:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B45CE1CCE; Tue, 2 Jun 2015 01:47:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t521lDjH061129; Tue, 2 Jun 2015 01:47:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t521lDOx061128; Tue, 2 Jun 2015 01:47:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201506020147.t521lDOx061128@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 2 Jun 2015 01:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283898 - head/usr.sbin/ctld 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, 02 Jun 2015 01:47:13 -0000 Author: mav Date: Tue Jun 2 01:47:12 2015 New Revision: 283898 URL: https://svnweb.freebsd.org/changeset/base/283898 Log: Fix bug in r278331: unlike some other options MaxRecvDataSegmentLength is not negotiated as minimum, but only reported by sides to each other. MFC after: 1 week Modified: head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Tue Jun 2 00:47:38 2015 (r283897) +++ head/usr.sbin/ctld/login.c Tue Jun 2 01:47:12 2015 (r283898) @@ -557,7 +557,7 @@ login_negotiate_key(struct pdu *request, tmp = conn->conn_data_segment_limit; } conn->conn_max_data_segment_length = tmp; - keys_add_int(response_keys, name, tmp); + keys_add_int(response_keys, name, conn->conn_data_segment_limit); } else if (strcmp(name, "MaxBurstLength") == 0) { tmp = strtoul(value, NULL, 10); if (tmp <= 0) { From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 09:03:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F9D9D39; Tue, 2 Jun 2015 09:03:16 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1D0031585; Tue, 2 Jun 2015 09:03:16 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5293F7Z081584; Tue, 2 Jun 2015 09:03:15 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5293Fa3081583; Tue, 2 Jun 2015 09:03:15 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201506020903.t5293Fa3081583@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 2 Jun 2015 09:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283906 - head/lib/libgssapi 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, 02 Jun 2015 09:03:16 -0000 Author: araujo (ports committer) Date: Tue Jun 2 09:03:15 2015 New Revision: 283906 URL: https://svnweb.freebsd.org/changeset/base/283906 Log: Remove unused variable allocated_ctx reported by clang. Differential Revision: D2684 Reviewed by: rodrigc Modified: head/lib/libgssapi/gss_accept_sec_context.c Modified: head/lib/libgssapi/gss_accept_sec_context.c ============================================================================== --- head/lib/libgssapi/gss_accept_sec_context.c Tue Jun 2 08:03:28 2015 (r283905) +++ head/lib/libgssapi/gss_accept_sec_context.c Tue Jun 2 09:03:15 2015 (r283906) @@ -165,7 +165,6 @@ OM_uint32 gss_accept_sec_context(OM_uint struct _gss_mechanism_cred *mc; gss_cred_id_t acceptor_mc, delegated_mc; gss_name_t src_mn; - int allocated_ctx; *minor_status = 0; if (src_name) @@ -206,11 +205,8 @@ OM_uint32 gss_accept_sec_context(OM_uint free(ctx); return (GSS_S_BAD_MECH); } - allocated_ctx = 1; - } else { + } else m = ctx->gc_mech; - allocated_ctx = 0; - } if (cred) { SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 09:05:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA78AF98; Tue, 2 Jun 2015 09:05:46 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C7B4815B3; Tue, 2 Jun 2015 09:05:46 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5295kKI082101; Tue, 2 Jun 2015 09:05:46 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5295k7G082099; Tue, 2 Jun 2015 09:05:46 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201506020905.t5295k7G082099@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 2 Jun 2015 09:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283907 - head/sbin/camcontrol 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, 02 Jun 2015 09:05:47 -0000 Author: araujo (ports committer) Date: Tue Jun 2 09:05:45 2015 New Revision: 283907 URL: https://svnweb.freebsd.org/changeset/base/283907 Log: Remove unused variables reported by clang. Differential Revision: D2688 Reviewed by: rodrigc, mav Modified: head/sbin/camcontrol/camcontrol.c head/sbin/camcontrol/persist.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue Jun 2 09:03:15 2015 (r283906) +++ head/sbin/camcontrol/camcontrol.c Tue Jun 2 09:05:45 2015 (r283907) @@ -2566,12 +2566,11 @@ atahpa(struct cam_device *device, int re struct ata_params *ident_buf; struct ccb_getdev cgd; struct ata_set_max_pwd pwd; - int error, confirm, quiet, c, action, actions, setpwd, persist; + int error, confirm, quiet, c, action, actions, persist; int security, is48bit, pwdsize; u_int64_t hpasize, maxsize; actions = 0; - setpwd = 0; confirm = 0; quiet = 0; maxsize = 0; Modified: head/sbin/camcontrol/persist.c ============================================================================== --- head/sbin/camcontrol/persist.c Tue Jun 2 09:03:15 2015 (r283906) +++ head/sbin/camcontrol/persist.c Tue Jun 2 09:05:45 2015 (r283907) @@ -432,7 +432,7 @@ scsipersist(struct cam_device *device, i uint32_t res_len = 0; unsigned long rel_tgt_port = 0; uint8_t *res_buf = NULL; - int scope = SPR_LU_SCOPE, res_type = 0, key_set = 0, sa_key_set = 0; + int scope = SPR_LU_SCOPE, res_type = 0; struct persist_transport_id *id, *id2; STAILQ_HEAD(, persist_transport_id) transport_id_list; uint64_t key = 0, sa_key = 0; @@ -510,10 +510,8 @@ scsipersist(struct cam_device *device, i } if (c == 'k') { key = tmpval; - key_set = 1; } else { sa_key = tmpval; - sa_key_set = 1; } break; } From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 15:02:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23FD9629; Tue, 2 Jun 2015 15:02:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 12CD11F5D; Tue, 2 Jun 2015 15:02:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t52F2UPv066945; Tue, 2 Jun 2015 15:02:30 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t52F2UGg066944; Tue, 2 Jun 2015 15:02:30 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506021502.t52F2UGg066944@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 2 Jun 2015 15:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283913 - head/release/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: Tue, 02 Jun 2015 15:02:31 -0000 Author: gjb Date: Tue Jun 2 15:02:30 2015 New Revision: 283913 URL: https://svnweb.freebsd.org/changeset/base/283913 Log: Pass the '-b' argument to pw(8) so the '/home' directory is created in the correct place. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Tue Jun 2 15:02:28 2015 (r283912) +++ head/release/tools/arm.subr Tue Jun 2 15:02:30 2015 (r283913) @@ -85,7 +85,8 @@ arm_create_user() { chroot ${CHROOTDIR} /usr/sbin/pw -V ${DESTDIR}/etc \ useradd freebsd \ -m -M 0755 -w yes -n freebsd -u 1001 -g 1001 -G 0 \ - -c 'FreeBSD User' -d '/home/freebsd' -s '/bin/csh' + -c 'FreeBSD User' -d '/home/freebsd' -s '/bin/csh' \ + -b "${DESTDIR}/home" chroot ${CHROOTDIR} /usr/sbin/pw -V ${DESTDIR}/etc \ usermod root -w yes From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 16:07:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9685319F; Tue, 2 Jun 2015 16:07:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6A37113DA; Tue, 2 Jun 2015 16:07:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t52G7TPS098656; Tue, 2 Jun 2015 16:07:29 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t52G7TIk098655; Tue, 2 Jun 2015 16:07:29 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201506021607.t52G7TIk098655@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 2 Jun 2015 16:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283918 - head/sys/arm/broadcom/bcm2835 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, 02 Jun 2015 16:07:29 -0000 Author: ian Date: Tue Jun 2 16:07:28 2015 New Revision: 283918 URL: https://svnweb.freebsd.org/changeset/base/283918 Log: Add a missing wakeup when releasing ownership of the SPI hardware. Also, validate the chipselect parameter before grabbing ownership of the hardware, and report timeout errors after releasing it. PR: 200584 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_spi.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Tue Jun 2 15:35:38 2015 (r283917) +++ head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Tue Jun 2 16:07:28 2015 (r283918) @@ -427,6 +427,15 @@ bcm_spi_transfer(device_t dev, device_t KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, ("TX/RX data sizes should be equal")); + /* Get the proper chip select for this child. */ + spibus_get_cs(child, &cs); + if (cs < 0 || cs > 2) { + device_printf(dev, + "Invalid chip select %d requested by %s\n", cs, + device_get_nameunit(child)); + return (EINVAL); + } + BCM_SPI_LOCK(sc); /* If the controller is in use wait until it is available. */ @@ -441,16 +450,6 @@ bcm_spi_transfer(device_t dev, device_t SPI_CS_CLEAR_RXFIFO | SPI_CS_CLEAR_TXFIFO, SPI_CS_CLEAR_RXFIFO | SPI_CS_CLEAR_TXFIFO); - /* Get the proper chip select for this child. */ - spibus_get_cs(child, &cs); - if (cs < 0 || cs > 2) { - device_printf(dev, - "Invalid chip select %d requested by %s\n", cs, - device_get_nameunit(child)); - BCM_SPI_UNLOCK(sc); - return (EINVAL); - } - /* Save a pointer to the SPI command. */ sc->sc_cmd = cmd; sc->sc_read = 0; @@ -471,8 +470,10 @@ bcm_spi_transfer(device_t dev, device_t /* Make sure the SPI engine and interrupts are disabled. */ bcm_spi_modifyreg(sc, SPI_CS, SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD, 0); - /* Clear the controller flags. */ + /* Release the controller and wakeup the next thread waiting for it. */ sc->sc_flags = 0; + wakeup_one(dev); + BCM_SPI_UNLOCK(sc); /* * Check for transfer timeout. The SPI controller doesn't @@ -483,8 +484,6 @@ bcm_spi_transfer(device_t dev, device_t err = EIO; } - BCM_SPI_UNLOCK(sc); - return (err); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 17:00:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3D23DE3; Tue, 2 Jun 2015 17:00:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B1D351130; Tue, 2 Jun 2015 17:00:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t52H0VSD023924; Tue, 2 Jun 2015 17:00:31 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t52H0VFS023923; Tue, 2 Jun 2015 17:00:31 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506021700.t52H0VFS023923@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 2 Jun 2015 17:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283919 - 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, 02 Jun 2015 17:00:31 -0000 Author: gjb Date: Tue Jun 2 17:00:31 2015 New Revision: 283919 URL: https://svnweb.freebsd.org/changeset/base/283919 Log: Remove trailing tabs to avoid spamming stdout with long lines. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.ec2 Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Tue Jun 2 16:07:28 2015 (r283918) +++ head/release/Makefile.ec2 Tue Jun 2 17:00:31 2015 (r283919) @@ -51,9 +51,9 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} @echo "--------------------------------------------------------------" @false .endif - /usr/local/bin/bsdec2-image-upload ${PUBLISH} \ - ${.OBJDIR}/ec2.raw \ - "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ - "${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \ + /usr/local/bin/bsdec2-image-upload ${PUBLISH} \ + ${.OBJDIR}/ec2.raw \ + "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ + "${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} @touch ${.TARGET} From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 17:03:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CCFEAF8F; Tue, 2 Jun 2015 17:03:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BB1E31343; Tue, 2 Jun 2015 17:03:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t52H3W23027905; Tue, 2 Jun 2015 17:03:32 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t52H3WW0027904; Tue, 2 Jun 2015 17:03:32 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506021703.t52H3WW0027904@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 2 Jun 2015 17:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283920 - head/release/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, 02 Jun 2015 17:03:32 -0000 Author: gjb Date: Tue Jun 2 17:03:31 2015 New Revision: 283920 URL: https://svnweb.freebsd.org/changeset/base/283920 Log: Add a configuration file to support the Cubox/Hummingboard SoC. Sponsored by: The FreeBSD Foundation Added: head/release/arm/CUBOX-HUMMINGBOARD.conf (contents, props changed) Added: head/release/arm/CUBOX-HUMMINGBOARD.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/arm/CUBOX-HUMMINGBOARD.conf Tue Jun 2 17:03:31 2015 (r283920) @@ -0,0 +1,39 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard" +KERNEL="IMX6" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000" +IMAGE_SIZE="1G" +PART_SCHEME="MBR" +FAT_SIZE="50m -b 16384" +FAT_TYPE="16" +MD_ARGS="-x 63 -y 255" +NODOC=1 +export BOARDNAME="CUBOX-HUMMINGBOARD" + +arm_install_uboot() { + UBOOT_DIR="/usr/local/share/u-boot/u-boot-cubox-hummingboard" + UBOOT_FILES="u-boot.imx" + FATMOUNT="${DESTDIR%${KERNEL}}/fat" + UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" + chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ + of=/dev/${mddev} bs=512 seek=2 + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr + chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + chroot ${CHROOTDIR} rmdir ${FATMOUNT} + chroot ${CHROOTDIR} rmdir ${UFSMOUNT} + + return 0 +} From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 17:40:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D475709; Tue, 2 Jun 2015 17:40:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3A5E21BBF; Tue, 2 Jun 2015 17:40:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t52HerUT046357; Tue, 2 Jun 2015 17:40:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t52Her4Q046356; Tue, 2 Jun 2015 17:40:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201506021740.t52Her4Q046356@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 2 Jun 2015 17:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283922 - head/sys/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: Tue, 02 Jun 2015 17:40:53 -0000 Author: hselasky Date: Tue Jun 2 17:40:52 2015 New Revision: 283922 URL: https://svnweb.freebsd.org/changeset/base/283922 Log: Fix for control endpoint handling in the DWC OTG driver. The data stage processing is only allowed after the setup complete event has been received. Else a race may occur and the OUT data can be corrupted. While at it ensure resetting a FIFO has the required wait loop. MFC after: 3 days Modified: head/sys/dev/usb/controller/dwc_otg.c Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Tue Jun 2 17:11:47 2015 (r283921) +++ head/sys/dev/usb/controller/dwc_otg.c Tue Jun 2 17:40:52 2015 (r283922) @@ -180,6 +180,22 @@ dwc_otg_get_hw_ep_profile(struct usb_dev *ppf = NULL; } +static void +dwc_otg_tx_fifo_reset(struct dwc_otg_softc *sc, uint32_t value) +{ + uint32_t temp; + + /* reset FIFO */ + DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, value); + + /* wait for reset to complete */ + for (temp = 0; temp != 16; temp++) { + value = DWC_OTG_READ_4(sc, DOTG_GRSTCTL); + if (!(value & (GRSTCTL_TXFFLSH | GRSTCTL_RXFFLSH))) + break; + } +} + static int dwc_otg_init_fifo(struct dwc_otg_softc *sc, uint8_t mode) { @@ -331,12 +347,11 @@ dwc_otg_init_fifo(struct dwc_otg_softc * } /* reset RX FIFO */ - DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, - GRSTCTL_RXFFLSH); + dwc_otg_tx_fifo_reset(sc, GRSTCTL_RXFFLSH); if (mode != DWC_MODE_OTG) { /* reset all TX FIFOs */ - DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, + dwc_otg_tx_fifo_reset(sc, GRSTCTL_TXFIFO(0x10) | GRSTCTL_TXFFLSH); } else { @@ -947,15 +962,21 @@ dwc_otg_setup_rx(struct dwc_otg_softc *s if (GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) != 0) goto not_complete; - if ((sc->sc_last_rx_status & GRXSTSRD_DPID_MASK) != - GRXSTSRD_DPID_DATA0) { + if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) != + GRXSTSRD_STP_DATA) { + if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) != + GRXSTSRD_STP_COMPLETE || td->remainder != 0) { + /* release FIFO */ + dwc_otg_common_rx_ack(sc); + goto not_complete; + } /* release FIFO */ dwc_otg_common_rx_ack(sc); - goto not_complete; + return (0); /* complete */ } - if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) != - GRXSTSRD_STP_DATA) { + if ((sc->sc_last_rx_status & GRXSTSRD_DPID_MASK) != + GRXSTSRD_DPID_DATA0) { /* release FIFO */ dwc_otg_common_rx_ack(sc); goto not_complete; @@ -969,14 +990,6 @@ dwc_otg_setup_rx(struct dwc_otg_softc *s /* get the packet byte count */ count = GRXSTSRD_BCNT_GET(sc->sc_last_rx_status); - /* verify data length */ - if (count != td->remainder) { - DPRINTFN(0, "Invalid SETUP packet " - "length, %d bytes\n", count); - /* release FIFO */ - dwc_otg_common_rx_ack(sc); - goto not_complete; - } if (count != sizeof(req)) { DPRINTFN(0, "Unsupported SETUP packet " "length, %d bytes\n", count); @@ -1002,43 +1015,27 @@ dwc_otg_setup_rx(struct dwc_otg_softc *s } /* don't send any data by default */ - DWC_OTG_WRITE_4(sc, DOTG_DIEPTSIZ(0), - DXEPTSIZ_SET_NPKT(0) | - DXEPTSIZ_SET_NBYTES(0)); - - temp = sc->sc_in_ctl[0]; - - /* enable IN endpoint */ - DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(0), - temp | DIEPCTL_EPENA); - DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(0), - temp | DIEPCTL_SNAK); + DWC_OTG_WRITE_4(sc, DOTG_DIEPTSIZ(0), DIEPCTL_EPDIS); + DWC_OTG_WRITE_4(sc, DOTG_DOEPTSIZ(0), DOEPCTL_EPDIS); /* reset IN endpoint buffer */ - DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, + dwc_otg_tx_fifo_reset(sc, GRSTCTL_TXFIFO(0) | GRSTCTL_TXFFLSH); /* acknowledge RX status */ dwc_otg_common_rx_ack(sc); - return (0); /* complete */ + td->did_stall = 1; not_complete: /* abort any ongoing transfer, before enabling again */ - - temp = sc->sc_out_ctl[0]; - - temp |= DOEPCTL_EPENA | - DOEPCTL_SNAK; - - /* enable OUT endpoint */ - DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(0), temp); - if (!td->did_stall) { td->did_stall = 1; DPRINTFN(5, "stalling IN and OUT direction\n"); + temp = sc->sc_out_ctl[0]; + /* set stall after enabling endpoint */ DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(0), temp | DOEPCTL_STALL); @@ -1049,13 +1046,6 @@ not_complete: DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(0), temp | DIEPCTL_STALL); } - - /* setup number of buffers to receive */ - DWC_OTG_WRITE_4(sc, DOTG_DOEPTSIZ(0), - DXEPTSIZ_SET_MULTI(3) | - DXEPTSIZ_SET_NPKT(1) | - DXEPTSIZ_SET_NBYTES(sizeof(req))); - return (1); /* not complete */ } @@ -1499,7 +1489,9 @@ dwc_otg_data_rx(struct dwc_otg_softc *sc /* check for SETUP packet */ if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) == - GRXSTSRD_STP_DATA) { + GRXSTSRD_STP_DATA || + (sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) == + GRXSTSRD_STP_COMPLETE) { if (td->remainder == 0) { /* * We are actually complete and have @@ -1584,15 +1576,10 @@ dwc_otg_data_rx(struct dwc_otg_softc *sc not_complete: - temp = sc->sc_out_ctl[td->ep_no]; - - temp |= DOEPCTL_EPENA | DOEPCTL_CNAK; - - DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(td->ep_no), temp); - /* enable SETUP and transfer complete interrupt */ if (td->ep_no == 0) { DWC_OTG_WRITE_4(sc, DOTG_DOEPTSIZ(0), + DXEPTSIZ_SET_MULTI(3) | DXEPTSIZ_SET_NPKT(1) | DXEPTSIZ_SET_NBYTES(td->max_packet_size)); } else { @@ -1601,8 +1588,12 @@ not_complete: DXEPTSIZ_SET_MULTI(1) | DXEPTSIZ_SET_NPKT(4) | DXEPTSIZ_SET_NBYTES(4 * - ((td->max_packet_size + 3) & ~3))); + ((td->max_packet_size + 3) & ~3))); } + temp = sc->sc_out_ctl[td->ep_no]; + DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(td->ep_no), temp | + DOEPCTL_EPENA | DOEPCTL_CNAK); + return (1); /* not complete */ } @@ -2004,7 +1995,9 @@ repeat: (GRXSTSRD_CHNUM_GET(temp) == 0)) { if ((temp & GRXSTSRD_PKTSTS_MASK) != - GRXSTSRD_STP_DATA) { + GRXSTSRD_STP_DATA && + (temp & GRXSTSRD_PKTSTS_MASK) != + GRXSTSRD_STP_COMPLETE) { /* dump data - wrong direction */ dwc_otg_common_rx_ack(sc); @@ -2209,7 +2202,9 @@ not_complete: (GRXSTSRD_CHNUM_GET(temp) == 0)) { if ((temp & GRXSTSRD_PKTSTS_MASK) == - GRXSTSRD_STP_DATA) { + GRXSTSRD_STP_DATA || + (temp & GRXSTSRD_PKTSTS_MASK) == + GRXSTSRD_STP_COMPLETE) { DPRINTFN(5, "faking complete\n"); /* * Race condition: We are complete! @@ -2634,6 +2629,7 @@ repeat: /* non-data messages we simply skip */ if (temp != GRXSTSRD_STP_DATA && + temp != GRXSTSRD_STP_COMPLETE && temp != GRXSTSRD_OUT_DATA) { dwc_otg_common_rx_ack(sc); goto repeat; @@ -3669,7 +3665,7 @@ dwc_otg_clear_stall_sub_locked(struct dw /* we only reset the transmit FIFO */ if (ep_dir) { - DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, + dwc_otg_tx_fifo_reset(sc, GRSTCTL_TXFIFO(ep_no) | GRSTCTL_TXFFLSH); From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 18:28:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD661732; Tue, 2 Jun 2015 18:28:42 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9A33917CA; Tue, 2 Jun 2015 18:28:42 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t52ISgtg069460; Tue, 2 Jun 2015 18:28:42 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t52ISgFJ069457; Tue, 2 Jun 2015 18:28:42 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201506021828.t52ISgFJ069457@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 2 Jun 2015 18:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283923 - 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: Tue, 02 Jun 2015 18:28:42 -0000 Author: sbruno Date: Tue Jun 2 18:28:41 2015 New Revision: 283923 URL: https://svnweb.freebsd.org/changeset/base/283923 Log: Simplify hang detection by stealing the techniques used in ixl(4) and applying them to em(4). Rely on iterations through the local timer, and the tx queue state to determine if an actual hang has occurred. Any time a descriptor is used (packet sent), the tx queue is flagged as busy. Then when txeof runs, it either clears the flag when all is clean, or resets it to 1 if ANY are cleaned, if nothing is cleaned it increments the flag. Local timer simply checks to see if busy ever reaches MAX (10, which is compile time configurable), and then sets it as HUNG, at that point there is one more timer cycle in which to have any cleans, if not a watchdog reset will occur. Differential Revision: https://reviews.freebsd.org/D2019 Submitted by: jfv Reviewed by: hiren Obtained from: Intel Corporation MFC after: 2 weeks Relnotes: Yes Sponsored by: Limelight Networks Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue Jun 2 17:40:52 2015 (r283922) +++ head/sys/dev/e1000/if_em.c Tue Jun 2 18:28:41 2015 (r283923) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -943,11 +943,9 @@ em_mq_start_locked(if_t ifp, struct tx_r break; } - if (enq > 0) { - /* Set the watchdog */ - txr->queue_status = EM_QUEUE_WORKING; - txr->watchdog_time = ticks; - } + /* Mark the queue as having work */ + if ((enq > 0) && (txr->busy == EM_TX_IDLE)) + txr->busy = EM_TX_BUSY; if (txr->tx_avail < EM_MAX_SCATTER) em_txeof(txr); @@ -1032,12 +1030,12 @@ em_start_locked(if_t ifp, struct tx_ring break; } + /* Mark the queue as having work */ + if (txr->busy == EM_TX_IDLE) + txr->busy = EM_TX_BUSY; + /* Send a copy of the frame to the BPF listener */ if_etherbpfmtap(ifp, m_head); - - /* Set timeout in case hardware has problems transmitting. */ - txr->watchdog_time = ticks; - txr->queue_status = EM_QUEUE_WORKING; } return; @@ -2102,8 +2100,6 @@ retry: */ tx_buffer = &txr->tx_buffers[first]; tx_buffer->next_eop = last; - /* Update the watchdog time early and often */ - txr->watchdog_time = ticks; /* * Advance the Transmit Descriptor Tail (TDT), this tells the E1000 @@ -2247,15 +2243,16 @@ em_local_timer(void *arg) ** and the HUNG state will be static if set. */ for (int i = 0; i < adapter->num_queues; i++, txr++) { - if ((txr->queue_status == EM_QUEUE_HUNG) && - (adapter->pause_frames == 0)) + /* Last cycle a queue was declared hung */ + if (txr->busy == EM_TX_HUNG) goto hung; + if (txr->busy >= EM_TX_MAXTRIES) + txr->busy = EM_TX_HUNG; /* Schedule a TX tasklet if needed */ if (txr->tx_avail <= EM_MAX_SCATTER) taskqueue_enqueue(txr->tq, &txr->tx_task); } - adapter->pause_frames = 0; callout_reset(&adapter->timer, hz, em_local_timer, adapter); #ifndef DEVICE_POLLING /* Trigger an RX interrupt to guarantee mbuf refresh */ @@ -2274,7 +2271,6 @@ hung: txr->me, txr->tx_avail, txr->next_to_clean); if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); adapter->watchdog_events++; - adapter->pause_frames = 0; em_init_locked(adapter); } @@ -2343,9 +2339,9 @@ em_update_link_status(struct adapter *ad if (bootverbose) device_printf(dev, "Link is Down\n"); adapter->link_active = 0; - /* Link down, disable watchdog */ + /* Link down, disable hang detection */ for (int i = 0; i < adapter->num_queues; i++, txr++) - txr->queue_status = EM_QUEUE_IDLE; + txr->busy = EM_TX_IDLE; if_link_state_change(ifp, LINK_STATE_DOWN); } } @@ -2376,10 +2372,10 @@ em_stop(void *arg) /* Tell the stack that the interface is no longer active */ if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); - /* Unarm watchdog timer. */ + /* Disarm Hang Detection. */ for (int i = 0; i < adapter->num_queues; i++, txr++) { EM_TX_LOCK(txr); - txr->queue_status = EM_QUEUE_IDLE; + txr->busy = EM_TX_IDLE; EM_TX_UNLOCK(txr); } @@ -3358,7 +3354,7 @@ em_setup_transmit_ring(struct tx_ring *t /* Set number of descriptors available */ txr->tx_avail = adapter->num_tx_desc; - txr->queue_status = EM_QUEUE_IDLE; + txr->busy = EM_TX_IDLE; /* Clear checksum offload context. */ txr->last_hw_offload = 0; @@ -3419,7 +3415,7 @@ em_initialize_transmit_unit(struct adapt E1000_READ_REG(&adapter->hw, E1000_TDBAL(i)), E1000_READ_REG(&adapter->hw, E1000_TDLEN(i))); - txr->queue_status = EM_QUEUE_IDLE; + txr->busy = EM_TX_IDLE; } /* Set the default values for the Tx Inter Packet Gap timer */ @@ -3802,9 +3798,9 @@ em_txeof(struct tx_ring *txr) return; #endif /* DEV_NETMAP */ - /* No work, make sure watchdog is off */ + /* No work, make sure hang detection is disabled */ if (txr->tx_avail == adapter->num_tx_desc) { - txr->queue_status = EM_QUEUE_IDLE; + txr->busy = EM_TX_IDLE; return; } @@ -3847,7 +3843,6 @@ em_txeof(struct tx_ring *txr) tx_buffer->m_head = NULL; } tx_buffer->next_eop = -1; - txr->watchdog_time = ticks; if (++first == adapter->num_tx_desc) first = 0; @@ -3872,14 +3867,16 @@ em_txeof(struct tx_ring *txr) txr->next_to_clean = first; /* - ** Watchdog calculation, we know there's - ** work outstanding or the first return - ** would have been taken, so none processed - ** for too long indicates a hang. local timer - ** will examine this and do a reset if needed. + ** Hang detection: we know there's work outstanding + ** or the entry return would have been taken, so no + ** descriptor processed here indicates a potential hang. + ** The local timer will examine this and do a reset if needed. */ - if ((!processed) && ((ticks - txr->watchdog_time) > EM_WATCHDOG)) - txr->queue_status = EM_QUEUE_HUNG; + if (processed == 0) { + if (txr->busy != EM_TX_HUNG) + ++txr->busy; + } else /* At least one descriptor was cleaned */ + txr->busy = EM_TX_BUSY; /* note this clears HUNG */ /* * If we have a minimum free, clear IFF_DRV_OACTIVE @@ -3891,10 +3888,9 @@ em_txeof(struct tx_ring *txr) if (txr->tx_avail >= EM_MAX_SCATTER) if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); - /* Disable watchdog if all clean */ - if (txr->tx_avail == adapter->num_tx_desc) { - txr->queue_status = EM_QUEUE_IDLE; - } + /* Disable hang detection if all clean */ + if (txr->tx_avail == adapter->num_tx_desc) + txr->busy = EM_TX_IDLE; } @@ -5130,12 +5126,7 @@ em_update_stats_counters(struct adapter adapter->stats.rlec += E1000_READ_REG(&adapter->hw, E1000_RLEC); adapter->stats.xonrxc += E1000_READ_REG(&adapter->hw, E1000_XONRXC); adapter->stats.xontxc += E1000_READ_REG(&adapter->hw, E1000_XONTXC); - /* - ** For watchdog management we need to know if we have been - ** paused during the last interval, so capture that here. - */ - adapter->pause_frames = E1000_READ_REG(&adapter->hw, E1000_XOFFRXC); - adapter->stats.xoffrxc += adapter->pause_frames; + adapter->stats.xoffrxc += E1000_READ_REG(&adapter->hw, E1000_XOFFRXC); adapter->stats.xofftxc += E1000_READ_REG(&adapter->hw, E1000_XOFFTXC); adapter->stats.fcruc += E1000_READ_REG(&adapter->hw, E1000_FCRUC); adapter->stats.prc64 += E1000_READ_REG(&adapter->hw, E1000_PRC64); @@ -5762,7 +5753,7 @@ em_print_debug_info(struct adapter *adap device_printf(dev, "hw rdh = %d, hw rdt = %d\n", E1000_READ_REG(&adapter->hw, E1000_RDH(0)), E1000_READ_REG(&adapter->hw, E1000_RDT(0))); - device_printf(dev, "Tx Queue Status = %d\n", txr->queue_status); + device_printf(dev, "Tx Queue Status = %d\n", txr->busy); device_printf(dev, "TX descriptors avail = %d\n", txr->tx_avail); device_printf(dev, "Tx Descriptors avail failure = %ld\n", Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Tue Jun 2 17:40:52 2015 (r283922) +++ head/sys/dev/e1000/if_em.h Tue Jun 2 18:28:41 2015 (r283923) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -188,9 +188,19 @@ #define EM_EEPROM_APME 0x400; #define EM_82544_APME 0x0004; -#define EM_QUEUE_IDLE 0 -#define EM_QUEUE_WORKING 1 -#define EM_QUEUE_HUNG 2 +/* + * Driver state logic for the detection of a hung state + * in hardware. Set TX_HUNG whenever a TX packet is used + * (data is sent) and clear it when txeof() is invoked if + * any descriptors from the ring are cleaned/reclaimed. + * Increment internal counter if no descriptors are cleaned + * and compare to TX_MAXTRIES. When counter > TX_MAXTRIES, + * reset adapter. + */ +#define EM_TX_IDLE 0x00000000 +#define EM_TX_BUSY 0x00000001 +#define EM_TX_HUNG 0x80000000 +#define EM_TX_MAXTRIES 10 /* * TDBA/RDBA should be aligned on 16 byte boundary. But TDLEN/RDLEN should be @@ -281,8 +291,7 @@ struct tx_ring { u32 me; u32 msix; u32 ims; - int queue_status; - int watchdog_time; + int busy; struct em_dma_alloc txdma; struct e1000_tx_desc *tx_base; struct task tx_task; @@ -368,7 +377,6 @@ struct adapter { int if_flags; int max_frame_size; int min_frame_size; - int pause_frames; struct mtx core_mtx; int em_insert_vlan_header; u32 ims; From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 18:37:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFD449E0; Tue, 2 Jun 2015 18:37:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CC64C1A00; Tue, 2 Jun 2015 18:37:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t52Ib6Kg074330; Tue, 2 Jun 2015 18:37:06 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t52Ib4UN074318; Tue, 2 Jun 2015 18:37:04 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201506021837.t52Ib4UN074318@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 2 Jun 2015 18:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283924 - in head/sys: compat/linprocfs dev/hwpmc fs/procfs kern 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: Tue, 02 Jun 2015 18:37:07 -0000 Author: vangyzen Date: Tue Jun 2 18:37:04 2015 New Revision: 283924 URL: https://svnweb.freebsd.org/changeset/base/283924 Log: Provide vnode in memory map info for files on tmpfs When providing memory map information to userland, populate the vnode pointer for tmpfs files. Set the memory mapping to appear as a vnode type, to match FreeBSD 9 behavior. This fixes the use of tmpfs files with the dtrace pid provider, procstat -v, procfs, linprocfs, pmc (pmcstat), and ptrace (PT_VM_ENTRY). Submitted by: Eric Badger (initial revision) Obtained from: Dell Inc. PR: 198431 MFC after: 2 weeks Reviewed by: jhb Approved by: kib (mentor) Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/fs/procfs/procfs_map.c head/sys/kern/kern_proc.c head/sys/kern/sys_process.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Tue Jun 2 18:28:41 2015 (r283923) +++ head/sys/compat/linprocfs/linprocfs.c Tue Jun 2 18:37:04 2015 (r283924) @@ -1025,20 +1025,16 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) ino = 0; if (lobj) { off = IDX_TO_OFF(lobj->size); - if (lobj->type == OBJT_VNODE) { - vp = lobj->handle; - if (vp) - vref(vp); - } - else - vp = NULL; + vp = vm_object_vnode(lobj); + if (vp != NULL) + vref(vp); if (lobj != obj) VM_OBJECT_RUNLOCK(lobj); flags = obj->flags; ref_count = obj->ref_count; shadow_count = obj->shadow_count; VM_OBJECT_RUNLOCK(obj); - if (vp) { + if (vp != NULL) { vn_fullpath(td, vp, &name, &freename); vn_lock(vp, LK_SHARED | LK_RETRY); VOP_GETATTR(vp, &vat, td->td_ucred); Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Jun 2 18:28:41 2015 (r283923) +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Jun 2 18:37:04 2015 (r283924) @@ -1655,7 +1655,8 @@ pmc_log_process_mappings(struct pmc_owne continue; } - if (lobj->type != OBJT_VNODE || lobj->handle == NULL) { + vp = vm_object_vnode(lobj); + if (vp == NULL) { if (lobj != obj) VM_OBJECT_RUNLOCK(lobj); VM_OBJECT_RUNLOCK(obj); @@ -1667,7 +1668,7 @@ pmc_log_process_mappings(struct pmc_owne * vnode, so we don't emit redundant MAP-IN * directives. */ - if (entry->start == last_end && lobj->handle == last_vp) { + if (entry->start == last_end && vp == last_vp) { last_end = entry->end; if (lobj != obj) VM_OBJECT_RUNLOCK(lobj); @@ -1690,7 +1691,6 @@ pmc_log_process_mappings(struct pmc_owne last_timestamp = map->timestamp; vm_map_unlock_read(map); - vp = lobj->handle; vref(vp); if (lobj != obj) VM_OBJECT_RUNLOCK(lobj); Modified: head/sys/fs/procfs/procfs_map.c ============================================================================== --- head/sys/fs/procfs/procfs_map.c Tue Jun 2 18:28:41 2015 (r283923) +++ head/sys/fs/procfs/procfs_map.c Tue Jun 2 18:37:04 2015 (r283924) @@ -159,11 +159,11 @@ procfs_doprocmap(PFS_FILL_ARGS) freepath = NULL; fullpath = "-"; if (lobj) { + vp = NULL; switch (lobj->type) { default: case OBJT_DEFAULT: type = "default"; - vp = NULL; break; case OBJT_VNODE: type = "vnode"; @@ -171,13 +171,19 @@ procfs_doprocmap(PFS_FILL_ARGS) vref(vp); break; case OBJT_SWAP: - type = "swap"; - vp = NULL; + if ((lobj->flags & OBJ_TMPFS_NODE) != 0) { + type = "vnode"; + if ((lobj->flags & OBJ_TMPFS) != 0) { + vp = lobj->un_pager.swp.swp_tmpfs; + vref(vp); + } + } else { + type = "swap"; + } break; case OBJT_SG: case OBJT_DEVICE: type = "device"; - vp = NULL; break; } if (lobj != obj) Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Tue Jun 2 18:28:41 2015 (r283923) +++ head/sys/kern/kern_proc.c Tue Jun 2 18:37:04 2015 (r283924) @@ -2113,7 +2113,15 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A vref(vp); break; case OBJT_SWAP: - kve->kve_type = KVME_TYPE_SWAP; + if ((lobj->flags & OBJ_TMPFS_NODE) != 0) { + kve->kve_type = KVME_TYPE_VNODE; + if ((lobj->flags & OBJ_TMPFS) != 0) { + vp = lobj->un_pager.swp.swp_tmpfs; + vref(vp); + } + } else { + kve->kve_type = KVME_TYPE_SWAP; + } break; case OBJT_DEVICE: kve->kve_type = KVME_TYPE_DEVICE; @@ -2339,7 +2347,15 @@ kern_proc_vmmap_out(struct proc *p, stru vref(vp); break; case OBJT_SWAP: - kve->kve_type = KVME_TYPE_SWAP; + if ((lobj->flags & OBJ_TMPFS_NODE) != 0) { + kve->kve_type = KVME_TYPE_VNODE; + if ((lobj->flags & OBJ_TMPFS) != 0) { + vp = lobj->un_pager.swp.swp_tmpfs; + vref(vp); + } + } else { + kve->kve_type = KVME_TYPE_SWAP; + } break; case OBJT_DEVICE: kve->kve_type = KVME_TYPE_DEVICE; Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Tue Jun 2 18:28:41 2015 (r283923) +++ head/sys/kern/sys_process.c Tue Jun 2 18:37:04 2015 (r283924) @@ -402,7 +402,7 @@ ptrace_vm_entry(struct thread *td, struc lobj = tobj; pve->pve_offset += tobj->backing_object_offset; } - vp = (lobj->type == OBJT_VNODE) ? lobj->handle : NULL; + vp = vm_object_vnode(lobj); if (vp != NULL) vref(vp); if (lobj != obj) Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Jun 2 18:28:41 2015 (r283923) +++ head/sys/vm/vm_object.c Tue Jun 2 18:37:04 2015 (r283924) @@ -2287,6 +2287,18 @@ next_page: } } +struct vnode * +vm_object_vnode(vm_object_t object) +{ + + VM_OBJECT_ASSERT_LOCKED(object); + if (object->type == OBJT_VNODE) + return (object->handle); + if (object->type == OBJT_SWAP && (object->flags & OBJ_TMPFS) != 0) + return (object->un_pager.swp.swp_tmpfs); + return (NULL); +} + static int sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) { Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Tue Jun 2 18:28:41 2015 (r283923) +++ head/sys/vm/vm_object.h Tue Jun 2 18:37:04 2015 (r283924) @@ -322,6 +322,7 @@ boolean_t vm_object_sync(vm_object_t, vm boolean_t); void vm_object_unwire(vm_object_t object, vm_ooffset_t offset, vm_size_t length, uint8_t queue); +struct vnode *vm_object_vnode(vm_object_t object); #endif /* _KERNEL */ #endif /* _VM_OBJECT_ */ From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 19:05:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EF038C6; Tue, 2 Jun 2015 19:05:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2CF1410E2; Tue, 2 Jun 2015 19:05:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t52J53Wk090314; Tue, 2 Jun 2015 19:05:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t52J53kV090313; Tue, 2 Jun 2015 19:05:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201506021905.t52J53kV090313@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 2 Jun 2015 19:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283925 - 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: Tue, 02 Jun 2015 19:05:03 -0000 Author: bdrewery Date: Tue Jun 2 19:05:02 2015 New Revision: 283925 URL: https://svnweb.freebsd.org/changeset/base/283925 Log: Similar to r280178, don't hide command for building static library. Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue Jun 2 18:37:04 2015 (r283924) +++ head/share/mk/bsd.lib.mk Tue Jun 2 19:05:02 2015 (r283925) @@ -169,7 +169,7 @@ _LIBS= lib${LIB_PRIVATE}${LIB}.a lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS} @${ECHO} building static ${LIB} library @rm -f ${.TARGET} - @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} + ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif @@ -183,7 +183,7 @@ NOPATH_FILES+= ${POBJS} lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} @${ECHO} building profiled ${LIB} library @rm -f ${.TARGET} - @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD} + ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD} ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif @@ -240,7 +240,7 @@ _LIBS+= lib${LIB_PRIVATE}${LIB}_pic.a lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} @${ECHO} building special pic ${LIB} library @rm -f ${.TARGET} - @${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD} + ${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD} ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 20:53:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79AD9D52; Tue, 2 Jun 2015 20:53:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 687C91C07; Tue, 2 Jun 2015 20:53:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t52KrICV046681; Tue, 2 Jun 2015 20:53:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t52KrIuk046680; Tue, 2 Jun 2015 20:53:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201506022053.t52KrIuk046680@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 2 Jun 2015 20:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283929 - head/games/grdc 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, 02 Jun 2015 20:53:18 -0000 Author: emaste Date: Tue Jun 2 20:53:17 2015 New Revision: 283929 URL: https://svnweb.freebsd.org/changeset/base/283929 Log: Correct grdc(1) 12-hour display between 12:00 and 13:00 PM starts at 12:00, not 13:00. PR: 194291, 200133 Submitted by: Nick Price MFC after: 1 week Modified: head/games/grdc/grdc.c Modified: head/games/grdc/grdc.c ============================================================================== --- head/games/grdc/grdc.c Tue Jun 2 20:29:58 2015 (r283928) +++ head/games/grdc/grdc.c Tue Jun 2 20:53:17 2015 (r283929) @@ -150,14 +150,14 @@ main(int argc, char *argv[]) set(tm->tm_min/10, 14); if (t12) { - if (tm->tm_hour > 12) { - tm->tm_hour -= 12; - mvaddstr(YBASE + 5, XBASE + 52, "PM"); - } else { + if (tm->tm_hour < 12) { if (tm->tm_hour == 0) tm->tm_hour = 12; - mvaddstr(YBASE + 5, XBASE + 52, "AM"); + } else { + if (tm->tm_hour > 12) + tm->tm_hour -= 12; + mvaddstr(YBASE + 5, XBASE + 52, "PM"); } } From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 22:23:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B31E7435; Tue, 2 Jun 2015 22:23:21 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A1CB0111D; Tue, 2 Jun 2015 22:23:21 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t52MNL5x094103; Tue, 2 Jun 2015 22:23:21 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t52MNLbp094102; Tue, 2 Jun 2015 22:23:21 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201506022223.t52MNLbp094102@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 2 Jun 2015 22:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283933 - head/sys/boot/forth 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, 02 Jun 2015 22:23:21 -0000 Author: dteske Date: Tue Jun 2 22:23:20 2015 New Revision: 283933 URL: https://svnweb.freebsd.org/changeset/base/283933 Log: Add comments to indicate where the flag for later abort" originates. MFC after: 3 days X-MFC-to: stable/10 Modified: head/sys/boot/forth/support.4th Modified: head/sys/boot/forth/support.4th ============================================================================== --- head/sys/boot/forth/support.4th Tue Jun 2 22:05:33 2015 (r283932) +++ head/sys/boot/forth/support.4th Tue Jun 2 22:23:20 2015 (r283933) @@ -1437,12 +1437,12 @@ also builtins abort" Unable to load a kernel!" ; -: load_xen ( -- ) +: load_xen ( -- flag ) s" xen_kernel" getenv dup -1 <> if - 1 1 load + 1 1 load ( c-addr/u flag N -- flag ) else drop - 0 + 0 ( -1 -- flag ) then ; From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 22:39:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C79874D; Tue, 2 Jun 2015 22:39:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0B0FF13CC; Tue, 2 Jun 2015 22:39:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t52MdG7l000268; Tue, 2 Jun 2015 22:39:16 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t52MdGPQ000267; Tue, 2 Jun 2015 22:39:16 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201506022239.t52MdGPQ000267@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 2 Jun 2015 22:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283934 - head/sys/dev/iwi 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, 02 Jun 2015 22:39:17 -0000 Author: glebius Date: Tue Jun 2 22:39:16 2015 New Revision: 283934 URL: https://svnweb.freebsd.org/changeset/base/283934 Log: The argument passed to the iwi_update_wme() is softc, not ieee80211com. This fatal mismatch appeared to be absolutely harmless, since both structs have pointer to struct ifnet as their first member, and they both point to the same ifnet. And the first member is the only one used from the argument. Modified: head/sys/dev/iwi/if_iwi.c Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Tue Jun 2 22:23:20 2015 (r283933) +++ head/sys/dev/iwi/if_iwi.c Tue Jun 2 22:39:16 2015 (r283934) @@ -1083,8 +1083,7 @@ iwi_wme_setparams(struct iwi_softc *sc, static void iwi_update_wme(void *arg, int npending) { - struct ieee80211com *ic = arg; - struct iwi_softc *sc = ic->ic_ifp->if_softc; + struct iwi_softc *sc = arg; IWI_LOCK_DECL; IWI_LOCK(sc); From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 22:45:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18AE69A9; Tue, 2 Jun 2015 22:45:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E260B165E; Tue, 2 Jun 2015 22:45:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t52MjSwu004855; Tue, 2 Jun 2015 22:45:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t52MjSWx004854; Tue, 2 Jun 2015 22:45:28 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201506022245.t52MjSWx004854@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 2 Jun 2015 22:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283935 - head/sys/dev/iwi 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, 02 Jun 2015 22:45:29 -0000 Author: glebius Date: Tue Jun 2 22:45:28 2015 New Revision: 283935 URL: https://svnweb.freebsd.org/changeset/base/283935 Log: Make the last revision compilable. Remove extra argument from iwi_wme_setparams(), a softc has 1 to 1 accordance with ieee80211com. Modified: head/sys/dev/iwi/if_iwi.c Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Tue Jun 2 22:39:16 2015 (r283934) +++ head/sys/dev/iwi/if_iwi.c Tue Jun 2 22:45:28 2015 (r283935) @@ -154,7 +154,7 @@ static void iwi_node_free(struct ieee802 static void iwi_media_status(struct ifnet *, struct ifmediareq *); static int iwi_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void iwi_wme_init(struct iwi_softc *); -static int iwi_wme_setparams(struct iwi_softc *, struct ieee80211com *); +static int iwi_wme_setparams(struct iwi_softc *); static void iwi_update_wme(void *, int); static int iwi_wme_update(struct ieee80211com *); static uint16_t iwi_read_prom_word(struct iwi_softc *, uint8_t); @@ -1059,8 +1059,9 @@ iwi_wme_init(struct iwi_softc *sc) } static int -iwi_wme_setparams(struct iwi_softc *sc, struct ieee80211com *ic) +iwi_wme_setparams(struct iwi_softc *sc) { + struct ieee80211com *ic = sc->sc_ifp->if_l2com; const struct wmeParams *wmep; int ac; @@ -1087,7 +1088,7 @@ iwi_update_wme(void *arg, int npending) IWI_LOCK_DECL; IWI_LOCK(sc); - (void) iwi_wme_setparams(sc, ic); + (void) iwi_wme_setparams(sc); IWI_UNLOCK(sc); } @@ -2946,7 +2947,7 @@ iwi_auth_and_assoc(struct iwi_softc *sc, if ((vap->iv_flags & IEEE80211_F_WME) && ni->ni_ies.wme_ie != NULL) { /* NB: don't treat WME setup as failure */ - if (iwi_wme_setparams(sc, ic) == 0 && iwi_wme_setie(sc) == 0) + if (iwi_wme_setparams(sc) == 0 && iwi_wme_setie(sc) == 0) assoc->policy |= htole16(IWI_POLICY_WME); /* XXX complain on failure? */ } From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 23:11:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDF1444A; Tue, 2 Jun 2015 23:11:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BD0D51CCA; Tue, 2 Jun 2015 23:11:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t52NBDBr017119; Tue, 2 Jun 2015 23:11:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t52NBDNm017118; Tue, 2 Jun 2015 23:11:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201506022311.t52NBDNm017118@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 2 Jun 2015 23:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283936 - head/sys/dev/ahci 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, 02 Jun 2015 23:11:13 -0000 Author: mav Date: Tue Jun 2 23:11:12 2015 New Revision: 283936 URL: https://svnweb.freebsd.org/changeset/base/283936 Log: Restore AHCI quirks printing as base16. smh@ at r278034 made it base17, that is somewhat odd. :) MFC after: 3 days Modified: head/sys/dev/ahci/ahci.h Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Tue Jun 2 22:45:28 2015 (r283935) +++ head/sys/dev/ahci/ahci.h Tue Jun 2 23:11:12 2015 (r283936) @@ -578,7 +578,7 @@ enum ahci_err_type { #define AHCI_Q_RESTORE_CAP 0x00080000 #define AHCI_Q_BIT_STRING \ - "\021" \ + "\020" \ "\001NOFORCE" \ "\002NOPMP" \ "\003NONCQ" \ From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 06:02:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23ED6E33; Wed, 3 Jun 2015 06:02:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 135511B2B; Wed, 3 Jun 2015 06:02:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5362nWg028194; Wed, 3 Jun 2015 06:02:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5362n3r028193; Wed, 3 Jun 2015 06:02:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506030602.t5362n3r028193@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 3 Jun 2015 06:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283938 - 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: Wed, 03 Jun 2015 06:02:50 -0000 Author: bapt Date: Wed Jun 3 06:02:49 2015 New Revision: 283938 URL: https://svnweb.freebsd.org/changeset/base/283938 Log: mandoc's makewhatis requires gnuzip to be in the path when deadling with with compressed manpages. This should fix spam during installworld: "exec: No such file or directory" Reported by: many Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jun 3 02:50:58 2015 (r283937) +++ head/Makefile.inc1 Wed Jun 3 06:02:49 2015 (r283938) @@ -1366,7 +1366,8 @@ _kerberos5_bootstrap_tools= \ .if ${MK_MANDOCDB} != "no" _libohash?= lib/libohash _makewhatis= lib/libsqlite3 \ - usr.bin/mandoc + usr.bin/mandoc \ + usr.bin/gzip ${_bt}-usr.bin/mandoc: ${_bt}-lib/libohash ${_bt}-lib/libsqlite3 .else _makewhatis=usr.bin/makewhatis From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 06:39:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC51C332; Wed, 3 Jun 2015 06:39:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 6EACC11F0; Wed, 3 Jun 2015 06:39:45 +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 mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 7546542811F; Wed, 3 Jun 2015 16:39:35 +1000 (AEST) Date: Wed, 3 Jun 2015 16:39:32 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Baptiste Daroussin cc: Bruce Evans , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r283842 - head/usr.sbin/pw In-Reply-To: <20150601180501.GA7523@ivaldir.etoilebsd.net> Message-ID: <20150603155545.E1331@besplex.bde.org> References: <201505312207.t4VM73Vh015383@svn.freebsd.org> <20150601143951.J863@besplex.bde.org> <20150601180501.GA7523@ivaldir.etoilebsd.net> 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=BoBgutj5 c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=0lsTka3QrQbgM_JBd40A:9 a=EoK6N0YADXpUK65B:21 a=a6pfpDM_nVtj1rF-: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, 03 Jun 2015 06:39:46 -0000 On Mon, 1 Jun 2015, Baptiste Daroussin wrote: > On Mon, Jun 01, 2015 at 03:36:58PM +1000, Bruce Evans wrote: >> On Sun, 31 May 2015, Baptiste Daroussin wrote: >> >>> Log: >>> Remove useless cast in printf and printf-like functions: >>> use %u for uid_t and gid_t >> >> The cast was not useless. It was to avoid the assumption that the default >> promotion of uid_t and gid_t is anything in particular. Now it is assumed >> that the default promotion is unsigned (int works too, but this is subtler). >> >> uids and gids are only guaranteed to have non-negative values. In >> POSIX before about 2001, uid_t and gid_t can be any type that can >> represent all the values taken on, so can be floating point. Floating >> point was rarely used for POSIX types, and most programs make too many >> assumptions about types, so POSIX now requires uid_t and gid_t to be >> integer types. Then can still be signed integer types IIRC. Nornally >> it is a bug to print signed integer types with unsigned integer formats, >> but since uids and gids are guaranteed to be non-negative both formats >> work. (pids require different handling since they are overloaded to >> hold process group ids as negative values, so pid_t is signed and %u >> format is very broken for printing general pids.) > > Well uid_t is defined as an unsigned int (__uint32_t actually) if it is ever > going to be changed to something else they at least it will now raise a warning. The definition is an implementation detail. Knowing this detail defeats the point of using typedefs. > I consider using %u here is less buggy than the previous casts. The casts were almost 100% correct (only had sign mismatches) when written in ~1996 before C99 added uintmax_t and broke unsigned long. Using %u don't even attempt to preserve the 1996 level of correctness/ carefulness. pw is badly written so I'm surprised that it was this careful. chpass from 4.4BSD at least uses strtoul() to parse uids and gids, although it has many of the usual errors in such use (first it blindly assigns the result of strtoul() to a uid_t. Then it has a bogus check for ids being (uid_t)ULONG_MAX. It is isn't clear if this is one of the usual errors in the use of strto*(), or just an obfuscated way of checking that the special id (uid_t)-1 is not input...) chpass int 4.4BSD was improved from chpass in Net/2 by switching from atoi() to strtoul(). Note that unless you further switch all these strto*()s to strtoumax(), ids larger than ULONG_MAX are just unsupported, so uid_t can't be larger than uint32_t on 32-bit arches, and all the casts to u_long remained 100% correct within this limit. This shows that C99's breakage of long is much more than for printing. All input methods that were careful enough to use strtol() or strtoul() to parse values represented by typedefed integer types are now broken unless they have been changed to use strtoimax or stroumax() (or more usually, because the types are still no larger than long or u_long). It will take a few more rounds of expansion before the larger types are common. On i386, u_long must remains 32 bits and use of 64 bits for any basic type will cause much the same bugs as use of it for off_t. On amd64, u_long must remain 64 bits and it will take use of __int128_t to break things. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 08:56:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05EAB8FE; Wed, 3 Jun 2015 08:56:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d: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 B67101337; Wed, 3 Jun 2015 08:56:00 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qkoo18 with SMTP id o18so1490692qko.1; Wed, 03 Jun 2015 01:56:00 -0700 (PDT) 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=XpYdcAQb/zTy86fj40GnXsKoU8uexsbIaWaAM3q5z1I=; b=KxUXvfRpRBPBvKUa8tH6ZCt+QL7nhDSCLXr627ZhOB2eH9Sy0LXAMO83doWwqiDY+2 yhJVvStwtywgRrW+ZWAwo6s7A/it+bFOflMatWIoDidrfWKDPNLmwPlI9IJbh0zk69LR t5TRN9QY97qoLqoxJ7lMMTD8J0cLeNhkibesM97DWy/hlB7pdP0xwVTIcbZzPgtKbuU0 OuilzaZEz57Uo7Wi8hZsVWGTk9ua0XZmd+FKVf9gX+Xz/BarMY/YR3msBbUb+omDAiNH VwNsvs69wW+3KLfNwiGfGHDZkwJU3QfwHTN7gesfN5nitRmfhaOypxEl4Mk0uSFm9jiH WzdA== MIME-Version: 1.0 X-Received: by 10.55.16.146 with SMTP id 18mr55570083qkq.39.1433321759918; Wed, 03 Jun 2015 01:55:59 -0700 (PDT) Received: by 10.140.98.73 with HTTP; Wed, 3 Jun 2015 01:55:59 -0700 (PDT) In-Reply-To: <201506030602.t5362n3r028193@svn.freebsd.org> References: <201506030602.t5362n3r028193@svn.freebsd.org> Date: Wed, 3 Jun 2015 01:55:59 -0700 Message-ID: Subject: Re: svn commit: r283938 - head From: NGie Cooper To: Baptiste Daroussin 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, 03 Jun 2015 08:56:01 -0000 On Tue, Jun 2, 2015 at 11:02 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Jun 3 06:02:49 2015 > New Revision: 283938 > URL: https://svnweb.freebsd.org/changeset/base/283938 > > Log: > mandoc's makewhatis requires gnuzip to be in the path when deadling with > with compressed manpages. > > This should fix spam during installworld: "exec: No such file or directory" > > Reported by: many This needs some liblegacy love... https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/229/console From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 09:01:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1BC5BFA; Wed, 3 Jun 2015 09:01:45 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::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 739F3158B; Wed, 3 Jun 2015 09:01:45 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wiga1 with SMTP id a1so6414194wig.0; Wed, 03 Jun 2015 02:01:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=FgIfhDyxMd4IEST3s0YRw2mOp0cYiIcOZ5o4667XVQI=; b=UNmkcdZIaEuM5wuLu6SeQNRv4tLQd+MG/azlft1dxSvxU2B9tt3Pzn0/rjWO2A1OoR yg6PST7QWiexPkxBrCL4CVj1OunGh3nKovVz7cDb2D0FUKmDPM556Tqv9yEQmIR7yUuk B4c3TJ8yYt9X0fWpQLd3K4YGRlIL/8G/br3WHlTLLeCKZ/yIjmvtouM6la+tMKe4E1PZ P7DR5dWp6Mbfzau+kmPntdxqIIuzYVH7gHcIfSYqreMV1f8Yg3KN1YJXaq0vr/czqeSO DajN0GzZbG4UCiiGfN2At3dcSt4F27rZcxAKa6y5X17/noxKEoSJNkUUqlh17gAXkGMj E9GQ== X-Received: by 10.194.178.201 with SMTP id da9mr49935369wjc.139.1433322103928; Wed, 03 Jun 2015 02:01:43 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id uc9sm60827wjc.7.2015.06.03.02.01.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2015 02:01:42 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 3 Jun 2015 11:01:40 +0200 From: Baptiste Daroussin To: NGie Cooper Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r283938 - head Message-ID: <20150603090139.GA32562@ivaldir.etoilebsd.net> References: <201506030602.t5362n3r028193@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2fHTh5uZTiUOsy+g" Content-Disposition: inline In-Reply-To: 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: Wed, 03 Jun 2015 09:01:45 -0000 --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 03, 2015 at 01:55:59AM -0700, NGie Cooper wrote: > On Tue, Jun 2, 2015 at 11:02 PM, Baptiste Daroussin wr= ote: > > Author: bapt > > Date: Wed Jun 3 06:02:49 2015 > > New Revision: 283938 > > URL: https://svnweb.freebsd.org/changeset/base/283938 > > > > Log: > > mandoc's makewhatis requires gnuzip to be in the path when deadling w= ith > > with compressed manpages. > > > > This should fix spam during installworld: "exec: No such file or dire= ctory" > > > > Reported by: many >=20 > This needs some liblegacy love... Yes I need to make that happen, but I won't be able to do anything before 2= 1h CEST Best regards, Bapt --2fHTh5uZTiUOsy+g Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlVuwnMACgkQ8kTtMUmk6ExUcACgijGjGd8Mf6hAO2IIJy9ZNuE2 ab8An0fxD3OOddm+Jzf0wnz4Ak9Dc6B5 =B9P5 -----END PGP SIGNATURE----- --2fHTh5uZTiUOsy+g-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 10:03:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 217AC64A; Wed, 3 Jun 2015 10:03:39 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::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 AF763143A; Wed, 3 Jun 2015 10:03:38 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by wifw1 with SMTP id w1so15462526wif.0; Wed, 03 Jun 2015 03:03:37 -0700 (PDT) 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=+R25y/hC/JZVTfM7GxaSsw9IKSZTnNaBm8GfaSZ35AA=; b=0tTBlklllTYaXbn1z40nEpncWqbN6kWzxd/MZjMWgIHJumIltVsFl8+bCiB8WQe2zB aekCTODmbXUTxGAz5KsWY4bTTt9n4BdYchr9Kahz3DB9G8kCmyOGLUPBd6PInJY6dDTO LQQv4ncMPCiFdL99vpp90jDXUWkGoCgZ9Gq0fKwD/fKTWfk1vhAp//kkKnkc+JuCOfLs XfbDpB6vBt9qElv7r00/NRqnlHpYuu5Uhe7sQyZ0NJyI4XNMQ1nWntf6m7zFRazV8nHa 1KS394DqPw4xgcAWd3VvU2gqrWpUYWldJu87G2V4M73ortYfz7skoQdySuWIhl14ADkP Z3xQ== MIME-Version: 1.0 X-Received: by 10.194.82.167 with SMTP id j7mr60389035wjy.123.1433325817115; Wed, 03 Jun 2015 03:03:37 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.27.100.214 with HTTP; Wed, 3 Jun 2015 03:03:37 -0700 (PDT) In-Reply-To: <201506030602.t5362n3r028193@svn.freebsd.org> References: <201506030602.t5362n3r028193@svn.freebsd.org> Date: Wed, 3 Jun 2015 13:03:37 +0300 X-Google-Sender-Auth: bbM5ysDMBpB8NJ72OoZsD2Ut5uk Message-ID: Subject: Re: svn commit: r283938 - head From: Sergey Kandaurov To: Baptiste Daroussin 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, 03 Jun 2015 10:03:39 -0000 On 3 June 2015 at 09:02, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Jun 3 06:02:49 2015 > New Revision: 283938 > URL: https://svnweb.freebsd.org/changeset/base/283938 > > Log: > mandoc's makewhatis requires gnuzip to be in the path when deadling with > with compressed manpages. > [pluknet@omg] man gnuzip No manual entry for gnuzip Looks like a typo in "gzip", which is the name for the compressing format as described in RFC 1952, and of the utility that implements it. The implementation that is included in base is BSD-licensed and has no relationship with GNU project. As from usr.bin/gzip/gzip.c * gzip.c -- GPL free gzip using zlib. -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 10:10:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F434851; Wed, 3 Jun 2015 10:10:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7C278147C; Wed, 3 Jun 2015 10:10:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53AA1te049061; Wed, 3 Jun 2015 10:10:01 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53AA1ch049060; Wed, 3 Jun 2015 10:10:01 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201506031010.t53AA1ch049060@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 3 Jun 2015 10:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283939 - head/sys/boot/userboot/userboot 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, 03 Jun 2015 10:10:01 -0000 Author: avg Date: Wed Jun 3 10:10:00 2015 New Revision: 283939 URL: https://svnweb.freebsd.org/changeset/base/283939 Log: userboot: enable bzipfs support Additionally, sort all real filesystems before the virtual ones. Differential Revision: https://reviews.freebsd.org/D2709 Reviewed by: grehan MFC after: 5 days Modified: head/sys/boot/userboot/userboot/conf.c Modified: head/sys/boot/userboot/userboot/conf.c ============================================================================== --- head/sys/boot/userboot/userboot/conf.c Wed Jun 3 06:02:49 2015 (r283938) +++ head/sys/boot/userboot/userboot/conf.c Wed Jun 3 10:10:00 2015 (r283939) @@ -65,10 +65,11 @@ struct fs_ops *file_system[] = { &host_fsops, &ufs_fsops, &cd9660_fsops, - &gzipfs_fsops, #if defined(USERBOOT_ZFS_SUPPORT) &zfs_fsops, #endif + &gzipfs_fsops, + &bzipfs_fsops, NULL }; From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 11:25:10 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CA79432; Wed, 3 Jun 2015 11:25:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B9146175F; Wed, 3 Jun 2015 11:25:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA09396; Wed, 03 Jun 2015 14:25:00 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Z06n6-0003K6-59; Wed, 03 Jun 2015 14:25:00 +0300 Message-ID: <556EE3D3.6030608@FreeBSD.org> Date: Wed, 03 Jun 2015 14:24:03 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Sergey Kandaurov , Baptiste Daroussin CC: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r283938 - head References: <201506030602.t5362n3r028193@svn.freebsd.org> 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, 03 Jun 2015 11:25:10 -0000 On 03/06/2015 13:03, Sergey Kandaurov wrote: > On 3 June 2015 at 09:02, Baptiste Daroussin wrote: >> Author: bapt >> Date: Wed Jun 3 06:02:49 2015 >> New Revision: 283938 >> URL: https://svnweb.freebsd.org/changeset/base/283938 >> >> Log: >> mandoc's makewhatis requires gnuzip to be in the path when deadling with >> with compressed manpages. >> > > [pluknet@omg] man gnuzip > No manual entry for gnuzip > > Looks like a typo in "gzip", which is the name for the compressing format > as described in RFC 1952, and of the utility that implements it. I suspect that it's simpler and "gunzip" was intended :) > The implementation that is included in base is BSD-licensed and has no > relationship with GNU project. > > As from usr.bin/gzip/gzip.c > > * gzip.c -- GPL free gzip using zlib. > -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 13:32:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17CD65CF; Wed, 3 Jun 2015 13:32:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E031617E8; Wed, 3 Jun 2015 13:32:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53DWTJo055077; Wed, 3 Jun 2015 13:32:29 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53DWTXU055075; Wed, 3 Jun 2015 13:32:29 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506031332.t53DWTXU055075@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 3 Jun 2015 13:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283945 - in head: contrib/mdocml 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: Wed, 03 Jun 2015 13:32:30 -0000 Author: bapt Date: Wed Jun 3 13:32:28 2015 New Revision: 283945 URL: https://svnweb.freebsd.org/changeset/base/283945 Log: Replace the gunzip(1) system by a minimalistic zlib based implementation. This allows to not depend on gunzip(1) at bootstrap time, and is good enough to wait for upstream real implementation using zlib. Modified: head/contrib/mdocml/read.c head/usr.bin/mandoc/Makefile Modified: head/contrib/mdocml/read.c ============================================================================== --- head/contrib/mdocml/read.c Wed Jun 3 13:26:15 2015 (r283944) +++ head/contrib/mdocml/read.c Wed Jun 3 13:32:28 2015 (r283945) @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,7 @@ #include #include #include +#include #include "mandoc.h" #include "mandoc_aux.h" @@ -792,6 +794,27 @@ mparse_readfd(struct mparse *curp, int f return(curp->file_status); } +/* + * hack to avoid depending on gnuzip(1) waiting for upstream proper + * support + */ +static int +gunzip(const char *file) +{ + gzFile gz; + char buf[8192]; + int r; + + gz = gzopen(file, "r"); + if (gz == NULL) + err(EXIT_FAILURE, "cannot open %s", file); + + while ((r = gzread(gz, buf, sizeof(buf))) > 0) + fwrite(buf, 1, r, stdout); + + gzclose(gz); + return (EXIT_SUCCESS); +} enum mandoclevel mparse_open(struct mparse *curp, int *fd, const char *file) { @@ -846,9 +869,7 @@ mparse_open(struct mparse *curp, int *fd perror("dup"); exit((int)MANDOCLEVEL_SYSERR); } - execlp("gunzip", "gunzip", "-c", file, NULL); - perror("exec"); - exit((int)MANDOCLEVEL_SYSERR); + exit(gunzip(file)); default: close(pfd[1]); *fd = pfd[0]; Modified: head/usr.bin/mandoc/Makefile ============================================================================== --- head/usr.bin/mandoc/Makefile Wed Jun 3 13:26:15 2015 (r283944) +++ head/usr.bin/mandoc/Makefile Wed Jun 3 13:32:28 2015 (r283945) @@ -84,6 +84,6 @@ WARNS?= 2 CFLAGS+= -DHAVE_CONFIG_H \ -I${.CURDIR}/../../lib/libohash/ \ -I${.CURDIR}/../../contrib/sqlite3 -LIBADD= ohash sqlite3 +LIBADD= ohash sqlite3 z .include From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 13:43:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2B8990D; Wed, 3 Jun 2015 13:43:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C1EF01A45; Wed, 3 Jun 2015 13:43:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53Dh4Rb060046; Wed, 3 Jun 2015 13:43:04 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53Dh4Gu060045; Wed, 3 Jun 2015 13:43:04 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506031343.t53Dh4Gu060045@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 3 Jun 2015 13:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283946 - 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: Wed, 03 Jun 2015 13:43:04 -0000 Author: bapt Date: Wed Jun 3 13:43:04 2015 New Revision: 283946 URL: https://svnweb.freebsd.org/changeset/base/283946 Log: Revert r283938 it is not needed anymore and broken gzip(1) cannot be used as bootstrap tools as it depends on syscalls that only exists on HEAD Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jun 3 13:32:28 2015 (r283945) +++ head/Makefile.inc1 Wed Jun 3 13:43:04 2015 (r283946) @@ -1366,8 +1366,7 @@ _kerberos5_bootstrap_tools= \ .if ${MK_MANDOCDB} != "no" _libohash?= lib/libohash _makewhatis= lib/libsqlite3 \ - usr.bin/mandoc \ - usr.bin/gzip + usr.bin/mandoc ${_bt}-usr.bin/mandoc: ${_bt}-lib/libohash ${_bt}-lib/libsqlite3 .else _makewhatis=usr.bin/makewhatis From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 14:07:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25ED6D7C; Wed, 3 Jun 2015 14:07:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 144DD1F16; Wed, 3 Jun 2015 14:07:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53E7pbY070462; Wed, 3 Jun 2015 14:07:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53E7pDX070458; Wed, 3 Jun 2015 14:07:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201506031407.t53E7pDX070458@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 3 Jun 2015 14:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283947 - 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, 03 Jun 2015 14:07:52 -0000 Author: ian Date: Wed Jun 3 14:07:50 2015 New Revision: 283947 URL: https://svnweb.freebsd.org/changeset/base/283947 Log: Better handling of userland sysarch() requests to flush icache. On armv6, cache maintenance can trigger page faults. Add handling so that these turn into SIGSEGV that kills the process rather than panics that kill the kernel. Differential Revision: https://reviews.freebsd.org/D2035 Submitted by: Michal Meloun Modified: head/sys/arm/arm/cpu_asm-v6.S head/sys/arm/arm/sys_machdep.c head/sys/arm/arm/trap-v6.c Modified: head/sys/arm/arm/cpu_asm-v6.S ============================================================================== --- head/sys/arm/arm/cpu_asm-v6.S Wed Jun 3 13:43:04 2015 (r283946) +++ head/sys/arm/arm/cpu_asm-v6.S Wed Jun 3 14:07:50 2015 (r283947) @@ -26,6 +26,7 @@ * * $FreeBSD$ */ +#include "assym.s" #include #include @@ -33,6 +34,17 @@ #include #include +#if __ARM_ARCH >= 6 +#define GET_PCB(tmp) \ + mrc CP15_TPIDRPRW(tmp); \ + add tmp, tmp, #(TD_PCB) +#else +.Lcurpcb: + .word _C_LABEL(__pcpu) + PC_CURPCB +#define GET_PCB(tmp) \ + ldr tmp, .Lcurpcb +#endif + /* * Define cache functions used by startup code, which counts on the fact that * only r0-r3,r12 (ip) are modified and no stack space is used. These functions @@ -208,3 +220,59 @@ ASENTRY_NP(dcache_wbinv_poc_all) bx lr #endif /* __ARM_ARCH == 6 */ END(dcache_wbinv_poc_all) + +ASENTRY_NP(dcache_wb_pou_checked) + ldr ip, .Lcpuinfo + ldr ip, [ip, #DCACHE_LINE_SIZE] + + GET_PCB(r2) + ldr r2, [r2] + + adr r3, _C_LABEL(cachebailout) + str r3, [r2, #PCB_ONFAULT] +1: + mcr CP15_DCCMVAC(r0) + add r0, r0, ip + subs r1, r1, ip + bhi 1b + DSB + mov r0, #0 + str r0, [r2, #PCB_ONFAULT] + mov r0, #1 /* cannot be faulting address */ + RET + +.Lcpuinfo: + .word cpuinfo +END(dcache_wb_pou_checked) + +ASENTRY_NP(icache_inv_pou_checked) + ldr ip, .Lcpuinfo + ldr ip, [ip, #ICACHE_LINE_SIZE] + + GET_PCB(r2) + ldr r2, [r2] + + adr r3, _C_LABEL(cachebailout) + str r3, [r2, #PCB_ONFAULT] + +1: + mcr CP15_ICIMVAU(r0) + add r0, r0, ip + subs r1, r1, ip + bhi 1b + DSB + ISB + mov r0, #0 + str r0, [r2, #PCB_ONFAULT] + mov r0, #1 /* cannot be faulting address */ + RET +END(icache_inv_pou_checked) + +/* label must be global as trap-v6.c references it */ + .global _C_LABEL(cachebailout) +_C_LABEL(cachebailout): + DSB + ISB + mov r1, #0 + str r1, [r2, #PCB_ONFAULT] + RET Modified: head/sys/arm/arm/sys_machdep.c ============================================================================== --- head/sys/arm/arm/sys_machdep.c Wed Jun 3 13:43:04 2015 (r283946) +++ head/sys/arm/arm/sys_machdep.c Wed Jun 3 14:07:50 2015 (r283947) @@ -41,8 +41,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include +#include #ifndef _SYS_SYSPROTO_H_ struct sysarch_args { @@ -55,16 +59,89 @@ struct sysarch_args { static int arm32_sync_icache (struct thread *, void *); static int arm32_drain_writebuf(struct thread *, void *); +#if __ARM_ARCH >= 6 +static int +sync_icache(uintptr_t addr, size_t len) +{ + size_t size; + vm_offset_t rv; + + /* + * Align starting address to even number because value of "1" + * is used as return value for success. + */ + len += addr & 1; + addr &= ~1; + + /* Break whole range to pages. */ + do { + size = PAGE_SIZE - (addr & PAGE_MASK); + size = min(size, len); + rv = dcache_wb_pou_checked(addr, size); + if (rv == 1) /* see dcache_wb_pou_checked() */ + rv = icache_inv_pou_checked(addr, size); + if (rv != 1) { + if (!useracc((void *)addr, size, VM_PROT_READ)) { + /* Invalid access */ + return (rv); + } + /* Valid but unmapped page - skip it. */ + } + len -= size; + addr += size; + } while (len > 0); + + /* Invalidate branch predictor buffer. */ + bpb_inv_all(); + return (1); +} +#endif + static int arm32_sync_icache(struct thread *td, void *args) { struct arm_sync_icache_args ua; int error; + ksiginfo_t ksi; +#if __ARM_ARCH >= 6 + vm_offset_t rv; +#endif if ((error = copyin(args, &ua, sizeof(ua))) != 0) return (error); + if (ua.len == 0) { + td->td_retval[0] = 0; + return (0); + } + + /* + * Validate arguments. Address and length are unsigned, + * so we can use wrapped overflow check. + */ + if (((ua.addr + ua.len) < ua.addr) || + ((ua.addr + ua.len) > VM_MAXUSER_ADDRESS)) { + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGSEGV; + ksi.ksi_code = SEGV_ACCERR; + ksi.ksi_addr = (void *)max(ua.addr, VM_MAXUSER_ADDRESS); + trapsignal(td, &ksi); + return (EINVAL); + } + +#if __ARM_ARCH >= 6 + rv = sync_icache(ua.addr, ua.len); + if (rv != 1) { + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGSEGV; + ksi.ksi_code = SEGV_MAPERR; + ksi.ksi_addr = (void *)rv; + trapsignal(td, &ksi); + return (EINVAL); + } +#else cpu_icache_sync_range(ua.addr, ua.len); +#endif td->td_retval[0] = 0; return (0); Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Wed Jun 3 13:43:04 2015 (r283946) +++ head/sys/arm/arm/trap-v6.c Wed Jun 3 14:07:50 2015 (r283947) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #endif extern char fusubailout[]; +extern char cachebailout[]; #ifdef DEBUG int last_fault_code; /* For the benefit of pmap_fault_fixup() */ @@ -133,7 +134,7 @@ static const struct abort aborts[] = { {abort_align, "Alignment Fault"}, {abort_fatal, "Debug Event"}, {NULL, "Access Bit (L1)"}, - {abort_icache, "Instruction cache maintenance"}, + {NULL, "Instruction cache maintenance"}, {NULL, "Translation Fault (L1)"}, {NULL, "Access Bit (L2)"}, {NULL, "Translation Fault (L2)"}, @@ -406,6 +407,24 @@ abort_handler(struct trapframe *tf, int } /* + * Don't pass faulting cache operation to vm_fault(). We don't want + * to handle all vm stuff at this moment. + */ + pcb = td->td_pcb; + if (__predict_false(pcb->pcb_onfault == cachebailout)) { + tf->tf_r0 = far; /* return failing address */ + tf->tf_pc = (register_t)pcb->pcb_onfault; + return; + } + + /* Handle remaining I cache aborts. */ + if (idx == FAULT_ICACHE) { + if (abort_icache(tf, idx, fsr, far, prefetch, td, &ksig)) + goto do_trapsignal; + goto out; + } + + /* * At this point, we're dealing with one of the following aborts: * * FAULT_TRAN_xx - Translation From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 14:48:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 774028D0; Wed, 3 Jun 2015 14:48:04 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 65AB1199A; Wed, 3 Jun 2015 14:48:04 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53Em4je090710; Wed, 3 Jun 2015 14:48:04 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53Em4Gn090709; Wed, 3 Jun 2015 14:48:04 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201506031448.t53Em4Gn090709@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 3 Jun 2015 14:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283948 - head/sys/dev/dwc 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, 03 Jun 2015 14:48:04 -0000 Author: loos Date: Wed Jun 3 14:48:03 2015 New Revision: 283948 URL: https://svnweb.freebsd.org/changeset/base/283948 Log: Fix the OACTIVE handling on if_dwc. Previously the OACTIVE flag was being set when the tx descriptors are fully allocated but it wasn't unset anywhere. As soon as a packet is transmitted, unset the OACTIVE flag and call start routine to push any pending packets from the tx queue. This closes another race where a full tx queue would jam the tx path (tx queue is full, new packets cannot be added to queue and dwc_txstart never gets called). Modified: head/sys/dev/dwc/if_dwc.c Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Wed Jun 3 14:07:50 2015 (r283947) +++ head/sys/dev/dwc/if_dwc.c Wed Jun 3 14:48:03 2015 (r283948) @@ -741,9 +741,11 @@ dwc_txfinish_locked(struct dwc_softc *sc { struct dwc_bufmap *bmap; struct dwc_hwdesc *desc; + struct ifnet *ifp; DWC_ASSERT_LOCKED(sc); + fp = sc->ifp; while (sc->tx_idx_tail != sc->tx_idx_head) { desc = &sc->txdesc_ring[sc->tx_idx_tail]; if ((desc->tdes0 & DDESC_TDES0_OWN) != 0) @@ -756,6 +758,7 @@ dwc_txfinish_locked(struct dwc_softc *sc bmap->mbuf = NULL; dwc_setup_txdesc(sc, sc->tx_idx_tail, 0, 0); sc->tx_idx_tail = next_txidx(sc, sc->tx_idx_tail); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } /* If there are no buffers outstanding, muzzle the watchdog. */ @@ -838,8 +841,10 @@ dwc_intr(void *arg) if (reg & DMA_STATUS_RI) dwc_rxfinish_locked(sc); - if (reg & DMA_STATUS_TI) + if (reg & DMA_STATUS_TI) { dwc_txfinish_locked(sc); + dwc_txstart_locked(sc); + } } if (reg & DMA_STATUS_AIS) { From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 14:52:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95DF7A8D; Wed, 3 Jun 2015 14:52:34 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-ob0-x22f.google.com (mail-ob0-x22f.google.com [IPv6:2607:f8b0:4003:c01::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 59CFF1BC6; Wed, 3 Jun 2015 14:52:34 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by obcnx10 with SMTP id nx10so9577582obc.2; Wed, 03 Jun 2015 07:52:33 -0700 (PDT) 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=2zbt0wbcdTsuFZnGTIJDUJef2akQqoLNN6ASSgGAEbc=; b=nZZxZu2dHIfSmgp61X4Tnii3u/Qo1B017TQSu+qJuzJfL4L2Asp86EY48aCv4mCvTr b4GGKYpkectjb8VBG+SEYz2ohwJmLVHCaTYvuT7r+5D3Ho4piwGt3cGeBYUJDHQGRNxt 5/oT8OYZmPPKoq5ZY5nVgk4Rsh1CRtBSxt+kjKw1LkkbHXysqcYi/MnlE9BIOU6cdhgz DYZyBapoAKEkJDp3Hd+MHFqxTjO9LZ7N7Xn3MOvsVU7IFAGLmkJZtpEtQD9BTp7M6qhG 50qgYvrZ7Y8BD46gEyACh0qU8PsKHh1CtCgrrH6ypGxtQ1fxb/fB2vbeuTalr+rINEKU Ohog== MIME-Version: 1.0 X-Received: by 10.60.93.42 with SMTP id cr10mr20601921oeb.74.1433343153747; Wed, 03 Jun 2015 07:52:33 -0700 (PDT) Received: by 10.202.11.193 with HTTP; Wed, 3 Jun 2015 07:52:33 -0700 (PDT) Received: by 10.202.11.193 with HTTP; Wed, 3 Jun 2015 07:52:33 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <201506031448.t53Em4Gn090709@svn.freebsd.org> References: <201506031448.t53Em4Gn090709@svn.freebsd.org> Date: Wed, 3 Jun 2015 22:52:33 +0800 Message-ID: Subject: Re: svn commit: r283948 - head/sys/dev/dwc From: Marcelo Araujo To: Luiz Otavio O Souza Cc: svn-src-head@freebsd.org, src-committers@freebsd.org, svn-src-all@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, 03 Jun 2015 14:52:34 -0000 Oi, fp = sc->ifp; Deveria ser: ifp = sc->ifp; []s On Jun 3, 2015 10:48 PM, "Luiz Otavio O Souza" wrote: > Author: loos > Date: Wed Jun 3 14:48:03 2015 > New Revision: 283948 > URL: https://svnweb.freebsd.org/changeset/base/283948 > > Log: > Fix the OACTIVE handling on if_dwc. > > Previously the OACTIVE flag was being set when the tx descriptors are > fully > allocated but it wasn't unset anywhere. > > As soon as a packet is transmitted, unset the OACTIVE flag and call start > routine to push any pending packets from the tx queue. > > This closes another race where a full tx queue would jam the tx path (tx > queue is full, new packets cannot be added to queue and dwc_txstart never > gets called). > > Modified: > head/sys/dev/dwc/if_dwc.c > > Modified: head/sys/dev/dwc/if_dwc.c > > ============================================================================== > --- head/sys/dev/dwc/if_dwc.c Wed Jun 3 14:07:50 2015 (r283947) > +++ head/sys/dev/dwc/if_dwc.c Wed Jun 3 14:48:03 2015 (r283948) > @@ -741,9 +741,11 @@ dwc_txfinish_locked(struct dwc_softc *sc > { > struct dwc_bufmap *bmap; > struct dwc_hwdesc *desc; > + struct ifnet *ifp; > > DWC_ASSERT_LOCKED(sc); > > + fp = sc->ifp; > while (sc->tx_idx_tail != sc->tx_idx_head) { > desc = &sc->txdesc_ring[sc->tx_idx_tail]; > if ((desc->tdes0 & DDESC_TDES0_OWN) != 0) > @@ -756,6 +758,7 @@ dwc_txfinish_locked(struct dwc_softc *sc > bmap->mbuf = NULL; > dwc_setup_txdesc(sc, sc->tx_idx_tail, 0, 0); > sc->tx_idx_tail = next_txidx(sc, sc->tx_idx_tail); > + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; > } > > /* If there are no buffers outstanding, muzzle the watchdog. */ > @@ -838,8 +841,10 @@ dwc_intr(void *arg) > if (reg & DMA_STATUS_RI) > dwc_rxfinish_locked(sc); > > - if (reg & DMA_STATUS_TI) > + if (reg & DMA_STATUS_TI) { > dwc_txfinish_locked(sc); > + dwc_txstart_locked(sc); > + } > } > > if (reg & DMA_STATUS_AIS) { > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://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 Wed Jun 3 15:02:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB900470; Wed, 3 Jun 2015 15:02:14 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: from mail-la0-x22d.google.com (mail-la0-x22d.google.com [IPv6:2a00:1450:4010:c03::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 3F2921E4E; Wed, 3 Jun 2015 15:02:14 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: by labpy14 with SMTP id py14so10451663lab.0; Wed, 03 Jun 2015 08:02:12 -0700 (PDT) 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=HyroETHIR8WhEnTtGuU6YYkspLggEpvURax8SEGq2+8=; b=VUvCPdPBQJ2OSd2N1ow82K//9eNFB/LoKukTkR9KUAeyis2Ou+v4Qfg50JZuXK+VAU upMeQ2eytASCc7GMBmbH+8GHuKb+BKH8AYhBmzkHk8GyR9rXh15a/SIpjHdj3c35gKQv gKe+Wn+H1/uHonq0dqpK+JG3AFSB/+xTqW0i7JO9BVBlqpCDhr08h9UhByUZHjsf9oT0 zDat3u6Rz3yW5LZsWsQ0Qkh85xw9hoIzKnDfVNwATKhSToFMQLV+p/7bjmVouGQWGLKi ORaDybwwGnAwfE3ii/bFXfxhbcDyrkwiF6Ha7gmdLyrHPGN+zD8O7zKEG6jzto8Vx8x9 0ioQ== MIME-Version: 1.0 X-Received: by 10.112.242.40 with SMTP id wn8mr32701715lbc.57.1433343732390; Wed, 03 Jun 2015 08:02:12 -0700 (PDT) Received: by 10.112.154.166 with HTTP; Wed, 3 Jun 2015 08:02:12 -0700 (PDT) In-Reply-To: References: <201506031448.t53Em4Gn090709@svn.freebsd.org> Date: Wed, 3 Jun 2015 12:02:12 -0300 Message-ID: Subject: Re: svn commit: r283948 - head/sys/dev/dwc From: Luiz Otavio O Souza To: araujo@freebsd.org Cc: Luiz Otavio O Souza , svn-src-head@freebsd.org, src-committers@freebsd.org, svn-src-all@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, 03 Jun 2015 15:02:14 -0000 On Wed, Jun 3, 2015 at 11:52 AM, Marcelo Araujo wrote: > Oi, > > fp = sc->ifp; > > Deveria ser: > > ifp = sc->ifp; > > []s > Yeah, I caught the conflict when merging back to my work sources. Obrigado Marcelo. Luiz From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 15:18:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3DB6D9A; Wed, 3 Jun 2015 15:18:32 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D265E113B; Wed, 3 Jun 2015 15:18:32 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53FIWHo006073; Wed, 3 Jun 2015 15:18:32 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53FIWXT006071; Wed, 3 Jun 2015 15:18:32 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201506031518.t53FIWXT006071@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 3 Jun 2015 15:18:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283949 - head/sys/dev/dwc 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, 03 Jun 2015 15:18:33 -0000 Author: loos Date: Wed Jun 3 15:18:32 2015 New Revision: 283949 URL: https://svnweb.freebsd.org/changeset/base/283949 Log: Fix wrong variable name in the previous commit. Pointy hat to: loos Reported by: araujo Modified: head/sys/dev/dwc/if_dwc.c Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Wed Jun 3 14:48:03 2015 (r283948) +++ head/sys/dev/dwc/if_dwc.c Wed Jun 3 15:18:32 2015 (r283949) @@ -745,7 +745,7 @@ dwc_txfinish_locked(struct dwc_softc *sc DWC_ASSERT_LOCKED(sc); - fp = sc->ifp; + ifp = sc->ifp; while (sc->tx_idx_tail != sc->tx_idx_head) { desc = &sc->txdesc_ring[sc->tx_idx_tail]; if ((desc->tdes0 & DDESC_TDES0_OWN) != 0) From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 15:22:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8115FB3; Wed, 3 Jun 2015 15:22:53 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-ob0-x231.google.com (mail-ob0-x231.google.com [IPv6:2607:f8b0:4003:c01::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 6C11013B6; Wed, 3 Jun 2015 15:22:53 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by objn8 with SMTP id n8so10441571obj.3; Wed, 03 Jun 2015 08:22:52 -0700 (PDT) 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=ytuzVsw2rYQzdi+EOSKwUbrbnOUbWJ1pp2mdDt1YgSk=; b=UdE0bQ3syiJLLhtw2B0KXh5Yj6IPkkYX85UQ+zvfNYMaaqm8iGxC4LqVCKom1Gus66 ldExNQlYvcmTigS8hjkzWEnoW8N3VNbdbpzznq2p/foByddi3K551f3GZv9i7B7KuWzq e2GRGKRL0SLQb7Pja1MdoKBLsm5cjCiyTeYjvRrcEPrWkhWhHphAe/PWWrosEzluv+wJ kbXCTkeLe2DhgJa9lrNirhUN1xxkLpLqd44nrDPtMK/0OWJ92j4h+wX/BlPQjcIybyFV uD1S5jRAy8QzHW19yNKCcfjbccqnJTLmbtgVoH1iV+TS2wpNhUC7x8AzDtFX9MCapLJm OXLQ== MIME-Version: 1.0 X-Received: by 10.182.91.35 with SMTP id cb3mr28250559obb.87.1433344972817; Wed, 03 Jun 2015 08:22:52 -0700 (PDT) Received: by 10.202.11.193 with HTTP; Wed, 3 Jun 2015 08:22:52 -0700 (PDT) Received: by 10.202.11.193 with HTTP; Wed, 3 Jun 2015 08:22:52 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <201506031518.t53FIWXT006071@svn.freebsd.org> References: <201506031518.t53FIWXT006071@svn.freebsd.org> Date: Wed, 3 Jun 2015 23:22:52 +0800 Message-ID: Subject: Re: svn commit: r283949 - head/sys/dev/dwc From: Marcelo Araujo To: Luiz Otavio O Souza Cc: svn-src-head@freebsd.org, src-committers@freebsd.org, svn-src-all@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, 03 Jun 2015 15:22:53 -0000 Thanks Luiz, and sorry the email that I sent in Portuguese, that one should be addressed only to you. Best, On Jun 3, 2015 11:18 PM, "Luiz Otavio O Souza" wrote: > Author: loos > Date: Wed Jun 3 15:18:32 2015 > New Revision: 283949 > URL: https://svnweb.freebsd.org/changeset/base/283949 > > Log: > Fix wrong variable name in the previous commit. > > Pointy hat to: loos > Reported by: araujo > > Modified: > head/sys/dev/dwc/if_dwc.c > > Modified: head/sys/dev/dwc/if_dwc.c > > ============================================================================== > --- head/sys/dev/dwc/if_dwc.c Wed Jun 3 14:48:03 2015 (r283948) > +++ head/sys/dev/dwc/if_dwc.c Wed Jun 3 15:18:32 2015 (r283949) > @@ -745,7 +745,7 @@ dwc_txfinish_locked(struct dwc_softc *sc > > DWC_ASSERT_LOCKED(sc); > > - fp = sc->ifp; > + ifp = sc->ifp; > while (sc->tx_idx_tail != sc->tx_idx_head) { > desc = &sc->txdesc_ring[sc->tx_idx_tail]; > if ((desc->tdes0 & DDESC_TDES0_OWN) != 0) > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://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 Wed Jun 3 15:43:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90F0B8B1; Wed, 3 Jun 2015 15:43:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7E257191A; Wed, 3 Jun 2015 15:43:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53Fhu43020282; Wed, 3 Jun 2015 15:43:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53FhunV020281; Wed, 3 Jun 2015 15:43:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201506031543.t53FhunV020281@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 3 Jun 2015 15:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283952 - head/sys/dev/usb/template 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, 03 Jun 2015 15:43:56 -0000 Author: hselasky Date: Wed Jun 3 15:43:55 2015 New Revision: 283952 URL: https://svnweb.freebsd.org/changeset/base/283952 Log: Fix spelling. Modified: head/sys/dev/usb/template/usb_template_midi.c Modified: head/sys/dev/usb/template/usb_template_midi.c ============================================================================== --- head/sys/dev/usb/template/usb_template_midi.c Wed Jun 3 15:41:03 2015 (r283951) +++ head/sys/dev/usb/template/usb_template_midi.c Wed Jun 3 15:43:55 2015 (r283952) @@ -171,7 +171,7 @@ static const void *midi_descs_1[] = { static const struct usb_temp_interface_desc midi_iface_1 = { .ppRawDesc = midi_descs_1, .ppEndpoints = midi_iface_1_ep, - .bInterfaceClass = 0x01, /* Midi */ + .bInterfaceClass = 0x01, /* MIDI */ .bInterfaceSubClass = 3, /* MIDI streaming */ .bInterfaceProtocol = 0, .iInterface = INDEX_MIDI_IF, From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 17:10:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B5E1699; Wed, 3 Jun 2015 17:10:12 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 294EB1DC8; Wed, 3 Jun 2015 17:10:12 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53HABT5061859; Wed, 3 Jun 2015 17:10:11 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53HABcH061858; Wed, 3 Jun 2015 17:10:11 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201506031710.t53HABcH061858@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Wed, 3 Jun 2015 17:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283956 - head/share/man/man8 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, 03 Jun 2015 17:10:12 -0000 Author: jmg Date: Wed Jun 3 17:10:11 2015 New Revision: 283956 URL: https://svnweb.freebsd.org/changeset/base/283956 Log: install nanobsd.sh as a MLINK as that is the .Nm of the man page.. really the man page should be renamed as nanobsd.sh is not installed as nanobsd.. Modified: head/share/man/man8/Makefile Modified: head/share/man/man8/Makefile ============================================================================== --- head/share/man/man8/Makefile Wed Jun 3 16:47:14 2015 (r283955) +++ head/share/man/man8/Makefile Wed Jun 3 17:10:11 2015 (r283956) @@ -13,7 +13,9 @@ MAN= crash.8 \ ${_uefi.8} \ yp.8 -MLINKS= rc.8 rc.atm.8 \ +MLINKS= + nanobsd.8 nanobsd.sh.8 \ + rc.8 rc.atm.8 \ rc.8 rc.d.8 \ rc.8 rc.firewall.8 \ rc.8 rc.local.8 \ From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 17:10:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9203C7EF; Wed, 3 Jun 2015 17:10:53 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7FA801EEF; Wed, 3 Jun 2015 17:10:53 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53HArBs062476; Wed, 3 Jun 2015 17:10:53 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53HAr4n062475; Wed, 3 Jun 2015 17:10:53 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201506031710.t53HAr4n062475@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Wed, 3 Jun 2015 17:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283957 - head/share/man/man8 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, 03 Jun 2015 17:10:53 -0000 Author: jmg Date: Wed Jun 3 17:10:52 2015 New Revision: 283957 URL: https://svnweb.freebsd.org/changeset/base/283957 Log: fix missing backslash.. Modified: head/share/man/man8/Makefile Modified: head/share/man/man8/Makefile ============================================================================== --- head/share/man/man8/Makefile Wed Jun 3 17:10:11 2015 (r283956) +++ head/share/man/man8/Makefile Wed Jun 3 17:10:52 2015 (r283957) @@ -13,7 +13,7 @@ MAN= crash.8 \ ${_uefi.8} \ yp.8 -MLINKS= +MLINKS= \ nanobsd.8 nanobsd.sh.8 \ rc.8 rc.atm.8 \ rc.8 rc.d.8 \ From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 17:58:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25BB1AFD; Wed, 3 Jun 2015 17:58:52 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DBFF11A99; Wed, 3 Jun 2015 17:58:51 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.200] (p508F1163.dip0.t-ipconnect.de [80.143.17.99]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 515421C0B463E; Wed, 3 Jun 2015 19:58:49 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: svn commit: r283806 - head/contrib/traceroute From: Michael Tuexen In-Reply-To: <4E05B479-A012-4219-822A-68DF72CCAACF@freebsd.org> Date: Wed, 3 Jun 2015 19:58:47 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0EA0845B-0C79-40D3-A73A-27EA1C6EDAC0@freebsd.org> References: <201505310810.t4V8AZWR074647@svn.freebsd.org> <20150531185852.GA20409@strugglingcoder.info> <4E05B479-A012-4219-822A-68DF72CCAACF@freebsd.org> To: hiren panchasara X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Jun 2015 17:58:52 -0000 > On 31 May 2015, at 21:45, Michael Tuexen wrote: >=20 >> On 31 May 2015, at 20:58, hiren panchasara = wrote: >>=20 >> On 05/31/15 at 08:10P, Michael Tuexen wrote: >>> Author: tuexen >>> Date: Sun May 31 08:10:35 2015 >>> New Revision: 283806 >>> URL: https://svnweb.freebsd.org/changeset/base/283806 >>>=20 >>> Log: >>> When the packet verification fails in verbose mode, print the = correct >>> number of words in host byte order. Also remove a stray 'x'. >>>=20 >>> MFC after: 3 days >>>=20 >>> Modified: >>> head/contrib/traceroute/traceroute.c >>=20 >> Picking up a random traceroute commit here. I am not sure of the = history >> but don't we try to upstream the fixes for contrib/* things, in = general?=20 > The last version was release 12 years ago. They where integrated in > https://svnweb.freebsd.org/base?view=3Drevision&revision=3D100787 >=20 > I can submit the patches also to traceroute@ee.lbl.gov as indicated in > = https://svnweb.freebsd.org/base/head/contrib/traceroute/FREEBSD-upgrade?vi= ew=3Dmarkup I tried to... However, the e-mail address traceroute@ee.lbl.gov doesn't = seem to work anymore... Best regards Michael >=20 > Thanks for making me aware of it. >=20 > Best regards > Michael >>=20 >> I am just curious. Thanks for the fixes, btw. >>=20 >> Cheers, >> Hiren >=20 >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 18:01:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E08F2C97; Wed, 3 Jun 2015 18:01:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CC5571B98; Wed, 3 Jun 2015 18:01:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53I1Bhc090117; Wed, 3 Jun 2015 18:01:11 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53I1ARn090108; Wed, 3 Jun 2015 18:01:10 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201506031801.t53I1ARn090108@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 3 Jun 2015 18:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283959 - in head: share/man/man4 sys/conf sys/dev/e1000 sys/dev/netmap sys/modules/em 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, 03 Jun 2015 18:01:12 -0000 Author: sbruno Date: Wed Jun 3 18:01:09 2015 New Revision: 283959 URL: https://svnweb.freebsd.org/changeset/base/283959 Log: Change EM_MULTIQUEUE to a real kernconf entry and enable support for up to 2 rx/tx queues for the 82574. Program the 82574 to enable 5 msix vectors, assign 1 to each rx queue, 1 to each tx queue and 1 to the link handler. Inspired by DragonFlyBSD, enable some RSS logic for handling tx queue handling/processing. Move multiqueue handler functions so that they line up better in a diff review to if_igb.c Always enqueue tx work to be done in em_mq_start, if unable to acquire the TX lock, then this will be processed in the background later by the taskqueue. Remove mbuf argument from em_start_mq_locked() as the work is always enqueued. (stolen from igb) Setup TARC, TXDCTL and RXDCTL registers for better performance and stability in multiqueue and singlequeue implementations. Handle Intel errata 3 and generic multiqueue behavior with the initialization of TARC(0) and TARC(1) Bind interrupt threads to cpus in order. (stolen from igb) Add 2 new DDB functions, one to display the queue(s) and their settings and one to reset the adapter. Primarily used for debugging. In the multiqueue configuration, bump RXD and TXD ring size to max for the adapter (4096). Setup an RDTR of 64 and an RADV of 128 in multiqueue configuration to cut down on the number of interrupts. RADV was arbitrarily set to 2x RDTR and can be adjusted as needed. Cleanup the display in top a bit to make it clearer where the taskqueue threads are running and what they should be doing. Ensure that both queues are processed by em_local_timer() by writing them both to the IMS register to generate soft interrupts. Ensure that an soft interrupt is generated when em_msix_link() is run so that any races between assertion of the link/status interrupt and a rx/tx interrupt are handled. Document existing tuneables: hw.em.eee_setting, hw.em.msix, hw.em.smart_pwr_down, hw.em.sbp Document use of hw.em.num_queues and the new kernel option EM_MULTIQUEUE Thanks to Intel for their continued support of FreeBSD. Reviewed by: erj jfv hiren gnn wblock Obtained from: Intel Corporation MFC after: 2 weeks Relnotes: Yes Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D1994 Modified: head/share/man/man4/em.4 head/sys/conf/NOTES head/sys/conf/options head/sys/dev/e1000/e1000_defines.h head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/netmap/if_em_netmap.h head/sys/modules/em/Makefile Modified: head/share/man/man4/em.4 ============================================================================== --- head/share/man/man4/em.4 Wed Jun 3 17:45:45 2015 (r283958) +++ head/share/man/man4/em.4 Wed Jun 3 18:01:09 2015 (r283959) @@ -45,6 +45,14 @@ kernel configuration file: .Cd "device em" .Ed .Pp +Optional multiqueue support is available via the following kernel +compile options: +.Bd -ragged -offset indent +.Cd "options EM_MULTIQUEUE" +.Ed +.Pp +Note: Activating EM_MULTIQUEUE support is not supported by Intel. +.Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : @@ -197,6 +205,18 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent +.It Va hw.em.eee_setting +Disable or enable Energy Efficient Ethernet. +Default 1 (disabled). +.It Va hw.em.msix +Enable or disable MSI-X style interrupts. +Default 1 (enabled). +.It Va hw.em.smart_pwr_down +Enable or disable smart power down features on newer adapters. +Default 0 (disabled). +.It Va hw.em.sbp +Show bad packets when in promiscuous mode. +Default 0 (off). .It Va hw.em.rxd Number of receive descriptors allocated by the driver. The default value is 1024 for adapters newer than 82547, @@ -228,6 +248,11 @@ If .Va hw.em.tx_int_delay is non-zero, this tunable limits the maximum delay in which a transmit interrupt is generated. +.It Va hw.em.num_queues +Number of hardware queues that will be configured on this adapter (maximum of 2) +Defaults to 1. +Only valid with kernel configuration +.Cd "options EM_MULTIQUEUE". .El .Sh FILES .Bl -tag -width /dev/led/em* @@ -287,3 +312,5 @@ You can enable it on an .Nm interface using .Xr ifconfig 8 . +.Pp +Activating EM_MULTIQUEUE support requires MSI-X features. Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Jun 3 17:45:45 2015 (r283958) +++ head/sys/conf/NOTES Wed Jun 3 18:01:09 2015 (r283959) @@ -2980,6 +2980,9 @@ options RANDOM_DEBUG # Debugging messag # Module to enable execution of application via emulators like QEMU options IMAGACT_BINMISC +# Intel em(4) driver +options EM_MULTIQUEUE # Activate multiqueue features/disable MSI-X + # zlib I/O stream support # This enables support for compressed core dumps. options GZIO Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Jun 3 17:45:45 2015 (r283958) +++ head/sys/conf/options Wed Jun 3 18:01:09 2015 (r283959) @@ -940,3 +940,6 @@ RCTL opt_global.h RANDOM_YARROW opt_random.h RANDOM_FORTUNA opt_random.h RANDOM_DEBUG opt_random.h + +# Intel em(4) driver +EM_MULTIQUEUE opt_em.h Modified: head/sys/dev/e1000/e1000_defines.h ============================================================================== --- head/sys/dev/e1000/e1000_defines.h Wed Jun 3 17:45:45 2015 (r283958) +++ head/sys/dev/e1000/e1000_defines.h Wed Jun 3 18:01:09 2015 (r283959) @@ -158,10 +158,12 @@ E1000_RXDEXT_STATERR_CXE | \ E1000_RXDEXT_STATERR_RXE) +#define E1000_MRQC_RSS_ENABLE_2Q 0x00000001 #define E1000_MRQC_RSS_FIELD_MASK 0xFFFF0000 #define E1000_MRQC_RSS_FIELD_IPV4_TCP 0x00010000 #define E1000_MRQC_RSS_FIELD_IPV4 0x00020000 #define E1000_MRQC_RSS_FIELD_IPV6_TCP_EX 0x00040000 +#define E1000_MRQC_RSS_FIELD_IPV6_EX 0x00080000 #define E1000_MRQC_RSS_FIELD_IPV6 0x00100000 #define E1000_MRQC_RSS_FIELD_IPV6_TCP 0x00200000 Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Jun 3 17:45:45 2015 (r283958) +++ head/sys/dev/e1000/if_em.c Wed Jun 3 18:01:09 2015 (r283959) @@ -32,6 +32,8 @@ ******************************************************************************/ /*$FreeBSD$*/ +#include "opt_em.h" +#include "opt_ddb.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -41,6 +43,10 @@ #include #include +#ifdef DDB +#include +#include +#endif #if __FreeBSD_version >= 800000 #include #endif @@ -52,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -208,7 +215,7 @@ static int em_resume(device_t); #ifdef EM_MULTIQUEUE static int em_mq_start(if_t, struct mbuf *); static int em_mq_start_locked(if_t, - struct tx_ring *, struct mbuf *); + struct tx_ring *); static void em_qflush(if_t); #else static void em_start(if_t); @@ -299,6 +306,10 @@ static void em_handle_tx(void *context, static void em_handle_rx(void *context, int pending); static void em_handle_link(void *context, int pending); +#ifdef EM_MULTIQUEUE +static void em_enable_vectors_82574(struct adapter *); +#endif + static void em_set_sysctl_value(struct adapter *, const char *, const char *, int *, int); static int em_set_flowcntl(SYSCTL_HANDLER_ARGS); @@ -388,6 +399,19 @@ static int em_enable_msix = TRUE; SYSCTL_INT(_hw_em, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &em_enable_msix, 0, "Enable MSI-X interrupts"); +#ifdef EM_MULTIQUEUE +static int em_num_queues = 1; +SYSCTL_INT(_hw_em, OID_AUTO, num_queues, CTLFLAG_RDTUN, &em_num_queues, 0, + "82574 only: Number of queues to configure, 0 indicates autoconfigure"); +#endif + +/* +** Global variable to store last used CPU when binding queues +** to CPUs in igb_allocate_msix. Starts at CPU_FIRST and increments when a +** queue is bound to a cpu. +*/ +static int em_last_bind_cpu = -1; + /* How many packets rxeof tries to clean at a time */ static int em_rx_process_limit = 100; SYSCTL_INT(_hw_em, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, @@ -420,10 +444,10 @@ static int em_probe(device_t dev) { char adapter_name[60]; - u16 pci_vendor_id = 0; - u16 pci_device_id = 0; - u16 pci_subvendor_id = 0; - u16 pci_subdevice_id = 0; + uint16_t pci_vendor_id = 0; + uint16_t pci_device_id = 0; + uint16_t pci_subvendor_id = 0; + uint16_t pci_subdevice_id = 0; em_vendor_info_t *ent; INIT_DEBUGOUT("em_probe: begin"); @@ -550,6 +574,11 @@ em_attach(device_t dev) goto err_pci; } + /* + * Setup MSI/X or MSI if PCI Express + */ + adapter->msix = em_setup_msix(adapter); + e1000_get_bus_info(hw); /* Set up some sysctls for the tunable interrupt delays */ @@ -880,7 +909,7 @@ em_resume(device_t dev) EM_TX_LOCK(txr); #ifdef EM_MULTIQUEUE if (!drbr_empty(ifp, txr->br)) - em_mq_start_locked(ifp, txr, NULL); + em_mq_start_locked(ifp, txr); #else if (!if_sendq_empty(ifp)) em_start_locked(ifp, txr); @@ -894,105 +923,7 @@ em_resume(device_t dev) } -#ifdef EM_MULTIQUEUE -/********************************************************************* - * Multiqueue Transmit routines - * - * em_mq_start is called by the stack to initiate a transmit. - * however, if busy the driver can queue the request rather - * than do an immediate send. It is this that is an advantage - * in this driver, rather than also having multiple tx queues. - **********************************************************************/ -static int -em_mq_start_locked(if_t ifp, struct tx_ring *txr, struct mbuf *m) -{ - struct adapter *adapter = txr->adapter; - struct mbuf *next; - int err = 0, enq = 0; - - if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || adapter->link_active == 0) { - if (m != NULL) - err = drbr_enqueue(ifp, txr->br, m); - return (err); - } - - enq = 0; - if (m != NULL) { - err = drbr_enqueue(ifp, txr->br, m); - if (err) - return (err); - } - - /* Process the queue */ - while ((next = drbr_peek(ifp, txr->br)) != NULL) { - if ((err = em_xmit(txr, &next)) != 0) { - if (next == NULL) - drbr_advance(ifp, txr->br); - else - drbr_putback(ifp, txr->br, next); - break; - } - drbr_advance(ifp, txr->br); - enq++; - if_inc_counter(ifp, IFCOUNTER_OBYTES, next->m_pkthdr.len); - if (next->m_flags & M_MCAST) - if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); - if_etherbpfmtap(ifp, next); - if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) - break; - } - - /* Mark the queue as having work */ - if ((enq > 0) && (txr->busy == EM_TX_IDLE)) - txr->busy = EM_TX_BUSY; - - if (txr->tx_avail < EM_MAX_SCATTER) - em_txeof(txr); - if (txr->tx_avail < EM_MAX_SCATTER) - if_setdrvflagbits(ifp, IFF_DRV_OACTIVE,0); - return (err); -} - -/* -** Multiqueue capable stack interface -*/ -static int -em_mq_start(if_t ifp, struct mbuf *m) -{ - struct adapter *adapter = if_getsoftc(ifp); - struct tx_ring *txr = adapter->tx_rings; - int error; - - if (EM_TX_TRYLOCK(txr)) { - error = em_mq_start_locked(ifp, txr, m); - EM_TX_UNLOCK(txr); - } else - error = drbr_enqueue(ifp, txr->br, m); - - return (error); -} - -/* -** Flush all ring buffers -*/ -static void -em_qflush(if_t ifp) -{ - struct adapter *adapter = if_getsoftc(ifp); - struct tx_ring *txr = adapter->tx_rings; - struct mbuf *m; - - for (int i = 0; i < adapter->num_queues; i++, txr++) { - EM_TX_LOCK(txr); - while ((m = buf_ring_dequeue_sc(txr->br)) != NULL) - m_freem(m); - EM_TX_UNLOCK(txr); - } - if_qflush(ifp); -} -#else /* !EM_MULTIQUEUE */ - +#ifndef EM_MULTIQUEUE static void em_start_locked(if_t ifp, struct tx_ring *txr) { @@ -1035,7 +966,8 @@ em_start_locked(if_t ifp, struct tx_ring txr->busy = EM_TX_BUSY; /* Send a copy of the frame to the BPF listener */ - if_etherbpfmtap(ifp, m_head); + ETHER_BPF_MTAP(ifp, m_head); + } return; @@ -1054,6 +986,115 @@ em_start(if_t ifp) } return; } +#else /* EM_MULTIQUEUE */ +/********************************************************************* + * Multiqueue Transmit routines + * + * em_mq_start is called by the stack to initiate a transmit. + * however, if busy the driver can queue the request rather + * than do an immediate send. It is this that is an advantage + * in this driver, rather than also having multiple tx queues. + **********************************************************************/ +/* +** Multiqueue capable stack interface +*/ +static int +em_mq_start(if_t ifp, struct mbuf *m) +{ + struct adapter *adapter = if_getsoftc(ifp); + struct tx_ring *txr = adapter->tx_rings; + unsigned int i, error; + + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) + i = m->m_pkthdr.flowid % adapter->num_queues; + else + i = curcpu % adapter->num_queues; + + txr = &adapter->tx_rings[i]; + + error = drbr_enqueue(ifp, txr->br, m); + if (error) + return (error); + + if (EM_TX_TRYLOCK(txr)) { + em_mq_start_locked(ifp, txr); + EM_TX_UNLOCK(txr); + } else + taskqueue_enqueue(txr->tq, &txr->tx_task); + + return (0); +} + +static int +em_mq_start_locked(if_t ifp, struct tx_ring *txr) +{ + struct adapter *adapter = txr->adapter; + struct mbuf *next; + int err = 0, enq = 0; + + EM_TX_LOCK_ASSERT(txr); + + if (((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) || + adapter->link_active == 0) { + return (ENETDOWN); + } + + /* Process the queue */ + while ((next = drbr_peek(ifp, txr->br)) != NULL) { + if ((err = em_xmit(txr, &next)) != 0) { + if (next == NULL) { + /* It was freed, move forward */ + drbr_advance(ifp, txr->br); + } else { + /* + * Still have one left, it may not be + * the same since the transmit function + * may have changed it. + */ + drbr_putback(ifp, txr->br, next); + } + break; + } + drbr_advance(ifp, txr->br); + enq++; + if_inc_counter(ifp, IFCOUNTER_OBYTES, next->m_pkthdr.len); + if (next->m_flags & M_MCAST) + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); + ETHER_BPF_MTAP(ifp, next); + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) + break; + } + + /* Mark the queue as having work */ + if ((enq > 0) && (txr->busy == EM_TX_IDLE)) + txr->busy = EM_TX_BUSY; + + if (txr->tx_avail < EM_MAX_SCATTER) + em_txeof(txr); + if (txr->tx_avail < EM_MAX_SCATTER) { + if_setdrvflagbits(ifp, IFF_DRV_OACTIVE,0); + } + return (err); +} + +/* +** Flush all ring buffers +*/ +static void +em_qflush(if_t ifp) +{ + struct adapter *adapter = if_getsoftc(ifp); + struct tx_ring *txr = adapter->tx_rings; + struct mbuf *m; + + for (int i = 0; i < adapter->num_queues; i++, txr++) { + EM_TX_LOCK(txr); + while ((m = buf_ring_dequeue_sc(txr->br)) != NULL) + m_freem(m); + EM_TX_UNLOCK(txr); + } + if_qflush(ifp); +} #endif /* EM_MULTIQUEUE */ /********************************************************************* @@ -1449,7 +1490,7 @@ em_poll(if_t ifp, enum poll_cmd cmd, int em_txeof(txr); #ifdef EM_MULTIQUEUE if (!drbr_empty(ifp, txr->br)) - em_mq_start_locked(ifp, txr, NULL); + em_mq_start_locked(ifp, txr); #else if (!if_sendq_empty(ifp)) em_start_locked(ifp, txr); @@ -1516,14 +1557,14 @@ em_handle_que(void *context, int pending struct tx_ring *txr = adapter->tx_rings; struct rx_ring *rxr = adapter->rx_rings; - if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { bool more = em_rxeof(rxr, adapter->rx_process_limit, NULL); + EM_TX_LOCK(txr); em_txeof(txr); #ifdef EM_MULTIQUEUE if (!drbr_empty(ifp, txr->br)) - em_mq_start_locked(ifp, txr, NULL); + em_mq_start_locked(ifp, txr); #else if (!if_sendq_empty(ifp)) em_start_locked(ifp, txr); @@ -1557,11 +1598,12 @@ em_msix_tx(void *arg) em_txeof(txr); #ifdef EM_MULTIQUEUE if (!drbr_empty(ifp, txr->br)) - em_mq_start_locked(ifp, txr, NULL); + em_mq_start_locked(ifp, txr); #else if (!if_sendq_empty(ifp)) em_start_locked(ifp, txr); #endif + /* Reenable this interrupt */ E1000_WRITE_REG(&adapter->hw, E1000_IMS, txr->ims); EM_TX_UNLOCK(txr); @@ -1587,9 +1629,10 @@ em_msix_rx(void *arg) more = em_rxeof(rxr, adapter->rx_process_limit, NULL); if (more) taskqueue_enqueue(rxr->tq, &rxr->rx_task); - else + else { /* Reenable this interrupt */ E1000_WRITE_REG(&adapter->hw, E1000_IMS, rxr->ims); + } return; } @@ -1616,6 +1659,16 @@ em_msix_link(void *arg) } else E1000_WRITE_REG(&adapter->hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC); + /* + ** Because we must read the ICR for this interrupt + ** it may clear other causes using autoclear, for + ** this reason we simply create a soft interrupt + ** for all these vectors. + */ + if (reg_icr) { + E1000_WRITE_REG(&adapter->hw, + E1000_ICS, adapter->ims); + } return; } @@ -1629,9 +1682,10 @@ em_handle_rx(void *context, int pending) more = em_rxeof(rxr, adapter->rx_process_limit, NULL); if (more) taskqueue_enqueue(rxr->tq, &rxr->rx_task); - else + else { /* Reenable this interrupt */ E1000_WRITE_REG(&adapter->hw, E1000_IMS, rxr->ims); + } } static void @@ -1645,7 +1699,7 @@ em_handle_tx(void *context, int pending) em_txeof(txr); #ifdef EM_MULTIQUEUE if (!drbr_empty(ifp, txr->br)) - em_mq_start_locked(ifp, txr, NULL); + em_mq_start_locked(ifp, txr); #else if (!if_sendq_empty(ifp)) em_start_locked(ifp, txr); @@ -1675,7 +1729,7 @@ em_handle_link(void *context, int pendin EM_TX_LOCK(txr); #ifdef EM_MULTIQUEUE if (!drbr_empty(ifp, txr->br)) - em_mq_start_locked(ifp, txr, NULL); + em_mq_start_locked(ifp, txr); #else if (if_sendq_empty(ifp)) em_start_locked(ifp, txr); @@ -2219,7 +2273,7 @@ em_local_timer(void *arg) if_t ifp = adapter->ifp; struct tx_ring *txr = adapter->tx_rings; struct rx_ring *rxr = adapter->rx_rings; - u32 trigger; + u32 trigger = 0; EM_CORE_LOCK_ASSERT(adapter); @@ -2232,9 +2286,11 @@ em_local_timer(void *arg) e1000_rar_set(&adapter->hw, adapter->hw.mac.addr, 0); /* Mask to use in the irq trigger */ - if (adapter->msix_mem) - trigger = rxr->ims; - else + if (adapter->msix_mem) { + for (int i = 0; i < adapter->num_queues; i++, rxr++) + trigger |= rxr->ims; + rxr = adapter->rx_rings; + } else trigger = E1000_ICS_RXDMT0; /* @@ -2243,7 +2299,6 @@ em_local_timer(void *arg) ** and the HUNG state will be static if set. */ for (int i = 0; i < adapter->num_queues; i++, txr++) { - /* Last cycle a queue was declared hung */ if (txr->busy == EM_TX_HUNG) goto hung; if (txr->busy >= EM_TX_MAXTRIES) @@ -2261,14 +2316,9 @@ em_local_timer(void *arg) return; hung: /* Looks like we're hung */ - device_printf(adapter->dev, "Watchdog timeout -- resetting\n"); - device_printf(adapter->dev, - "Queue(%d) tdh = %d, hw tdt = %d\n", txr->me, - E1000_READ_REG(&adapter->hw, E1000_TDH(txr->me)), - E1000_READ_REG(&adapter->hw, E1000_TDT(txr->me))); - device_printf(adapter->dev,"TX(%d) desc avail = %d," - "Next TX to Clean = %d\n", - txr->me, txr->tx_avail, txr->next_to_clean); + device_printf(adapter->dev, "Watchdog timeout Queue[%d]-- resetting\n", + txr->me); + em_print_debug_info(adapter); if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); adapter->watchdog_events++; em_init_locked(adapter); @@ -2320,7 +2370,7 @@ em_update_link_status(struct adapter *ad (hw->mac.type == e1000_82572))) { int tarc0; tarc0 = E1000_READ_REG(hw, E1000_TARC(0)); - tarc0 &= ~SPEED_MODE_BIT; + tarc0 &= ~TARC_SPEED_MODE_BIT; E1000_WRITE_REG(hw, E1000_TARC(0), tarc0); } if (bootverbose) @@ -2436,14 +2486,6 @@ em_allocate_pci_resources(struct adapter rman_get_bushandle(adapter->memory); adapter->hw.hw_addr = (u8 *)&adapter->osdep.mem_bus_space_handle; - /* Default to a single queue */ - adapter->num_queues = 1; - - /* - * Setup MSI/X or MSI if PCI Express - */ - adapter->msix = em_setup_msix(adapter); - adapter->hw.back = &adapter->osdep; return (0); @@ -2518,13 +2560,14 @@ em_allocate_msix(struct adapter *adapter struct tx_ring *txr = adapter->tx_rings; struct rx_ring *rxr = adapter->rx_rings; int error, rid, vector = 0; + int cpu_id = 0; /* Make sure all interrupts are disabled */ E1000_WRITE_REG(&adapter->hw, E1000_IMC, 0xffffffff); /* First set up ring resources */ - for (int i = 0; i < adapter->num_queues; i++, txr++, rxr++) { + for (int i = 0; i < adapter->num_queues; i++, rxr++, vector++) { /* RX ring */ rid = vector + 1; @@ -2544,14 +2587,20 @@ em_allocate_msix(struct adapter *adapter return (error); } #if __FreeBSD_version >= 800504 - bus_describe_intr(dev, rxr->res, rxr->tag, "rx %d", i); + bus_describe_intr(dev, rxr->res, rxr->tag, "rx%d", i); #endif - rxr->msix = vector++; /* NOTE increment vector for TX */ + rxr->msix = vector; + + if (em_last_bind_cpu < 0) + em_last_bind_cpu = CPU_FIRST(); + cpu_id = em_last_bind_cpu; + bus_bind_intr(dev, rxr->res, cpu_id); + TASK_INIT(&rxr->rx_task, 0, em_handle_rx, rxr); rxr->tq = taskqueue_create_fast("em_rxq", M_NOWAIT, taskqueue_thread_enqueue, &rxr->tq); - taskqueue_start_threads(&rxr->tq, 1, PI_NET, "%s rxq", - device_get_nameunit(adapter->dev)); + taskqueue_start_threads(&rxr->tq, 1, PI_NET, "%s rxq (cpuid %d)", + device_get_nameunit(adapter->dev), cpu_id); /* ** Set the bit to enable interrupt ** in E1000_IMS -- bits 20 and 21 @@ -2559,8 +2608,13 @@ em_allocate_msix(struct adapter *adapter ** NOTHING to do with the MSIX vector */ rxr->ims = 1 << (20 + i); + adapter->ims |= rxr->ims; adapter->ivars |= (8 | rxr->msix) << (i * 4); + em_last_bind_cpu = CPU_NEXT(em_last_bind_cpu); + } + + for (int i = 0; i < adapter->num_queues; i++, txr++, vector++) { /* TX ring */ rid = vector + 1; txr->res = bus_alloc_resource_any(dev, @@ -2578,14 +2632,20 @@ em_allocate_msix(struct adapter *adapter return (error); } #if __FreeBSD_version >= 800504 - bus_describe_intr(dev, txr->res, txr->tag, "tx %d", i); + bus_describe_intr(dev, txr->res, txr->tag, "tx%d", i); #endif - txr->msix = vector++; /* Increment vector for next pass */ + txr->msix = vector; + + if (em_last_bind_cpu < 0) + em_last_bind_cpu = CPU_FIRST(); + cpu_id = em_last_bind_cpu; + bus_bind_intr(dev, txr->res, cpu_id); + TASK_INIT(&txr->tx_task, 0, em_handle_tx, txr); txr->tq = taskqueue_create_fast("em_txq", M_NOWAIT, taskqueue_thread_enqueue, &txr->tq); - taskqueue_start_threads(&txr->tq, 1, PI_NET, "%s txq", - device_get_nameunit(adapter->dev)); + taskqueue_start_threads(&txr->tq, 1, PI_NET, "%s txq (cpuid %d)", + device_get_nameunit(adapter->dev), cpu_id); /* ** Set the bit to enable interrupt ** in E1000_IMS -- bits 22 and 23 @@ -2593,13 +2653,16 @@ em_allocate_msix(struct adapter *adapter ** NOTHING to do with the MSIX vector */ txr->ims = 1 << (22 + i); + adapter->ims |= txr->ims; adapter->ivars |= (8 | txr->msix) << (8 + (i * 4)); + + em_last_bind_cpu = CPU_NEXT(em_last_bind_cpu); } /* Link interrupt */ - ++rid; + rid = vector + 1; adapter->res = bus_alloc_resource_any(dev, - SYS_RES_IRQ, &rid, RF_ACTIVE); + SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (!adapter->res) { device_printf(dev,"Unable to allocate " "bus resource: Link interrupt [%d]\n", rid); @@ -2615,7 +2678,7 @@ em_allocate_msix(struct adapter *adapter return (error); } #if __FreeBSD_version >= 800504 - bus_describe_intr(dev, adapter->res, adapter->tag, "link"); + bus_describe_intr(dev, adapter->res, adapter->tag, "link"); #endif adapter->linkvec = vector; adapter->ivars |= (8 | vector) << 16; @@ -2639,9 +2702,8 @@ em_free_pci_resources(struct adapter *ad */ for (int i = 0; i < adapter->num_queues; i++) { txr = &adapter->tx_rings[i]; - rxr = &adapter->rx_rings[i]; /* an early abort? */ - if ((txr == NULL) || (rxr == NULL)) + if (txr == NULL) break; rid = txr->msix +1; if (txr->tag != NULL) { @@ -2651,6 +2713,11 @@ em_free_pci_resources(struct adapter *ad if (txr->res != NULL) bus_release_resource(dev, SYS_RES_IRQ, rid, txr->res); + + rxr = &adapter->rx_rings[i]; + /* an early abort? */ + if (rxr == NULL) + break; rid = rxr->msix +1; if (rxr->tag != NULL) { bus_teardown_intr(dev, rxr->res, rxr->tag); @@ -2700,14 +2767,19 @@ em_setup_msix(struct adapter *adapter) device_t dev = adapter->dev; int val; + /* Nearly always going to use one queue */ + adapter->num_queues = 1; + /* - ** Setup MSI/X for Hartwell: tests have shown - ** use of two queues to be unstable, and to - ** provide no great gain anyway, so we simply - ** seperate the interrupts and use a single queue. + ** Try using MSI-X for Hartwell adapters */ if ((adapter->hw.mac.type == e1000_82574) && (em_enable_msix == TRUE)) { +#ifdef EM_MULTIQUEUE + adapter->num_queues = (em_num_queues == 1) ? 1 : 2; + if (adapter->num_queues > 1) + em_enable_vectors_82574(adapter); +#endif /* Map the MSIX BAR */ int rid = PCIR_BAR(EM_MSIX_BAR); adapter->msix_mem = bus_alloc_resource_any(dev, @@ -2719,16 +2791,34 @@ em_setup_msix(struct adapter *adapter) goto msi; } val = pci_msix_count(dev); - /* We only need/want 3 vectors */ - if (val >= 3) - val = 3; - else { - device_printf(adapter->dev, - "MSIX: insufficient vectors, using MSI\n"); - goto msi; + +#ifdef EM_MULTIQUEUE + /* We need 5 vectors in the multiqueue case */ + if (adapter->num_queues > 1 ) { + if (val >= 5) + val = 5; + else { + adapter->num_queues = 1; + device_printf(adapter->dev, + "Insufficient MSIX vectors for >1 queue, " + "using single queue...\n"); + goto msix_one; + } + } else { +msix_one: +#endif + if (val >= 3) + val = 3; + else { + device_printf(adapter->dev, + "Insufficient MSIX vectors, using MSI\n"); + goto msi; + } +#ifdef EM_MULTIQUEUE } +#endif - if ((pci_alloc_msix(dev, &val) == 0) && (val == 3)) { + if ((pci_alloc_msix(dev, &val) == 0)) { device_printf(adapter->dev, "Using MSIX interrupts " "with %d vectors\n", val); @@ -2749,7 +2839,7 @@ msi: } val = 1; if (pci_alloc_msi(dev, &val) == 0) { - device_printf(adapter->dev,"Using an MSI interrupt\n"); + device_printf(adapter->dev, "Using an MSI interrupt\n"); return (val); } /* Should only happen due to manual configuration */ @@ -3394,7 +3484,7 @@ em_initialize_transmit_unit(struct adapt { struct tx_ring *txr = adapter->tx_rings; struct e1000_hw *hw = &adapter->hw; - u32 tctl, tarc, tipg = 0; + u32 tctl, txdctl = 0, tarc, tipg = 0; INIT_DEBUGOUT("em_initialize_transmit_unit: begin"); @@ -3416,6 +3506,15 @@ em_initialize_transmit_unit(struct adapt E1000_READ_REG(&adapter->hw, E1000_TDLEN(i))); txr->busy = EM_TX_IDLE; + txdctl = 0; /* clear txdctl */ + txdctl |= 0x1f; /* PTHRESH */ + txdctl |= 1 << 8; /* HTHRESH */ + txdctl |= 1 << 16;/* WTHRESH */ + txdctl |= 1 << 22; /* Reserved bit 22 must always be 1 */ + txdctl |= E1000_TXDCTL_GRAN; + txdctl |= 1 << 25; /* LWTHRESH */ + + E1000_WRITE_REG(hw, E1000_TXDCTL(i), txdctl); } /* Set the default values for the Tx Inter Packet Gap timer */ @@ -3446,15 +3545,25 @@ em_initialize_transmit_unit(struct adapt if ((adapter->hw.mac.type == e1000_82571) || (adapter->hw.mac.type == e1000_82572)) { tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0)); - tarc |= SPEED_MODE_BIT; + tarc |= TARC_SPEED_MODE_BIT; E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); } else if (adapter->hw.mac.type == e1000_80003es2lan) { + /* errata: program both queues to unweighted RR */ tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0)); tarc |= 1; E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(1)); tarc |= 1; E1000_WRITE_REG(&adapter->hw, E1000_TARC(1), tarc); + } else if (adapter->hw.mac.type == e1000_82574) { + tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0)); + tarc |= TARC_ERRATA_BIT; + if ( adapter->num_queues > 1) { + tarc |= (TARC_COMPENSATION_MODE | TARC_MQ_FIX); + E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); + E1000_WRITE_REG(&adapter->hw, E1000_TARC(1), tarc); + } else + E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); } adapter->txd_cmd = E1000_TXD_CMD_IFCS; @@ -3885,8 +3994,9 @@ em_txeof(struct tx_ring *txr) * TX lock which, with a single queue, guarantees * sanity. */ - if (txr->tx_avail >= EM_MAX_SCATTER) + if (txr->tx_avail >= EM_MAX_SCATTER) { if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); + } /* Disable hang detection if all clean */ if (txr->tx_avail == adapter->num_tx_desc) @@ -4258,6 +4368,9 @@ em_initialize_receive_unit(struct adapte E1000_WRITE_REG(&adapter->hw, E1000_RADV, adapter->rx_abs_int_delay.value); + + E1000_WRITE_REG(&adapter->hw, E1000_RDTR, + adapter->rx_int_delay.value); /* * Set the interrupt throttling rate. Value is calculated * as DEFAULT_ITR = 1/(MAX_INTS_PER_SEC * 256ns) @@ -4269,20 +4382,65 @@ em_initialize_receive_unit(struct adapte ** using the EITR register (82574 only) */ if (hw->mac.type == e1000_82574) { + u32 rfctl; for (int i = 0; i < 4; i++) E1000_WRITE_REG(hw, E1000_EITR_82574(i), DEFAULT_ITR); /* Disable accelerated acknowledge */ - E1000_WRITE_REG(hw, E1000_RFCTL, E1000_RFCTL_ACK_DIS); + rfctl = E1000_READ_REG(hw, E1000_RFCTL); + rfctl |= E1000_RFCTL_ACK_DIS; + E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); } rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); - if (if_getcapenable(ifp) & IFCAP_RXCSUM) + if (if_getcapenable(ifp) & IFCAP_RXCSUM) { +#ifdef EM_MULTIQUEUE + rxcsum |= E1000_RXCSUM_TUOFL | + E1000_RXCSUM_IPOFL | + E1000_RXCSUM_PCSD; +#else rxcsum |= E1000_RXCSUM_TUOFL; - else +#endif + } else rxcsum &= ~E1000_RXCSUM_TUOFL; + E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); +#ifdef EM_MULTIQUEUE + if (adapter->num_queues > 1) { + uint32_t rss_key[10]; + uint32_t reta; + int i; + + /* + * Configure RSS key + */ + arc4rand(rss_key, sizeof(rss_key), 0); + for (i = 0; i < 10; ++i) + E1000_WRITE_REG_ARRAY(hw,E1000_RSSRK(0), i, rss_key[i]); + + /* + * Configure RSS redirect table in following fashion: + * (hash & ring_cnt_mask) == rdr_table[(hash & rdr_table_mask)] + */ + reta = 0; + for (i = 0; i < 4; ++i) { + uint32_t q; + q = (i % adapter->num_queues) << 7; + reta |= q << (8 * i); + } + for (i = 0; i < 32; ++i) + E1000_WRITE_REG(hw, E1000_RETA(i), reta); + + E1000_WRITE_REG(hw, E1000_MRQC, E1000_MRQC_RSS_ENABLE_2Q | + E1000_MRQC_RSS_FIELD_IPV4_TCP | + E1000_MRQC_RSS_FIELD_IPV4 | + E1000_MRQC_RSS_FIELD_IPV6_TCP_EX | + E1000_MRQC_RSS_FIELD_IPV6_EX | + E1000_MRQC_RSS_FIELD_IPV6 | + E1000_MRQC_RSS_FIELD_IPV6_TCP); + } +#endif /* ** XXX TEMPORARY WORKAROUND: on some systems with 82573 ** long latencies are observed, like Lenovo X60. This @@ -4317,13 +4475,30 @@ em_initialize_receive_unit(struct adapte E1000_WRITE_REG(hw, E1000_RDT(i), rdt); } - /* Set PTHRESH for improved jumbo performance */ + /* + * Set PTHRESH for improved jumbo performance + * According to 10.2.5.11 of Intel 82574 Datasheet, + * RXDCTL(1) is written whenever RXDCTL(0) is written. + * Only write to RXDCTL(1) if there is a need for different + * settings. + */ if (((adapter->hw.mac.type == e1000_ich9lan) || (adapter->hw.mac.type == e1000_pch2lan) || (adapter->hw.mac.type == e1000_ich10lan)) && (if_getmtu(ifp) > ETHERMTU)) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0)); E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl | 3); + } else if ((adapter->hw.mac.type == e1000_82574) && + (if_getmtu(ifp) > ETHERMTU)) { + for (int i = 0; i < adapter->num_queues; i++) { + u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(i)); + + rxdctl |= 0x20; /* PTHRESH */ + rxdctl |= 4 << 8; /* HTHRESH */ + rxdctl |= 4 << 16;/* WTHRESH */ + rxdctl |= 1 << 24; /* Switch to granularity */ + E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); + } } if (adapter->hw.mac.type >= e1000_pch2lan) { @@ -4390,6 +4565,11 @@ em_rxeof(struct rx_ring *rxr, int count, EM_RX_LOCK(rxr); + /* Sync the ring */ + bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + + #ifdef DEV_NETMAP if (netmap_rx_irq(ifp, rxr->me, &processed)) { EM_RX_UNLOCK(rxr); @@ -4402,9 +4582,6 @@ em_rxeof(struct rx_ring *rxr, int count, if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) break; - bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 18:49:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72F11BC1; Wed, 3 Jun 2015 18:49:22 +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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4C117C3; Wed, 3 Jun 2015 18:49:21 +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 ESMTPSA id 8883818E10; Wed, 3 Jun 2015 11:49:15 -0700 (PDT) Date: Wed, 3 Jun 2015 11:49:15 -0700 From: hiren panchasara To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283806 - head/contrib/traceroute Message-ID: <20150603184915.GC20409@strugglingcoder.info> References: <201505310810.t4V8AZWR074647@svn.freebsd.org> <20150531185852.GA20409@strugglingcoder.info> <4E05B479-A012-4219-822A-68DF72CCAACF@freebsd.org> <0EA0845B-0C79-40D3-A73A-27EA1C6EDAC0@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="RIYY1s2vRbPFwWeW" Content-Disposition: inline In-Reply-To: <0EA0845B-0C79-40D3-A73A-27EA1C6EDAC0@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: Wed, 03 Jun 2015 18:49:22 -0000 --RIYY1s2vRbPFwWeW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 06/03/15 at 07:58P, Michael Tuexen wrote: > > On 31 May 2015, at 21:45, Michael Tuexen wrote: > >=20 > >> On 31 May 2015, at 20:58, hiren panchasara wrote: > >>=20 > >> On 05/31/15 at 08:10P, Michael Tuexen wrote: > >>> Author: tuexen > >>> Date: Sun May 31 08:10:35 2015 > >>> New Revision: 283806 > >>> URL: https://svnweb.freebsd.org/changeset/base/283806 > >>>=20 > >>> Log: > >>> When the packet verification fails in verbose mode, print the correct > >>> number of words in host byte order. Also remove a stray 'x'. > >>>=20 > >>> MFC after: 3 days > >>>=20 > >>> Modified: > >>> head/contrib/traceroute/traceroute.c > >>=20 > >> Picking up a random traceroute commit here. I am not sure of the histo= ry > >> but don't we try to upstream the fixes for contrib/* things, in genera= l?=20 > > The last version was release 12 years ago. They where integrated in > > https://svnweb.freebsd.org/base?view=3Drevision&revision=3D100787 > >=20 > > I can submit the patches also to traceroute@ee.lbl.gov as indicated in > > https://svnweb.freebsd.org/base/head/contrib/traceroute/FREEBSD-upgrade= ?view=3Dmarkup > I tried to... However, the e-mail address traceroute@ee.lbl.gov doesn't s= eem > to work anymore... In that case, we should continue fixing things in-house like you've been do= ing. Thanks again. cheers, Hiren --RIYY1s2vRbPFwWeW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF8BAEBCgBmBQJVb0wqXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lDAMH/R5/EgTBYtXuhduDNrsPJaft GltOFd+lObkUQnKmGJ7+Rt851M0ODsOgmrXBsRni69ZmVhif/gF2/7PI5tgAd0Ca 1aNX4hA99tWReI8SlkDVVordV1BckTYRngGkp1pL2tsYgx81vN0hrzTJbmtbzFGZ +cC6YWBnqz56OhLtqdZ5rYBv5fGMkQAnwZMfLkp1jFh6oUxvEyUACrUMyvoix1jl agas+AUWG9quokeLYcWf2EnSb0IZlyzzM/jEf8b8OGlJagTlpjkKOqMLo4lrUk2h JYksMsiaT2pLMK/amOlC2hMyEFrd7zOHfwushdqa0set/6MeVtWpeh3Y9OVIndc= =EUif -----END PGP SIGNATURE----- --RIYY1s2vRbPFwWeW-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 19:08:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 097ABEAF; Wed, 3 Jun 2015 19:08:27 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DDE211C7B; Wed, 3 Jun 2015 19:08:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53J8Q75024611; Wed, 3 Jun 2015 19:08:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53J8Q8P024606; Wed, 3 Jun 2015 19:08:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506031908.t53J8Q8P024606@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 3 Jun 2015 19:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283961 - head/usr.sbin/pw 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, 03 Jun 2015 19:08:27 -0000 Author: bapt Date: Wed Jun 3 19:08:25 2015 New Revision: 283961 URL: https://svnweb.freebsd.org/changeset/base/283961 Log: New pw -R rootdir option This allows to set an alternate root directory in which the users/groups will be manipulated Requested by: gjb, ian Tested by: gjb Modified: head/usr.sbin/pw/pw.c head/usr.sbin/pw/pw_user.c head/usr.sbin/pw/pwupd.h Modified: head/usr.sbin/pw/pw.c ============================================================================== --- head/usr.sbin/pw/pw.c Wed Jun 3 18:33:47 2015 (r283960) +++ head/usr.sbin/pw/pw.c Wed Jun 3 19:08:25 2015 (r283961) @@ -56,7 +56,7 @@ static const char *Combo2[] = { struct pwf PWF = { - 0, + PWF_REGULAR, setpwent, endpwent, getpwent, @@ -71,7 +71,7 @@ struct pwf PWF = }; struct pwf VPWF = { - 1, + PWF_ALT, vsetpwent, vendpwent, vgetpwent, @@ -99,24 +99,27 @@ main(int argc, char *argv[]) char *config = NULL; struct userconf *cnf; struct stat st; + char arg; + struct carg *carg; + char *etcpath = NULL; static const char *opts[W_NUM][M_NUM] = { { /* user */ - "V:C:qn:u:c:d:e:p:g:G:mM:k:s:oL:i:w:h:H:Db:NPy:Y", - "V:C:qn:u:rY", - "V:C:qn:u:c:d:e:p:g:G:mM:l:k:s:w:L:h:H:FNPY", - "V:C:qn:u:FPa7", - "V:C:q", - "V:C:q", - "V:C:q" + "R:V:C:qn:u:c:d:e:p:g:G:mM:k:s:oL:i:w:h:H:Db:NPy:Y", + "R:V:C:qn:u:rY", + "R:V:C:qn:u:c:d:e:p:g:G:mM:l:k:s:w:L:h:H:FNPY", + "R:V:C:qn:u:FPa7", + "R:V:C:q", + "R:V:C:q", + "R:V:C:q" }, { /* grp */ - "V:C:qn:g:h:H:M:opNPY", - "V:C:qn:g:Y", - "V:C:qn:d:g:l:h:H:FM:m:NPY", - "V:C:qn:g:FPa", - "V:C:q" + "R:V:C:qn:g:h:H:M:opNPY", + "R:V:C:qn:g:Y", + "R:V:C:qn:d:g:l:h:H:FM:m:NPY", + "R:V:C:qn:g:FPa", + "R:V:C:q" } }; @@ -141,7 +144,8 @@ main(int argc, char *argv[]) /* * Special case, allow pw -V [args] for scripts etc. */ - if (argv[1][1] == 'V') { + arg = argv[1][1]; + if (arg == 'V' || arg == 'R') { optarg = &argv[1][2]; if (*optarg == '\0') { if (stat(argv[2], &st) != 0) @@ -155,7 +159,7 @@ main(int argc, char *argv[]) ++argv; --argc; } - addarg(&arglist, 'V', optarg); + addarg(&arglist, arg, optarg); } else break; } @@ -217,19 +221,29 @@ main(int argc, char *argv[]) config = getarg(&arglist, 'C') ? getarg(&arglist, 'C')->val : NULL; - if (getarg(&arglist, 'V') != NULL) { - char * etcpath = getarg(&arglist, 'V')->val; - if (*etcpath) { - if (config == NULL) { /* Only override config location if -C not specified */ - asprintf(&config, "%s/pw.conf", etcpath); - if (config == NULL) - errx(EX_OSERR, "out of memory"); - } - memcpy(&PWF, &VPWF, sizeof PWF); - setpwdir(etcpath); - setgrdir(etcpath); + if ((carg = getarg(&arglist, 'R')) != NULL) { + asprintf(&etcpath, "%s/etc", carg->val); + if (etcpath == NULL) + errx(EX_OSERR, "out of memory"); + } + if (etcpath == NULL && (carg = getarg(&arglist, 'V')) != NULL) { + etcpath = strdup(carg->val); + if (etcpath == NULL) + errx(EX_OSERR, "out of memory"); + } + if (etcpath && *etcpath) { + if (config == NULL) { /* Only override config location if -C not specified */ + asprintf(&config, "%s/pw.conf", etcpath); + if (config == NULL) + errx(EX_OSERR, "out of memory"); } + setpwdir(etcpath); + setgrdir(etcpath); + memcpy(&PWF, &VPWF, sizeof PWF); + if (getarg(&arglist, 'R')) + PWF._altdir = PWF_ROOTDIR; } + free(etcpath); /* * Now, let's do the common initialisation @@ -303,6 +317,7 @@ cmdhelp(int mode, int which) { "usage: pw useradd [name] [switches]\n" "\t-V etcdir alternate /etc location\n" + "\t-R rootir alternate root directory\n" "\t-C config configuration file\n" "\t-q quiet operation\n" " Adding users:\n" @@ -325,6 +340,7 @@ cmdhelp(int mode, int which) "\t-N no update\n" " Setting defaults:\n" "\t-V etcdir alternate /etc location\n" + "\t-R rootir alternate root directory\n" "\t-D set user defaults\n" "\t-b dir default home root dir\n" "\t-e period default expiry period\n" @@ -341,12 +357,14 @@ cmdhelp(int mode, int which) "\t-y path set NIS passwd file path\n", "usage: pw userdel [uid|name] [switches]\n" "\t-V etcdir alternate /etc location\n" + "\t-R rootir alternate root directory\n" "\t-n name login name\n" "\t-u uid user id\n" "\t-Y update NIS maps\n" "\t-r remove home & contents\n", "usage: pw usermod [uid|name] [switches]\n" "\t-V etcdir alternate /etc location\n" + "\t-R rootir alternate root directory\n" "\t-C config configuration file\n" "\t-q quiet operation\n" "\t-F force add if no user\n" @@ -370,6 +388,7 @@ cmdhelp(int mode, int which) "\t-N no update\n", "usage: pw usershow [uid|name] [switches]\n" "\t-V etcdir alternate /etc location\n" + "\t-R rootir alternate root directory\n" "\t-n name login name\n" "\t-u uid user id\n" "\t-F force print\n" @@ -378,6 +397,7 @@ cmdhelp(int mode, int which) "\t-7 print in v7 format\n", "usage: pw usernext [switches]\n" "\t-V etcdir alternate /etc location\n" + "\t-R rootir alternate root directory\n" "\t-C config configuration file\n" "\t-q quiet operation\n", "usage pw: lock [switches]\n" @@ -392,6 +412,7 @@ cmdhelp(int mode, int which) { "usage: pw groupadd [group|gid] [switches]\n" "\t-V etcdir alternate /etc location\n" + "\t-R rootir alternate root directory\n" "\t-C config configuration file\n" "\t-q quiet operation\n" "\t-n group group name\n" @@ -402,11 +423,13 @@ cmdhelp(int mode, int which) "\t-N no update\n", "usage: pw groupdel [group|gid] [switches]\n" "\t-V etcdir alternate /etc location\n" + "\t-R rootir alternate root directory\n" "\t-n name group name\n" "\t-g gid group id\n" "\t-Y update NIS maps\n", "usage: pw groupmod [group|gid] [switches]\n" "\t-V etcdir alternate /etc location\n" + "\t-R rootir alternate root directory\n" "\t-C config configuration file\n" "\t-q quiet operation\n" "\t-F force add if not exists\n" @@ -420,6 +443,7 @@ cmdhelp(int mode, int which) "\t-N no update\n", "usage: pw groupshow [group|gid] [switches]\n" "\t-V etcdir alternate /etc location\n" + "\t-R rootir alternate root directory\n" "\t-n name group name\n" "\t-g gid group id\n" "\t-F force print\n" @@ -427,6 +451,7 @@ cmdhelp(int mode, int which) "\t-a print all accounting groups\n", "usage: pw groupnext [switches]\n" "\t-V etcdir alternate /etc location\n" + "\t-R rootir alternate root directory\n" "\t-C config configuration file\n" "\t-q quiet operation\n" } Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Wed Jun 3 18:33:47 2015 (r283960) +++ head/usr.sbin/pw/pw_user.c Wed Jun 3 19:08:25 2015 (r283961) @@ -63,6 +63,28 @@ static char *shell_path(char const * static void rmat(uid_t uid); static void rmopie(char const * name); +static void +create_and_populate_homedir(int mode, struct cargs *args, struct passwd *pwd, + struct userconf *cnf) +{ + char *homedir, *dotdir; + struct carg *arg; + + homedir = dotdir = NULL; + + if ((arg = getarg(args, 'R'))) { + asprintf(&homedir, "%s/%s", arg->val, pwd->pw_dir); + if (homedir == NULL) + errx(EX_OSERR, "out of memory"); + asprintf(&dotdir, "%s/%s", arg->val, cnf->dotdir); + } + + copymkdir(homedir ? homedir : pwd->pw_dir, dotdir ? dotdir: cnf->dotdir, + cnf->homemode, pwd->pw_uid, pwd->pw_gid); + pw_log(cnf, mode, W_USER, "%s(%u) home %s made", pwd->pw_name, + pwd->pw_uid, pwd->pw_dir); +} + /*- * -C config configuration file * -q quiet operation @@ -108,6 +130,7 @@ pw_user(struct userconf * cnf, int mode, struct group *grp; struct stat st; char line[_PASSWORD_LEN+1]; + char path[MAXPATHLEN]; FILE *fp; char *dmode_c; void *set = NULL; @@ -451,7 +474,7 @@ pw_user(struct userconf * cnf, int mode, pw_log(cnf, mode, W_USER, "%s(%u) account removed", a_name->val, uid); - if (!PWALTDIR()) { + if (PWALTDIR()) { /* * Remove mail file */ @@ -800,11 +823,13 @@ pw_user(struct userconf * cnf, int mode, * doesn't hurt anything to create the empty mailfile */ if (mode == M_ADD) { - if (!PWALTDIR()) { - snprintf(line, sizeof(line), "%s/%s", _PATH_MAILDIR, pwd->pw_name); - close(open(line, O_RDWR | O_CREAT, 0600)); /* Preserve contents & + if (PWALTDIR() != PWF_ALT) { + arg = getarg(args, 'R'); + snprintf(path, sizeof(path), "%s%s/%s", + arg ? arg->val : "", _PATH_MAILDIR, pwd->pw_name); + close(open(path, O_RDWR | O_CREAT, 0600)); /* Preserve contents & * mtime */ - chown(line, pwd->pw_uid, pwd->pw_gid); + chown(path, pwd->pw_uid, pwd->pw_gid); } } @@ -813,12 +838,9 @@ pw_user(struct userconf * cnf, int mode, * that this also `works' for editing users if -m is used, but * existing files will *not* be overwritten. */ - if (!PWALTDIR() && getarg(args, 'm') != NULL && pwd->pw_dir && *pwd->pw_dir == '/' && pwd->pw_dir[1]) { - copymkdir(pwd->pw_dir, cnf->dotdir, cnf->homemode, pwd->pw_uid, pwd->pw_gid); - pw_log(cnf, mode, W_USER, "%s(%u) home %s made", - pwd->pw_name, pwd->pw_uid, pwd->pw_dir); - } - + if (PWALTDIR() != PWF_ALT && getarg(args, 'm') != NULL && pwd->pw_dir && + *pwd->pw_dir == '/' && pwd->pw_dir[1]) + create_and_populate_homedir(mode, args, pwd, cnf); /* * Finally, send mail to the new user as well, if we are asked to Modified: head/usr.sbin/pw/pwupd.h ============================================================================== --- head/usr.sbin/pw/pwupd.h Wed Jun 3 18:33:47 2015 (r283960) +++ head/usr.sbin/pw/pwupd.h Wed Jun 3 19:08:25 2015 (r283961) @@ -71,6 +71,10 @@ extern struct pwf VPWF; #define GETGRGID(gid) PWF._getgrgid(gid) #define GETGRNAM(nam) PWF._getgrnam(nam) +#define PWF_REGULAR 0 +#define PWF_ALT 1 +#define PWF_ROOTDIR 2 + #define PWALTDIR() PWF._altdir #ifndef _PATH_PWD #define _PATH_PWD "/etc" From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 19:17:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67EFA2A9; Wed, 3 Jun 2015 19:17:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3BDAF1EC6; Wed, 3 Jun 2015 19:17:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53JHko5029588; Wed, 3 Jun 2015 19:17:46 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53JHkYs029587; Wed, 3 Jun 2015 19:17:46 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506031917.t53JHkYs029587@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 3 Jun 2015 19:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283962 - head/usr.sbin/pw 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, 03 Jun 2015 19:17:46 -0000 Author: gjb Date: Wed Jun 3 19:17:45 2015 New Revision: 283962 URL: https://svnweb.freebsd.org/changeset/base/283962 Log: Document pw(8) '-R' option, added in r283961. MFC after: 1 week X-MFC-after: r283961 Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/pw/pw.8 Modified: head/usr.sbin/pw/pw.8 ============================================================================== --- head/usr.sbin/pw/pw.8 Wed Jun 3 19:08:25 2015 (r283961) +++ head/usr.sbin/pw/pw.8 Wed Jun 3 19:17:45 2015 (r283962) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 29, 2012 +.Dd June 3, 2015 .Dt PW 8 .Os .Sh NAME @@ -32,6 +32,7 @@ .Nd create, remove, modify & display system users and groups .Sh SYNOPSIS .Nm +.Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar useradd .Op name|uid @@ -57,6 +58,7 @@ .Op Fl P .Op Fl Y .Nm +.Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar useradd .Op name|uid @@ -76,6 +78,7 @@ .Op Fl s Ar shell .Op Fl y Ar path .Nm +.Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar userdel .Op name|uid @@ -84,6 +87,7 @@ .Op Fl r .Op Fl Y .Nm +.Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar usermod .Op name|uid @@ -109,6 +113,7 @@ .Op Fl P .Op Fl Y .Nm +.Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar usershow .Op name|uid @@ -119,11 +124,13 @@ .Op Fl 7 .Op Fl a .Nm +.Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar usernext .Op Fl C Ar config .Op Fl q .Nm +.Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar groupadd .Op group|gid @@ -138,6 +145,7 @@ .Op Fl P .Op Fl Y .Nm +.Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar groupdel .Op group|gid @@ -145,6 +153,7 @@ .Op Fl g Ar gid .Op Fl Y .Nm +.Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar groupmod .Op group|gid @@ -161,6 +170,7 @@ .Op Fl P .Op Fl Y .Nm +.Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar groupshow .Op group|gid @@ -170,17 +180,20 @@ .Op Fl P .Op Fl a .Nm +.Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar groupnext .Op Fl C Ar config .Op Fl q .Nm +.Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar lock .Op name|uid .Op Fl C Ar config .Op Fl q .Nm +.Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar unlock .Op name|uid @@ -246,6 +259,12 @@ options. .Pp The following flags are common to most or all modes of operation: .Bl -tag -width "-G grouplist" +.It Fl R Ar rootdir +Specifies an alternate root directory within which +.Nm +will operate. +Any paths specified will be relative to +.Va rootdir . .It Fl V Ar etcdir This flag sets an alternate location for the password, group and configuration files, and may be used to maintain a user/group database in an alternate location. From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 19:18:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5588D407; Wed, 3 Jun 2015 19:18:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 3 Jun 2015 19:18:02 +0000 From: Glen Barber To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283961 - head/usr.sbin/pw Message-ID: <20150603191802.GA1550@hub.FreeBSD.org> References: <201506031908.t53J8Q8P024606@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline In-Reply-To: <201506031908.t53J8Q8P024606@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer 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: Wed, 03 Jun 2015 19:18:07 -0000 --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 03, 2015 at 07:08:26PM +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Jun 3 19:08:25 2015 > New Revision: 283961 > URL: https://svnweb.freebsd.org/changeset/base/283961 >=20 > Log: > New pw -R rootdir option > =20 > This allows to set an alternate root directory in which the users/group= s will be > manipulated > =20 > Requested by: gjb, ian > Tested by: gjb >=20 Thank you! Glen --UugvWAfsgieZRqgk Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVb1LkAAoJEAMUWKVHj+KTYZgP/RyRO/Z7/b6Xj2ykXQy1qtHT axUZdpZ1Z0xnESoHtRyr6KuZsbibpiH/jPgeFqprpmhkWILhhM97rplm8XkKp2Vo pcBWjvHVkjL37+SMp357OgWCMg7Prom0X6I/U/sDaYqGv4gxEgtFslDyhbs0xoYk R86AeP0jpbSelBQwkh+3j3+wGqWE4bi3YP+W634TPwEnaM3wAdT4voUkxTnat601 jOWuHLtL5RAxjCW63m68g2WJ3mXlDvnfRrpyqJawFe25d3H8u0N0XWpPSqV6ZYkJ 5oCmNfcJYwAdRgc3cjq2y1c/QD4xHiqH4P2yrDVcsA26TOzaTukX42PpIBccjTgA jPBd9G4DXXGn8Dpu6xQ53SpZHCMGQnaUctwSAo11bVf1HWYbJXlx1KQs9GcRv3PC /6pc0H2VzLTuyHvjZrPjvkZNKEQy9vg01Jy1QKqErKUrkTkmz0ZaDMqj5Dgfab0y UeB0NVowCiBXmiJtkgU/Y2frZI9OfbhFmURzqxy0YxGekckm715txx4p3HsJdcQm IdIqAcdQvmzy41895jndOsk2+GQvQO7ixge3FgwBuFlriMvId3QkM8UGfA8N6X8z JMroB8WONeYpXQIzyLHhH70soOWoJeOhxyP1xEtTVt3z7stMclAQaBrHeYZBoGfF 6EJZW0cS3b+rYz+rVehP =Z6CM -----END PGP SIGNATURE----- --UugvWAfsgieZRqgk-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 19:19:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA52C572; Wed, 3 Jun 2015 19:19:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 97B351EDE; Wed, 3 Jun 2015 19:19:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53JJQ6P029862; Wed, 3 Jun 2015 19:19:26 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53JJQTG029861; Wed, 3 Jun 2015 19:19:26 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506031919.t53JJQTG029861@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 3 Jun 2015 19:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283963 - head/release/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: Wed, 03 Jun 2015 19:19:26 -0000 Author: gjb Date: Wed Jun 3 19:19:25 2015 New Revision: 283963 URL: https://svnweb.freebsd.org/changeset/base/283963 Log: Use the new pw(8) '-R' option to create the users/groups. MFC after: 1 week X-MFC-after: r283961 Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Wed Jun 3 19:17:45 2015 (r283962) +++ head/release/tools/arm.subr Wed Jun 3 19:19:25 2015 (r283963) @@ -80,14 +80,13 @@ arm_create_disk() { arm_create_user() { # Create a default user account 'freebsd' with the password 'freebsd', # and set the default password for the 'root' user to 'root'. - chroot ${CHROOTDIR} /usr/sbin/pw -V ${DESTDIR}/etc \ + chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ groupadd freebsd -g 1001 - chroot ${CHROOTDIR} /usr/sbin/pw -V ${DESTDIR}/etc \ + chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ useradd freebsd \ -m -M 0755 -w yes -n freebsd -u 1001 -g 1001 -G 0 \ - -c 'FreeBSD User' -d '/home/freebsd' -s '/bin/csh' \ - -b "${DESTDIR}/home" - chroot ${CHROOTDIR} /usr/sbin/pw -V ${DESTDIR}/etc \ + -c 'FreeBSD User' -d '/home/freebsd' -s '/bin/csh' + chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ usermod root -w yes return 0 From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 19:22:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0E0A6EF; Wed, 3 Jun 2015 19:22:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CF1F410D6; Wed, 3 Jun 2015 19:22:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53JMGe5033889; Wed, 3 Jun 2015 19:22:16 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53JMGWp033888; Wed, 3 Jun 2015 19:22:16 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506031922.t53JMGWp033888@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 3 Jun 2015 19:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283964 - head/lib/libutil 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, 03 Jun 2015 19:22:17 -0000 Author: bapt Date: Wed Jun 3 19:22:16 2015 New Revision: 283964 URL: https://svnweb.freebsd.org/changeset/base/283964 Log: Fix typo Modified: head/lib/libutil/pw_util.3 Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Wed Jun 3 19:19:25 2015 (r283963) +++ head/lib/libutil/pw_util.3 Wed Jun 3 19:22:16 2015 (r283964) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2012 +.Dd June 06, 2015 .Dt PW_UTIL 3 .Os .Sh NAME @@ -222,7 +222,7 @@ and it is the caller's responsibility to The .Fn pw_mkdb function regenerates the password database by running -.Xr pw_mkdb 8 . +.Xr pwd_mkdb 8 . If .Fa user only the record corresponding to that user will be updated. From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 19:40:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D372ADD; Wed, 3 Jun 2015 19:40:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4A65D13A6; Wed, 3 Jun 2015 19:40:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53Je0dm039936; Wed, 3 Jun 2015 19:40:00 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53JdxYO039882; Wed, 3 Jun 2015 19:39:59 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201506031939.t53JdxYO039882@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 3 Jun 2015 19:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283966 - in head/sys/contrib/dev/acpica: common 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: Wed, 03 Jun 2015 19:40:00 -0000 Author: jkim Date: Wed Jun 3 19:39:59 2015 New Revision: 283966 URL: https://svnweb.freebsd.org/changeset/base/283966 Log: MFV: r283965 - Update GUIDs for new NFIT tables. - Fix ill-formed GUID strings for NFIT tables. - Fix a possible fault when performing a UUID search. Modified: head/sys/contrib/dev/acpica/common/ahuuids.c head/sys/contrib/dev/acpica/include/acuuid.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/common/ahuuids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahuuids.c Wed Jun 3 19:27:36 2015 (r283965) +++ head/sys/contrib/dev/acpica/common/ahuuids.c Wed Jun 3 19:39:59 2015 (r283966) @@ -43,6 +43,7 @@ #include #include +#include #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("ahuuids") @@ -52,44 +53,36 @@ */ const AH_UUID AcpiUuids[] = { - {"PCI Host Bridge Device", - "33db4d5b-1ff7-401c-9657-7441c03dd766"}, - - {"Platform-wide Capabilities", - "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"}, - - {"Dynamic Enumeration", - "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"}, - - {"GPIO Controller", - "4f248f40-d5e2-499f-834c-27758ea1cd3f"}, - - {"Battery Thermal Limit", - "4c2067e3-887d-475c-9720-4af1d3ed602e"}, - - {"Thermal Extensions", - "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"}, - - {"USB Controller", - "ce2ee385-00e6-48cb-9f05-2edb927c4899"}, - - {"HID I2C Device", - "3cdff6f7-4267-4555-ad05-b30a3d8938de"}, - - {"Power Button Device", - "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"}, - - {"Device Labeling Interface", - "e5c937d0-3553-4d7a-9117-ea4d19c3434d"}, - - {"SATA Controller", - "e4db149b-fcfe-425b-a6d8-92357d78fc7f"}, - - {"Physical Presence Interface", - "3dddfaa6-361b-4eb4-a424-8d10089d1653"}, - - {"Device Properties for _DSD", - "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"}, + {"[Controllers]", NULL}, + {"GPIO Controller", UUID_GPIO_CONTROLLER}, + {"USB Controller", UUID_USB_CONTROLLER}, + {"SATA Controller", UUID_SATA_CONTROLLER}, + + {"[Devices]", NULL}, + {"PCI Host Bridge Device", UUID_PCI_HOST_BRIDGE}, + {"HID I2C Device", UUID_I2C_DEVICE}, + {"Power Button Device", UUID_POWER_BUTTON}, + + {"[Interfaces]", NULL}, + {"Device Labeling Interface", UUID_DEVICE_LABELING}, + {"Physical Presence Interface", UUID_PHYSICAL_PRESENCE}, + + {"[Non-volatile DIMM and NFIT table]", NULL}, + {"Volatile Memory Region", UUID_VOLATILE_MEMORY}, + {"Persistent Memory Region", UUID_PERSISTENT_MEMORY}, + {"NVDIMM Control Region", UUID_CONTROL_REGION}, + {"NVDIMM Data Region", UUID_DATA_REGION}, + {"Volatile Virtual Disk", UUID_VOLATILE_VIRTUAL_DISK}, + {"Volatile Virtual CD", UUID_VOLATILE_VIRTUAL_CD}, + {"Persistent Virtual Disk", UUID_PERSISTENT_VIRTUAL_DISK}, + {"Persistent Virtual CD", UUID_PERSISTENT_VIRTUAL_CD}, + + {"[Miscellaneous]", NULL}, + {"Platform-wide Capabilities", UUID_PLATFORM_CAPABILITIES}, + {"Dynamic Enumeration", UUID_DYNAMIC_ENUMERATION}, + {"Battery Thermal Limit", UUID_BATTERY_THERMAL_LIMIT}, + {"Thermal Extensions", UUID_THERMAL_EXTENSIONS}, + {"Device Properties for _DSD", UUID_DEVICE_PROPERTIES}, {NULL, NULL} }; @@ -120,6 +113,13 @@ AcpiAhMatchUuid ( for (Info = AcpiUuids; Info->Description; Info++) { + /* Null string means desciption is a UUID class */ + + if (!Info->String) + { + continue; + } + AcpiUtConvertStringToUuid (Info->String, UuidBuffer); if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH)) Modified: head/sys/contrib/dev/acpica/include/acuuid.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acuuid.h Wed Jun 3 19:27:36 2015 (r283965) +++ head/sys/contrib/dev/acpica/include/acuuid.h Wed Jun 3 19:39:59 2015 (r283966) @@ -50,15 +50,41 @@ * Note2: This file is standalone and should remain that way. */ -/* NFIT/NVDIMM */ +/* Controllers */ + +#define UUID_GPIO_CONTROLLER "4f248f40-d5e2-499f-834c-27758ea1cd3f" +#define UUID_USB_CONTROLLER "ce2ee385-00e6-48cb-9f05-2edb927c4899" +#define UUID_SATA_CONTROLLER "e4db149b-fcfe-425b-a6d8-92357d78fc7f" + +/* Devices */ + +#define UUID_PCI_HOST_BRIDGE "33db4d5b-1ff7-401c-9657-7441c03dd766" +#define UUID_I2C_DEVICE "3cdff6f7-4267-4555-ad05-b30a3d8938de" +#define UUID_POWER_BUTTON "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c" + +/* Interfaces */ + +#define UUID_DEVICE_LABELING "e5c937d0-3553-4d7a-9117-ea4d19c3434d" +#define UUID_PHYSICAL_PRESENCE "3dddfaa6-361b-4eb4-a424-8d10089d1653" + +/* NVDIMM - NFIT table */ + +#define UUID_VOLATILE_MEMORY "7305944f-fdda-44e3-b16c-3f22d252e5d0" +#define UUID_PERSISTENT_MEMORY "66f0d379-b4f3-4074-ac43-0d3318b78cdb" +#define UUID_CONTROL_REGION "92f701f6-13b4-405d-910b-299367e8234c" +#define UUID_DATA_REGION "91af0530-5d86-470e-a6b0-0a2db9408249" +#define UUID_VOLATILE_VIRTUAL_DISK "77ab535a-45fc-624b-5560-f7b281d1f96e" +#define UUID_VOLATILE_VIRTUAL_CD "3d5abd30-4175-87ce-6d64-d2ade523c4bb" +#define UUID_PERSISTENT_VIRTUAL_DISK "5cea02c9-4d07-69d3-269f-4496fbe096f9" +#define UUID_PERSISTENT_VIRTUAL_CD "08018188-42cd-bb48-100f-5387d53ded3d" + +/* Miscellaneous */ + +#define UUID_PLATFORM_CAPABILITIES "0811b06e-4a27-44f9-8d60-3cbbc22e7b48" +#define UUID_DYNAMIC_ENUMERATION "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf" +#define UUID_BATTERY_THERMAL_LIMIT "4c2067e3-887d-475c-9720-4af1d3ed602e" +#define UUID_THERMAL_EXTENSIONS "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500" +#define UUID_DEVICE_PROPERTIES "daffd814-6eba-4d8c-8a91-bc9bbf4aa301" -#define UUID_VOLATILE_MEMORY "4F940573-DAFD-E344-B16C-3F22D252E5D0" -#define UUID_PERSISTENT_MEMORY "79D3F066-F3B4-7440-AC43-0D3318B78CDB" -#define UUID_CONTROL_REGION "F601F792-B413-5D40-910B-299367E8234C" -#define UUID_DATA_REGION "3005AF91-865D-0E47-A6B0-0A2DB9408249" -#define UUID_VOLATILE_VIRTUAL_DISK "5A53AB77-FC45-4B62-5560-F7B281D1F96E" -#define UUID_VOLATILE_VIRTUAL_CD "30BD5A3D-7541-CE87-6D64-D2ADE523C4BB" -#define UUID_PERSISTENT_VIRTUAL_DISK "C902EA5C-074D-69D3-269F-4496FBE096F9" -#define UUID_PERSISTENT_VIRTUAL_CD "88810108-CD42-48BB-100F-5387D53DED3D" #endif /* __AUUID_H__ */ From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 19:48:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1713ACF8; Wed, 3 Jun 2015 19:48:33 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DDA49169C; Wed, 3 Jun 2015 19:48:32 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t53JmPTH013431 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Jun 2015 12:48:25 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t53JmP8K013430; Wed, 3 Jun 2015 12:48:25 -0700 (PDT) (envelope-from jmg) Date: Wed, 3 Jun 2015 12:48:25 -0700 From: John-Mark Gurney To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283929 - head/games/grdc Message-ID: <20150603194825.GJ50817@funkthat.com> References: <201506022053.t52KrIuk046680@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201506022053.t52KrIuk046680@svn.freebsd.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Wed, 03 Jun 2015 12:48:25 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Jun 2015 19:48:33 -0000 Ed Maste wrote this message on Tue, Jun 02, 2015 at 20:53 +0000: > Author: emaste > Date: Tue Jun 2 20:53:17 2015 > New Revision: 283929 > URL: https://svnweb.freebsd.org/changeset/base/283929 > > Log: > Correct grdc(1) 12-hour display between 12:00 and 13:00 > > PM starts at 12:00, not 13:00. > > PR: 194291, 200133 > Submitted by: Nick Price > MFC after: 1 week The fact that this was missed for a 20+ year old program shows that we should just remove it... and that it wasn't using strftime to get it, and the patch doesn't use strftime's %p... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 20:01:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6285938D; Wed, 3 Jun 2015 20:01:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E22611A23; Wed, 3 Jun 2015 20:01:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t53K105v044978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 3 Jun 2015 23:01:00 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t53K10Cc044977; Wed, 3 Jun 2015 23:01:00 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 3 Jun 2015 23:01:00 +0300 From: Gleb Smirnoff To: Luiz Otavio O Souza Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283948 - head/sys/dev/dwc Message-ID: <20150603200100.GB73119@FreeBSD.org> References: <201506031448.t53Em4Gn090709@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201506031448.t53Em4Gn090709@svn.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: Wed, 03 Jun 2015 20:01:03 -0000 On Wed, Jun 03, 2015 at 02:48:04PM +0000, Luiz Otavio O Souza wrote: L> Author: loos L> Date: Wed Jun 3 14:48:03 2015 L> New Revision: 283948 L> URL: https://svnweb.freebsd.org/changeset/base/283948 L> L> Log: L> Fix the OACTIVE handling on if_dwc. L> L> Previously the OACTIVE flag was being set when the tx descriptors are fully L> allocated but it wasn't unset anywhere. L> L> As soon as a packet is transmitted, unset the OACTIVE flag and call start L> routine to push any pending packets from the tx queue. L> L> This closes another race where a full tx queue would jam the tx path (tx L> queue is full, new packets cannot be added to queue and dwc_txstart never L> gets called). The only real fix of OACTIVE handling is removing OACTIVE :) -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 20:02:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 996C04EA; Wed, 3 Jun 2015 20:02:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 219A01B82; Wed, 3 Jun 2015 20:02:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t53K2AHw044994 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 3 Jun 2015 23:02:10 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t53K2AOQ044993; Wed, 3 Jun 2015 23:02:10 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 3 Jun 2015 23:02:10 +0300 From: Gleb Smirnoff To: hiren panchasara Cc: Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283806 - head/contrib/traceroute Message-ID: <20150603200210.GC73119@FreeBSD.org> References: <201505310810.t4V8AZWR074647@svn.freebsd.org> <20150531185852.GA20409@strugglingcoder.info> <4E05B479-A012-4219-822A-68DF72CCAACF@freebsd.org> <0EA0845B-0C79-40D3-A73A-27EA1C6EDAC0@freebsd.org> <20150603184915.GC20409@strugglingcoder.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150603184915.GC20409@strugglingcoder.info> 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: Wed, 03 Jun 2015 20:02:13 -0000 On Wed, Jun 03, 2015 at 11:49:15AM -0700, hiren panchasara wrote: h> > >> Picking up a random traceroute commit here. I am not sure of the history h> > >> but don't we try to upstream the fixes for contrib/* things, in general? h> > > The last version was release 12 years ago. They where integrated in h> > > https://svnweb.freebsd.org/base?view=revision&revision=100787 h> > > h> > > I can submit the patches also to traceroute@ee.lbl.gov as indicated in h> > > https://svnweb.freebsd.org/base/head/contrib/traceroute/FREEBSD-upgrade?view=markup h> > I tried to... However, the e-mail address traceroute@ee.lbl.gov doesn't seem h> > to work anymore... h> h> In that case, we should continue fixing things in-house like you've been doing. And probably 'svn mv' it out of contrib. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 20:04:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7117266F; Wed, 3 Jun 2015 20:04:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 44E2D1BB4; Wed, 3 Jun 2015 20:04:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53K4eIY053981; Wed, 3 Jun 2015 20:04:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53K4eY1053980; Wed, 3 Jun 2015 20:04:40 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506032004.t53K4eY1053980@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 3 Jun 2015 20:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283967 - head/share/doc/papers/bufbio 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, 03 Jun 2015 20:04:40 -0000 Author: bapt Date: Wed Jun 3 20:04:39 2015 New Revision: 283967 URL: https://svnweb.freebsd.org/changeset/base/283967 Log: In r282297 \fC was wrong changed to \fCW.) when it should have been \fCW Reported by: carsten.kunze@arcor.de (heirloom doctools) Modified: head/share/doc/papers/bufbio/bio.ms Modified: head/share/doc/papers/bufbio/bio.ms ============================================================================== --- head/share/doc/papers/bufbio/bio.ms Wed Jun 3 19:39:59 2015 (r283966) +++ head/share/doc/papers/bufbio/bio.ms Wed Jun 3 20:04:39 2015 (r283967) @@ -40,7 +40,7 @@ This paper contains the road-map for a s FreeBSD, which will support these facilities. .AE .NH -The miseducation of \f(CW.)struct buf\fP. +The miseducation of \f(CWstruct buf\fP. .PP To fully appreciate the topic, I include a little historic overview of struct buf, it is a most enlightening case of not exactly bit-rot @@ -215,7 +215,7 @@ and Vinum. They all basically do the sa a logical space to a physical space, and the mappings they perform can be 1:1 or 1:N. \** .FS -It is interesting to note that Lions in his comments to the \f(CW.)rkaddr\fP +It is interesting to note that Lions in his comments to the \f(CWrkaddr\fP routine (p. 16-2) writes \fIThe code in this procedure incorporates a special feature for files which extend over more than one disk drive. This feature is described in the UPM Section "RK(IV)". Its @@ -258,7 +258,7 @@ limited extent diskslice/label, which need only the I/O aspect, not the vnode, caching or VM linkage. .IP .I -The I/O aspect of struct buf should be put in a separate \f(CW.)struct bio\fP. +The I/O aspect of struct buf should be put in a separate \f(CWstruct bio\fP. .R .NH 1 Implications for future struct buf improvements @@ -296,7 +296,7 @@ Anything that could be added to or done the I/O aspect of struct buf can also be added to or done with the I/O aspect if it lives in a new "struct bio". .NH 1 -Implementing a \f(CW.)struct bio\fP +Implementing a \f(CWstruct bio\fP .PP The first decision to be made was who got to use the name "struct buf", and considering the fact that it is the I/O aspect which gets separated From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 20:45:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81D0023A; Wed, 3 Jun 2015 20:45:59 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D51A1614; Wed, 3 Jun 2015 20:45:59 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:50350 helo=tinkerbell.pixel8networks.com) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Z08vI-000BWQ-RY; Wed, 03 Jun 2015 06:41:36 -0700 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Subject: Re: svn commit: r283929 - head/games/grdc From: Devin Teske In-Reply-To: <20150603194825.GJ50817@funkthat.com> Date: Wed, 3 Jun 2015 13:45:55 -0700 Cc: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Content-Transfer-Encoding: quoted-printable Message-Id: <4D6EF798-B894-41AC-8889-84791D925D7E@FreeBSD.org> References: <201506022053.t52KrIuk046680@svn.freebsd.org> <20150603194825.GJ50817@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.1990.1) Sender: devin@shxd.cx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Jun 2015 20:45:59 -0000 > On Jun 3, 2015, at 12:48 PM, John-Mark Gurney = wrote: >=20 > Ed Maste wrote this message on Tue, Jun 02, 2015 at 20:53 +0000: >> Author: emaste >> Date: Tue Jun 2 20:53:17 2015 >> New Revision: 283929 >> URL: https://svnweb.freebsd.org/changeset/base/283929 >>=20 >> Log: >> Correct grdc(1) 12-hour display between 12:00 and 13:00 >>=20 >> PM starts at 12:00, not 13:00. >>=20 >> PR: 194291, 200133 >> Submitted by: Nick Price >> MFC after: 1 week >=20 > The fact that this was missed for a 20+ year old program shows that > we should just remove it=E2=80=A6 FYI removal was discussed on src-commmitters@ (svn-src-all@ and svn-src-head@ were also CC=E2=80=99d) on these days by these people: Thread Subject: svn commit r278616 - in head: . = contrib/netbsd-tests/games etc etc/mtree etc/root games games/caesar games/fortune/ datfiles release/scripts share/man/man4 share/man/man6 share/man/man7 share/mk sh... Feb 10, 2015 @ 01:47A: commit r278616 by cperciva removes grdc et. al. = games Feb 10, 2015 @ 01:49A: cperciva says if you want punch card support, = e-mail off-list Feb 10, 2015 @ 02:29A: dteske voices opposition to removal of grdc Feb 10, 2015 @ 06:36A: Slawa Olihovchenkov voices opposition to removal = of pom Feb 10, 2015 @ 10:25A: Jan Beich gives opinions on grdc Feb 10, 2015 @ 10:37A: Stanislav Sedov gives +1 for keeping grdc and voices opposition to removal of caesar/rot13 Then fast forward to February 21: Thread Subject: svn commit: r279150 - in head: . games games/bcd = games/ppt tools/build/mk February 21, 2015 @ 11:23P: cperciva moves forward with ``Step 2 of = eliminating the =E2=80=9Cgames=E2=80=9D distribution=E2=80=99=E2=80=99 while = retaining pom, grdc, rot13, and caesar utilities based on ``an astonishing volume of email informing [cperciva] that = those are still being widely used.=E2=80=99' =E2=80=94=20 Cheers, Devin From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 20:48:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEC4D3A7; Wed, 3 Jun 2015 20:48:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9D63B1630; Wed, 3 Jun 2015 20:48:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53Km1ri074500; Wed, 3 Jun 2015 20:48:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53Km1nc074499; Wed, 3 Jun 2015 20:48:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506032048.t53Km1nc074499@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Jun 2015 20:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283968 - head/sys/ufs/ffs 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, 03 Jun 2015 20:48:01 -0000 Author: kib Date: Wed Jun 3 20:48:00 2015 New Revision: 283968 URL: https://svnweb.freebsd.org/changeset/base/283968 Log: Syncing a directory vnode might drop the vnode lock in the softdep_sync() similarly to the regular vnode sync. Allow retry for both vnode types. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Wed Jun 3 20:04:39 2015 (r283967) +++ head/sys/ufs/ffs/ffs_vnops.c Wed Jun 3 20:48:00 2015 (r283968) @@ -201,8 +201,8 @@ retry: * bo_dirty list. Recheck and resync as needed. */ BO_LOCK(bo); - if (vp->v_type == VREG && (bo->bo_numoutput > 0 || - bo->bo_dirty.bv_cnt > 0)) { + if ((vp->v_type == VREG || vp->v_type == VDIR) && + (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0)) { BO_UNLOCK(bo); goto retry; } From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 20:48:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C71C64EA; Wed, 3 Jun 2015 20:48:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B50181635; Wed, 3 Jun 2015 20:48:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53KmTwA074623; Wed, 3 Jun 2015 20:48:29 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53KmSCf074619; Wed, 3 Jun 2015 20:48:28 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506032048.t53KmSCf074619@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 3 Jun 2015 20:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283969 - head/lib/libutil 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, 03 Jun 2015 20:48:29 -0000 Author: bapt Date: Wed Jun 3 20:48:28 2015 New Revision: 283969 URL: https://svnweb.freebsd.org/changeset/base/283969 Log: Add a pw_mkdb2(3) function which does the same thing as pw_mkdb(3) except it takes a new argument allowing to specify the endianness of the database to generate Differential Revision: https://reviews.freebsd.org/D2730 Reviewed by: ian Modified: head/lib/libutil/Makefile head/lib/libutil/libutil.h head/lib/libutil/pw_util.3 head/lib/libutil/pw_util.c Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Wed Jun 3 20:48:00 2015 (r283968) +++ head/lib/libutil/Makefile Wed Jun 3 20:48:28 2015 (r283969) @@ -78,6 +78,7 @@ MLINKS+=pw_util.3 pw_copy.3 \ pw_util.3 pw_make.3 \ pw_util.3 pw_make_v7.3 \ pw_util.3 pw_mkdb.3 \ + pw_util.3 pw_mkdb2.3 \ pw_util.3 pw_lock.3 \ pw_util.3 pw_scan.3 \ pw_util.3 pw_tempname.3 \ Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Wed Jun 3 20:48:00 2015 (r283968) +++ head/lib/libutil/libutil.h Wed Jun 3 20:48:28 2015 (r283969) @@ -144,6 +144,9 @@ char *fparseln(FILE *_fp, size_t *_len, #endif #ifdef _PWD_H_ +#define PWDB_NATIVE 0 +#define PWDB_LE 1 +#define PWDB_BE 2 int pw_copy(int _ffd, int _tfd, const struct passwd *_pw, struct passwd *_old_pw); struct passwd @@ -155,6 +158,7 @@ int pw_init(const char *_dir, const char char *pw_make(const struct passwd *_pw); char *pw_make_v7(const struct passwd *_pw); int pw_mkdb(const char *_user); +int pw_mkdb2(const char *_user, int endian); int pw_lock(void); struct passwd * pw_scan(const char *_line, int _flags); Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Wed Jun 3 20:48:00 2015 (r283968) +++ head/lib/libutil/pw_util.3 Wed Jun 3 20:48:28 2015 (r283969) @@ -37,6 +37,7 @@ .Nm pw_make , .Nm pw_make_v7 , .Nm pw_mkdb , +.Nm pw_mkdb2 , .Nm pw_lock , .Nm pw_scan , .Nm pw_tempname , @@ -66,6 +67,8 @@ .Ft int .Fn pw_mkdb "const char *user" .Ft int +.Fn pw_mkdb "const char *user" "int endian" +.Ft int .Fn pw_lock "void" .Ft "struct passwd *" .Fn pw_scan "const char *line" "int flags" @@ -225,11 +228,30 @@ function regenerates the password databa .Xr pwd_mkdb 8 . If .Fa user -only the record corresponding to that user will be updated. +is set, only the record corresponding to that user will be updated. The .Fn pw_mkdb function returns 0 in case of success and -1 in case of failure. .Pp +.Fn pw_mkdb2 +function regenerates the password database by running +.Xr pwd_mkdb 8 . +If +.Fa user +is set, only the record corresponding to that user will be updated. +.Pp +The +.Fa endian +variable can take the following values +.Bl -tag -width PWDB_NATIVE +.It Dv PWDB_NATIVE +the database will be generated in host native endianness. +.It Dv PWDB_LE +the database will be generated in Little-endian. +.It Dv PWDB_BE +the database will be generated in Big-endian. +.El +.Pp The .Fn pw_lock function locks the master password file. Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Wed Jun 3 20:48:00 2015 (r283968) +++ head/lib/libutil/pw_util.c Wed Jun 3 20:48:28 2015 (r283969) @@ -242,14 +242,36 @@ pw_tmp(int mfd) return (tfd); } +int +pw_mkdb(const char *user) +{ + + return (pw_mkdb2(user, PWDB_NATIVE)); +} + /* * Regenerate the password database. */ int -pw_mkdb(const char *user) +pw_mkdb2(const char *user, int endian) { int pstat; pid_t pid; + const char *arg; + + switch (endian) { + case PWDB_NATIVE: + arg = "-p"; + break; + case PWDB_LE: + arg = "-pL"; + break; + case PWDB_BE: + arg = "-pB"; + break; + default: + return (-1); + } (void)fflush(stderr); switch ((pid = fork())) { @@ -258,10 +280,10 @@ pw_mkdb(const char *user) case 0: /* child */ if (user == NULL) - execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", + execl(_PATH_PWD_MKDB, "pwd_mkdb", arg, "-d", passwd_dir, tempname, (char *)NULL); else - execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", + execl(_PATH_PWD_MKDB, "pwd_mkdb", arg, "-d", passwd_dir, "-u", user, tempname, (char *)NULL); _exit(1); From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 21:26:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DFD3FE4; Wed, 3 Jun 2015 21:26:52 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 665BC1FFD; Wed, 3 Jun 2015 21:26:52 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t53LQpdQ014395 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Jun 2015 14:26:51 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t53LQpPU014394; Wed, 3 Jun 2015 14:26:51 -0700 (PDT) (envelope-from jmg) Date: Wed, 3 Jun 2015 14:26:51 -0700 From: John-Mark Gurney To: Devin Teske Cc: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283929 - head/games/grdc Message-ID: <20150603212651.GL50817@funkthat.com> References: <201506022053.t52KrIuk046680@svn.freebsd.org> <20150603194825.GJ50817@funkthat.com> <4D6EF798-B894-41AC-8889-84791D925D7E@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D6EF798-B894-41AC-8889-84791D925D7E@FreeBSD.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Wed, 03 Jun 2015 14:26:51 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Jun 2015 21:26:52 -0000 Devin Teske wrote this message on Wed, Jun 03, 2015 at 13:45 -0700: > > On Jun 3, 2015, at 12:48 PM, John-Mark Gurney wrote: > > > > Ed Maste wrote this message on Tue, Jun 02, 2015 at 20:53 +0000: > >> Author: emaste > >> Date: Tue Jun 2 20:53:17 2015 > >> New Revision: 283929 > >> URL: https://svnweb.freebsd.org/changeset/base/283929 > >> > >> Log: > >> Correct grdc(1) 12-hour display between 12:00 and 13:00 > >> > >> PM starts at 12:00, not 13:00. > >> > >> PR: 194291, 200133 > >> Submitted by: Nick Price > >> MFC after: 1 week > > > > The fact that this was missed for a 20+ year old program shows that > > we should just remove it??? > > FYI removal was discussed on src-commmitters@ (svn-src-all@ and > svn-src-head@ were also CC???d) on these days by these people: Ok, and what does this mean to you? To me that the two people who voiced their support of keeping it didn't notice such a trivial bug, or bother to commit the bugs in the database shows they aren't interested in maintaining it.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 21:51:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53CEA5A1; Wed, 3 Jun 2015 21:51:49 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::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 009A5170D; Wed, 3 Jun 2015 21:51:49 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by wgv5 with SMTP id 5so19905330wgv.1; Wed, 03 Jun 2015 14:51:46 -0700 (PDT) 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=jAtQrqvwxQDkA0D+Pn/tvu2Qm2w/OVf+pouHCS71vrI=; b=f0nQhC7J68soF26ym3vt0CqI50MKPDAhIN4CDl18UaFtQzf+IirSRn7NVw89JSeC0v XMiKucx5wsPvF1L0gymBEp5Q/xIVadOZ2thgdA+RcMqjL26NjbRlOWov5Ny6C2aR1lnp Dy+0sTaI+NenW2WGBf2C9ar7rDhA+OO7tfvofyvmbZwGYUb4ZKLKWCg/Ik1lNVmicYRP TjqrCqeoJPdzNyNBZKCl+ICj0pVf7vxX0Vnk31LzLzCe4alofNN36xP8G0nu44hOCiZw MX6TWb/BWJ5h4WIh8PSmB2wg0mu6jrRb8TYjjFP7ReYZurHQLkjDls2ybQgIU21XWGg9 v9tA== MIME-Version: 1.0 X-Received: by 10.180.82.6 with SMTP id e6mr46194313wiy.84.1433368306549; Wed, 03 Jun 2015 14:51:46 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.27.100.214 with HTTP; Wed, 3 Jun 2015 14:51:46 -0700 (PDT) In-Reply-To: <201506032048.t53KmSCf074619@svn.freebsd.org> References: <201506032048.t53KmSCf074619@svn.freebsd.org> Date: Thu, 4 Jun 2015 00:51:46 +0300 X-Google-Sender-Auth: ylTLYRuPXJ-O0hQ7jnqNbv8gy50 Message-ID: Subject: Re: svn commit: r283969 - head/lib/libutil From: Sergey Kandaurov To: Baptiste Daroussin 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, 03 Jun 2015 21:51:49 -0000 On 3 June 2015 at 23:48, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Jun 3 20:48:28 2015 > New Revision: 283969 > URL: https://svnweb.freebsd.org/changeset/base/283969 > > Log: > Add a pw_mkdb2(3) function which does the same thing as pw_mkdb(3) except > it takes a new argument allowing to specify the endianness of the database > to generate > Why not change pw_mkdb()? Is it used outside of the project? > Modified: head/lib/libutil/pw_util.3 > ============================================================================== > --- head/lib/libutil/pw_util.3 Wed Jun 3 20:48:00 2015 (r283968) > +++ head/lib/libutil/pw_util.3 Wed Jun 3 20:48:28 2015 (r283969) > @@ -37,6 +37,7 @@ > .Nm pw_make , > .Nm pw_make_v7 , > .Nm pw_mkdb , > +.Nm pw_mkdb2 , > .Nm pw_lock , > .Nm pw_scan , > .Nm pw_tempname , > @@ -66,6 +67,8 @@ > .Ft int > .Fn pw_mkdb "const char *user" > .Ft int > +.Fn pw_mkdb "const char *user" "int endian" typo there -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 21:58:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DA8677E; Wed, 3 Jun 2015 21:58:46 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::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 00D3A1791; Wed, 3 Jun 2015 21:58:46 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wifw1 with SMTP id w1so37934888wif.0; Wed, 03 Jun 2015 14:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=R65MZoseHgJTu44oQdPfV7/754WZwTazDHSy/HkBu8U=; b=nE9ELEQ/Ga+3g/f/jtd1dwUKdv+0CEHR+vmQ1OM8LYEINGD3oaI9fvRm3HkAJaouQn fU8N0bi2KoWvKORYti98tGJ/dNI0Qbs2ad6PqFGdf3pi495hw95Yn95bsFTJX4zZrSKf 4KiBPttAyD2MA17WjL0Ah0MOx2V0udvDxdUAYimCL0ATiSWFXrp21/T11s6DFmPi8W20 axYoLa5GMM9LoPSmYpNZVT5++UPzBzrBp3pR45Us2lQaT9OJ79NFR5SLCEWmqYqVlDUt PJR2gGh7dDT87cfIn081am+7zTLGsqOC310ZIobEjdxDZbb18vmThZzPBcDP/WV/6kUF Xchg== X-Received: by 10.194.200.228 with SMTP id jv4mr63435282wjc.157.1433368724364; Wed, 03 Jun 2015 14:58:44 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id js3sm2886944wjc.5.2015.06.03.14.58.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2015 14:58:43 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 3 Jun 2015 23:58:41 +0200 From: Baptiste Daroussin To: Sergey Kandaurov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r283969 - head/lib/libutil Message-ID: <20150603215841.GF32562@ivaldir.etoilebsd.net> References: <201506032048.t53KmSCf074619@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Wtrm9ATX0sn6fFKv" Content-Disposition: inline In-Reply-To: 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: Wed, 03 Jun 2015 21:58:46 -0000 --Wtrm9ATX0sn6fFKv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 04, 2015 at 12:51:46AM +0300, Sergey Kandaurov wrote: > On 3 June 2015 at 23:48, Baptiste Daroussin wrote: > > Author: bapt > > Date: Wed Jun 3 20:48:28 2015 > > New Revision: 283969 > > URL: https://svnweb.freebsd.org/changeset/base/283969 > > > > Log: > > Add a pw_mkdb2(3) function which does the same thing as pw_mkdb(3) ex= cept > > it takes a new argument allowing to specify the endianness of the dat= abase > > to generate > > >=20 > Why not change pw_mkdb()? Is it used outside of the project? >=20 Because that would change the ABI of libutil and it is not a private librar= y aka we are supposed to maintain ABI compatibility as we do not know if it is us= ed or not externally to the project. I care about the ABI because I have made this change in order to use it in pw(8) and MFC it to stable/10 before 10.2. libutil is not versionned so this is the only way to not break the ABI. Exc= ept if someone has a better idea than I do. Best regards, Bapt --Wtrm9ATX0sn6fFKv Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlVveJEACgkQ8kTtMUmk6EzviACgsPTwWtjKbdgBy1eoW0yzp07U nYgAn1/+XXfW0AfV14Zg9HYFfE5isAv/ =ipb9 -----END PGP SIGNATURE----- --Wtrm9ATX0sn6fFKv-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 22:01:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 397438FA; Wed, 3 Jun 2015 22:01:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 27F47187E; Wed, 3 Jun 2015 22:01:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53M1Erg010893; Wed, 3 Jun 2015 22:01:14 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53M1ErV010892; Wed, 3 Jun 2015 22:01:14 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506032201.t53M1ErV010892@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 3 Jun 2015 22:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283970 - head/lib/libutil 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, 03 Jun 2015 22:01:14 -0000 Author: bapt Date: Wed Jun 3 22:01:13 2015 New Revision: 283970 URL: https://svnweb.freebsd.org/changeset/base/283970 Log: Capitalize the list of accepted variables Suggested by: wblock Modified: head/lib/libutil/pw_util.3 Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Wed Jun 3 20:48:28 2015 (r283969) +++ head/lib/libutil/pw_util.3 Wed Jun 3 22:01:13 2015 (r283970) @@ -245,11 +245,11 @@ The variable can take the following values .Bl -tag -width PWDB_NATIVE .It Dv PWDB_NATIVE -the database will be generated in host native endianness. +The database will be generated in host native endianness. .It Dv PWDB_LE -the database will be generated in Little-endian. +The database will be generated in Little-endian. .It Dv PWDB_BE -the database will be generated in Big-endian. +The database will be generated in Big-endian. .El .Pp The From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 22:43:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1FE8EB9; Wed, 3 Jun 2015 22:43:47 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 87EA91301; Wed, 3 Jun 2015 22:43:47 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from zeta.ixsystems.com (unknown [12.229.62.2]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 0E82017078; Wed, 3 Jun 2015 15:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1433371427; x=1433385827; bh=WWgXDwHXfjfuLUPJe1I3yZKLXrD4XQ5T10UnFQyr+VA=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=C8JdP6Z6C+JKUdlQjCx7RxwaXRJfl9vB5Cuo7wAYrDfqoRzeuY5oMiuJ0byOR3Vg4 FEqZZ6P+kd6gxcRYJG7ulT9OQgBflT+mXP2HczcN7DN6OHYwX+wcrAP2QA0XAkeKW/ NGidPD6Lm4nvTvMmCUWWYhPzXsn2VLEQrsW0IOG8= Message-ID: <556F8322.9050602@delphij.net> Date: Wed, 03 Jun 2015 15:43:46 -0700 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Baptiste Daroussin , Sergey Kandaurov CC: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, nectar@FreeBSD.org Subject: Re: svn commit: r283969 - head/lib/libutil References: <201506032048.t53KmSCf074619@svn.freebsd.org> <20150603215841.GF32562@ivaldir.etoilebsd.net> In-Reply-To: <20150603215841.GF32562@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=windows-1252 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, 03 Jun 2015 22:43:47 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 06/03/15 14:58, Baptiste Daroussin wrote: > On Thu, Jun 04, 2015 at 12:51:46AM +0300, Sergey Kandaurov wrote: >> On 3 June 2015 at 23:48, Baptiste Daroussin >> wrote: >>> Author: bapt Date: Wed Jun 3 20:48:28 2015 New Revision: >>> 283969 URL: https://svnweb.freebsd.org/changeset/base/283969 >>> >>> Log: Add a pw_mkdb2(3) function which does the same thing as >>> pw_mkdb(3) except it takes a new argument allowing to specify >>> the endianness of the database to generate >>> >> >> Why not change pw_mkdb()? Is it used outside of the project? >> > Because that would change the ABI of libutil and it is not a > private library aka we are supposed to maintain ABI compatibility > as we do not know if it is used or not externally to the project. I > care about the ABI because I have made this change in order to use > it in pw(8) and MFC it to stable/10 before 10.2. > > libutil is not versionned so this is the only way to not break the > ABI. Except if someone has a better idea than I do. Looking at r113596, pwd_mkdb(8) was changed to generate both legacy (version 3, endianness sensitive) and new (version 4, machine independent) formats. Now, after 12 years, is it still sensible to generate legacy format db entries? Maybe we should just disable the generation by default and eventually remove the ability to generate them? Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.1.4 (FreeBSD) iQIcBAEBCgAGBQJVb4MYAAoJEJW2GBstM+nsUqAP/1VTYSVd4CvhepOd6uEoi6YG 616V2X6vNNA11BKK7AHWjSIydzwpg1GNrEUeSUwoU7vCzNAsU0zIjYWK2Vfl30ru PFjtuDlJwU3z5qhYtLlBOoSMQk+0LDJ0t8SSeaaXNO589t+66B+USSJk1YvTGOB8 KkkLq20Y+C+VyVEQ76I/RExJE5aJSvtUgN4+po+Ic8iZHhSWPJoe7XsHK/L/R/QZ WJuGQe7qmbpfi1j1wHdGRpdtYzZolwvc8Z6RHNhIA7h5m83wdR0zOgtH/RlFAtn8 4IBd2V0YCBTz6nrRav1lSo/tXGrKTFzoM6ij+Sjl4k2IQXsc/DkIpV9XUJH4oQBF mhJlNP7BxomUlb2J6anqfdh3+ni3Rpx3FN+77lAMe1IWolbEwJkXsVZDUDZ8O4Ik QF+qa+lY4aFR83ZNq9AG0aU7/UdoX0+COr0VJ0SwYk/DgpmGOqhxLnOMyWdWehLm kIeJkZPySGNGqnqUISfSRxjKXns7CqfGEuRMO6ED2m+x0Tg4KMmklnjnMPG4H8hv qbt4ALynIeuaGIG7oCrc1EXw5XbrMrPeU2mIA+82uqAGgsQdYngFi4vzr3kp7CkK yLKxlFuPrQ6QS9uJI1/MhCDpXff+GzJGE5R22QgFsLNiQemDfvjVcne4ZBBTwWI7 S78XZWGwJihSGp0XgDAd =4wxs -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 23:10:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60AAA2DC; Wed, 3 Jun 2015 23:10:32 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 490E6181F; Wed, 3 Jun 2015 23:10:32 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:51199 helo=tinkerbell.pixel8networks.com) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Z0B8y-000Gln-VD; Wed, 03 Jun 2015 09:03:53 -0700 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Subject: Re: svn commit: r283929 - head/games/grdc From: Devin Teske In-Reply-To: <20150603212651.GL50817@funkthat.com> Date: Wed, 3 Jun 2015 16:10:35 -0700 Cc: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Message-Id: <65EE2E83-06C1-446B-94F7-6CFAB99B990D@FreeBSD.org> References: <201506022053.t52KrIuk046680@svn.freebsd.org> <20150603194825.GJ50817@funkthat.com> <4D6EF798-B894-41AC-8889-84791D925D7E@FreeBSD.org> <20150603212651.GL50817@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.1990.1) Sender: devin@shxd.cx 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: Wed, 03 Jun 2015 23:10:32 -0000 > On Jun 3, 2015, at 2:26 PM, John-Mark Gurney wrote: >=20 > Devin Teske wrote this message on Wed, Jun 03, 2015 at 13:45 -0700: >>> On Jun 3, 2015, at 12:48 PM, John-Mark Gurney = wrote: >>>=20 >>> Ed Maste wrote this message on Tue, Jun 02, 2015 at 20:53 +0000: >>>> Author: emaste >>>> Date: Tue Jun 2 20:53:17 2015 >>>> New Revision: 283929 >>>> URL: https://svnweb.freebsd.org/changeset/base/283929 >>>>=20 >>>> Log: >>>> Correct grdc(1) 12-hour display between 12:00 and 13:00 >>>>=20 >>>> PM starts at 12:00, not 13:00. >>>>=20 >>>> PR: 194291, 200133 >>>> Submitted by: Nick Price >>>> MFC after: 1 week >>>=20 >>> The fact that this was missed for a 20+ year old program shows that >>> we should just remove it??? >>=20 >> FYI removal was discussed on src-commmitters@ (svn-src-all@ and >> svn-src-head@ were also CC???d) on these days by these people: >=20 > Ok, and what does this mean to you? >=20 > To me that the two people who voiced their support of keeping it > didn't notice such a trivial bug, or bother to commit the bugs in > the database shows they aren't interested in maintaining it.. >=20 Means that the people using it (incl. me) never hit those edge-cases. Seldom is there time to go poking around the code of things that appear to be working as-expected 100% of the time. That=E2=80=99s all. In the case of this particular bug, I hadn=E2=80=99t noticed it. And I = use grdc all the time. What can we say? code gets better over time with more eyeballs (and sometimes the old eyeballs stop scrutinizing, so it=E2=80=99= s often good to also have young eyeballs take a look at things). I don=E2=80=99t think this situation is a call for deprecating anything. =E2=80=94=20 Devin= From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 00:01:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C8F482C; Thu, 4 Jun 2015 00:01:58 +0000 (UTC) (envelope-from rionda@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 60DD014C4; Thu, 4 Jun 2015 00:01:58 +0000 (UTC) (envelope-from rionda@gmail.com) Received: by oihb142 with SMTP id b142so19797682oih.3; Wed, 03 Jun 2015 17:01:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=ko7U1f0xTuGMrrzLK9W3mHqzCjJGPxH/361IXdPsQpU=; b=gyqEpr7Si5PxUliT5WKjU7J7L/oTUQYijjMFwIzOBBBHcppQZXGVqgYatYbvhSN5G9 yI5RhwrAtn0t3TUpjuZb2DHWz8Vt7YEvGaM/wn0IwgNbrAG2yElcFkea2xjJen6jxd5j Jt2kkwN+LpH/p1TSwv6L6NK9lCzyU0/9Pu/sXT+5mI7ki45RyLAaPLhewSTuq3ujH3hq OYTJ0QUQPqanhychFV+ycgai/BsQ1zI1z0UCJDzQvfbQkByxq0xciAeJXuY0W/+LXcdi siqev9/x5Gmi2I1LlDOvyKfFNW4IVNLQBSGv4s3zKiZ2rcKwoymfq86dQw31iAoRrrSK bXTg== X-Received: by 10.202.107.77 with SMTP id g74mr28215141oic.120.1433376117282; Wed, 03 Jun 2015 17:01:57 -0700 (PDT) MIME-Version: 1.0 Sender: rionda@gmail.com Received: by 10.76.91.131 with HTTP; Wed, 3 Jun 2015 17:01:36 -0700 (PDT) In-Reply-To: <65EE2E83-06C1-446B-94F7-6CFAB99B990D@FreeBSD.org> References: <201506022053.t52KrIuk046680@svn.freebsd.org> <20150603194825.GJ50817@funkthat.com> <4D6EF798-B894-41AC-8889-84791D925D7E@FreeBSD.org> <20150603212651.GL50817@funkthat.com> <65EE2E83-06C1-446B-94F7-6CFAB99B990D@FreeBSD.org> From: Matteo Riondato Date: Wed, 3 Jun 2015 20:01:36 -0400 X-Google-Sender-Auth: 1_9KrKDTXdfyOdiC0ysTCQRGJOc Message-ID: Subject: Re: svn commit: r283929 - head/games/grdc To: Devin Teske Cc: John-Mark Gurney , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Maste 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, 04 Jun 2015 00:01:58 -0000 On Wed, Jun 3, 2015 at 7:10 PM, Devin Teske wrote: > >> On Jun 3, 2015, at 2:26 PM, John-Mark Gurney wrote: >> Ok, and what does this mean to you? >> >> To me that the two people who voiced their support of keeping it >> didn't notice such a trivial bug, or bother to commit the bugs in >> the database shows they aren't interested in maintaining it.. >> > > Means that the people using it (incl. me) never hit those edge-cases. > In the case of this particular bug, I hadn=E2=80=99t noticed it. And I us= e grdc > all the time. So do I and I've never noticed it either, and it's because it only happens when running "grdc -t". I didn't even know that "grdc" had options. =3D) Best, Matteo From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 02:12:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51BBF5A0; Thu, 4 Jun 2015 02:12:24 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 25BDF11B9; Thu, 4 Jun 2015 02:12:24 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t542COjY036510; Thu, 4 Jun 2015 02:12:24 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t542CO4N036509; Thu, 4 Jun 2015 02:12:24 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201506040212.t542CO4N036509@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Thu, 4 Jun 2015 02:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283973 - head/sys/amd64/vmm/amd 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, 04 Jun 2015 02:12:24 -0000 Author: neel Date: Thu Jun 4 02:12:23 2015 New Revision: 283973 URL: https://svnweb.freebsd.org/changeset/base/283973 Log: Use tunable 'hw.vmm.svm.features' to disable specific SVM features even though they might be available in hardware. Use tunable 'hw.vmm.svm.num_asids' to limit the number of ASIDs used by the hypervisor. MFC after: 1 week Modified: head/sys/amd64/vmm/amd/svm.c Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Thu Jun 4 01:52:17 2015 (r283972) +++ head/sys/amd64/vmm/amd/svm.c Thu Jun 4 02:12:23 2015 (r283973) @@ -102,8 +102,8 @@ static MALLOC_DEFINE(M_SVM_VLAPIC, "svm- /* Per-CPU context area. */ extern struct pcpu __pcpu[]; -static uint32_t svm_feature; /* AMD SVM features. */ -SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, features, CTLFLAG_RD, &svm_feature, 0, +static uint32_t svm_feature = ~0U; /* AMD SVM features. */ +SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, features, CTLFLAG_RDTUN, &svm_feature, 0, "SVM features advertised by CPUID.8000000AH:EDX"); static int disable_npf_assist; @@ -112,7 +112,7 @@ SYSCTL_INT(_hw_vmm_svm, OID_AUTO, disabl /* Maximum ASIDs supported by the processor */ static uint32_t nasid; -SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, num_asids, CTLFLAG_RD, &nasid, 0, +SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, num_asids, CTLFLAG_RDTUN, &nasid, 0, "Number of ASIDs supported by this processor"); /* Current ASID generation for each host cpu */ @@ -174,9 +174,14 @@ check_svm_features(void) /* CPUID Fn8000_000A is for SVM */ do_cpuid(0x8000000A, regs); - svm_feature = regs[3]; + svm_feature &= regs[3]; - nasid = regs[1]; + /* + * The number of ASIDs can be configured to be less than what is + * supported by the hardware but not more. + */ + if (nasid == 0 || nasid > regs[1]) + nasid = regs[1]; KASSERT(nasid > 1, ("Insufficient ASIDs for guests: %#x", nasid)); /* bhyve requires the Nested Paging feature */ From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 02:44:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB05B900; Thu, 4 Jun 2015 02:44:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C8B5018C1; Thu, 4 Jun 2015 02:44:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t542ibel051339; Thu, 4 Jun 2015 02:44:37 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t542ibW9051338; Thu, 4 Jun 2015 02:44:37 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201506040244.t542ibW9051338@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 4 Jun 2015 02:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283974 - head/lib/libugidfw 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, 04 Jun 2015 02:44:38 -0000 Author: araujo (ports committer) Date: Thu Jun 4 02:44:37 2015 New Revision: 283974 URL: https://svnweb.freebsd.org/changeset/base/283974 Log: Remove unused variables and silence clang warnings. Differential Revision: D2686 Reviewed by: rodrigc Modified: head/lib/libugidfw/ugidfw.c Modified: head/lib/libugidfw/ugidfw.c ============================================================================== --- head/lib/libugidfw/ugidfw.c Thu Jun 4 02:12:23 2015 (r283973) +++ head/lib/libugidfw/ugidfw.c Thu Jun 4 02:44:37 2015 (r283974) @@ -64,11 +64,10 @@ bsde_rule_to_string(struct mac_bsdextend struct statfs *mntbuf; char *cur, type[sizeof(rule->mbr_object.mbo_type) * CHAR_BIT + 1]; size_t left, len; - int anymode, unknownmode, truncated, numfs, i, notdone; + int anymode, unknownmode, numfs, i, notdone; cur = buf; left = buflen; - truncated = 0; len = snprintf(cur, left, "subject "); if (len < 0 || len > left) @@ -1216,7 +1215,7 @@ bsde_delete_rule(int rulenum, size_t buf { struct mac_bsdextended_rule rule; int name[10]; - size_t len, size; + size_t len; int error; if (bsde_check_version(buflen, errstr) != 0) @@ -1233,7 +1232,6 @@ bsde_delete_rule(int rulenum, size_t buf name[len] = rulenum; len++; - size = sizeof(rule); error = sysctl(name, len, NULL, NULL, &rule, 0); if (error) { len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 02:48:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42F36A7B; Thu, 4 Jun 2015 02:48:05 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 309DA18E0; Thu, 4 Jun 2015 02:48:05 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t542m5Gt051867; Thu, 4 Jun 2015 02:48:05 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t542m57I051866; Thu, 4 Jun 2015 02:48:05 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201506040248.t542m57I051866@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 4 Jun 2015 02:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283975 - 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, 04 Jun 2015 02:48:05 -0000 Author: araujo (ports committer) Date: Thu Jun 4 02:48:04 2015 New Revision: 283975 URL: https://svnweb.freebsd.org/changeset/base/283975 Log: Clean up unused variable and silence clang warnings. Differential Revision: D2682 Reviewed by: rodrigc Modified: head/lib/libdpv/dprompt.c Modified: head/lib/libdpv/dprompt.c ============================================================================== --- head/lib/libdpv/dprompt.c Thu Jun 4 02:44:37 2015 (r283974) +++ head/lib/libdpv/dprompt.c Thu Jun 4 02:48:04 2015 (r283975) @@ -391,7 +391,6 @@ dprompt_add_files(struct dpv_file_node * enum dprompt_state dstate; int estext_lsize; int estext_rsize; - int estext_size; int flabel_size; int hlen; int lsize; @@ -559,13 +558,11 @@ dprompt_add_files(struct dpv_file_node * bg_code = "\\Zr\\Z1"; /* Red */ estext_lsize = fail_lsize; estext_rsize = fail_rsize; - estext_size = fail_size; estext = fail; } else { /* e.g., DPV_STATUS_DONE */ bg_code = "\\Zr\\Z2"; /* Green */ estext_lsize = done_lsize; estext_rsize = done_rsize; - estext_size = done_size; estext = done; } switch (dstate) { From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 02:50:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8061BBD5; Thu, 4 Jun 2015 02:50:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6DF921910; Thu, 4 Jun 2015 02:50:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t542oEaQ052733; Thu, 4 Jun 2015 02:50:14 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t542oEhA052732; Thu, 4 Jun 2015 02:50:14 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201506040250.t542oEhA052732@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 4 Jun 2015 02:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283976 - head/lib/libdevstat 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, 04 Jun 2015 02:50:14 -0000 Author: araujo (ports committer) Date: Thu Jun 4 02:50:13 2015 New Revision: 283976 URL: https://svnweb.freebsd.org/changeset/base/283976 Log: Remove unused variable and silence clang warnings. Differential Revision: D2681 Reviewed by: rodrigc Modified: head/lib/libdevstat/devstat.c Modified: head/lib/libdevstat/devstat.c ============================================================================== --- head/lib/libdevstat/devstat.c Thu Jun 4 02:48:04 2015 (r283975) +++ head/lib/libdevstat/devstat.c Thu Jun 4 02:50:13 2015 (r283976) @@ -334,7 +334,6 @@ devstat_getdevs(kvm_t *kd, struct statin { int error; size_t dssize; - int oldnumdevs; long oldgeneration; int retval = 0; struct devinfo *dinfo; @@ -348,7 +347,6 @@ devstat_getdevs(kvm_t *kd, struct statin return(-1); } - oldnumdevs = dinfo->numdevs; oldgeneration = dinfo->generation; if (kd == NULL) { From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 05:21:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2ABDC08; Thu, 4 Jun 2015 05:21:25 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::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 760751D2B; Thu, 4 Jun 2015 05:21:25 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wiga1 with SMTP id a1so35363890wig.0; Wed, 03 Jun 2015 22:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=XbKSL4vs2yW8yS9GHRGqSB8EEDnwMNIa4ljh+6UEjK8=; b=QqPvCEuEYsrkvyC6fk9sKYIyYzfl35Vtr5fCwBJp7pcEFObeodYXxbhLVJyfsz9497 /5UPrf0wBlG8cAFfQxUrVeylfEzBjxl14pYAqeqEvw8ODUloWlplIg3ZDAPFjANNeVVv 9Mq+WJ/2lsGK4DAzCGzvpZAUmAXULZlGCecFwIgmH9MCRh1RBxoGkqv3bGDqgzoY4dTS G5Oc8uzoA6xZhIPPLFMEAWptDxBTVTrkU959imszO+yN8szzOGRj1Q5LWFpHJ33PtM1B iXSzIYwCGPip9kwP7jDhqgdCblcGkn0WYw8xDQEkKJpMGEw7Vn8ILJGHA2b7PqTrx9oC gDCQ== X-Received: by 10.194.178.39 with SMTP id cv7mr34728301wjc.100.1433395283963; Wed, 03 Jun 2015 22:21:23 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id c3sm3958167wja.3.2015.06.03.22.21.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2015 22:21:23 -0700 (PDT) Sender: Baptiste Daroussin Date: Thu, 4 Jun 2015 07:21:21 +0200 From: Baptiste Daroussin To: d@delphij.net Cc: Sergey Kandaurov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, nectar@FreeBSD.org Subject: Re: svn commit: r283969 - head/lib/libutil Message-ID: <20150604052120.GH32562@ivaldir.etoilebsd.net> References: <201506032048.t53KmSCf074619@svn.freebsd.org> <20150603215841.GF32562@ivaldir.etoilebsd.net> <556F8322.9050602@delphij.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CD/aTaZybdUisKIc" Content-Disposition: inline In-Reply-To: <556F8322.9050602@delphij.net> 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: Thu, 04 Jun 2015 05:21:26 -0000 --CD/aTaZybdUisKIc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 03, 2015 at 03:43:46PM -0700, Xin Li wrote: > On 06/03/15 14:58, Baptiste Daroussin wrote: > > On Thu, Jun 04, 2015 at 12:51:46AM +0300, Sergey Kandaurov wrote: > >> On 3 June 2015 at 23:48, Baptiste Daroussin > >> wrote: > >>> Author: bapt Date: Wed Jun 3 20:48:28 2015 New Revision: > >>> 283969 URL: https://svnweb.freebsd.org/changeset/base/283969 > >>>=20 > >>> Log: Add a pw_mkdb2(3) function which does the same thing as > >>> pw_mkdb(3) except it takes a new argument allowing to specify > >>> the endianness of the database to generate > >>>=20 > >>=20 > >> Why not change pw_mkdb()? Is it used outside of the project? > >>=20 > > Because that would change the ABI of libutil and it is not a > > private library aka we are supposed to maintain ABI compatibility > > as we do not know if it is used or not externally to the project. I > > care about the ABI because I have made this change in order to use > > it in pw(8) and MFC it to stable/10 before 10.2. > >=20 > > libutil is not versionned so this is the only way to not break the > > ABI. Except if someone has a better idea than I do. >=20 > Looking at r113596, pwd_mkdb(8) was changed to generate both legacy > (version 3, endianness sensitive) and new (version 4, machine > independent) formats. >=20 > Now, after 12 years, is it still sensible to generate legacy format db > entries? Maybe we should just disable the generation by default and > eventually remove the ability to generate them? >=20 That could be an option, in this case we could add a -l (legacy) option to pwd_mkdb to allow the users to generate the db in legacy format and drop su= pport support for legacy format in all other tools. Meaning I can revert pw_mkdb2= (3) If noone raised a voice against disable the generation by default, I'll do = it in a couple of days. Best regards, Bapt --CD/aTaZybdUisKIc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlVv4E8ACgkQ8kTtMUmk6EzcJQCgj7JXlzynJdha7X8XIVawQ0Il 8W8AnR27CtARQzhy5+YG4qM2QnlXkrEF =cIO6 -----END PGP SIGNATURE----- --CD/aTaZybdUisKIc-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 05:31:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31770EBE; Thu, 4 Jun 2015 05:31:02 +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 E3B5D1E66; Thu, 4 Jun 2015 05:31:01 +0000 (UTC) (envelope-from joel@vnode.se) Received: from ymer.vnode.se (h71n10-th-c-d4.ias.bredband.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 C661112F37; Thu, 4 Jun 2015 07:30:51 +0200 (CEST) Date: Thu, 4 Jun 2015 07:30:51 +0200 From: Joel Dahl To: Gleb Smirnoff Cc: hiren panchasara , Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283806 - head/contrib/traceroute Message-ID: <20150604053051.GA12118@ymer.vnode.se> Mail-Followup-To: Gleb Smirnoff , hiren panchasara , Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201505310810.t4V8AZWR074647@svn.freebsd.org> <20150531185852.GA20409@strugglingcoder.info> <4E05B479-A012-4219-822A-68DF72CCAACF@freebsd.org> <0EA0845B-0C79-40D3-A73A-27EA1C6EDAC0@freebsd.org> <20150603184915.GC20409@strugglingcoder.info> <20150603200210.GC73119@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150603200210.GC73119@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: Thu, 04 Jun 2015 05:31:02 -0000 On Wed, Jun 03, 2015 at 11:02:10PM +0300, Gleb Smirnoff wrote: > On Wed, Jun 03, 2015 at 11:49:15AM -0700, hiren panchasara wrote: > h> > >> Picking up a random traceroute commit here. I am not sure of the history > h> > >> but don't we try to upstream the fixes for contrib/* things, in general? > h> > > The last version was release 12 years ago. They where integrated in > h> > > https://svnweb.freebsd.org/base?view=revision&revision=100787 > h> > > > h> > > I can submit the patches also to traceroute@ee.lbl.gov as indicated in > h> > > https://svnweb.freebsd.org/base/head/contrib/traceroute/FREEBSD-upgrade?view=markup > h> > I tried to... However, the e-mail address traceroute@ee.lbl.gov doesn't seem > h> > to work anymore... > h> > h> In that case, we should continue fixing things in-house like you've been doing. > > And probably 'svn mv' it out of contrib. Yes, please move it. There is no upstream. -- Joel From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 05:37:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9CA418B; Thu, 4 Jun 2015 05:37:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C7CF51FEC; Thu, 4 Jun 2015 05:37:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t545b7cP035938; Thu, 4 Jun 2015 05:37:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t545b7XK035937; Thu, 4 Jun 2015 05:37:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201506040537.t545b7XK035937@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 4 Jun 2015 05:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283979 - head/sys/dev/iwn 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, 04 Jun 2015 05:37:08 -0000 Author: adrian Date: Thu Jun 4 05:37:07 2015 New Revision: 283979 URL: https://svnweb.freebsd.org/changeset/base/283979 Log: Disable bgscan for now - it interferes with 11n activity and general stability. I'll re-enable it once the scan overhaul is done - the NIC itself can do bgscan, but not how we're doing it. MFC after: 2 weeks Sponsored by: Norse Corp, Inc. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Thu Jun 4 04:54:54 2015 (r283978) +++ head/sys/dev/iwn/if_iwn.c Thu Jun 4 05:37:07 2015 (r283979) @@ -565,7 +565,9 @@ iwn_attach(device_t dev) ic->ic_caps = IEEE80211_C_STA /* station mode supported */ | IEEE80211_C_MONITOR /* monitor mode supported */ +#if 0 | IEEE80211_C_BGSCAN /* background scanning */ +#endif | IEEE80211_C_TXPMGT /* tx power management */ | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_WPA From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 06:30:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A5522B5; Thu, 4 Jun 2015 06:30:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 784BA1D4F; Thu, 4 Jun 2015 06:30:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t546UeZQ062064; Thu, 4 Jun 2015 06:30:40 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t546Uelc061867; Thu, 4 Jun 2015 06:30:40 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201506040630.t546Uelc061867@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 4 Jun 2015 06:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283980 - head/sys/net80211 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, 04 Jun 2015 06:30:40 -0000 Author: adrian Date: Thu Jun 4 06:30:39 2015 New Revision: 283980 URL: https://svnweb.freebsd.org/changeset/base/283980 Log: First pass of adding transmit parameters as an option for outbound 802.11 mbufs. The raw transmit path currently doesn't make it easy to queue these frames: * there's no node reference stored in the mbuf, like for the normal path, and * the bpf supplied raw transmit parameters (rate, rts/cts, etc) are passed in as an argument, not as an mbuf tag. In order to support driver queuing of these frames, we need to be able to put the above into the mbuf before the driver gets it, so the driver /can/ put it into a queue if needed. Use an mbuf tag and for now just verbatim copy the bpf parameters into it. Later on it may grow to include more options but this will do for now. Why would you want to queue raw frames? Well, in the case of iwn(4), we can't send the firmware frames to transmit before we hear a beacon - the firmware will consider passive channels as unavailable until it hears a beacon. The firmware "passive" channel state is cleared upon each RXON command, which is sent to update association status. So, when we attempt association and authorisation, the RXON command causes the firmware to clear out what it's already seen, and so we have to wait for a beacon before we can transmit. Before people get overly excited - this alone doesn't "fix" 5GHz operation - it just makes it (more) possible. The aim here is to convert all the drivers over to use a raw_xmit() API that doesn't include the node and params - instead they'd get those from the mbuf. Then raw_xmit() becomes just a side-channel version of the normal transmit path for management traffic. MFC after: 2 weeks Sponsored by: Norse Corp, Inc. Modified: head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_freebsd.h Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Thu Jun 4 05:37:07 2015 (r283979) +++ head/sys/net80211/ieee80211_freebsd.c Thu Jun 4 06:30:39 2015 (r283980) @@ -474,6 +474,40 @@ ieee80211_add_callback(struct mbuf *m, return 1; } +int +ieee80211_add_xmit_params(struct mbuf *m, + const struct ieee80211_bpf_params *params) +{ + struct m_tag *mtag; + struct ieee80211_tx_params *tx; + + mtag = m_tag_alloc(MTAG_ABI_NET80211, NET80211_TAG_XMIT_PARAMS, + sizeof(struct ieee80211_tx_params), M_NOWAIT); + if (mtag == NULL) + return (0); + + tx = (struct ieee80211_tx_params *)(mtag+1); + memcpy(&tx->params, params, sizeof(struct ieee80211_bpf_params)); + m_tag_prepend(m, mtag); + return (1); +} + +int +ieee80211_get_xmit_params(struct mbuf *m, + struct ieee80211_bpf_params *params) +{ + struct m_tag *mtag; + struct ieee80211_tx_params *tx; + + mtag = m_tag_locate(m, MTAG_ABI_NET80211, NET80211_TAG_XMIT_PARAMS, + NULL); + if (mtag == NULL) + return (-1); + tx = (struct ieee80211_tx_params *)(mtag + 1); + memcpy(params, &tx->params, sizeof(struct ieee80211_bpf_params)); + return (0); +} + void ieee80211_process_callback(struct ieee80211_node *ni, struct mbuf *m, int status) Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Thu Jun 4 05:37:07 2015 (r283979) +++ head/sys/net80211/ieee80211_freebsd.h Thu Jun 4 06:30:39 2015 (r283980) @@ -327,6 +327,9 @@ int ieee80211_add_callback(struct mbuf * void (*func)(struct ieee80211_node *, void *, int), void *arg); void ieee80211_process_callback(struct ieee80211_node *, struct mbuf *, int); +#define NET80211_TAG_XMIT_PARAMS 1 +/* See below; this is after the bpf_params definition */ + struct ieee80211com; int ieee80211_parent_xmitpkt(struct ieee80211com *, struct mbuf *); int ieee80211_vap_xmitpkt(struct ieee80211vap *, struct mbuf *); @@ -607,6 +610,14 @@ struct ieee80211_bpf_params { uint8_t ibp_rate3; /* series 4 IEEE tx rate */ }; +struct ieee80211_tx_params { + struct ieee80211_bpf_params params; +}; +int ieee80211_add_xmit_params(struct mbuf *m, + const struct ieee80211_bpf_params *); +int ieee80211_get_xmit_params(struct mbuf *m, + struct ieee80211_bpf_params *); + /* * Malloc API. Other BSD operating systems have slightly * different malloc/free namings (eg DragonflyBSD.) From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 07:24:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71E3011E; Thu, 4 Jun 2015 07:24:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 603F51A5D; Thu, 4 Jun 2015 07:24:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t547Ov35090195; Thu, 4 Jun 2015 07:24:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t547OuIh090193; Thu, 4 Jun 2015 07:24:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201506040724.t547OuIh090193@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Jun 2015 07:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283981 - head/usr.sbin/pwd_mkdb 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, 04 Jun 2015 07:24:57 -0000 Author: delphij Date: Thu Jun 4 07:24:56 2015 New Revision: 283981 URL: https://svnweb.freebsd.org/changeset/base/283981 Log: In r113596, version 4 of entries have been added but pwd_mkdb have been generating both new (machine independent) and legacy version entries (endianness sensitive). The base system have been using the new format for quite some time, so disable the generation by default. An interim option, -l, have been added to re-enable old behavior. The -l, -B and -L options are considered deprecated and will be removed in FreeBSD 12.0 release. Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8 head/usr.sbin/pwd_mkdb/pwd_mkdb.c Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8 ============================================================================== --- head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Thu Jun 4 06:30:39 2015 (r283980) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Thu Jun 4 07:24:56 2015 (r283981) @@ -36,7 +36,7 @@ .Nd "generate the password databases" .Sh SYNOPSIS .Nm -.Op Fl BCiLNp +.Op Fl BCilLNp .Op Fl d Ar directory .Op Fl s Ar cachesize .Op Fl u Ar username @@ -61,14 +61,10 @@ different from the historic Version 7 st .Pp The options are as follows: .Bl -tag -width flag -.It Fl B -Store data in big-endian format. .It Fl C Check if the password file is in the correct format. Do not change, add, or remove any files. -.It Fl L -Store data in little-endian format. .It Fl N Tell .Nm @@ -116,6 +112,34 @@ encrypted password and the insecure vers The databases are used by the C library password routines (see .Xr getpwent 3 ) . .Pp +By default, +the +.Nm +utility generates new, +machine independent format +.Pq v4 +entries only. +For compatibility with +.Fx 5.0 +and earlier releases, +the +.Fl l +option may be specified, +which enables generation of legacy format +.Pq v3 +entries. +The legacy format entries are endianness dependent. +.Pp +The following options may be specified and will affect the +generation of legacy entries. +.Pp +.Bl -tag -width flag +.It Fl B +Store data in big-endian format. +.It Fl L +Store data in little-endian format. +.El +.Pp The .Nm utility exits zero on success, non-zero on failure. Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c ============================================================================== --- head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Jun 4 06:30:39 2015 (r283980) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Jun 4 07:24:56 2015 (r283981) @@ -112,15 +112,15 @@ main(int argc, char *argv[]) char sbuf2[MAXPATHLEN]; char *username; u_int method, methoduid; - int Cflag, dflag, iflag; + int Cflag, dflag, iflag, lflag; int nblock = 0; - iflag = dflag = Cflag = 0; + iflag = dflag = Cflag = lflag = 0; strcpy(prefix, _PATH_PWD); makeold = 0; username = NULL; oldfp = NULL; - while ((ch = getopt(argc, argv, "BCLNd:ips:u:v")) != -1) + while ((ch = getopt(argc, argv, "BCLlNd:ips:u:v")) != -1) switch(ch) { case 'B': /* big-endian output */ openinfo.lorder = BIG_ENDIAN; @@ -128,6 +128,9 @@ main(int argc, char *argv[]) case 'C': /* verify only */ Cflag = 1; break; + case 'l': /* generate legacy entries */ + lflag = 1; + break; case 'L': /* little-endian output */ openinfo.lorder = LITTLE_ENDIAN; break; @@ -465,6 +468,7 @@ main(int argc, char *argv[]) error("put"); } + if (lflag) { /* Create insecure data. (legacy version) */ p = buf; COMPACT(pwd.pw_name); @@ -555,6 +559,7 @@ main(int argc, char *argv[]) error("put"); } } + } /* Create original format password file entry */ if (is_comment && makeold){ /* copy comments */ if (fprintf(oldfp, "%s\n", line) < 0) @@ -583,6 +588,7 @@ main(int argc, char *argv[]) error("put"); if ((sdp->put)(sdp, &key, &data, method) == -1) error("put"); + if (lflag) { tbuf[0] = LEGACY_VERSION(_PW_KEYYPENABLED); key.size = 1; if ((dp->put)(dp, &key, &data, method) == -1) @@ -590,6 +596,7 @@ main(int argc, char *argv[]) if ((sdp->put)(sdp, &key, &data, method) == -1) error("put"); } + } if ((dp->close)(dp) == -1) error("close"); From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 07:25:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AC31272; Thu, 4 Jun 2015 07:25:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 091061A6B; Thu, 4 Jun 2015 07:25:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t547PeGD090382; Thu, 4 Jun 2015 07:25:40 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t547PeCV090381; Thu, 4 Jun 2015 07:25:40 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201506040725.t547PeCV090381@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Jun 2015 07:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283982 - head/usr.sbin/pwd_mkdb 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, 04 Jun 2015 07:25:41 -0000 Author: delphij Date: Thu Jun 4 07:25:40 2015 New Revision: 283982 URL: https://svnweb.freebsd.org/changeset/base/283982 Log: Whitespace changes for r283981. No actual code changes. Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c ============================================================================== --- head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Jun 4 07:24:56 2015 (r283981) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Jun 4 07:25:40 2015 (r283982) @@ -469,97 +469,97 @@ main(int argc, char *argv[]) } if (lflag) { - /* Create insecure data. (legacy version) */ - p = buf; - COMPACT(pwd.pw_name); - COMPACT("*"); - LSCALAR(pwd.pw_uid); - LSCALAR(pwd.pw_gid); - LSCALAR(pwd.pw_change); - COMPACT(pwd.pw_class); - COMPACT(pwd.pw_gecos); - COMPACT(pwd.pw_dir); - COMPACT(pwd.pw_shell); - LSCALAR(pwd.pw_expire); - LSCALAR(pwd.pw_fields); - data.size = p - buf; - - /* Create secure data. (legacy version) */ - p = sbuf; - COMPACT(pwd.pw_name); - COMPACT(pwd.pw_passwd); - LSCALAR(pwd.pw_uid); - LSCALAR(pwd.pw_gid); - LSCALAR(pwd.pw_change); - COMPACT(pwd.pw_class); - COMPACT(pwd.pw_gecos); - COMPACT(pwd.pw_dir); - COMPACT(pwd.pw_shell); - LSCALAR(pwd.pw_expire); - LSCALAR(pwd.pw_fields); - sdata.size = p - sbuf; - - /* Store insecure by name. */ - tbuf[0] = LEGACY_VERSION(_PW_KEYBYNAME); - len = strlen(pwd.pw_name); - memmove(tbuf + 1, pwd.pw_name, len); - key.size = len + 1; - if ((dp->put)(dp, &key, &data, method) == -1) - error("put"); - - /* Store insecure by number. */ - tbuf[0] = LEGACY_VERSION(_PW_KEYBYNUM); - store = HTOL(cnt); - memmove(tbuf + 1, &store, sizeof(store)); - key.size = sizeof(store) + 1; - if ((dp->put)(dp, &key, &data, method) == -1) - error("put"); - - /* Store insecure by uid. */ - tbuf[0] = LEGACY_VERSION(_PW_KEYBYUID); - store = HTOL(pwd.pw_uid); - memmove(tbuf + 1, &store, sizeof(store)); - key.size = sizeof(store) + 1; - if ((dp->put)(dp, &key, &data, methoduid) == -1) - error("put"); + /* Create insecure data. (legacy version) */ + p = buf; + COMPACT(pwd.pw_name); + COMPACT("*"); + LSCALAR(pwd.pw_uid); + LSCALAR(pwd.pw_gid); + LSCALAR(pwd.pw_change); + COMPACT(pwd.pw_class); + COMPACT(pwd.pw_gecos); + COMPACT(pwd.pw_dir); + COMPACT(pwd.pw_shell); + LSCALAR(pwd.pw_expire); + LSCALAR(pwd.pw_fields); + data.size = p - buf; + + /* Create secure data. (legacy version) */ + p = sbuf; + COMPACT(pwd.pw_name); + COMPACT(pwd.pw_passwd); + LSCALAR(pwd.pw_uid); + LSCALAR(pwd.pw_gid); + LSCALAR(pwd.pw_change); + COMPACT(pwd.pw_class); + COMPACT(pwd.pw_gecos); + COMPACT(pwd.pw_dir); + COMPACT(pwd.pw_shell); + LSCALAR(pwd.pw_expire); + LSCALAR(pwd.pw_fields); + sdata.size = p - sbuf; + + /* Store insecure by name. */ + tbuf[0] = LEGACY_VERSION(_PW_KEYBYNAME); + len = strlen(pwd.pw_name); + memmove(tbuf + 1, pwd.pw_name, len); + key.size = len + 1; + if ((dp->put)(dp, &key, &data, method) == -1) + error("put"); - /* Store secure by name. */ - tbuf[0] = LEGACY_VERSION(_PW_KEYBYNAME); - len = strlen(pwd.pw_name); - memmove(tbuf + 1, pwd.pw_name, len); - key.size = len + 1; - if ((sdp->put)(sdp, &key, &sdata, method) == -1) - error("put"); + /* Store insecure by number. */ + tbuf[0] = LEGACY_VERSION(_PW_KEYBYNUM); + store = HTOL(cnt); + memmove(tbuf + 1, &store, sizeof(store)); + key.size = sizeof(store) + 1; + if ((dp->put)(dp, &key, &data, method) == -1) + error("put"); - /* Store secure by number. */ - tbuf[0] = LEGACY_VERSION(_PW_KEYBYNUM); - store = HTOL(cnt); - memmove(tbuf + 1, &store, sizeof(store)); - key.size = sizeof(store) + 1; - if ((sdp->put)(sdp, &key, &sdata, method) == -1) - error("put"); + /* Store insecure by uid. */ + tbuf[0] = LEGACY_VERSION(_PW_KEYBYUID); + store = HTOL(pwd.pw_uid); + memmove(tbuf + 1, &store, sizeof(store)); + key.size = sizeof(store) + 1; + if ((dp->put)(dp, &key, &data, methoduid) == -1) + error("put"); - /* Store secure by uid. */ - tbuf[0] = LEGACY_VERSION(_PW_KEYBYUID); - store = HTOL(pwd.pw_uid); - memmove(tbuf + 1, &store, sizeof(store)); - key.size = sizeof(store) + 1; - if ((sdp->put)(sdp, &key, &sdata, methoduid) == -1) - error("put"); + /* Store secure by name. */ + tbuf[0] = LEGACY_VERSION(_PW_KEYBYNAME); + len = strlen(pwd.pw_name); + memmove(tbuf + 1, pwd.pw_name, len); + key.size = len + 1; + if ((sdp->put)(sdp, &key, &sdata, method) == -1) + error("put"); - /* Store insecure and secure special plus and special minus */ - if (pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-') { - tbuf[0] = LEGACY_VERSION(_PW_KEYYPBYNUM); - store = HTOL(ypcnt); + /* Store secure by number. */ + tbuf[0] = LEGACY_VERSION(_PW_KEYBYNUM); + store = HTOL(cnt); memmove(tbuf + 1, &store, sizeof(store)); key.size = sizeof(store) + 1; - if ((dp->put)(dp, &key, &data, method) == -1) - error("put"); if ((sdp->put)(sdp, &key, &sdata, method) == -1) error("put"); + + /* Store secure by uid. */ + tbuf[0] = LEGACY_VERSION(_PW_KEYBYUID); + store = HTOL(pwd.pw_uid); + memmove(tbuf + 1, &store, sizeof(store)); + key.size = sizeof(store) + 1; + if ((sdp->put)(sdp, &key, &sdata, methoduid) == -1) + error("put"); + + /* Store insecure and secure special plus and special minus */ + if (pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-') { + tbuf[0] = LEGACY_VERSION(_PW_KEYYPBYNUM); + store = HTOL(ypcnt); + memmove(tbuf + 1, &store, sizeof(store)); + key.size = sizeof(store) + 1; + if ((dp->put)(dp, &key, &data, method) == -1) + error("put"); + if ((sdp->put)(sdp, &key, &sdata, method) == -1) + error("put"); + } } } - } /* Create original format password file entry */ if (is_comment && makeold){ /* copy comments */ if (fprintf(oldfp, "%s\n", line) < 0) @@ -589,13 +589,13 @@ main(int argc, char *argv[]) if ((sdp->put)(sdp, &key, &data, method) == -1) error("put"); if (lflag) { - tbuf[0] = LEGACY_VERSION(_PW_KEYYPENABLED); - key.size = 1; - if ((dp->put)(dp, &key, &data, method) == -1) - error("put"); - if ((sdp->put)(sdp, &key, &data, method) == -1) - error("put"); - } + tbuf[0] = LEGACY_VERSION(_PW_KEYYPENABLED); + key.size = 1; + if ((dp->put)(dp, &key, &data, method) == -1) + error("put"); + if ((sdp->put)(sdp, &key, &data, method) == -1) + error("put"); + } } if ((dp->close)(dp) == -1) From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 07:37:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60DBC7C6; Thu, 4 Jun 2015 07:37:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4FFED1D14; Thu, 4 Jun 2015 07:37:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t547bACQ095673; Thu, 4 Jun 2015 07:37:10 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t547b9OK095671; Thu, 4 Jun 2015 07:37:09 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201506040737.t547b9OK095671@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Jun 2015 07:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283983 - in head: . sys/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, 04 Jun 2015 07:37:10 -0000 Author: delphij Date: Thu Jun 4 07:37:09 2015 New Revision: 283983 URL: https://svnweb.freebsd.org/changeset/base/283983 Log: Document the disable of legacy entries in password database in UPDATING and bump __FreeBSD_version after r283981. Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jun 4 07:25:40 2015 (r283982) +++ head/UPDATING Thu Jun 4 07:37:09 2015 (r283983) @@ -31,6 +31,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150604: + Generation of legacy formatted entries have been disabled by default + in pwd_mkdb(8), as all base system consumers of the legacy formatted + entries were converted to use the new format by default when the new, + machine independent format have been added and supported since FreeBSD + 5.x. + + Please see the pwd_mkdb(8) manual page for further details. + 20150525: Clang and llvm have been upgraded to 3.6.1 release. Please see the 20141231 entry below for information about prerequisites and upgrading, Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Jun 4 07:25:40 2015 (r283982) +++ head/sys/sys/param.h Thu Jun 4 07:37:09 2015 (r283983) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100075 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100076 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 07:41:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 892A997C; Thu, 4 Jun 2015 07:41:59 +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 F3C921F00; Thu, 4 Jun 2015 07:41:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t547frWP045983 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 4 Jun 2015 10:41:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t547frWP045983 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t547fqwT045982; Thu, 4 Jun 2015 10:41:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 4 Jun 2015 10:41:52 +0300 From: Konstantin Belousov To: Marcelo Araujo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283974 - head/lib/libugidfw Message-ID: <20150604074152.GZ2499@kib.kiev.ua> References: <201506040244.t542ibW9051338@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201506040244.t542ibW9051338@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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: Thu, 04 Jun 2015 07:41:59 -0000 On Thu, Jun 04, 2015 at 02:44:37AM +0000, Marcelo Araujo wrote: > Author: araujo (ports committer) > Date: Thu Jun 4 02:44:37 2015 > New Revision: 283974 > URL: https://svnweb.freebsd.org/changeset/base/283974 > > Log: > Remove unused variables and silence clang warnings. > > Differential Revision: D2686 > Reviewed by: rodrigc > > Modified: > head/lib/libugidfw/ugidfw.c > > @@ -1216,7 +1215,7 @@ bsde_delete_rule(int rulenum, size_t buf > { > struct mac_bsdextended_rule rule; > int name[10]; > - size_t len, size; > + size_t len; > int error; > > if (bsde_check_version(buflen, errstr) != 0) > @@ -1233,7 +1232,6 @@ bsde_delete_rule(int rulenum, size_t buf > name[len] = rulenum; > len++; > > - size = sizeof(rule); > error = sysctl(name, len, NULL, NULL, &rule, 0); This is very strange chunk. I suspect that the intent was to have 'size' as the sixth argument to the sysctl(3) call, or just have sizeof(rule) instead of 0. > if (error) { > len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 07:53:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 488DFD3F; Thu, 4 Jun 2015 07:53:00 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EF7911199; Thu, 4 Jun 2015 07:52:59 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from Xins-MBP.home.us.delphij.net (c-71-202-112-39.hsd1.ca.comcast.net [71.202.112.39]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id A1F4917DB6; Thu, 4 Jun 2015 00:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1433404379; x=1433418779; bh=9Sp+DKyQG711enRF492iQ7eYIdnbcXMn6UNF6nWDNWQ=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=CqCYTi+e8mtsqwBBmhK8Bo+rdI3E8nEV3mDZueRGr3FUooKDhX1U8D8BvgHvQIkDH bF+q6cV+w7PZcAkSMdcE+bo3D4qZbVs3jnMfgnxUh+2Z4qemK9Kw1coZjzCJmON6PM Xahbv8H03hkBwkg0+HsmD/FzVSQVYn2y+p87yMfY= Message-ID: <557003DA.9090205@delphij.net> Date: Thu, 04 Jun 2015 00:52:58 -0700 From: Xin Li User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Baptiste Daroussin , d@delphij.net CC: Sergey Kandaurov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, nectar@FreeBSD.org Subject: Re: svn commit: r283969 - head/lib/libutil References: <201506032048.t53KmSCf074619@svn.freebsd.org> <20150603215841.GF32562@ivaldir.etoilebsd.net> <556F8322.9050602@delphij.net> <20150604052120.GH32562@ivaldir.etoilebsd.net> In-Reply-To: <20150604052120.GH32562@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=windows-1252 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, 04 Jun 2015 07:53:00 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 6/3/15 22:21, Baptiste Daroussin wrote: > On Wed, Jun 03, 2015 at 03:43:46PM -0700, Xin Li wrote: >> On 06/03/15 14:58, Baptiste Daroussin wrote: >>> On Thu, Jun 04, 2015 at 12:51:46AM +0300, Sergey Kandaurov >>> wrote: >>>> On 3 June 2015 at 23:48, Baptiste Daroussin >>>> wrote: >>>>> Author: bapt Date: Wed Jun 3 20:48:28 2015 New Revision: >>>>> 283969 URL: >>>>> https://svnweb.freebsd.org/changeset/base/283969 >>>>> >>>>> Log: Add a pw_mkdb2(3) function which does the same thing >>>>> as pw_mkdb(3) except it takes a new argument allowing to >>>>> specify the endianness of the database to generate >>>>> >>>> >>>> Why not change pw_mkdb()? Is it used outside of the project? >>>> >>> Because that would change the ABI of libutil and it is not a >>> private library aka we are supposed to maintain ABI >>> compatibility as we do not know if it is used or not externally >>> to the project. I care about the ABI because I have made this >>> change in order to use it in pw(8) and MFC it to stable/10 >>> before 10.2. >>> >>> libutil is not versionned so this is the only way to not break >>> the ABI. Except if someone has a better idea than I do. >> >> Looking at r113596, pwd_mkdb(8) was changed to generate both >> legacy (version 3, endianness sensitive) and new (version 4, >> machine independent) formats. >> >> Now, after 12 years, is it still sensible to generate legacy >> format db entries? Maybe we should just disable the generation >> by default and eventually remove the ability to generate them? >> > > That could be an option, in this case we could add a -l (legacy) > option to pwd_mkdb to allow the users to generate the db in legacy > format and drop support support for legacy format in all other > tools. Meaning I can revert pw_mkdb2(3) Well, I think the pw_mkdb2(3) should be reverted, because the base system libraries are not using the legacy format when new formatted entries are present (which is true for databases generated on FreeBSD 5+); and if they do, that shall be seen as a bug and we should fix these libraries. I have committed r283981-r283983 to implement the default change and the -l option. Cheers, -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJVcAPZAAoJEJW2GBstM+nsb1oQAKug0zb3dxTSZScZJ/R8YBof +upLW/MALifOlhkYz0QBp+VQwrXvX+ZT1tseIwopg6pL0mrq9ZRrSb5DepFIc8fY lJ0P1s15RF41hRFcRSh3bJh8rEGekgS5fv3EFWwvrwUSA1D22X+wOofCLfZs2uji MpPmhc1g5jMN3tx4Evsx/7prSoXFGZYimnVIb8uNmjJyruHlrSrXsIau/b8ND4lm 7eQS4n5EoNmu8ui7rk4IsJPr1kP/gpjE+UPGi0tICjb8In8lE0Tj2fgMuDpRHQ7K II90Qanv+RZrapRb8zIOJRH8GBA0IlE8LzcIcoI4Dd32eP+HfP6BPMOD+kB9VlsS xapUo/PSF6ouScPNIoQD0Pq1VdvYHUTid/McoI6UTauHYSerl8mGOvpSRZF1GIFa pFzpJcsl15tWXAhwrDxSSwO+2BvtXDO36K+VbmTlMlr8Z623S6F2K/MyEkIbpj55 Un85J2xNoYbeEjc8+66emjILUZajGXXiJLS4v1f5RYTyOTl4t7coV4aDPb2c0aZu JsbagSfkPCuHttzwbry4EnfI+4eRo7+wtR3rf9tOXBt6DOY7qTba6GSBIpvVeqbe tlM/rpXnREgIUFyshKGN50I2OcpJY9RWALNUMwlCXDUbW4sHwy7acma0+hhDoGAl Q5Hc9f0/u76LNnvDQWNZ =6rIW -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 08:00:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 709F7208; Thu, 4 Jun 2015 08:00:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5FB99121A; Thu, 4 Jun 2015 08:00:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5480DQR006295; Thu, 4 Jun 2015 08:00:13 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5480CJd006286; Thu, 4 Jun 2015 08:00:12 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506040800.t5480CJd006286@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 4 Jun 2015 08:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283984 - head/lib/libutil 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, 04 Jun 2015 08:00:13 -0000 Author: bapt Date: Thu Jun 4 08:00:11 2015 New Revision: 283984 URL: https://svnweb.freebsd.org/changeset/base/283984 Log: revert r283969,283970 not needed anymore after r283981 Modified: head/lib/libutil/Makefile head/lib/libutil/libutil.h head/lib/libutil/pw_util.3 head/lib/libutil/pw_util.c Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Thu Jun 4 07:37:09 2015 (r283983) +++ head/lib/libutil/Makefile Thu Jun 4 08:00:11 2015 (r283984) @@ -78,7 +78,6 @@ MLINKS+=pw_util.3 pw_copy.3 \ pw_util.3 pw_make.3 \ pw_util.3 pw_make_v7.3 \ pw_util.3 pw_mkdb.3 \ - pw_util.3 pw_mkdb2.3 \ pw_util.3 pw_lock.3 \ pw_util.3 pw_scan.3 \ pw_util.3 pw_tempname.3 \ Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Thu Jun 4 07:37:09 2015 (r283983) +++ head/lib/libutil/libutil.h Thu Jun 4 08:00:11 2015 (r283984) @@ -144,9 +144,6 @@ char *fparseln(FILE *_fp, size_t *_len, #endif #ifdef _PWD_H_ -#define PWDB_NATIVE 0 -#define PWDB_LE 1 -#define PWDB_BE 2 int pw_copy(int _ffd, int _tfd, const struct passwd *_pw, struct passwd *_old_pw); struct passwd @@ -158,7 +155,6 @@ int pw_init(const char *_dir, const char char *pw_make(const struct passwd *_pw); char *pw_make_v7(const struct passwd *_pw); int pw_mkdb(const char *_user); -int pw_mkdb2(const char *_user, int endian); int pw_lock(void); struct passwd * pw_scan(const char *_line, int _flags); Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Thu Jun 4 07:37:09 2015 (r283983) +++ head/lib/libutil/pw_util.3 Thu Jun 4 08:00:11 2015 (r283984) @@ -37,7 +37,6 @@ .Nm pw_make , .Nm pw_make_v7 , .Nm pw_mkdb , -.Nm pw_mkdb2 , .Nm pw_lock , .Nm pw_scan , .Nm pw_tempname , @@ -67,8 +66,6 @@ .Ft int .Fn pw_mkdb "const char *user" .Ft int -.Fn pw_mkdb "const char *user" "int endian" -.Ft int .Fn pw_lock "void" .Ft "struct passwd *" .Fn pw_scan "const char *line" "int flags" @@ -228,30 +225,11 @@ function regenerates the password databa .Xr pwd_mkdb 8 . If .Fa user -is set, only the record corresponding to that user will be updated. +only the record corresponding to that user will be updated. The .Fn pw_mkdb function returns 0 in case of success and -1 in case of failure. .Pp -.Fn pw_mkdb2 -function regenerates the password database by running -.Xr pwd_mkdb 8 . -If -.Fa user -is set, only the record corresponding to that user will be updated. -.Pp -The -.Fa endian -variable can take the following values -.Bl -tag -width PWDB_NATIVE -.It Dv PWDB_NATIVE -The database will be generated in host native endianness. -.It Dv PWDB_LE -The database will be generated in Little-endian. -.It Dv PWDB_BE -The database will be generated in Big-endian. -.El -.Pp The .Fn pw_lock function locks the master password file. Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Thu Jun 4 07:37:09 2015 (r283983) +++ head/lib/libutil/pw_util.c Thu Jun 4 08:00:11 2015 (r283984) @@ -242,36 +242,14 @@ pw_tmp(int mfd) return (tfd); } -int -pw_mkdb(const char *user) -{ - - return (pw_mkdb2(user, PWDB_NATIVE)); -} - /* * Regenerate the password database. */ int -pw_mkdb2(const char *user, int endian) +pw_mkdb(const char *user) { int pstat; pid_t pid; - const char *arg; - - switch (endian) { - case PWDB_NATIVE: - arg = "-p"; - break; - case PWDB_LE: - arg = "-pL"; - break; - case PWDB_BE: - arg = "-pB"; - break; - default: - return (-1); - } (void)fflush(stderr); switch ((pid = fork())) { @@ -280,10 +258,10 @@ pw_mkdb2(const char *user, int endian) case 0: /* child */ if (user == NULL) - execl(_PATH_PWD_MKDB, "pwd_mkdb", arg, + execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", "-d", passwd_dir, tempname, (char *)NULL); else - execl(_PATH_PWD_MKDB, "pwd_mkdb", arg, + execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", "-d", passwd_dir, "-u", user, tempname, (char *)NULL); _exit(1); From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 08:05:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1A28456; Thu, 4 Jun 2015 08:05:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D0D5814AA; Thu, 4 Jun 2015 08:05:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5485iEH010645; Thu, 4 Jun 2015 08:05:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5485iYf010644; Thu, 4 Jun 2015 08:05:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506040805.t5485iYf010644@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 4 Jun 2015 08:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283985 - 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, 04 Jun 2015 08:05:45 -0000 Author: bapt Date: Thu Jun 4 08:05:44 2015 New Revision: 283985 URL: https://svnweb.freebsd.org/changeset/base/283985 Log: After r283981 it is no more needed to specify endianness when generating the passwd database Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu Jun 4 08:00:11 2015 (r283984) +++ head/etc/Makefile Thu Jun 4 08:05:44 2015 (r283985) @@ -188,13 +188,10 @@ distribute: .include .if ${TARGET_ENDIANNESS} == "1234" CAP_MKDB_ENDIAN?= -l -PWD_MKDB_ENDIAN?= -L .elif ${TARGET_ENDIANNESS} == "4321" CAP_MKDB_ENDIAN?= -b -PWD_MKDB_ENDIAN?= -B .else CAP_MKDB_ENDIAN?= -PWD_MKDB_ENDIAN?= .endif .if defined(NO_ROOT) @@ -220,8 +217,7 @@ distribution: .if ${MK_TCSH} == "no" sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd .endif - pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \ - ${DESTDIR}/etc/master.passwd + pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd .if defined(NO_ROOT) ( \ echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \ From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 08:09:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06136749; Thu, 4 Jun 2015 08:09:06 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::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 8B2E31506; Thu, 4 Jun 2015 08:09:05 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wiga1 with SMTP id a1so39066035wig.0; Thu, 04 Jun 2015 01:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=A24LIapDc5LEUiLSbBlt07TteVbvl1nxJlp3ej99a9w=; b=al0yO6JbewQa1Sd1rIp3TwWA2gPXbYrfE4lNFBKFgAqJTWPNe+zpJJBT+5iFTX4flb y9X6QKGQkfPOTwmIwoZXeYqYF1+hBXWiUDw0Tmu4qwvI8o5lXGfK5rF0j44InbEw97zu crYW+h1da32iaHvbocdq2jtZvqnPOnUcWBopcZAVS+K6L9qQ8fz+NrH0wzLygcfDHidk BO5k/EdovCUS5YGPNgDtj3M6CrA1KtXxT34M8mrJHX6i6OeZW8BTkOKgl3Gj95xhtmfA md5ZGGjdLeKFZ2BaX3rI7rtxdQOyCtkNW/905Whk6zveKZWiEi1sa9Syva3lW6jjACSQ HuJg== X-Received: by 10.180.215.101 with SMTP id oh5mr5450843wic.6.1433405343968; Thu, 04 Jun 2015 01:09:03 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id y19sm5137939wia.15.2015.06.04.01.09.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jun 2015 01:09:01 -0700 (PDT) Sender: Baptiste Daroussin Date: Thu, 4 Jun 2015 10:08:59 +0200 From: Baptiste Daroussin To: Xin Li Cc: d@delphij.net, Sergey Kandaurov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, nectar@FreeBSD.org Subject: Re: svn commit: r283969 - head/lib/libutil Message-ID: <20150604080858.GA1832@ivaldir.etoilebsd.net> References: <201506032048.t53KmSCf074619@svn.freebsd.org> <20150603215841.GF32562@ivaldir.etoilebsd.net> <556F8322.9050602@delphij.net> <20150604052120.GH32562@ivaldir.etoilebsd.net> <557003DA.9090205@delphij.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="T4sUOijqQbZv57TR" Content-Disposition: inline In-Reply-To: <557003DA.9090205@delphij.net> 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: Thu, 04 Jun 2015 08:09:06 -0000 --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 04, 2015 at 12:52:58AM -0700, Xin Li wrote: >=20 >=20 > On 6/3/15 22:21, Baptiste Daroussin wrote: > > On Wed, Jun 03, 2015 at 03:43:46PM -0700, Xin Li wrote: > >> On 06/03/15 14:58, Baptiste Daroussin wrote: > >>> On Thu, Jun 04, 2015 at 12:51:46AM +0300, Sergey Kandaurov > >>> wrote: > >>>> On 3 June 2015 at 23:48, Baptiste Daroussin > >>>> wrote: > >>>>> Author: bapt Date: Wed Jun 3 20:48:28 2015 New Revision:=20 > >>>>> 283969 URL: > >>>>> https://svnweb.freebsd.org/changeset/base/283969 > >>>>>=20 > >>>>> Log: Add a pw_mkdb2(3) function which does the same thing > >>>>> as pw_mkdb(3) except it takes a new argument allowing to > >>>>> specify the endianness of the database to generate > >>>>>=20 > >>>>=20 > >>>> Why not change pw_mkdb()? Is it used outside of the project? > >>>>=20 > >>> Because that would change the ABI of libutil and it is not a=20 > >>> private library aka we are supposed to maintain ABI > >>> compatibility as we do not know if it is used or not externally > >>> to the project. I care about the ABI because I have made this > >>> change in order to use it in pw(8) and MFC it to stable/10 > >>> before 10.2. > >>>=20 > >>> libutil is not versionned so this is the only way to not break > >>> the ABI. Except if someone has a better idea than I do. > >>=20 > >> Looking at r113596, pwd_mkdb(8) was changed to generate both > >> legacy (version 3, endianness sensitive) and new (version 4, > >> machine independent) formats. > >>=20 > >> Now, after 12 years, is it still sensible to generate legacy > >> format db entries? Maybe we should just disable the generation > >> by default and eventually remove the ability to generate them? > >>=20 > >=20 > > That could be an option, in this case we could add a -l (legacy) > > option to pwd_mkdb to allow the users to generate the db in legacy > > format and drop support support for legacy format in all other > > tools. Meaning I can revert pw_mkdb2(3) >=20 > Well, I think the pw_mkdb2(3) should be reverted, because the base > system libraries are not using the legacy format when new formatted > entries are present (which is true for databases generated on FreeBSD > 5+); and if they do, that shall be seen as a bug and we should fix > these libraries. >=20 > I have committed r283981-r283983 to implement the default change and > the -l option. >=20 done, thank you! Bapt --T4sUOijqQbZv57TR Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlVwB5oACgkQ8kTtMUmk6ExTWgCgoVXuu1hJui9ADtOuPaDR38Wi bW8Anj7z++CJVQoLe0gDlf4oDvsVkevi =6Mo0 -----END PGP SIGNATURE----- --T4sUOijqQbZv57TR-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 08:11:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDF7E92A; Thu, 4 Jun 2015 08:11:59 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D65F81709; Thu, 4 Jun 2015 08:11:59 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from Xins-MBP.home.us.delphij.net (c-71-202-112-39.hsd1.ca.comcast.net [71.202.112.39]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 692A317E76; Thu, 4 Jun 2015 01:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1433405519; x=1433419919; bh=ZZf7m3IiRxAJYOYe/ivgWuoAQY6l+7TCJJ8CYZNVfDo=; h=Date:From:To:Subject:References:In-Reply-To; b=PTMwxdhdz0M1Zm/zpUFZZw1abvqz5TS7rMGOXB0MXLfBqZAhA7xAkNIIcnUzOwDIb 9utYEagP7g0NaULM0eiYiwxNU8a313tU7sd0oQZXsbkyOTJOJyqwUFwLKCmeG0j69L SPGJ84HV50LJglwXAikxUgXkCOmhnpG/CEqCn+uA= Message-ID: <5570084E.6060809@delphij.net> Date: Thu, 04 Jun 2015 01:11:58 -0700 From: Xin Li User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283985 - head/etc References: <201506040805.t5485iYf010644@svn.freebsd.org> In-Reply-To: <201506040805.t5485iYf010644@svn.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: Thu, 04 Jun 2015 08:12:00 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 6/4/15 01:05, Baptiste Daroussin wrote: > Author: bapt Date: Thu Jun 4 08:05:44 2015 New Revision: 283985 > URL: https://svnweb.freebsd.org/changeset/base/283985 > > Log: After r283981 it is no more needed to specify endianness when > generating the passwd database Thanks! Cheers, -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJVcAhNAAoJEJW2GBstM+ns53UP/AjxAY4vzjM8ZsBh+GkxjTht ePJtOF5SnCsG6ATQQ7x9zr+55Uwq9qidbaIbkf9V+3I8N5VPoOSbHmRHvj7aFRd3 IivJzO+WE4tSFfUbJcz6NaEtOAu0qUEsh4si/lD7LyFUhIxRsIi9wxVXZr/U5ZbS 8QC4iRsSCBAGBc+sWsaG0iwJPzaHKSJkHGTXUqXA8mpuko1SM0htNriX/bdb856V qMFmCnLScEKd7JiOx7ndbXT5PGdDVTr3U2hvKDX4gx3II9yg4BZlBGGz1HFvcKno WAwPng3hKe+KHEhVbDZri5rngwUn0ZitGBFKxOXjPPpEJr/+yGybchM3mAA8N3gh BRSrOzAsf+Q9LC530tmbU/neMm9Dh2i2OYNeeyoy8S01D71H54kBSY0J/82WEI91 sxCtFzPIEJjezOxqeK4d1YUwCKzWT9ISbsfsgmnLcx8dKEkGIHfnwJClic5szoE/ 1dSz6CA1HmNAOA/7TegU1UfqIqwK2C4QFjtSzzmmiZvncv7MmMYiZdZUZ5eHTp7w yuiAG3GpYBaEcJYlsakIE06JQx+ktS1PswHSGY2TiLIIEIyuAPcYPMH8mY+EtjoI nEzfIQB/pwyo+T3bTLzAKnHnvdY+Cp4uXezh1s0Of/zkYrpNjOhj6zOLM5axwiT4 Mpv1SFb02rx2zmX9PEze =AyfO -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 08:29:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5E1AD84; Thu, 4 Jun 2015 08:29:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22b.google.com (mail-qk0-x22b.google.com [IPv6:2607:f8b0:400d: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 A2EF119B4; Thu, 4 Jun 2015 08:29:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qkx62 with SMTP id 62so20114314qkx.3; Thu, 04 Jun 2015 01:29:43 -0700 (PDT) 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=Za5sZL92fz6NlQeBu9dcAVrigordperovlrhYV+GimI=; b=asdXgeVIEqOSj2Lq+E+5U6RgTzoo7DeklJEGpVI5phR1HW1KUoxN4e9e+04a1yRhlr 3YEacffw4ZGkNVMWJXJMatEzcdvrtk7s0z9m+wXQzyTi1geiP2WejFSymEa9Dj/PwE3O Bq5H6ix9id9lRkDfkKJT3VVFdKd5pF+d5t09BXaSafcKhvI7iwt3LL9TP6Q63oRnAQIu myaRKBR3oT04gk170VfRx3LQLKJycwrrLGX53umOIrCyclUgj4NM6rW7nmNvxJEwJtTs mILbIcNxTDNdtIEU4b2GyHWd6Zh4Ogn6nxXo0MhvydbNVONF58Jet9GcdtiNfOQFTJ6u z/Mg== MIME-Version: 1.0 X-Received: by 10.140.108.195 with SMTP id j61mr41368489qgf.83.1433406583808; Thu, 04 Jun 2015 01:29:43 -0700 (PDT) Received: by 10.140.98.73 with HTTP; Thu, 4 Jun 2015 01:29:43 -0700 (PDT) In-Reply-To: <20150604074152.GZ2499@kib.kiev.ua> References: <201506040244.t542ibW9051338@svn.freebsd.org> <20150604074152.GZ2499@kib.kiev.ua> Date: Thu, 4 Jun 2015 01:29:43 -0700 Message-ID: Subject: Re: svn commit: r283974 - head/lib/libugidfw From: NGie Cooper To: Konstantin Belousov Cc: Marcelo Araujo , "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, 04 Jun 2015 08:29:45 -0000 On Thu, Jun 4, 2015 at 12:41 AM, Konstantin Belousov wrote: ... >> - size = sizeof(rule); >> error = sysctl(name, len, NULL, NULL, &rule, 0); > This is very strange chunk. I suspect that the intent was to have 'size' > as the sixth argument to the sysctl(3) call, or just have sizeof(rule) > instead of 0. Agreed. From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 10:18:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CC86426; Thu, 4 Jun 2015 10:18:04 +0000 (UTC) (envelope-from araujobsdport@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 E32DE14CF; Thu, 4 Jun 2015 10:18:03 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by obew15 with SMTP id w15so29163508obe.1; Thu, 04 Jun 2015 03:18:03 -0700 (PDT) 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=Wf5TTIR1flZORLtbOtK4GcS8RD4CaEv6pQEu59RbpYU=; b=mutnVuEf3yYPH00UOHf6sEGdQYzQYUymAbPGzoVV3jMVPAW2a78iVCwLx89KBRiXqv moMWZRw+WidE9nk2vNjTb97IOq+ryRIxjeSEJxBdBanWzpgjqeAVDqfCUHIKRka+ovo+ +x/TB1iTBA1mY2LwtRP3C8yw3a4YzQmyGW6Q0l+04SEPw2qGAxPR8IANxBOau9JFH889 fvfr+/qYf34EykULb/x84Yn4bNjk1RPmS3XOHsHfcYCQTFeOejLXc8tSA0KlQZxHuDlt YT6sHO3dskBMDAqAiRR0ZQxyWbXb/eS7zGG4voBKl/7DUAYKWV97o0qki5bcaz6Ql3yN LB0A== MIME-Version: 1.0 X-Received: by 10.182.97.138 with SMTP id ea10mr31035258obb.11.1433413083089; Thu, 04 Jun 2015 03:18:03 -0700 (PDT) Received: by 10.202.11.193 with HTTP; Thu, 4 Jun 2015 03:18:03 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: References: <201506040244.t542ibW9051338@svn.freebsd.org> <20150604074152.GZ2499@kib.kiev.ua> Date: Thu, 4 Jun 2015 18:18:03 +0800 Message-ID: Subject: Re: svn commit: r283974 - head/lib/libugidfw From: Marcelo Araujo To: NGie Cooper Cc: Konstantin Belousov , "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: Thu, 04 Jun 2015 10:18:04 -0000 2015-06-04 16:29 GMT+08:00 NGie Cooper : > On Thu, Jun 4, 2015 at 12:41 AM, Konstantin Belousov > wrote: > ... > >> - size = sizeof(rule); > >> error = sysctl(name, len, NULL, NULL, &rule, 0); > > This is very strange chunk. I suspect that the intent was to have 'size' > > as the sixth argument to the sysctl(3) call, or just have sizeof(rule) > > instead of 0. > > Agreed. > Agreed too, I have open another review request, because I have double check and there are some missing prototypes too. Best, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 10:55:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18181E08; Thu, 4 Jun 2015 10:55:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 044BB1E7D; Thu, 4 Jun 2015 10:55:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t54Ataub097446; Thu, 4 Jun 2015 10:55:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t54AtaUD097445; Thu, 4 Jun 2015 10:55:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201506041055.t54AtaUD097445@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 4 Jun 2015 10:55:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283986 - head/sys/net80211 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, 04 Jun 2015 10:55:37 -0000 Author: andrew Date: Thu Jun 4 10:55:36 2015 New Revision: 283986 URL: https://svnweb.freebsd.org/changeset/base/283986 Log: Fix the build by hiding ieee80211_add_xmit_params and ieee80211_get_xmit_params from userspace. Modified: head/sys/net80211/ieee80211_freebsd.h Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Thu Jun 4 08:05:44 2015 (r283985) +++ head/sys/net80211/ieee80211_freebsd.h Thu Jun 4 10:55:36 2015 (r283986) @@ -610,6 +610,7 @@ struct ieee80211_bpf_params { uint8_t ibp_rate3; /* series 4 IEEE tx rate */ }; +#ifdef _KERNEL struct ieee80211_tx_params { struct ieee80211_bpf_params params; }; @@ -617,6 +618,7 @@ int ieee80211_add_xmit_params(struct mbu const struct ieee80211_bpf_params *); int ieee80211_get_xmit_params(struct mbuf *m, struct ieee80211_bpf_params *); +#endif /* _KERNEL */ /* * Malloc API. Other BSD operating systems have slightly From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 12:46:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EFF3A27; Thu, 4 Jun 2015 12:46:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0C7911ACC; Thu, 4 Jun 2015 12:46:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t54CkvNs053895; Thu, 4 Jun 2015 12:46:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t54CkvAw053893; Thu, 4 Jun 2015 12:46:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201506041246.t54CkvAw053893@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 4 Jun 2015 12:46:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283988 - 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, 04 Jun 2015 12:46:58 -0000 Author: tuexen Date: Thu Jun 4 12:46:56 2015 New Revision: 283988 URL: https://svnweb.freebsd.org/changeset/base/283988 Log: Export a pointer to the SCTP socket. This is needed to add SCTP support to sockstat. MFC after: 3 days Modified: head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Thu Jun 4 12:35:00 2015 (r283987) +++ head/sys/netinet/sctp_sysctl.c Thu Jun 4 12:46:56 2015 (r283988) @@ -418,6 +418,7 @@ sctp_sysctl_handle_assoclist(SYSCTL_HAND xinpcb.total_recvs = inp->total_recvs; xinpcb.total_nospaces = inp->total_nospaces; xinpcb.fragmentation_point = inp->sctp_frag_point; + xinpcb.socket = inp->sctp_socket; so = inp->sctp_socket; if ((so == NULL) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Thu Jun 4 12:35:00 2015 (r283987) +++ head/sys/netinet/sctp_uio.h Thu Jun 4 12:46:56 2015 (r283988) @@ -1165,7 +1165,12 @@ struct xsctp_inpcb { uint16_t local_port; uint16_t qlen; uint16_t maxqlen; - uint32_t extra_padding[31]; /* future */ + void *socket; +#if defined(__LP64__) + uint32_t extra_padding[29]; /* future */ +#else + uint32_t extra_padding[30]; /* future */ +#endif }; struct xsctp_tcb { From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 15:02:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7008B2E; Thu, 4 Jun 2015 15:02:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C52A01C9C; Thu, 4 Jun 2015 15:02:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t54F25iP023267; Thu, 4 Jun 2015 15:02:05 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t54F25T3023266; Thu, 4 Jun 2015 15:02:05 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506041502.t54F25T3023266@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 4 Jun 2015 15:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283989 - 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, 04 Jun 2015 15:02:05 -0000 Author: gjb Date: Thu Jun 4 15:02:05 2015 New Revision: 283989 URL: https://svnweb.freebsd.org/changeset/base/283989 Log: Re-implement endian-aware services_mkdb(8) in the 'distribute' target. This effectively reverts r261142, which reverted both r261031 and r261044. Prodded by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu Jun 4 12:46:56 2015 (r283988) +++ head/etc/Makefile Thu Jun 4 15:02:05 2015 (r283989) @@ -207,6 +207,8 @@ distribution: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${BIN1} ${DESTDIR}/etc; \ cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \ + services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \ + ${DESTDIR}/etc/services; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \ ${BIN2} ${DESTDIR}/etc; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 15:04:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36A57C9C; Thu, 4 Jun 2015 15:04:39 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::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 F3CAD1CBA; Thu, 4 Jun 2015 15:04:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igbsb11 with SMTP id sb11so41504446igb.0; Thu, 04 Jun 2015 08:04:38 -0700 (PDT) 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=ksZoKjHn38M23/tfbvoElvboZlqfpVVCF3Xs3KZ20B4=; b=lcA/8EaZHqsmXU63bik9BfHSfTmnpi//BjPwhJdMtH9SDxawvQCK8gY/05IogY5U2m YsApWTh+6FrzQPeIy3SxocIIy4lwHskIZ2b/Gjp2SqobOoFyCm7H9hINfWeGSFKk4ile 6IF/mzq0FtnjQYrfT+o+66lCtdc2OhFVhm9DHGCO2zAfmFowqYTN+/bl5+ujE/OQUyrI cWm9tRwDNVQDbyqxjlT1CHy91AEZFFHClHoFMp3PMzefG38XbZlPcZbdRVf71U/Wg2GV 8uOftoOjkUnyakTIbgiHQYK0KucKwsTz0YKyxyO2gupHp0VAbMLT7cWh3hS2LYdRbYZq TbuQ== MIME-Version: 1.0 X-Received: by 10.107.5.210 with SMTP id 201mr46988215iof.88.1433430278224; Thu, 04 Jun 2015 08:04:38 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.38.133 with HTTP; Thu, 4 Jun 2015 08:04:38 -0700 (PDT) In-Reply-To: <201506041055.t54AtaUD097445@svn.freebsd.org> References: <201506041055.t54AtaUD097445@svn.freebsd.org> Date: Thu, 4 Jun 2015 08:04:38 -0700 X-Google-Sender-Auth: 2wII6_zvZKeCJPOughm8B0cCqPI Message-ID: Subject: Re: svn commit: r283986 - head/sys/net80211 From: Adrian Chadd To: Andrew Turner 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, 04 Jun 2015 15:04:39 -0000 oops, sorry! Thanks Andrew! -a On 4 June 2015 at 03:55, Andrew Turner wrote: > Author: andrew > Date: Thu Jun 4 10:55:36 2015 > New Revision: 283986 > URL: https://svnweb.freebsd.org/changeset/base/283986 > > Log: > Fix the build by hiding ieee80211_add_xmit_params and > ieee80211_get_xmit_params from userspace. > > Modified: > head/sys/net80211/ieee80211_freebsd.h > > Modified: head/sys/net80211/ieee80211_freebsd.h > ============================================================================== > --- head/sys/net80211/ieee80211_freebsd.h Thu Jun 4 08:05:44 2015 (r283985) > +++ head/sys/net80211/ieee80211_freebsd.h Thu Jun 4 10:55:36 2015 (r283986) > @@ -610,6 +610,7 @@ struct ieee80211_bpf_params { > uint8_t ibp_rate3; /* series 4 IEEE tx rate */ > }; > > +#ifdef _KERNEL > struct ieee80211_tx_params { > struct ieee80211_bpf_params params; > }; > @@ -617,6 +618,7 @@ int ieee80211_add_xmit_params(struct mbu > const struct ieee80211_bpf_params *); > int ieee80211_get_xmit_params(struct mbuf *m, > struct ieee80211_bpf_params *); > +#endif /* _KERNEL */ > > /* > * Malloc API. Other BSD operating systems have slightly > From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 16:32:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F7D8F78; Thu, 4 Jun 2015 16:32:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4D8031281; Thu, 4 Jun 2015 16:32:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t54GWHWr067986; Thu, 4 Jun 2015 16:32:17 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t54GWHcb067985; Thu, 4 Jun 2015 16:32:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506041632.t54GWHcb067985@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 4 Jun 2015 16:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283991 - head/release/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, 04 Jun 2015 16:32:17 -0000 Author: gjb Date: Thu Jun 4 16:32:16 2015 New Revision: 283991 URL: https://svnweb.freebsd.org/changeset/base/283991 Log: Add initial support for building images for the Duovero Gumstix board. Sponsored by: The FreeBSD Foundation Added: head/release/arm/GUMSTIX.conf (contents, props changed) Added: head/release/arm/GUMSTIX.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/arm/GUMSTIX.conf Thu Jun 4 16:32:16 2015 (r283991) @@ -0,0 +1,37 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +EMBEDDEDPORTS="sysutils/u-boot-duovero" +KERNEL="GUMSTIX" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" +IMAGE_SIZE="1G" +PART_SCHEME="MBR" +FAT_SIZE="2m" +FAT_TYPE="12" +MD_ARGS="-x 63 -y 255" +NODOC=1 + +arm_install_uboot() { + UBOOT_DIR="/usr/local/share/u-boot/u-boot-duovero" + FATMOUNT="${DESTDIR%${KERNEL}}/fat" + UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO + chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img + chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr + chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + chroot ${CHROOTDIR} rmdir ${FATMOUNT} + chroot ${CHROOTDIR} rmdir ${UFSMOUNT} + + return 0 +} From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 16:33:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA1C213B; Thu, 4 Jun 2015 16:33:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B84671291; Thu, 4 Jun 2015 16:33:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t54GXUmh068242; Thu, 4 Jun 2015 16:33:30 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t54GXUS0068241; Thu, 4 Jun 2015 16:33:30 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506041633.t54GXUS0068241@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 4 Jun 2015 16:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283992 - head/release/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, 04 Jun 2015 16:33:30 -0000 Author: gjb Date: Thu Jun 4 16:33:29 2015 New Revision: 283992 URL: https://svnweb.freebsd.org/changeset/base/283992 Log: Fix a whitespace nit. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BEAGLEBONE.conf Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Thu Jun 4 16:32:16 2015 (r283991) +++ head/release/arm/BEAGLEBONE.conf Thu Jun 4 16:33:29 2015 (r283992) @@ -23,7 +23,7 @@ arm_install_uboot() { chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} - chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO + chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 17:54:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EC4E53A; Thu, 4 Jun 2015 17:54:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6D021169D; Thu, 4 Jun 2015 17:54:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t54Hsg9m018780; Thu, 4 Jun 2015 17:54:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t54HsgON018779; Thu, 4 Jun 2015 17:54:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201506041754.t54HsgON018779@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 4 Jun 2015 17:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283994 - head/sys/net80211 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, 04 Jun 2015 17:54:42 -0000 Author: adrian Date: Thu Jun 4 17:54:41 2015 New Revision: 283994 URL: https://svnweb.freebsd.org/changeset/base/283994 Log: Tag outbound raw 802.11 frames with both the node and an mbuf tag with the transmit params. This allows raw 802.11 frames to be queued in the driver if necessary, rather than requiring it to be direct-dispatched into the hardware. Tested: * ath(4), STA mode * iwn(4), STA mode MFC after: 2 weeks Sponsored by: Norse Corp, Inc. Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Thu Jun 4 17:05:51 2015 (r283993) +++ head/sys/net80211/ieee80211_output.c Thu Jun 4 17:54:41 2015 (r283994) @@ -508,6 +508,25 @@ ieee80211_raw_output(struct ieee80211vap { struct ieee80211com *ic = vap->iv_ic; + /* + * Set node - the caller has taken a reference, so ensure + * that the mbuf has the same node value that + * it would if it were going via the normal path. + */ + m->m_pkthdr.rcvif = (void *)ni; + + /* + * Attempt to add bpf transmit parameters. + * + * For now it's ok to fail; the raw_xmit api still takes + * them as an option. + * + * Later on when ic_raw_xmit() has params removed, + * they'll have to be added - so fail the transmit if + * they can't be. + */ + (void) ieee80211_add_xmit_params(m, params); + return (ic->ic_raw_xmit(ni, m, params)); } From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 19:18:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0899FEDB; Thu, 4 Jun 2015 19:18:59 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 EB8251A4A; Thu, 4 Jun 2015 19:18:58 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t54JIwl4061509; Thu, 4 Jun 2015 19:18:58 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t54JIwFQ061508; Thu, 4 Jun 2015 19:18:58 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201506041918.t54JIwFQ061508@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Thu, 4 Jun 2015 19:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283997 - head/bin/chmod 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, 04 Jun 2015 19:18:59 -0000 Author: pluknet Date: Thu Jun 4 19:18:58 2015 New Revision: 283997 URL: https://svnweb.freebsd.org/changeset/base/283997 Log: Change directory permissions in pre-order. In this order, it won't try to recurse into a directory for which it doesn't have permission, before changing that permission. This follows an existing behavior in other BSDs, linux, OS X. Obtained from: NetBSD Modified: head/bin/chmod/chmod.c Modified: head/bin/chmod/chmod.c ============================================================================== --- head/bin/chmod/chmod.c Thu Jun 4 19:11:56 2015 (r283996) +++ head/bin/chmod/chmod.c Thu Jun 4 19:18:58 2015 (r283997) @@ -162,14 +162,16 @@ done: argv += optind; atflag = AT_SYMLINK_NOFOLLOW; switch (p->fts_info) { - case FTS_D: /* Change it at FTS_DP. */ + case FTS_D: if (!Rflag) fts_set(ftsp, p, FTS_SKIP); - continue; + break; case FTS_DNR: /* Warn, chmod. */ warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); rval = 1; break; + case FTS_DP: /* Already changed at FTS_D. */ + continue; case FTS_ERR: /* Warn, continue. */ case FTS_NS: warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 19:41:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E863F391; Thu, 4 Jun 2015 19:41:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D5CA61FAE; Thu, 4 Jun 2015 19:41:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t54JfIMC075475; Thu, 4 Jun 2015 19:41:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t54JfGAA075455; Thu, 4 Jun 2015 19:41:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201506041941.t54JfGAA075455@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 4 Jun 2015 19:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283998 - in head/sys: dev/drm dev/drm2 fs/devfs kern 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: Thu, 04 Jun 2015 19:41:19 -0000 Author: jhb Date: Thu Jun 4 19:41:15 2015 New Revision: 283998 URL: https://svnweb.freebsd.org/changeset/base/283998 Log: Add a new file operations hook for mmap operations. File type-specific logic is now placed in the mmap hook implementation rather than requiring it to be placed in sys/vm/vm_mmap.c. This hook allows new file types to support mmap() as well as potentially allowing mmap() for existing file types that do not currently support any mapping. The vm_mmap() function is now split up into two functions. A new vm_mmap_object() function handles the "back half" of vm_mmap() and accepts a referenced VM object to map rather than a (handle, handle_type) tuple. vm_mmap() is now reduced to converting a (handle, handle_type) tuple to a a VM object and then calling vm_mmap_object() to handle the actual mapping. The vm_mmap() function remains for use by other parts of the kernel (e.g. device drivers and exec) but now only supports mapping vnodes, character devices, and anonymous memory. The mmap() system call invokes vm_mmap_object() directly with a NULL object for anonymous mappings. For mappings using a file descriptor, the descriptors fo_mmap() hook is invoked instead. The fo_mmap() hook is responsible for performing type-specific checks and adjustments to arguments as well as possibly modifying mapping parameters such as flags or the object offset. The fo_mmap() hook routines then call vm_mmap_object() to handle the actual mapping. The fo_mmap() hook is optional. If it is not set, then fo_mmap() will fail with ENODEV. A fo_mmap() hook is implemented for regular files, character devices, and shared memory objects (created via shm_open()). While here, consistently use the VM_PROT_* constants for the vm_prot_t type for the 'prot' variable passed to vm_mmap() and vm_mmap_object() as well as the vm_mmap_vnode() and vm_mmap_cdev() helper routines. Previously some places were using the mmap()-specific PROT_* constants instead. While this happens to work because PROT_xx == VM_PROT_xx, using VM_PROT_* is more correct. Differential Revision: https://reviews.freebsd.org/D2658 Reviewed by: alc (glanced over), kib MFC after: 1 month Sponsored by: Chelsio Modified: head/sys/dev/drm/drm_bufs.c head/sys/dev/drm2/drm_bufs.c head/sys/fs/devfs/devfs_vnops.c head/sys/kern/subr_uio.c head/sys/kern/uipc_shm.c head/sys/kern/vfs_vnops.c head/sys/sys/file.h head/sys/sys/mman.h head/sys/vm/vm_extern.h head/sys/vm/vm_mmap.c Modified: head/sys/dev/drm/drm_bufs.c ============================================================================== --- head/sys/dev/drm/drm_bufs.c Thu Jun 4 19:18:58 2015 (r283997) +++ head/sys/dev/drm/drm_bufs.c Thu Jun 4 19:41:15 2015 (r283998) @@ -1067,12 +1067,12 @@ int drm_mapbufs(struct drm_device *dev, vaddr = round_page((vm_offset_t)vms->vm_daddr + MAXDSIZ); #if __FreeBSD_version >= 600023 - retcode = vm_mmap(&vms->vm_map, &vaddr, size, PROT_READ | PROT_WRITE, - VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE, + retcode = vm_mmap(&vms->vm_map, &vaddr, size, VM_PROT_READ | + VM_PROT_WRITE, VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE, dev->devnode, foff); #else - retcode = vm_mmap(&vms->vm_map, &vaddr, size, PROT_READ | PROT_WRITE, - VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, + retcode = vm_mmap(&vms->vm_map, &vaddr, size, VM_PROT_READ | + VM_PROT_WRITE, VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, SLIST_FIRST(&dev->devnode->si_hlist), foff); #endif if (retcode) Modified: head/sys/dev/drm2/drm_bufs.c ============================================================================== --- head/sys/dev/drm2/drm_bufs.c Thu Jun 4 19:18:58 2015 (r283997) +++ head/sys/dev/drm2/drm_bufs.c Thu Jun 4 19:41:15 2015 (r283998) @@ -1635,12 +1635,12 @@ int drm_mapbufs(struct drm_device *dev, goto done; } retcode = vm_mmap(&vms->vm_map, &virtual, map->size, - PROT_READ | PROT_WRITE, VM_PROT_ALL, + VM_PROT_READ | VM_PROT_WRITE, VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE, file_priv->minor->device, token); } else { retcode = vm_mmap(&vms->vm_map, &virtual, dma->byte_count, - PROT_READ | PROT_WRITE, VM_PROT_ALL, + VM_PROT_READ | VM_PROT_WRITE, VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE, file_priv->minor->device, 0); } Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Thu Jun 4 19:18:58 2015 (r283997) +++ head/sys/fs/devfs/devfs_vnops.c Thu Jun 4 19:41:15 2015 (r283998) @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -71,6 +72,10 @@ static struct fileops devfs_ops_f; #include +#include +#include +#include + static MALLOC_DEFINE(M_CDEVPDATA, "DEVFSP", "Metainfo for cdev-fp data"); struct mtx devfs_de_interlock; @@ -1738,6 +1743,65 @@ devfs_write_f(struct file *fp, struct ui return (error); } +static int +devfs_mmap_f(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size, + vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff, + struct thread *td) +{ + struct cdev *dev; + struct cdevsw *dsw; + struct mount *mp; + struct vnode *vp; + struct file *fpop; + vm_object_t object; + vm_prot_t maxprot; + int error, ref; + + vp = fp->f_vnode; + + /* + * Ensure that file and memory protections are + * compatible. + */ + mp = vp->v_mount; + if (mp != NULL && (mp->mnt_flag & MNT_NOEXEC) != 0) + maxprot = VM_PROT_NONE; + else + maxprot = VM_PROT_EXECUTE; + if ((fp->f_flag & FREAD) != 0) + maxprot |= VM_PROT_READ; + else if ((prot & VM_PROT_READ) != 0) + return (EACCES); + + /* + * Character devices always share mappings, so + * require a writable fd for writable mappings. + */ + if ((fp->f_flag & FWRITE) != 0) + maxprot |= VM_PROT_WRITE; + else if ((prot & VM_PROT_WRITE) != 0) + return (EACCES); + maxprot &= cap_maxprot; + + fpop = td->td_fpop; + error = devfs_fp_check(fp, &dev, &dsw, &ref); + if (error != 0) + return (error); + + error = vm_mmap_cdev(td, size, prot, &maxprot, &flags, dev, dsw, &foff, + &object); + td->td_fpop = fpop; + dev_relthread(dev, ref); + if (error != 0) + return (error); + + error = vm_mmap_object(map, addr, size, prot, maxprot, flags, object, + foff, FALSE, td); + if (error != 0) + vm_object_deallocate(object); + return (error); +} + dev_t dev2udev(struct cdev *x) { @@ -1760,6 +1824,7 @@ static struct fileops devfs_ops_f = { .fo_sendfile = vn_sendfile, .fo_seek = vn_seek, .fo_fill_kinfo = vn_fill_kinfo, + .fo_mmap = devfs_mmap_f, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Thu Jun 4 19:18:58 2015 (r283997) +++ head/sys/kern/subr_uio.c Thu Jun 4 19:41:15 2015 (r283998) @@ -417,7 +417,7 @@ copyout_map(struct thread *td, vm_offset /* round size up to page boundry */ size = (vm_size_t)round_page(sz); - error = vm_mmap(&vms->vm_map, addr, size, PROT_READ | PROT_WRITE, + error = vm_mmap(&vms->vm_map, addr, size, VM_PROT_READ | VM_PROT_WRITE, VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0); return (error); Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Thu Jun 4 19:18:58 2015 (r283997) +++ head/sys/kern/uipc_shm.c Thu Jun 4 19:41:15 2015 (r283998) @@ -127,6 +127,7 @@ static fo_chmod_t shm_chmod; static fo_chown_t shm_chown; static fo_seek_t shm_seek; static fo_fill_kinfo_t shm_fill_kinfo; +static fo_mmap_t shm_mmap; /* File descriptor operations. */ static struct fileops shm_ops = { @@ -143,6 +144,7 @@ static struct fileops shm_ops = { .fo_sendfile = vn_sendfile, .fo_seek = shm_seek, .fo_fill_kinfo = shm_fill_kinfo, + .fo_mmap = shm_mmap, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; @@ -851,15 +853,37 @@ sys_shm_unlink(struct thread *td, struct return (error); } -/* - * mmap() helper to validate mmap() requests against shm object state - * and give mmap() the vm_object to use for the mapping. - */ int -shm_mmap(struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff, - vm_object_t *obj) +shm_mmap(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t objsize, + vm_prot_t prot, vm_prot_t cap_maxprot, int flags, + vm_ooffset_t foff, struct thread *td) { + struct shmfd *shmfd; + vm_prot_t maxprot; + int error; + + shmfd = fp->f_data; + maxprot = VM_PROT_NONE; + + /* FREAD should always be set. */ + if ((fp->f_flag & FREAD) != 0) + maxprot |= VM_PROT_EXECUTE | VM_PROT_READ; + if ((fp->f_flag & FWRITE) != 0) + maxprot |= VM_PROT_WRITE; + + /* Don't permit shared writable mappings on read-only descriptors. */ + if ((flags & MAP_SHARED) != 0 && + (maxprot & VM_PROT_WRITE) == 0 && + (prot & VM_PROT_WRITE) != 0) + return (EACCES); + maxprot &= cap_maxprot; +#ifdef MAC + error = mac_posixshm_check_mmap(td->td_ucred, shmfd, prot, flags); + if (error != 0) + return (error); +#endif + /* * XXXRW: This validation is probably insufficient, and subject to * sign errors. It should be fixed. @@ -872,7 +896,11 @@ shm_mmap(struct shmfd *shmfd, vm_size_t vfs_timestamp(&shmfd->shm_atime); mtx_unlock(&shm_timestamp_lock); vm_object_reference(shmfd->shm_object); - *obj = shmfd->shm_object; + + error = vm_mmap_object(map, addr, objsize, prot, maxprot, flags, + shmfd->shm_object, foff, FALSE, td); + if (error != 0) + vm_object_deallocate(shmfd->shm_object); return (0); } Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Jun 4 19:18:58 2015 (r283997) +++ head/sys/kern/vfs_vnops.c Thu Jun 4 19:41:15 2015 (r283998) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -80,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static fo_rdwr_t vn_read; static fo_rdwr_t vn_write; @@ -90,6 +92,7 @@ static fo_poll_t vn_poll; static fo_kqfilter_t vn_kqfilter; static fo_stat_t vn_statfile; static fo_close_t vn_closefile; +static fo_mmap_t vn_mmap; struct fileops vnops = { .fo_read = vn_io_fault, @@ -105,6 +108,7 @@ struct fileops vnops = { .fo_sendfile = vn_sendfile, .fo_seek = vn_seek, .fo_fill_kinfo = vn_fill_kinfo, + .fo_mmap = vn_mmap, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; @@ -2362,3 +2366,95 @@ vn_fill_kinfo_vnode(struct vnode *vp, st kif->kf_un.kf_file.kf_file_rdev = va.va_rdev; return (0); } + +int +vn_mmap(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size, + vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff, + struct thread *td) +{ +#ifdef HWPMC_HOOKS + struct pmckern_map_in pkm; +#endif + struct mount *mp; + struct vnode *vp; + vm_object_t object; + vm_prot_t maxprot; + boolean_t writecounted; + int error; + +#if defined(COMPAT_FREEBSD7) || defined(COMPAT_FREEBSD6) || \ + defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) + /* + * POSIX shared-memory objects are defined to have + * kernel persistence, and are not defined to support + * read(2)/write(2) -- or even open(2). Thus, we can + * use MAP_ASYNC to trade on-disk coherence for speed. + * The shm_open(3) library routine turns on the FPOSIXSHM + * flag to request this behavior. + */ + if ((fp->f_flag & FPOSIXSHM) != 0) + flags |= MAP_NOSYNC; +#endif + vp = fp->f_vnode; + + /* + * Ensure that file and memory protections are + * compatible. Note that we only worry about + * writability if mapping is shared; in this case, + * current and max prot are dictated by the open file. + * XXX use the vnode instead? Problem is: what + * credentials do we use for determination? What if + * proc does a setuid? + */ + mp = vp->v_mount; + if (mp != NULL && (mp->mnt_flag & MNT_NOEXEC) != 0) + maxprot = VM_PROT_NONE; + else + maxprot = VM_PROT_EXECUTE; + if ((fp->f_flag & FREAD) != 0) + maxprot |= VM_PROT_READ; + else if ((prot & VM_PROT_READ) != 0) + return (EACCES); + + /* + * If we are sharing potential changes via MAP_SHARED and we + * are trying to get write permission although we opened it + * without asking for it, bail out. + */ + if ((flags & MAP_SHARED) != 0) { + if ((fp->f_flag & FWRITE) != 0) + maxprot |= VM_PROT_WRITE; + else if ((prot & VM_PROT_WRITE) != 0) + return (EACCES); + } else { + maxprot |= VM_PROT_WRITE; + cap_maxprot |= VM_PROT_WRITE; + } + maxprot &= cap_maxprot; + + writecounted = FALSE; + error = vm_mmap_vnode(td, size, prot, &maxprot, &flags, vp, + &foff, &object, &writecounted); + if (error != 0) + return (error); + error = vm_mmap_object(map, addr, size, prot, maxprot, flags, object, + foff, writecounted, td); + if (error != 0) { + /* + * If this mapping was accounted for in the vnode's + * writecount, then undo that now. + */ + if (writecounted) + vnode_pager_release_writecount(object, 0, size); + vm_object_deallocate(object); + } +#ifdef HWPMC_HOOKS + /* Inform hwpmc(4) if an executable is being mapped. */ + if (error == 0 && (prot & VM_PROT_EXECUTE) != 0) { + pkm.pm_file = vp; + pkm.pm_address = (uintptr_t) addr; + PMC_CALL_HOOK(td, PMC_FN_MMAP, (void *) &pkm); + } +#endif + return (error); +} Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Thu Jun 4 19:18:58 2015 (r283997) +++ head/sys/sys/file.h Thu Jun 4 19:41:15 2015 (r283998) @@ -42,6 +42,7 @@ #include #include #include +#include struct filedesc; struct stat; @@ -115,6 +116,9 @@ typedef int fo_seek_t(struct file *fp, o struct thread *td); typedef int fo_fill_kinfo_t(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp); +typedef int fo_mmap_t(struct file *fp, vm_map_t map, vm_offset_t *addr, + vm_size_t size, vm_prot_t prot, vm_prot_t cap_maxprot, + int flags, vm_ooffset_t foff, struct thread *td); typedef int fo_flags_t; struct fileops { @@ -131,6 +135,7 @@ struct fileops { fo_sendfile_t *fo_sendfile; fo_seek_t *fo_seek; fo_fill_kinfo_t *fo_fill_kinfo; + fo_mmap_t *fo_mmap; fo_flags_t fo_flags; /* DFLAG_* below */ }; @@ -391,6 +396,18 @@ fo_fill_kinfo(struct file *fp, struct ki return ((*fp->f_ops->fo_fill_kinfo)(fp, kif, fdp)); } +static __inline int +fo_mmap(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size, + vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff, + struct thread *td) +{ + + if (fp->f_ops->fo_mmap == NULL) + return (ENODEV); + return ((*fp->f_ops->fo_mmap)(fp, map, addr, size, prot, cap_maxprot, + flags, foff, td)); +} + #endif /* _KERNEL */ #endif /* !SYS_FILE_H */ Modified: head/sys/sys/mman.h ============================================================================== --- head/sys/sys/mman.h Thu Jun 4 19:18:58 2015 (r283997) +++ head/sys/sys/mman.h Thu Jun 4 19:41:15 2015 (r283998) @@ -230,8 +230,6 @@ struct shmfd { #endif #ifdef _KERNEL -int shm_mmap(struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff, - vm_object_t *obj); int shm_map(struct file *fp, size_t size, off_t offset, void **memp); int shm_unmap(struct file *fp, void *mem, size_t size); Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Thu Jun 4 19:18:58 2015 (r283997) +++ head/sys/vm/vm_extern.h Thu Jun 4 19:41:15 2015 (r283998) @@ -40,6 +40,8 @@ struct vnode; struct vmem; #ifdef _KERNEL +struct cdev; +struct cdevsw; /* These operate on kernel virtual addresses only. */ vm_offset_t kva_alloc(vm_size_t); @@ -81,10 +83,18 @@ int vm_fault_hold(vm_map_t map, vm_offse int fault_flags, vm_page_t *m_hold); int vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t addr, vm_size_t len, vm_prot_t prot, vm_page_t *ma, int max_count); -int vm_forkproc(struct thread *, struct proc *, struct thread *, struct vmspace *, int); +int vm_forkproc(struct thread *, struct proc *, struct thread *, + struct vmspace *, int); void vm_waitproc(struct proc *); -int vm_mmap(vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, objtype_t, void *, vm_ooffset_t); +int vm_mmap(vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, + objtype_t, void *, vm_ooffset_t); +int vm_mmap_object(vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, + vm_prot_t, int, vm_object_t, vm_ooffset_t, boolean_t, struct thread *); int vm_mmap_to_errno(int rv); +int vm_mmap_cdev(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, + int *, struct cdev *, struct cdevsw *, vm_ooffset_t *, vm_object_t *); +int vm_mmap_vnode(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, int *, + struct vnode *, vm_ooffset_t *, vm_object_t *, boolean_t *); void vm_set_page_size(void); void vm_sync_icache(vm_map_t, vm_offset_t, vm_size_t); typedef int (*pmap_pinit_t)(struct pmap *pmap); Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Thu Jun 4 19:18:58 2015 (r283997) +++ head/sys/vm/vm_mmap.c Thu Jun 4 19:41:15 2015 (r283998) @@ -100,13 +100,6 @@ SYSCTL_INT(_vm, OID_AUTO, old_mlock, CTL #define MAP_32BIT_MAX_ADDR ((vm_offset_t)1 << 31) #endif -static int vm_mmap_vnode(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, - int *, struct vnode *, vm_ooffset_t *, vm_object_t *, boolean_t *); -static int vm_mmap_cdev(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, - int *, struct cdev *, vm_ooffset_t *, vm_object_t *); -static int vm_mmap_shm(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, - int *, struct shmfd *, vm_ooffset_t, vm_object_t *); - #ifndef _SYS_SYSPROTO_H_ struct sbrk_args { int incr; @@ -197,16 +190,10 @@ sys_mmap(td, uap) struct thread *td; struct mmap_args *uap; { -#ifdef HWPMC_HOOKS - struct pmckern_map_in pkm; -#endif struct file *fp; - struct vnode *vp; vm_offset_t addr; vm_size_t size, pageoff; - vm_prot_t cap_maxprot, maxprot; - void *handle; - objtype_t handle_type; + vm_prot_t cap_maxprot; int align, error, flags, prot; off_t pos; struct vmspace *vms = td->td_proc->p_vmspace; @@ -334,14 +321,22 @@ sys_mmap(td, uap) lim_max(td->td_proc, RLIMIT_DATA)); PROC_UNLOCK(td->td_proc); } - if (flags & MAP_ANON) { + if (size == 0) { + /* + * Return success without mapping anything for old + * binaries that request a page-aligned mapping of + * length 0. For modern binaries, this function + * returns an error earlier. + */ + error = 0; + } else if (flags & MAP_ANON) { /* * Mapping blank space is trivial. + * + * This relies on VM_PROT_* matching PROT_*. */ - handle = NULL; - handle_type = OBJT_DEFAULT; - maxprot = VM_PROT_ALL; - cap_maxprot = VM_PROT_ALL; + error = vm_mmap_object(&vms->vm_map, &addr, size, prot, + VM_PROT_ALL, flags, NULL, pos, FALSE, td); } else { /* * Mapping file, get fp for validation and don't let the @@ -366,93 +361,12 @@ sys_mmap(td, uap) error = EINVAL; goto done; } - if (fp->f_type == DTYPE_SHM) { - handle = fp->f_data; - handle_type = OBJT_SWAP; - maxprot = VM_PROT_NONE; - - /* FREAD should always be set. */ - if (fp->f_flag & FREAD) - maxprot |= VM_PROT_EXECUTE | VM_PROT_READ; - if (fp->f_flag & FWRITE) - maxprot |= VM_PROT_WRITE; - goto map; - } - if (fp->f_type != DTYPE_VNODE) { - error = ENODEV; - goto done; - } -#if defined(COMPAT_FREEBSD7) || defined(COMPAT_FREEBSD6) || \ - defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) - /* - * POSIX shared-memory objects are defined to have - * kernel persistence, and are not defined to support - * read(2)/write(2) -- or even open(2). Thus, we can - * use MAP_ASYNC to trade on-disk coherence for speed. - * The shm_open(3) library routine turns on the FPOSIXSHM - * flag to request this behavior. - */ - if (fp->f_flag & FPOSIXSHM) - flags |= MAP_NOSYNC; -#endif - vp = fp->f_vnode; - /* - * Ensure that file and memory protections are - * compatible. Note that we only worry about - * writability if mapping is shared; in this case, - * current and max prot are dictated by the open file. - * XXX use the vnode instead? Problem is: what - * credentials do we use for determination? What if - * proc does a setuid? - */ - if (vp->v_mount != NULL && vp->v_mount->mnt_flag & MNT_NOEXEC) - maxprot = VM_PROT_NONE; - else - maxprot = VM_PROT_EXECUTE; - if (fp->f_flag & FREAD) { - maxprot |= VM_PROT_READ; - } else if (prot & PROT_READ) { - error = EACCES; - goto done; - } - /* - * If we are sharing potential changes (either via - * MAP_SHARED or via the implicit sharing of character - * device mappings), and we are trying to get write - * permission although we opened it without asking - * for it, bail out. - */ - if ((flags & MAP_SHARED) != 0) { - if ((fp->f_flag & FWRITE) != 0) { - maxprot |= VM_PROT_WRITE; - } else if ((prot & PROT_WRITE) != 0) { - error = EACCES; - goto done; - } - } else if (vp->v_type != VCHR || (fp->f_flag & FWRITE) != 0) { - maxprot |= VM_PROT_WRITE; - cap_maxprot |= VM_PROT_WRITE; - } - handle = (void *)vp; - handle_type = OBJT_VNODE; - } -map: - td->td_fpop = fp; - maxprot &= cap_maxprot; - /* This relies on VM_PROT_* matching PROT_*. */ - error = vm_mmap(&vms->vm_map, &addr, size, prot, maxprot, - flags, handle_type, handle, pos); - td->td_fpop = NULL; -#ifdef HWPMC_HOOKS - /* inform hwpmc(4) if an executable is being mapped */ - if (error == 0 && handle_type == OBJT_VNODE && - (prot & PROT_EXEC)) { - pkm.pm_file = handle; - pkm.pm_address = (uintptr_t) addr; - PMC_CALL_HOOK(td, PMC_FN_MMAP, (void *) &pkm); + /* This relies on VM_PROT_* matching PROT_*. */ + error = fo_mmap(fp, &vms->vm_map, &addr, size, prot, + cap_maxprot, flags, pos, td); } -#endif + if (error == 0) td->td_retval[0] = (register_t) (addr + pageoff); done: @@ -1311,9 +1225,6 @@ sys_munlock(td, uap) * * Helper function for vm_mmap. Perform sanity check specific for mmap * operations on vnodes. - * - * For VCHR vnodes, the vnode lock is held over the call to - * vm_mmap_cdev() to keep vp->v_rdev valid. */ int vm_mmap_vnode(struct thread *td, vm_size_t objsize, @@ -1360,12 +1271,6 @@ vm_mmap_vnode(struct thread *td, vm_size *writecounted = TRUE; vnode_pager_update_writecount(obj, 0, objsize); } - } else if (vp->v_type == VCHR) { - error = vm_mmap_cdev(td, objsize, prot, maxprotp, flagsp, - vp->v_rdev, foffp, objp); - if (error == 0) - goto mark_atime; - goto done; } else { error = EINVAL; goto done; @@ -1373,13 +1278,14 @@ vm_mmap_vnode(struct thread *td, vm_size if ((error = VOP_GETATTR(vp, &va, cred))) goto done; #ifdef MAC - error = mac_vnode_check_mmap(cred, vp, prot, flags); + /* This relies on VM_PROT_* matching PROT_*. */ + error = mac_vnode_check_mmap(cred, vp, (int)prot, flags); if (error != 0) goto done; #endif if ((flags & MAP_SHARED) != 0) { if ((va.va_flags & (SF_SNAPSHOT|IMMUTABLE|APPEND)) != 0) { - if (prot & PROT_WRITE) { + if (prot & VM_PROT_WRITE) { error = EPERM; goto done; } @@ -1414,7 +1320,6 @@ vm_mmap_vnode(struct thread *td, vm_size *objp = obj; *flagsp = flags; -mark_atime: vfs_mark_atime(vp, cred); done: @@ -1435,21 +1340,18 @@ done: * operations on cdevs. */ int -vm_mmap_cdev(struct thread *td, vm_size_t objsize, - vm_prot_t prot, vm_prot_t *maxprotp, int *flagsp, - struct cdev *cdev, vm_ooffset_t *foff, vm_object_t *objp) +vm_mmap_cdev(struct thread *td, vm_size_t objsize, vm_prot_t prot, + vm_prot_t *maxprotp, int *flagsp, struct cdev *cdev, struct cdevsw *dsw, + vm_ooffset_t *foff, vm_object_t *objp) { vm_object_t obj; - struct cdevsw *dsw; - int error, flags, ref; + int error, flags; flags = *flagsp; - dsw = dev_refthread(cdev, &ref); - if (dsw == NULL) - return (ENXIO); if (dsw->d_flags & D_MMAP_ANON) { - dev_relthread(cdev, ref); + *objp = NULL; + *foff = 0; *maxprotp = VM_PROT_ALL; *flagsp |= MAP_ANON; return (0); @@ -1458,24 +1360,18 @@ vm_mmap_cdev(struct thread *td, vm_size_ * cdevs do not provide private mappings of any kind. */ if ((*maxprotp & VM_PROT_WRITE) == 0 && - (prot & PROT_WRITE) != 0) { - dev_relthread(cdev, ref); + (prot & VM_PROT_WRITE) != 0) return (EACCES); - } - if (flags & (MAP_PRIVATE|MAP_COPY)) { - dev_relthread(cdev, ref); + if (flags & (MAP_PRIVATE|MAP_COPY)) return (EINVAL); - } /* * Force device mappings to be shared. */ flags |= MAP_SHARED; #ifdef MAC_XXX - error = mac_cdev_check_mmap(td->td_ucred, cdev, prot); - if (error != 0) { - dev_relthread(cdev, ref); + error = mac_cdev_check_mmap(td->td_ucred, cdev, (int)prot); + if (error != 0) return (error); - } #endif /* * First, try d_mmap_single(). If that is not implemented @@ -1487,7 +1383,6 @@ vm_mmap_cdev(struct thread *td, vm_size_ * XXX assumes VM_PROT_* == PROT_* */ error = dsw->d_mmap_single(cdev, foff, objsize, objp, (int)prot); - dev_relthread(cdev, ref); if (error != ENODEV) return (error); obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, *foff, @@ -1500,59 +1395,89 @@ vm_mmap_cdev(struct thread *td, vm_size_ } /* - * vm_mmap_shm() - * - * MPSAFE + * vm_mmap() * - * Helper function for vm_mmap. Perform sanity check specific for mmap - * operations on shm file descriptors. + * Internal version of mmap used by exec, sys5 shared memory, and + * various device drivers. Handle is either a vnode pointer, a + * character device, or NULL for MAP_ANON. */ int -vm_mmap_shm(struct thread *td, vm_size_t objsize, - vm_prot_t prot, vm_prot_t *maxprotp, int *flagsp, - struct shmfd *shmfd, vm_ooffset_t foff, vm_object_t *objp) +vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, + vm_prot_t maxprot, int flags, + objtype_t handle_type, void *handle, + vm_ooffset_t foff) { + vm_object_t object; + struct thread *td = curthread; int error; + boolean_t writecounted; - if ((*flagsp & MAP_SHARED) != 0 && - (*maxprotp & VM_PROT_WRITE) == 0 && - (prot & PROT_WRITE) != 0) - return (EACCES); -#ifdef MAC - error = mac_posixshm_check_mmap(td->td_ucred, shmfd, prot, *flagsp); - if (error != 0) - return (error); -#endif - error = shm_mmap(shmfd, objsize, foff, objp); + if (size == 0) + return (EINVAL); + + size = round_page(size); + writecounted = FALSE; + + /* + * Lookup/allocate object. + */ + switch (handle_type) { + case OBJT_DEVICE: { + struct cdevsw *dsw; + struct cdev *cdev; + int ref; + + cdev = handle; + dsw = dev_refthread(cdev, &ref); + if (dsw == NULL) + return (ENXIO); + error = vm_mmap_cdev(td, size, prot, &maxprot, &flags, cdev, + dsw, &foff, &object); + dev_relthread(cdev, ref); + break; + } + case OBJT_VNODE: + error = vm_mmap_vnode(td, size, prot, &maxprot, &flags, + handle, &foff, &object, &writecounted); + break; + case OBJT_DEFAULT: + if (handle == NULL) { + error = 0; + break; + } + /* FALLTHROUGH */ + default: + error = EINVAL; + break; + } if (error) return (error); - return (0); + + error = vm_mmap_object(map, addr, size, prot, maxprot, flags, object, + foff, writecounted, td); + if (error != 0 && object != NULL) { + /* + * If this mapping was accounted for in the vnode's + * writecount, then undo that now. + */ + if (writecounted) + vnode_pager_release_writecount(object, 0, size); + vm_object_deallocate(object); + } + return (error); } /* - * vm_mmap() - * - * MPSAFE - * - * Internal version of mmap. Currently used by mmap, exec, and sys5 - * shared memory. Handle is either a vnode pointer or NULL for MAP_ANON. + * Internal version of mmap that maps a specific VM object into an + * map. Called by mmap for MAP_ANON, vm_mmap, shm_mmap, and vn_mmap. */ int -vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, - vm_prot_t maxprot, int flags, - objtype_t handle_type, void *handle, - vm_ooffset_t foff) +vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, + vm_prot_t maxprot, int flags, vm_object_t object, vm_ooffset_t foff, + boolean_t writecounted, struct thread *td) { boolean_t fitit; - vm_object_t object = NULL; - struct thread *td = curthread; int docow, error, findspace, rv; - boolean_t writecounted; - - if (size == 0) - return (0); - - size = round_page(size); if (map == &td->td_proc->p_vmspace->vm_map) { PROC_LOCK(td->td_proc); @@ -1586,11 +1511,11 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, /* * We currently can only deal with page aligned file offsets. - * The check is here rather than in the syscall because the - * kernel calls this function internally for other mmaping - * operations (such as in exec) and non-aligned offsets will - * cause pmap inconsistencies...so we want to be sure to - * disallow this in all cases. + * The mmap() system call already enforces this by subtracting + * the page offset from the file offset, but checking here + * catches errors in device drivers (e.g. d_single_mmap() + * callbacks) and other internal mapping requests (such as in + * exec). */ if (foff & PAGE_MASK) return (EINVAL); @@ -1603,44 +1528,11 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, return (EINVAL); fitit = FALSE; } - writecounted = FALSE; - /* - * Lookup/allocate object. - */ - switch (handle_type) { - case OBJT_DEVICE: - error = vm_mmap_cdev(td, size, prot, &maxprot, &flags, - handle, &foff, &object); - break; - case OBJT_VNODE: - error = vm_mmap_vnode(td, size, prot, &maxprot, &flags, - handle, &foff, &object, &writecounted); - break; - case OBJT_SWAP: - error = vm_mmap_shm(td, size, prot, &maxprot, &flags, - handle, foff, &object); - break; - case OBJT_DEFAULT: - if (handle == NULL) { - error = 0; - break; - } - /* FALLTHROUGH */ - default: - error = EINVAL; - break; - } - if (error) - return (error); if (flags & MAP_ANON) { - object = NULL; + if (object != NULL || foff != 0) + return (EINVAL); docow = 0; - /* - * Unnamed anonymous regions always start at 0. - */ - if (handle == 0) - foff = 0; } else if (flags & MAP_PREFAULT_READ) docow = MAP_PREFAULT; else @@ -1693,19 +1585,6 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, VM_MAP_WIRE_USER | ((flags & MAP_STACK) ? VM_MAP_WIRE_HOLESOK : VM_MAP_WIRE_NOHOLES)); } - } else { - /* - * If this mapping was accounted for in the vnode's - * writecount, then undo that now. - */ - if (writecounted) - vnode_pager_release_writecount(object, 0, size); - /* - * Lose the object reference. Will destroy the - * object if it's an unnamed anonymous mapping - * or named anonymous without other references. - */ - vm_object_deallocate(object); } return (vm_mmap_to_errno(rv)); } From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 20:36:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 245FCE9; Thu, 4 Jun 2015 20:36:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 05F081D6E; Thu, 4 Jun 2015 20:36:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t54KaK96001399; Thu, 4 Jun 2015 20:36:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t54KaHMU001382; Thu, 4 Jun 2015 20:36:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201506042036.t54KaHMU001382@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 4 Jun 2015 20:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283999 - head/sys/dev/drm 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, 04 Jun 2015 20:36:21 -0000 Author: jhb Date: Thu Jun 4 20:36:16 2015 New Revision: 283999 URL: https://svnweb.freebsd.org/changeset/base/283999 Log: Remove compatibility shims for FreeBSD versions older than 8.0. Modified: head/sys/dev/drm/drmP.h head/sys/dev/drm/drm_agpsupport.c head/sys/dev/drm/drm_bufs.c head/sys/dev/drm/drm_drv.c head/sys/dev/drm/drm_irq.c head/sys/dev/drm/i915_drv.c head/sys/dev/drm/mach64_drv.c head/sys/dev/drm/mga_drv.c head/sys/dev/drm/r128_drv.c head/sys/dev/drm/radeon_drv.c head/sys/dev/drm/savage_drv.c head/sys/dev/drm/sis_drv.c head/sys/dev/drm/tdfx_drv.c Modified: head/sys/dev/drm/drmP.h ============================================================================== --- head/sys/dev/drm/drmP.h Thu Jun 4 19:41:15 2015 (r283998) +++ head/sys/dev/drm/drmP.h Thu Jun 4 20:36:16 2015 (r283999) @@ -51,9 +51,7 @@ struct drm_file; #include #include #include -#if __FreeBSD_version >= 700000 #include -#endif #include #include #include @@ -94,11 +92,7 @@ struct drm_file; #include #include #include -#if __FreeBSD_version >= 800004 #include -#else /* __FreeBSD_version >= 800004 */ -#include -#endif /* __FreeBSD_version >= 800004 */ #include #include #include @@ -227,11 +221,7 @@ enum { #define PAGE_ALIGN(addr) round_page(addr) /* DRM_SUSER returns true if the user is superuser */ -#if __FreeBSD_version >= 700000 #define DRM_SUSER(p) (priv_check(p, PRIV_DRIVER) == 0) -#else -#define DRM_SUSER(p) (suser(p) == 0) -#endif #define DRM_AGP_FIND_DEVICE() agp_find_device() #define DRM_MTRR_WC MDF_WRITECOMBINE #define jiffies ticks Modified: head/sys/dev/drm/drm_agpsupport.c ============================================================================== --- head/sys/dev/drm/drm_agpsupport.c Thu Jun 4 19:41:15 2015 (r283998) +++ head/sys/dev/drm/drm_agpsupport.c Thu Jun 4 20:36:16 2015 (r283999) @@ -38,50 +38,15 @@ __FBSDID("$FreeBSD$"); #include "dev/drm/drmP.h" -#if __FreeBSD_version >= 800004 #include -#else /* __FreeBSD_version >= 800004 */ -#include -#endif /* __FreeBSD_version >= 800004 */ #include /* Returns 1 if AGP or 0 if not. */ static int drm_device_find_capability(struct drm_device *dev, int cap) { -#if __FreeBSD_version >= 602102 return (pci_find_cap(dev->device, cap, NULL) == 0); -#else - /* Code taken from agp.c. IWBNI that was a public interface. */ - u_int32_t status; - u_int8_t ptr, next; - - /* - * Check the CAP_LIST bit of the PCI status register first. - */ - status = pci_read_config(dev->device, PCIR_STATUS, 2); - if (!(status & 0x10)) - return 0; - - /* - * Traverse the capabilities list. - */ - for (ptr = pci_read_config(dev->device, AGP_CAPPTR, 1); - ptr != 0; - ptr = next) { - u_int32_t capid = pci_read_config(dev->device, ptr, 4); - next = AGP_CAPID_GET_NEXT_PTR(capid); - - /* - * If this capability entry ID is cap, then we are done. - */ - if (AGP_CAPID_GET_CAP_ID(capid) == cap) - return 1; - } - - return 0; -#endif } int drm_device_is_agp(struct drm_device *dev) Modified: head/sys/dev/drm/drm_bufs.c ============================================================================== --- head/sys/dev/drm/drm_bufs.c Thu Jun 4 19:41:15 2015 (r283998) +++ head/sys/dev/drm/drm_bufs.c Thu Jun 4 20:36:16 2015 (r283999) @@ -1066,15 +1066,9 @@ int drm_mapbufs(struct drm_device *dev, } vaddr = round_page((vm_offset_t)vms->vm_daddr + MAXDSIZ); -#if __FreeBSD_version >= 600023 retcode = vm_mmap(&vms->vm_map, &vaddr, size, VM_PROT_READ | VM_PROT_WRITE, VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE, dev->devnode, foff); -#else - retcode = vm_mmap(&vms->vm_map, &vaddr, size, VM_PROT_READ | - VM_PROT_WRITE, VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, - SLIST_FIRST(&dev->devnode->si_hlist), foff); -#endif if (retcode) goto done; Modified: head/sys/dev/drm/drm_drv.c ============================================================================== --- head/sys/dev/drm/drm_drv.c Thu Jun 4 19:41:15 2015 (r283998) +++ head/sys/dev/drm/drm_drv.c Thu Jun 4 20:36:16 2015 (r283999) @@ -161,19 +161,8 @@ int drm_probe(device_t kdev, drm_pci_id_ { drm_pci_id_list_t *id_entry; int vendor, device; -#if __FreeBSD_version < 700010 - device_t realdev; - - if (!strcmp(device_get_name(kdev), "drmsub")) - realdev = device_get_parent(kdev); - else - realdev = kdev; - vendor = pci_get_vendor(realdev); - device = pci_get_device(realdev); -#else vendor = pci_get_vendor(kdev); device = pci_get_device(kdev); -#endif if (pci_get_class(kdev) != PCIC_DISPLAY || pci_get_subclass(kdev) != PCIS_DISPLAY_VGA) @@ -200,14 +189,7 @@ int drm_attach(device_t kdev, drm_pci_id unit = device_get_unit(kdev); dev = device_get_softc(kdev); -#if __FreeBSD_version < 700010 - if (!strcmp(device_get_name(kdev), "drmsub")) - dev->device = device_get_parent(kdev); - else - dev->device = kdev; -#else dev->device = kdev; -#endif dev->devnode = make_dev(&drm_cdevsw, 0, DRM_DEV_UID, @@ -216,11 +198,7 @@ int drm_attach(device_t kdev, drm_pci_id "dri/card%d", unit); dev->devnode->si_drv1 = dev; -#if __FreeBSD_version >= 700053 dev->pci_domain = pci_get_domain(dev->device); -#else - dev->pci_domain = 0; -#endif dev->pci_bus = pci_get_bus(dev->device); dev->pci_slot = pci_get_slot(dev->device); dev->pci_func = pci_get_function(dev->device); Modified: head/sys/dev/drm/drm_irq.c ============================================================================== --- head/sys/dev/drm/drm_irq.c Thu Jun 4 19:41:15 2015 (r283998) +++ head/sys/dev/drm/drm_irq.c Thu Jun 4 20:36:16 2015 (r283999) @@ -175,15 +175,9 @@ int drm_irq_install(struct drm_device *d DRM_UNLOCK(); /* Install handler */ -#if __FreeBSD_version >= 700031 retcode = bus_setup_intr(dev->device, dev->irqr, INTR_TYPE_TTY | INTR_MPSAFE, NULL, drm_irq_handler_wrap, dev, &dev->irqh); -#else - retcode = bus_setup_intr(dev->device, dev->irqr, - INTR_TYPE_TTY | INTR_MPSAFE, - drm_irq_handler_wrap, dev, &dev->irqh); -#endif if (retcode != 0) goto err; Modified: head/sys/dev/drm/i915_drv.c ============================================================================== --- head/sys/dev/drm/i915_drv.c Thu Jun 4 19:41:15 2015 (r283998) +++ head/sys/dev/drm/i915_drv.c Thu Jun 4 20:36:16 2015 (r283999) @@ -147,19 +147,11 @@ static device_method_t i915_methods[] = }; static driver_t i915_driver = { -#if __FreeBSD_version >= 700010 "drm", -#else - "drmsub", -#endif i915_methods, sizeof(struct drm_device) }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 DRIVER_MODULE(i915, vgapci, i915_driver, drm_devclass, 0, 0); -#else -DRIVER_MODULE(i915, agp, i915_driver, drm_devclass, 0, 0); -#endif MODULE_DEPEND(i915, drm, 1, 1, 1); Modified: head/sys/dev/drm/mach64_drv.c ============================================================================== --- head/sys/dev/drm/mach64_drv.c Thu Jun 4 19:41:15 2015 (r283998) +++ head/sys/dev/drm/mach64_drv.c Thu Jun 4 20:36:16 2015 (r283999) @@ -130,9 +130,5 @@ static driver_t mach64_driver = { }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 DRIVER_MODULE(mach64, vgapci, mach64_driver, drm_devclass, 0, 0); -#else -DRIVER_MODULE(mach64, pci, mach64_driver, drm_devclass, 0, 0); -#endif MODULE_DEPEND(mach64, drm, 1, 1, 1); Modified: head/sys/dev/drm/mga_drv.c ============================================================================== --- head/sys/dev/drm/mga_drv.c Thu Jun 4 19:41:15 2015 (r283998) +++ head/sys/dev/drm/mga_drv.c Thu Jun 4 20:36:16 2015 (r283999) @@ -74,11 +74,7 @@ static int mga_driver_device_is_agp(stru * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the * device. */ -#if __FreeBSD_version >= 700010 bus = device_get_parent(device_get_parent(dev->device)); -#else - bus = device_get_parent(dev->device); -#endif if (pci_get_device(dev->device) == 0x0525 && pci_get_vendor(bus) == 0x3388 && pci_get_device(bus) == 0x0021) @@ -167,9 +163,5 @@ static driver_t mga_driver = { }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 DRIVER_MODULE(mga, vgapci, mga_driver, drm_devclass, 0, 0); -#else -DRIVER_MODULE(mga, pci, mga_driver, drm_devclass, 0, 0); -#endif MODULE_DEPEND(mga, drm, 1, 1, 1); Modified: head/sys/dev/drm/r128_drv.c ============================================================================== --- head/sys/dev/drm/r128_drv.c Thu Jun 4 19:41:15 2015 (r283998) +++ head/sys/dev/drm/r128_drv.c Thu Jun 4 20:36:16 2015 (r283999) @@ -128,9 +128,5 @@ static driver_t r128_driver = { }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 DRIVER_MODULE(r128, vgapci, r128_driver, drm_devclass, 0, 0); -#else -DRIVER_MODULE(r128, pci, r128_driver, drm_devclass, 0, 0); -#endif MODULE_DEPEND(r128, drm, 1, 1, 1); Modified: head/sys/dev/drm/radeon_drv.c ============================================================================== --- head/sys/dev/drm/radeon_drv.c Thu Jun 4 19:41:15 2015 (r283998) +++ head/sys/dev/drm/radeon_drv.c Thu Jun 4 20:36:16 2015 (r283999) @@ -127,9 +127,5 @@ static driver_t radeon_driver = { }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 DRIVER_MODULE(radeon, vgapci, radeon_driver, drm_devclass, 0, 0); -#else -DRIVER_MODULE(radeon, pci, radeon_driver, drm_devclass, 0, 0); -#endif MODULE_DEPEND(radeon, drm, 1, 1, 1); Modified: head/sys/dev/drm/savage_drv.c ============================================================================== --- head/sys/dev/drm/savage_drv.c Thu Jun 4 19:41:15 2015 (r283998) +++ head/sys/dev/drm/savage_drv.c Thu Jun 4 20:36:16 2015 (r283999) @@ -113,9 +113,5 @@ static driver_t savage_driver = { }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 DRIVER_MODULE(savage, vgapci, savage_driver, drm_devclass, 0, 0); -#else -DRIVER_MODULE(savage, pci, savage_driver, drm_devclass, 0, 0); -#endif MODULE_DEPEND(savage, drm, 1, 1, 1); Modified: head/sys/dev/drm/sis_drv.c ============================================================================== --- head/sys/dev/drm/sis_drv.c Thu Jun 4 19:41:15 2015 (r283998) +++ head/sys/dev/drm/sis_drv.c Thu Jun 4 20:36:16 2015 (r283999) @@ -107,9 +107,5 @@ static driver_t sis_driver = { }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 DRIVER_MODULE(sisdrm, vgapci, sis_driver, drm_devclass, 0, 0); -#else -DRIVER_MODULE(sisdrm, pci, sis_driver, drm_devclass, 0, 0); -#endif MODULE_DEPEND(sisdrm, drm, 1, 1, 1); Modified: head/sys/dev/drm/tdfx_drv.c ============================================================================== --- head/sys/dev/drm/tdfx_drv.c Thu Jun 4 19:41:15 2015 (r283998) +++ head/sys/dev/drm/tdfx_drv.c Thu Jun 4 20:36:16 2015 (r283999) @@ -109,9 +109,5 @@ static driver_t tdfx_driver = { }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 DRIVER_MODULE(tdfx, vgapci, tdfx_driver, drm_devclass, 0, 0); -#else -DRIVER_MODULE(tdfx, pci, tdfx_driver, drm_devclass, 0, 0); -#endif MODULE_DEPEND(tdfx, drm, 1, 1, 1); From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 21:07:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44B5274E; Thu, 4 Jun 2015 21:07:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 261E61487; Thu, 4 Jun 2015 21:07:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t54L7S5X016557; Thu, 4 Jun 2015 21:07:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t54L7SXb016556; Thu, 4 Jun 2015 21:07:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201506042107.t54L7SXb016556@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 4 Jun 2015 21:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284000 - head/tests/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, 04 Jun 2015 21:07:28 -0000 Author: jhb Date: Thu Jun 4 21:07:27 2015 New Revision: 284000 URL: https://svnweb.freebsd.org/changeset/base/284000 Log: Add a CHILD_REQUIRE macro similar to ATF_REQUIRE for use in child processes of the main test process. Differential Revision: https://reviews.freebsd.org/D2664 Reviewed by: ngie (previous version) Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Thu Jun 4 20:36:16 2015 (r283999) +++ head/tests/sys/kern/ptrace_test.c Thu Jun 4 21:07:27 2015 (r284000) @@ -34,11 +34,33 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include /* + * A variant of ATF_REQUIRE that is suitable for use in child + * processes. This only works if the parent process is tripped up by + * the early exit and fails some requirement itself. + */ +#define CHILD_REQUIRE(exp) do { \ + if (!(exp)) \ + child_fail_require(__FILE__, __LINE__, \ + #exp " not met"); \ + } while (0) + +static void __dead2 +child_fail_require(const char *file, int line, const char *str) +{ + char buf[128]; + + snprintf(buf, sizeof(buf), "%s:%d: %s\n", file, line, str); + write(2, buf, strlen(buf)); + _exit(32); +} + +/* * Verify that a parent debugger process "sees" the exit of a debugged * process exactly once when attached via PT_TRACE_ME. */ @@ -51,7 +73,7 @@ ATF_TC_BODY(ptrace__parent_wait_after_tr ATF_REQUIRE((child = fork()) != -1); if (child == 0) { /* Child process. */ - ATF_REQUIRE(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + CHILD_REQUIRE(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); /* Trigger a stop. */ raise(SIGSTOP); @@ -100,7 +122,7 @@ ATF_TC_BODY(ptrace__parent_wait_after_at close(cpipe[0]); /* Wait for the parent to attach. */ - ATF_REQUIRE(read(cpipe[1], &c, sizeof(c)) == 0); + CHILD_REQUIRE(read(cpipe[1], &c, sizeof(c)) == 0); exit(1); } @@ -154,7 +176,7 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft close(cpipe[0]); /* Wait for parent to be ready. */ - ATF_REQUIRE(read(cpipe[1], &c, sizeof(c)) == sizeof(c)); + CHILD_REQUIRE(read(cpipe[1], &c, sizeof(c)) == sizeof(c)); exit(1); } @@ -167,25 +189,25 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft /* Debugger process. */ close(dpipe[0]); - ATF_REQUIRE(ptrace(PT_ATTACH, child, NULL, 0) != -1); + CHILD_REQUIRE(ptrace(PT_ATTACH, child, NULL, 0) != -1); wpid = waitpid(child, &status, 0); - ATF_REQUIRE(wpid == child); - ATF_REQUIRE(WIFSTOPPED(status)); - ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + CHILD_REQUIRE(wpid == child); + CHILD_REQUIRE(WIFSTOPPED(status)); + CHILD_REQUIRE(WSTOPSIG(status) == SIGSTOP); - ATF_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); + CHILD_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); /* Signal parent that debugger is attached. */ - ATF_REQUIRE(write(dpipe[1], &c, sizeof(c)) == sizeof(c)); + CHILD_REQUIRE(write(dpipe[1], &c, sizeof(c)) == sizeof(c)); /* Wait for parent's failed wait. */ - ATF_REQUIRE(read(dpipe[1], &c, sizeof(c)) == 0); + CHILD_REQUIRE(read(dpipe[1], &c, sizeof(c)) == 0); wpid = waitpid(child, &status, 0); - ATF_REQUIRE(wpid == child); - ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + CHILD_REQUIRE(wpid == child); + CHILD_REQUIRE(WIFEXITED(status)); + CHILD_REQUIRE(WEXITSTATUS(status) == 1); exit(0); } @@ -268,7 +290,7 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft close(cpipe[0]); /* Wait for parent to be ready. */ - ATF_REQUIRE(read(cpipe[1], &c, sizeof(c)) == sizeof(c)); + CHILD_REQUIRE(read(cpipe[1], &c, sizeof(c)) == sizeof(c)); exit(1); } @@ -284,32 +306,32 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft * Fork again and drop the debugger parent so that the * debugger is not a child of the main parent. */ - ATF_REQUIRE((fpid = fork()) != -1); + CHILD_REQUIRE((fpid = fork()) != -1); if (fpid != 0) exit(2); /* Debugger process. */ close(dpipe[0]); - ATF_REQUIRE(ptrace(PT_ATTACH, child, NULL, 0) != -1); + CHILD_REQUIRE(ptrace(PT_ATTACH, child, NULL, 0) != -1); wpid = waitpid(child, &status, 0); - ATF_REQUIRE(wpid == child); - ATF_REQUIRE(WIFSTOPPED(status)); - ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + CHILD_REQUIRE(wpid == child); + CHILD_REQUIRE(WIFSTOPPED(status)); + CHILD_REQUIRE(WSTOPSIG(status) == SIGSTOP); - ATF_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); + CHILD_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); /* Signal parent that debugger is attached. */ - ATF_REQUIRE(write(dpipe[1], &c, sizeof(c)) == sizeof(c)); + CHILD_REQUIRE(write(dpipe[1], &c, sizeof(c)) == sizeof(c)); /* Wait for parent's failed wait. */ - ATF_REQUIRE(read(dpipe[1], &c, sizeof(c)) == sizeof(c)); + CHILD_REQUIRE(read(dpipe[1], &c, sizeof(c)) == sizeof(c)); wpid = waitpid(child, &status, 0); - ATF_REQUIRE(wpid == child); - ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + CHILD_REQUIRE(wpid == child); + CHILD_REQUIRE(WIFEXITED(status)); + CHILD_REQUIRE(WEXITSTATUS(status) == 1); exit(0); } From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 21:54:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F07904EE; Thu, 4 Jun 2015 21:54:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DE86C101C; Thu, 4 Jun 2015 21:54:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t54Lsk2A041534; Thu, 4 Jun 2015 21:54:46 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t54LskQu041533; Thu, 4 Jun 2015 21:54:46 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201506042154.t54LskQu041533@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 4 Jun 2015 21:54:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284001 - 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: Thu, 04 Jun 2015 21:54:47 -0000 Author: jilles Date: Thu Jun 4 21:54:46 2015 New Revision: 284001 URL: https://svnweb.freebsd.org/changeset/base/284001 Log: strchr(3): Mdoc fixes. Modified: head/lib/libc/string/strchr.3 Modified: head/lib/libc/string/strchr.3 ============================================================================== --- head/lib/libc/string/strchr.3 Thu Jun 4 21:07:27 2015 (r284000) +++ head/lib/libc/string/strchr.3 Thu Jun 4 21:54:46 2015 (r284001) @@ -113,10 +113,12 @@ and .Fn strrchr conform to .St -isoC . -The +The function .Fn strchrnul -is a GNU extension . -.Sh History +is a +.Tn GNU +extension. +.Sh HISTORY The .Fn strchrnul function first appeared in glibc 2.1.1 and was added in From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 23:07:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41BA163F; Thu, 4 Jun 2015 23:07:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2FE9D10CD; Thu, 4 Jun 2015 23:07:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t54N7MnO077960; Thu, 4 Jun 2015 23:07:22 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t54N7M1B077959; Thu, 4 Jun 2015 23:07:22 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201506042307.t54N7M1B077959@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 4 Jun 2015 23:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284003 - head/sys/net80211 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, 04 Jun 2015 23:07:22 -0000 Author: adrian Date: Thu Jun 4 23:07:21 2015 New Revision: 284003 URL: https://svnweb.freebsd.org/changeset/base/284003 Log: Some hostap setups may result in raw frames being transmitted with no parameters set. So, don't unconditionally call things. Thanks to jkim@ for pointing this out! MFC after: 2 weeks Sponsored by: Norse Corp, Inc. Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Thu Jun 4 22:11:39 2015 (r284002) +++ head/sys/net80211/ieee80211_output.c Thu Jun 4 23:07:21 2015 (r284003) @@ -525,7 +525,8 @@ ieee80211_raw_output(struct ieee80211vap * they'll have to be added - so fail the transmit if * they can't be. */ - (void) ieee80211_add_xmit_params(m, params); + if (params) + (void) ieee80211_add_xmit_params(m, params); return (ic->ic_raw_xmit(ni, m, params)); } From owner-svn-src-head@FreeBSD.ORG Thu Jun 4 23:11:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5050B7C1; Thu, 4 Jun 2015 23:11:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3EC941277; Thu, 4 Jun 2015 23:11:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t54NBPvQ082169; Thu, 4 Jun 2015 23:11:25 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t54NBP7L082168; Thu, 4 Jun 2015 23:11:25 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506042311.t54NBP7L082168@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 4 Jun 2015 23:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284004 - head/release/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: Thu, 04 Jun 2015 23:11:25 -0000 Author: gjb Date: Thu Jun 4 23:11:24 2015 New Revision: 284004 URL: https://svnweb.freebsd.org/changeset/base/284004 Log: Make sure /home exists within the DESTDIR before creating the 'freebsd' user account. Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Thu Jun 4 23:07:21 2015 (r284003) +++ head/release/tools/arm.subr Thu Jun 4 23:11:24 2015 (r284004) @@ -82,6 +82,7 @@ arm_create_user() { # and set the default password for the 'root' user to 'root'. chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ groupadd freebsd -g 1001 + chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/home chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ useradd freebsd \ -m -M 0755 -w yes -n freebsd -u 1001 -g 1001 -G 0 \ From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 00:37:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E8D6742; Fri, 5 Jun 2015 00:37:47 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6D3C91750; Fri, 5 Jun 2015 00:37:47 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t550blUC023528; Fri, 5 Jun 2015 00:37:47 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t550blOm023527; Fri, 5 Jun 2015 00:37:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <201506050037.t550blOm023527@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 5 Jun 2015 00:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284007 - 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: Fri, 05 Jun 2015 00:37:47 -0000 Author: np Date: Fri Jun 5 00:37:46 2015 New Revision: 284007 URL: https://svnweb.freebsd.org/changeset/base/284007 Log: cxgbe: set the minimum burst size when fetching fl buffers to 128B for netmap rx queues too. This should have gone in as part of r283858. Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Fri Jun 5 00:35:17 2015 (r284006) +++ head/sys/dev/cxgbe/t4_netmap.c Fri Jun 5 00:37:46 2015 (r284007) @@ -297,7 +297,7 @@ alloc_nm_rxq_hwq(struct port_info *pi, s (fl_pad ? F_FW_IQ_CMD_FL0PADEN : 0) | (black_hole == 2 ? F_FW_IQ_CMD_FL0PACKEN : 0)); c.fl0dcaen_to_fl0cidxfthresh = - htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_64B) | + htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_128B) | V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B)); c.fl0size = htobe16(na->num_rx_desc / 8 + spg_len / EQ_ESIZE); c.fl0addr = htobe64(nm_rxq->fl_ba); From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 02:22:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42782BA6; Fri, 5 Jun 2015 02:22:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 310B21431; Fri, 5 Jun 2015 02:22:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t552M563076847; Fri, 5 Jun 2015 02:22:05 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t552M5UL076846; Fri, 5 Jun 2015 02:22:05 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506050222.t552M5UL076846@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 5 Jun 2015 02:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284010 - head/release/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: Fri, 05 Jun 2015 02:22:05 -0000 Author: gjb Date: Fri Jun 5 02:22:04 2015 New Revision: 284010 URL: https://svnweb.freebsd.org/changeset/base/284010 Log: Work around a potential bug in pw(8) when '-m' is specified. According to the manual page, '-m' should create the user home directory, however rigorous testing suggests it does not, and it is unclear if this is an implementation or expectation issue. Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Fri Jun 5 00:46:49 2015 (r284009) +++ head/release/tools/arm.subr Fri Jun 5 02:22:04 2015 (r284010) @@ -82,7 +82,7 @@ arm_create_user() { # and set the default password for the 'root' user to 'root'. chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ groupadd freebsd -g 1001 - chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/home + chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/home/freebsd chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ useradd freebsd \ -m -M 0755 -w yes -n freebsd -u 1001 -g 1001 -G 0 \ From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 02:25:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71116D42; Fri, 5 Jun 2015 02:25:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Fri, 5 Jun 2015 02:25:40 +0000 From: Glen Barber To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284010 - head/release/tools Message-ID: <20150605022540.GN1550@hub.FreeBSD.org> References: <201506050222.t552M5UL076846@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lCFQJunhLz1tFGpX" Content-Disposition: inline In-Reply-To: <201506050222.t552M5UL076846@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer 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: Fri, 05 Jun 2015 02:25:44 -0000 --lCFQJunhLz1tFGpX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 05, 2015 at 02:22:05AM +0000, Glen Barber wrote: > Author: gjb > Date: Fri Jun 5 02:22:04 2015 > New Revision: 284010 > URL: https://svnweb.freebsd.org/changeset/base/284010 >=20 > Log: > Work around a potential bug in pw(8) when '-m' is specified. > According to the manual page, '-m' should create the user home > directory, however rigorous testing suggests it does not, and > it is unclear if this is an implementation or expectation issue. > =20 MFC after: I figure out WTF is going on here... Glen --lCFQJunhLz1tFGpX Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVcQieAAoJEAMUWKVHj+KTvBQP/i/IBiK2tELVL+JWCOHeab0J eR9iauUzCShlHNe94/Sz12K/jmBDp6WNZDx8MRNNsijR9po0XhJsKR4CUSEvB18K ZgWYd74gqmIqFdpjlrp2Poo3tBr4teecNrZw/4Pc9/yrzIy33LOTabMnx3JM4iN3 vgEuG/JASJc+DeG6DxS9DQitiq4jypL941ILzt2W2iqEyLnawbqinGlsft/6mlMj p1zsve7aZOd8NO32QZ2uiKVRpvbd+aVTb3qiGNGDXp6c0XGGO5waDobamanovjIq bULlyfhIlSoXtoVgJfJyw6bqrMSqJBgDl1otqi5GXTinwuhmeNZShy+L3yWVVMi7 M0hSq0qnzNQrXbzhWLaPdI77t8aYmOZp7lWoAwdKtvE5hZeiSzvJgkvLfgtkBu2K rjXI9LSDNeQhV8XAxJU4GTVIOdRHYXYVQC2cenzFAlS4B8x/WqfsJlboFn/NFAQq UekkRXYI1d8Oj+MTkpdK9LcsjDoYkYDZmZwPgOOGtOkQ5yTvGXlIPNI+jIpZOhOB We3GxajeM3GX/LQWv9CWUiGZz6S1DBs1hNfiA7eAmDb+Ba/jyQbe2u2TNSCW9s7H JvT+Ohskv2N4HdRCUXb7FA9ptWSozBptn1tGV8lcpY9RmsvYYiOl1M07OZHinri3 XgyheJ8RJ32P/0Yw7/uO =ERLO -----END PGP SIGNATURE----- --lCFQJunhLz1tFGpX-- From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 06:06:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BDE5779; Fri, 5 Jun 2015 06:06:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 09D4F168D; Fri, 5 Jun 2015 06:06:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55667RM087503; Fri, 5 Jun 2015 06:06:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55667v4087502; Fri, 5 Jun 2015 06:06:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201506050606.t55667v4087502@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Jun 2015 06:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284011 - 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, 05 Jun 2015 06:06:08 -0000 Author: hselasky Date: Fri Jun 5 06:06:07 2015 New Revision: 284011 URL: https://svnweb.freebsd.org/changeset/base/284011 Log: Don't wait forever for USB data to be flushed. MFC after: 1 week Modified: head/sys/dev/usb/usb_dev.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Fri Jun 5 02:22:04 2015 (r284010) +++ head/sys/dev/usb/usb_dev.c Fri Jun 5 06:06:07 2015 (r284011) @@ -830,7 +830,8 @@ usb_fifo_close(struct usb_fifo *f, int f (!f->flag_iserror)) { /* wait until all data has been written */ f->flag_sleeping = 1; - err = cv_wait_sig(&f->cv_io, f->priv_mtx); + err = cv_timedwait_sig(&f->cv_io, f->priv_mtx, + USB_MS_TO_TICKS(USB_DEFAULT_TIMEOUT)); if (err) { DPRINTF("signal received\n"); break; From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 06:23:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA8919CB; Fri, 5 Jun 2015 06:23:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B80AC1AA7; Fri, 5 Jun 2015 06:23:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t556N4NF096923; Fri, 5 Jun 2015 06:23:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t556N48w096922; Fri, 5 Jun 2015 06:23:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201506050623.t556N48w096922@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Jun 2015 06:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284012 - head/sys/dev/pci 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, 05 Jun 2015 06:23:04 -0000 Author: hselasky Date: Fri Jun 5 06:23:03 2015 New Revision: 284012 URL: https://svnweb.freebsd.org/changeset/base/284012 Log: Disable VGA PCI interrupts until a chipset driver is loaded for VGA PCI devices. Else unhandled display adapter interrupts might freeze the CPU or consume a lot of CPU. PR: 156596 MFC after: 1 week Modified: head/sys/dev/pci/vga_pci.c Modified: head/sys/dev/pci/vga_pci.c ============================================================================== --- head/sys/dev/pci/vga_pci.c Fri Jun 5 06:06:07 2015 (r284011) +++ head/sys/dev/pci/vga_pci.c Fri Jun 5 06:23:03 2015 (r284012) @@ -126,6 +126,13 @@ vga_pci_is_boot_display(device_t dev) if ((config & (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN)) == 0) return (0); + /* + * Disable interrupts until a chipset driver is loaded for + * this PCI device. Else unhandled display adapter interrupts + * might freeze the CPU. + */ + pci_write_config(dev, PCIR_COMMAND, config | PCIM_CMD_INTxDIS, 2); + /* This video card is the boot display: record its unit number. */ vga_pci_default_unit = unit; device_set_flags(dev, 1); From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 06:46:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A973BD01; Fri, 5 Jun 2015 06:46:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 972021F7D; Fri, 5 Jun 2015 06:46:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t556kCMW007256; Fri, 5 Jun 2015 06:46:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t556kCnv007255; Fri, 5 Jun 2015 06:46:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201506050646.t556kCnv007255@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 5 Jun 2015 06:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284013 - head/sys/cam/ctl 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, 05 Jun 2015 06:46:12 -0000 Author: mav Date: Fri Jun 5 06:46:11 2015 New Revision: 284013 URL: https://svnweb.freebsd.org/changeset/base/284013 Log: Allow setting only WWNN or only WWPN. MFC after: 2 weeks Modified: head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Fri Jun 5 06:23:03 2015 (r284012) +++ head/sys/cam/ctl/scsi_ctl.c Fri Jun 5 06:46:11 2015 (r284013) @@ -1657,16 +1657,24 @@ ctlfe_onoffline(void *arg, int online) * down to the SIM. Otherwise, record what the SIM * has reported. */ - if ((bus_softc->port.wwnn != 0) - && (bus_softc->port.wwpn != 0)) { + if (bus_softc->port.wwnn != 0 && bus_softc->port.wwnn + != ccb->knob.xport_specific.fc.wwnn) { ccb->knob.xport_specific.fc.wwnn = - bus_softc->port.wwnn; - ccb->knob.xport_specific.fc.wwpn = - bus_softc->port.wwpn; + bus_softc->port.wwnn; set_wwnn = 1; } else { ctl_port_set_wwns(&bus_softc->port, true, ccb->knob.xport_specific.fc.wwnn, + false, 0); + } + if (bus_softc->port.wwpn != 0 && bus_softc->port.wwpn + != ccb->knob.xport_specific.fc.wwpn) { + ccb->knob.xport_specific.fc.wwpn = + bus_softc->port.wwpn; + set_wwnn = 1; + } else { + ctl_port_set_wwns(&bus_softc->port, + false, 0, true, ccb->knob.xport_specific.fc.wwpn); } #endif /* RANDOM_WWNN */ From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 06:49:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35C48E9D; Fri, 5 Jun 2015 06:49:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2380C1F9B; Fri, 5 Jun 2015 06:49:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t556n9xn007674; Fri, 5 Jun 2015 06:49:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t556n9LI007673; Fri, 5 Jun 2015 06:49:09 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201506050649.t556n9LI007673@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 5 Jun 2015 06:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284014 - head/sys/net80211 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, 05 Jun 2015 06:49:09 -0000 Author: adrian Date: Fri Jun 5 06:49:08 2015 New Revision: 284014 URL: https://svnweb.freebsd.org/changeset/base/284014 Log: For now, just default to presenting "found" channels as 11g, not 11b. The intel 7260 driver under development requires this - the scans come in as normal frames but with the frequency provided. The correct method is to have the driver provide flags (so we can determine if it's 11b or 11g); this will have to do in the meantime. Without this, the channel found is 11b, and no ERP (ie "11g") bits are negotiated with the AP. This allows the 7260 in 2ghz mode to operate in 11bg, rather than just 11b. Tested: * intel 7260 driver, 11bg channels Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Fri Jun 5 06:46:11 2015 (r284013) +++ head/sys/net80211/ieee80211.c Fri Jun 5 06:49:08 2015 (r284014) @@ -1081,7 +1081,7 @@ ieee80211_lookup_channel_rxstatus(struct /* Determine a band */ /* XXX should be done by the driver? */ if (rxs->c_freq < 3000) { - flags = IEEE80211_CHAN_B; + flags = IEEE80211_CHAN_G; } else { flags = IEEE80211_CHAN_A; } From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 11:37:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E258939; Fri, 5 Jun 2015 11:37:55 +0000 (UTC) (envelope-from achim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1C9951336; Fri, 5 Jun 2015 11:37:55 +0000 (UTC) (envelope-from achim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55BbsFs051984; Fri, 5 Jun 2015 11:37:54 GMT (envelope-from achim@FreeBSD.org) Received: (from achim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55BbstN051983; Fri, 5 Jun 2015 11:37:54 GMT (envelope-from achim@FreeBSD.org) Message-Id: <201506051137.t55BbstN051983@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: achim set sender to achim@FreeBSD.org using -f From: Achim Leubner Date: Fri, 5 Jun 2015 11:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284022 - head/sys/dev/aic7xxx 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, 05 Jun 2015 11:37:55 -0000 Author: achim Date: Fri Jun 5 11:37:54 2015 New Revision: 284022 URL: https://svnweb.freebsd.org/changeset/base/284022 Log: aic7xxx: Do not support device IDs 0x8081, 0x8088 and 0x8089 to avoid conflicts with the new PMC Adaptec controller families supported by aacraid Modified: head/sys/dev/aic7xxx/aic79xx_pci.c Modified: head/sys/dev/aic7xxx/aic79xx_pci.c ============================================================================== --- head/sys/dev/aic7xxx/aic79xx_pci.c Fri Jun 5 08:36:25 2015 (r284021) +++ head/sys/dev/aic7xxx/aic79xx_pci.c Fri Jun 5 11:37:54 2015 (r284022) @@ -93,6 +93,11 @@ ahd_compose_id(u_int device, u_int vendo #define ID_AIC7902_PCI_REV_A4 0x3 #define ID_AIC7902_PCI_REV_B0 0x10 #define SUBID_HP 0x0E11 +#define DEVICE8081 0x8081 +#define DEVICE8088 0x8088 +#define DEVICE8089 0x8089 +#define ADAPTECVENDORID 0x9005 +#define SUBVENDOR9005 0x9005 #define DEVID_9005_HOSTRAID(id) ((id) & 0x80) @@ -292,6 +297,15 @@ ahd_find_pci_device(aic_dev_softc_t pci) device = aic_pci_read_config(pci, PCIR_DEVICE, /*bytes*/2); subvendor = aic_pci_read_config(pci, PCIR_SUBVEND_0, /*bytes*/2); subdevice = aic_pci_read_config(pci, PCIR_SUBDEV_0, /*bytes*/2); + + if ((vendor == ADAPTECVENDORID) && (subvendor == SUBVENDOR9005)) { + if ((device == DEVICE8081) || (device == DEVICE8088) || + (device == DEVICE8089)) { + printf("Controller device ID conflict with PMC Adaptec HBA\n"); + return (NULL); + } + } + full_id = ahd_compose_id(device, vendor, subdevice, From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 15:14:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED68EFCB; Fri, 5 Jun 2015 15:14:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DB5B218AA; Fri, 5 Jun 2015 15:14:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55FEsSW062155; Fri, 5 Jun 2015 15:14:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55FEsMb062154; Fri, 5 Jun 2015 15:14:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201506051514.t55FEsMb062154@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 5 Jun 2015 15:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284023 - head/share/examples/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: Fri, 05 Jun 2015 15:14:55 -0000 Author: avg Date: Fri Jun 5 15:14:54 2015 New Revision: 284023 URL: https://svnweb.freebsd.org/changeset/base/284023 Log: bhyve/vmrun.sh: support passing disk options same as for bhyve(8) Differential Revision: https://reviews.freebsd.org/D2723 Reviewed by: neel MFC after: 8 days Modified: head/share/examples/bhyve/vmrun.sh Modified: head/share/examples/bhyve/vmrun.sh ============================================================================== --- head/share/examples/bhyve/vmrun.sh Fri Jun 5 11:37:54 2015 (r284022) +++ head/share/examples/bhyve/vmrun.sh Fri Jun 5 15:14:54 2015 (r284023) @@ -104,7 +104,10 @@ while getopts ac:C:d:e:g:hH:iI:m:p:t: c console=${OPTARG} ;; d) - eval "disk_dev${disk_total}=\"${OPTARG}\"" + disk_dev=${OPTARG%%,*} + disk_opts=${OPTARG#${disk_dev}} + eval "disk_dev${disk_total}=\"${disk_dev}\"" + eval "disk_opts${disk_total}=\"${disk_opts}\"" disk_total=$(($disk_total + 1)) ;; e) @@ -237,8 +240,9 @@ while [ 1 ]; do i=0 while [ $i -lt $disk_total ] ; do eval "disk=\$disk_dev${i}" + eval "opts=\$disk_opts${i}" make_and_check_diskdev "${disk}" - devargs="$devargs -s $nextslot:0,virtio-blk,${disk} " + devargs="$devargs -s $nextslot:0,virtio-blk,${disk}${opts} " nextslot=$(($nextslot + 1)) i=$(($i + 1)) done From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 15:16:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A57B619E; Fri, 5 Jun 2015 15:16:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 79B4C18C1; Fri, 5 Jun 2015 15:16:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55FGRAw062470; Fri, 5 Jun 2015 15:16:27 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55FGRi0062469; Fri, 5 Jun 2015 15:16:27 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201506051516.t55FGRi0062469@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 5 Jun 2015 15:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284024 - head/share/examples/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: Fri, 05 Jun 2015 15:16:27 -0000 Author: avg Date: Fri Jun 5 15:16:26 2015 New Revision: 284024 URL: https://svnweb.freebsd.org/changeset/base/284024 Log: bhyve/vmrun.sh: pass all existing readable disks to bhyveload(8) This is done if the installation mode is not requested or auto-detected. This is useful when a kernel has to be loaded from multiple disks. For example from a RAID-Z pool or a ZFS pool with multiple top level vdevs. Differential Revision: https://reviews.freebsd.org/D2723 Reviewed by: neel MFC after: 8 days Modified: head/share/examples/bhyve/vmrun.sh Modified: head/share/examples/bhyve/vmrun.sh ============================================================================== --- head/share/examples/bhyve/vmrun.sh Fri Jun 5 15:14:54 2015 (r284023) +++ head/share/examples/bhyve/vmrun.sh Fri Jun 5 15:16:26 2015 (r284024) @@ -186,16 +186,16 @@ make_and_check_diskdev() echo "Launching virtual machine \"$vmname\" ..." -virtio_diskdev="$disk_dev0" +first_diskdev="$disk_dev0" ${BHYVECTL} --vm=${vmname} --destroy > /dev/null 2>&1 while [ 1 ]; do - file -s ${virtio_diskdev} | grep "boot sector" > /dev/null + file -s ${first_diskdev} | grep "boot sector" > /dev/null rc=$? if [ $rc -ne 0 ]; then - file -s ${virtio_diskdev} | grep ": Unix Fast File sys" > /dev/null + file -s ${first_diskdev} | grep ": Unix Fast File sys" > /dev/null rc=$? fi if [ $rc -ne 0 ]; then @@ -210,14 +210,22 @@ while [ 1 ]; do echo "is not readable" exit 1 fi - BOOTDISK=${isofile} - installer_opt="-s 31:0,ahci-cd,${BOOTDISK}" + BOOTDISKS="-d ${isofile}" + installer_opt="-s 31:0,ahci-cd,${isofile}" else - BOOTDISK=${virtio_diskdev} + BOOTDISKS="" + i=0 + while [ $i -lt $disk_total ] ; do + eval "disk=\$disk_dev${i}" + if [ -r ${disk} ] ; then + BOOTDISKS="$BOOTDISKS -d ${disk} " + fi + i=$(($i + 1)) + done installer_opt="" fi - ${LOADER} -c ${console} -m ${memsize} -d ${BOOTDISK} ${loader_opt} \ + ${LOADER} -c ${console} -m ${memsize} ${BOOTDISKS} ${loader_opt} \ ${vmname} bhyve_exit=$? if [ $bhyve_exit -ne 0 ]; then From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 15:32:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5878A496; Fri, 5 Jun 2015 15:32:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 468C21D6C; Fri, 5 Jun 2015 15:32:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55FW5lv071703; Fri, 5 Jun 2015 15:32:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55FW5Cl071702; Fri, 5 Jun 2015 15:32:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201506051532.t55FW5Cl071702@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 5 Jun 2015 15:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284025 - 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: Fri, 05 Jun 2015 15:32:05 -0000 Author: avg Date: Fri Jun 5 15:32:04 2015 New Revision: 284025 URL: https://svnweb.freebsd.org/changeset/base/284025 Log: dnode_read: handle hole blocks in zfs boot code A hole block pointer can be encountered at any level and the hole can cover multiple data blocks, but we are reading the data blocks one by one, so we care only about the current one. PR: 199804 Reported by: Toomas Soome Submitted by: Toomas Soome (earlier version) Tested by: Toomas Soome MFC after: 11 days Modified: head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Fri Jun 5 15:16:26 2015 (r284024) +++ head/sys/boot/zfs/zfsimpl.c Fri Jun 5 15:32:04 2015 (r284025) @@ -1255,6 +1255,10 @@ dnode_read(const spa_t *spa, const dnode ibn = bn >> ((nlevels - i - 1) * ibshift); ibn &= ((1 << ibshift) - 1); bp = indbp[ibn]; + if (BP_IS_HOLE(bp)) { + memset(dnode_cache_buf, 0, bsize); + break; + } rc = zio_read(spa, &bp, dnode_cache_buf); if (rc) return (rc); From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 16:21:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6075BCDD; Fri, 5 Jun 2015 16:21:44 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4DA9D19F1; Fri, 5 Jun 2015 16:21:44 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55GLixe095006; Fri, 5 Jun 2015 16:21:44 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55GLiKp095005; Fri, 5 Jun 2015 16:21:44 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201506051621.t55GLiKp095005@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 5 Jun 2015 16:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284029 - 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: Fri, 05 Jun 2015 16:21:44 -0000 Author: sbruno Date: Fri Jun 5 16:21:43 2015 New Revision: 284029 URL: https://svnweb.freebsd.org/changeset/base/284029 Log: This change uses a reader count instead of holding the mutex for the interpreter list to avoid the problem of holding a non-sleep lock during a page fault as reported by witness. In addition, it consistently uses memset()/memcpy() instead of bzero()/bcopy() except in the case where bcopy() is required (i.e. overlapping copy). Differential Revision: https://reviews.freebsd.org/D2123 Submitted by: sson MFC after: 2 weeks Relnotes: Yes Modified: head/sys/kern/imgact_binmisc.c Modified: head/sys/kern/imgact_binmisc.c ============================================================================== --- head/sys/kern/imgact_binmisc.c Fri Jun 5 16:02:24 2015 (r284028) +++ head/sys/kern/imgact_binmisc.c Fri Jun 5 16:21:43 2015 (r284029) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013, Stacey D. Son + * Copyright (c) 2013-15, Stacey D. Son * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include /** * Miscellaneous binary interpreter image activator. @@ -95,11 +98,68 @@ static SLIST_HEAD(, imgact_binmisc_entry SLIST_HEAD_INITIALIZER(interpreter_list); static int interp_list_entry_count = 0; - +static int interp_list_rcount = 0; static struct mtx interp_list_mtx; int imgact_binmisc_exec(struct image_params *imgp); +static inline void +interp_list_rlock() +{ + + /* Don't use atomic_add() here. We must block if the mutex is held. */ + mtx_lock(&interp_list_mtx); + interp_list_rcount++; + mtx_unlock(&interp_list_mtx); +} + +static inline void +interp_list_runlock() +{ + + /* Decrement the reader count and wake up one writer, if any. */ + atomic_subtract_int(&interp_list_rcount, 1); + if (interp_list_rcount == 0) + wakeup_one(&interp_list_rcount); +} + +static inline void +interp_list_wlock() +{ + + /* Wait until there are no readers. */ + mtx_lock(&interp_list_mtx); + while (interp_list_rcount) + mtx_sleep(&interp_list_rcount, &interp_list_mtx, 0, "IABM", 0); +} + +static inline void +interp_list_wunlock() +{ + + mtx_unlock(&interp_list_mtx); +} + +#define interp_list_assert_rlocked() \ + KASSERT(interp_list_rcount > 0, ("%s: interp_list lock not held " \ + "for read", __func__)) + +#define interp_list_assert_wlocked() mtx_assert(&interp_list_mtx, MA_OWNED) + +#ifdef INVARIANTS +#define interp_list_assert_locked() do { \ + if (interp_list_rcount == 0) \ + mtx_assert(&interp_list_mtx, MA_OWNED); \ + else \ + KASSERT(interp_list_rcount > 0, \ + ("%s: interp_list lock not held", __func__)); \ +} while(0) + +#else /* ! INVARIANTS */ + +#define interp_list_assert_locked() do { \ +} while(0) +#endif /* ! INVARIANTS */ /* * Populate the entry with the information about the interpreter. @@ -111,7 +171,7 @@ imgact_binmisc_populate_interp(char *str char t[IBE_INTERP_LEN_MAX]; char *sp, *tp; - bzero(t, sizeof(t)); + memset(t, 0, sizeof(t)); /* * Normalize interpreter string. Replace white space between args with @@ -152,8 +212,6 @@ imgact_binmisc_new_entry(ximgact_binmisc imgact_binmisc_entry_t *ibe = NULL; size_t namesz = min(strlen(xbe->xbe_name) + 1, IBE_NAME_MAX); - mtx_assert(&interp_list_mtx, MA_NOTOWNED); - ibe = malloc(sizeof(*ibe), M_BINMISC, M_WAITOK|M_ZERO); ibe->ibe_name = malloc(namesz, M_BINMISC, M_WAITOK|M_ZERO); @@ -203,7 +261,7 @@ imgact_binmisc_find_entry(char *name) { imgact_binmisc_entry_t *ibe; - mtx_assert(&interp_list_mtx, MA_OWNED); + interp_list_assert_locked(); SLIST_FOREACH(ibe, &interpreter_list, link) { if (strncmp(name, ibe->ibe_name, IBE_NAME_MAX) == 0) @@ -260,21 +318,21 @@ imgact_binmisc_add_entry(ximgact_binmisc } } - mtx_lock(&interp_list_mtx); - if (imgact_binmisc_find_entry(xbe->xbe_name) != NULL) { - mtx_unlock(&interp_list_mtx); - return (EEXIST); - } - mtx_unlock(&interp_list_mtx); - + /* Preallocate a new entry. */ ibe = imgact_binmisc_new_entry(xbe); if (!ibe) return (ENOMEM); - mtx_lock(&interp_list_mtx); + interp_list_wlock(); + if (imgact_binmisc_find_entry(xbe->xbe_name) != NULL) { + interp_list_wunlock(); + imgact_binmisc_destroy_entry(ibe); + return (EEXIST); + } + SLIST_INSERT_HEAD(&interpreter_list, ibe, link); interp_list_entry_count++; - mtx_unlock(&interp_list_mtx); + interp_list_wunlock(); return (0); } @@ -288,14 +346,14 @@ imgact_binmisc_remove_entry(char *name) { imgact_binmisc_entry_t *ibe; - mtx_lock(&interp_list_mtx); + interp_list_wlock(); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - mtx_unlock(&interp_list_mtx); + interp_list_wunlock(); return (ENOENT); } SLIST_REMOVE(&interpreter_list, ibe, imgact_binmisc_entry, link); interp_list_entry_count--; - mtx_unlock(&interp_list_mtx); + interp_list_wunlock(); imgact_binmisc_destroy_entry(ibe); @@ -311,14 +369,14 @@ imgact_binmisc_disable_entry(char *name) { imgact_binmisc_entry_t *ibe; - mtx_lock(&interp_list_mtx); + interp_list_rlock(); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - mtx_unlock(&interp_list_mtx); + interp_list_runlock(); return (ENOENT); } - ibe->ibe_flags &= ~IBF_ENABLED; - mtx_unlock(&interp_list_mtx); + atomic_clear_32(&ibe->ibe_flags, IBF_ENABLED); + interp_list_runlock(); return (0); } @@ -332,14 +390,14 @@ imgact_binmisc_enable_entry(char *name) { imgact_binmisc_entry_t *ibe; - mtx_lock(&interp_list_mtx); + interp_list_rlock(); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - mtx_unlock(&interp_list_mtx); + interp_list_runlock(); return (ENOENT); } - ibe->ibe_flags |= IBF_ENABLED; - mtx_unlock(&interp_list_mtx); + atomic_set_32(&ibe->ibe_flags, IBF_ENABLED); + interp_list_runlock(); return (0); } @@ -350,9 +408,9 @@ imgact_binmisc_populate_xbe(ximgact_binm { uint32_t i; - mtx_assert(&interp_list_mtx, MA_OWNED); + interp_list_assert_rlocked(); - bzero(xbe, sizeof(*xbe)); + memset(xbe, 0, sizeof(*xbe)); strlcpy(xbe->xbe_name, ibe->ibe_name, IBE_NAME_MAX); /* Copy interpreter string. Replace NULL breaks with space. */ @@ -382,14 +440,14 @@ imgact_binmisc_lookup_entry(char *name, imgact_binmisc_entry_t *ibe; int error = 0; - mtx_lock(&interp_list_mtx); + interp_list_rlock(); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - mtx_unlock(&interp_list_mtx); + interp_list_runlock(); return (ENOENT); } error = imgact_binmisc_populate_xbe(xbe, ibe); - mtx_unlock(&interp_list_mtx); + interp_list_runlock(); return (error); } @@ -404,12 +462,12 @@ imgact_binmisc_get_all_entries(struct sy imgact_binmisc_entry_t *ibe; int error = 0, count; - mtx_lock(&interp_list_mtx); + interp_list_rlock(); count = interp_list_entry_count; /* Don't block in malloc() while holding lock. */ xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_NOWAIT|M_ZERO); if (!xbe) { - mtx_unlock(&interp_list_mtx); + interp_list_runlock(); return (ENOMEM); } @@ -419,7 +477,7 @@ imgact_binmisc_get_all_entries(struct sy if (error) break; } - mtx_unlock(&interp_list_mtx); + interp_list_runlock(); if (!error) error = SYSCTL_OUT(req, xbe, sizeof(*xbe) * count); @@ -556,7 +614,7 @@ imgact_binmisc_find_interpreter(const ch int i; size_t sz; - mtx_assert(&interp_list_mtx, MA_OWNED); + interp_list_assert_rlocked(); SLIST_FOREACH(ibe, &interpreter_list, link) { if (!(IBF_ENABLED & ibe->ibe_flags)) @@ -593,15 +651,15 @@ imgact_binmisc_exec(struct image_params char *s, *d; /* Do we have an interpreter for the given image header? */ - mtx_lock(&interp_list_mtx); + interp_list_rlock(); if ((ibe = imgact_binmisc_find_interpreter(image_header)) == NULL) { - mtx_unlock(&interp_list_mtx); + interp_list_runlock(); return (-1); } /* No interpreter nesting allowed. */ if (imgp->interpreted & IMGACT_BINMISC) { - mtx_unlock(&interp_list_mtx); + interp_list_runlock(); return (ENOEXEC); } @@ -649,7 +707,7 @@ imgact_binmisc_exec(struct image_params default: /* Hmm... This shouldn't happen. */ - mtx_unlock(&interp_list_mtx); + interp_list_runlock(); printf("%s: Unknown macro #%c sequence in " "interpreter string\n", KMOD_NAME, *(s + 1)); error = EINVAL; @@ -660,12 +718,15 @@ imgact_binmisc_exec(struct image_params /* Check to make sure we won't overrun the stringspace. */ if (offset > imgp->args->stringspace) { - mtx_unlock(&interp_list_mtx); + interp_list_runlock(); error = E2BIG; goto done; } - /* Make room for the interpreter */ + /* + * Make room for the interpreter. Doing an overlapping copy so + * bcopy() must be used. + */ bcopy(imgp->args->begin_argv, imgp->args->begin_argv + offset, imgp->args->endp - imgp->args->begin_argv); @@ -720,7 +781,7 @@ imgact_binmisc_exec(struct image_params s++; } *d = '\0'; - mtx_unlock(&interp_list_mtx); + interp_list_runlock(); if (!error) imgp->interpreter_name = imgp->args->begin_argv; @@ -745,13 +806,13 @@ imgact_binmisc_fini(void *arg) imgact_binmisc_entry_t *ibe, *ibe_tmp; /* Free all the interpreters. */ - mtx_lock(&interp_list_mtx); + interp_list_wlock(); SLIST_FOREACH_SAFE(ibe, &interpreter_list, link, ibe_tmp) { SLIST_REMOVE(&interpreter_list, ibe, imgact_binmisc_entry, link); imgact_binmisc_destroy_entry(ibe); } - mtx_unlock(&interp_list_mtx); + interp_list_wunlock(); mtx_destroy(&interp_list_mtx); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 16:54:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70BAEFB8; Fri, 5 Jun 2015 16:54:23 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c: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 193B11294; Fri, 5 Jun 2015 16:54:23 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by wibut5 with SMTP id ut5so27105851wib.1; Fri, 05 Jun 2015 09:54:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=yyvSAky6sWyXI8u2rDljowf8b2qZyHGen9vwIIX1AF0=; b=T8hfcbRISy3Ict3rxnKFVXAeLlHrymrIcFCy76Ry1lJjU06oBWLNbIp2PnCXcNneAC GKuhoEC3tca1X84Hky0FpEIukq/FrAXQt2IIiy7Ec/EnU+qZdk6NJ3Ln078g2LcNXntD exrh58oWhB4rXt++leoLssiRGBU9PjA/QOKhhicr+nCKcWbja/H6gjWeNoqgV7gTOymf PsHBpLaWUSYIIGFPvg27JypmTEbAaN2w0/YLp8oYa5bZpz5ihyDKxxCkGVv/9F6UZt63 KsQf0y1+VTbyMXMIMusutDa89UOCdBQifKaR1xkhIf0IvJYF9GxV83UZO6LoMkxW2o6o +pCQ== X-Received: by 10.180.105.227 with SMTP id gp3mr19956587wib.56.1433523261452; Fri, 05 Jun 2015 09:54:21 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id r6sm4226612wiy.13.2015.06.05.09.54.19 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 05 Jun 2015 09:54:20 -0700 (PDT) Date: Fri, 5 Jun 2015 18:54:18 +0200 From: Mateusz Guzik To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284029 - head/sys/kern Message-ID: <20150605165417.GA13205@dft-labs.eu> References: <201506051621.t55GLiKp095005@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201506051621.t55GLiKp095005@svn.freebsd.org> 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: Fri, 05 Jun 2015 16:54:23 -0000 On Fri, Jun 05, 2015 at 04:21:44PM +0000, Sean Bruno wrote: > Author: sbruno > Date: Fri Jun 5 16:21:43 2015 > New Revision: 284029 > URL: https://svnweb.freebsd.org/changeset/base/284029 > > Log: > This change uses a reader count instead of holding the mutex for the > interpreter list to avoid the problem of holding a non-sleep lock during > a page fault as reported by witness. In addition, it consistently uses > memset()/memcpy() instead of bzero()/bcopy() except in the case where > bcopy() is required (i.e. overlapping copy). What lock was that? If it has to be held, why not use an sx lock? The change looks quite buggy. > > Differential Revision: https://reviews.freebsd.org/D2123 > Submitted by: sson > MFC after: 2 weeks > Relnotes: Yes > > Modified: > head/sys/kern/imgact_binmisc.c > > Modified: head/sys/kern/imgact_binmisc.c > ============================================================================== > --- head/sys/kern/imgact_binmisc.c Fri Jun 5 16:02:24 2015 (r284028) > +++ head/sys/kern/imgact_binmisc.c Fri Jun 5 16:21:43 2015 (r284029) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2013, Stacey D. Son > + * Copyright (c) 2013-15, Stacey D. Son > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > + > +#include > > /** > * Miscellaneous binary interpreter image activator. > @@ -95,11 +98,68 @@ static SLIST_HEAD(, imgact_binmisc_entry > SLIST_HEAD_INITIALIZER(interpreter_list); > > static int interp_list_entry_count = 0; > - > +static int interp_list_rcount = 0; > static struct mtx interp_list_mtx; > > int imgact_binmisc_exec(struct image_params *imgp); > > +static inline void > +interp_list_rlock() > +{ > + > + /* Don't use atomic_add() here. We must block if the mutex is held. */ > + mtx_lock(&interp_list_mtx); > + interp_list_rcount++; > + mtx_unlock(&interp_list_mtx); > +} > + > +static inline void > +interp_list_runlock() > +{ > + > + /* Decrement the reader count and wake up one writer, if any. */ > + atomic_subtract_int(&interp_list_rcount, 1); > + if (interp_list_rcount == 0) > + wakeup_one(&interp_list_rcount); > +} > + interp_list_rcount manipulation between these 2 is not safe. This effectively is: A B interp_list_rcount++ atomic_subtract_int(&interp_list_rcount, 1); As such updates can be lost. There is also potential for bonus wakeup. > +static inline void > +interp_list_wlock() > +{ > + > + /* Wait until there are no readers. */ > + mtx_lock(&interp_list_mtx); > + while (interp_list_rcount) > + mtx_sleep(&interp_list_rcount, &interp_list_mtx, 0, "IABM", 0); > +} > + Given that runlock does not take the lock, this func can sleep after wakeup_one() thus blocking the thread with nobody to wake it up. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 17:02:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2113A48E; Fri, 5 Jun 2015 17:02:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0E94915AD; Fri, 5 Jun 2015 17:02:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55H2LFe018518; Fri, 5 Jun 2015 17:02:21 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55H2LFZ018517; Fri, 5 Jun 2015 17:02:21 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201506051702.t55H2LFZ018517@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 5 Jun 2015 17:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284032 - 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: Fri, 05 Jun 2015 17:02:22 -0000 Author: avg Date: Fri Jun 5 17:02:21 2015 New Revision: 284032 URL: https://svnweb.freebsd.org/changeset/base/284032 Log: dnode_read: fixup r284025, BP_IS_HOLE macro expects a pointer PR: 199804 Reported by: sbruno Pointyhat to: avg MFC after: 10 days X-MFC with: r284025 Modified: head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Fri Jun 5 16:52:23 2015 (r284031) +++ head/sys/boot/zfs/zfsimpl.c Fri Jun 5 17:02:21 2015 (r284032) @@ -1255,7 +1255,7 @@ dnode_read(const spa_t *spa, const dnode ibn = bn >> ((nlevels - i - 1) * ibshift); ibn &= ((1 << ibshift) - 1); bp = indbp[ibn]; - if (BP_IS_HOLE(bp)) { + if (BP_IS_HOLE(&bp)) { memset(dnode_cache_buf, 0, bsize); break; } From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 17:18:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B1FD5CD; Fri, 5 Jun 2015 17:18:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 28EB8188B; Fri, 5 Jun 2015 17:18:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55HIBo8026497; Fri, 5 Jun 2015 17:18:11 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55HIBc3026496; Fri, 5 Jun 2015 17:18:11 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201506051718.t55HIBc3026496@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 5 Jun 2015 17:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284041 - head/contrib/dtc 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, 05 Jun 2015 17:18:11 -0000 Author: sbruno Date: Fri Jun 5 17:18:10 2015 New Revision: 284041 URL: https://svnweb.freebsd.org/changeset/base/284041 Log: Silence clang warning about extraneous parenthesis Verified that this exists upstream already: https://git.kernel.org/cgit/utils/dtc/dtc.git/tree/checks.c#n628 Differential Revision: https://reviews.freebsd.org/D913 Reviewed by: imp Modified: head/contrib/dtc/checks.c Modified: head/contrib/dtc/checks.c ============================================================================== --- head/contrib/dtc/checks.c Fri Jun 5 17:09:59 2015 (r284040) +++ head/contrib/dtc/checks.c Fri Jun 5 17:18:10 2015 (r284041) @@ -624,11 +624,11 @@ static void check_avoid_default_addr_siz if (!reg && !ranges) return; - if ((node->parent->addr_cells == -1)) + if (node->parent->addr_cells == -1) FAIL(c, "Relying on default #address-cells value for %s", node->fullpath); - if ((node->parent->size_cells == -1)) + if (node->parent->size_cells == -1) FAIL(c, "Relying on default #size-cells value for %s", node->fullpath); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 17:45:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 519C4548; Fri, 5 Jun 2015 17:45:30 +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 2B5591FED; Fri, 5 Jun 2015 17:45:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 755A7B915; Fri, 5 Jun 2015 13:45:28 -0400 (EDT) From: John Baldwin To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284029 - head/sys/kern Date: Fri, 05 Jun 2015 12:55:08 -0400 Message-ID: <3940850.1R9GTC4sC6@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201506051621.t55GLiKp095005@svn.freebsd.org> References: <201506051621.t55GLiKp095005@svn.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); Fri, 05 Jun 2015 13:45:28 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Jun 2015 17:45:30 -0000 On Friday, June 05, 2015 04:21:44 PM Sean Bruno wrote: > Author: sbruno > Date: Fri Jun 5 16:21:43 2015 > New Revision: 284029 > URL: https://svnweb.freebsd.org/changeset/base/284029 > > Log: > This change uses a reader count instead of holding the mutex for the > interpreter list to avoid the problem of holding a non-sleep lock during > a page fault as reported by witness. In addition, it consistently uses > memset()/memcpy() instead of bzero()/bcopy() except in the case where > bcopy() is required (i.e. overlapping copy). > > Differential Revision: https://reviews.freebsd.org/D2123 > Submitted by: sson > MFC after: 2 weeks > Relnotes: Yes > > Modified: > head/sys/kern/imgact_binmisc.c > > Modified: head/sys/kern/imgact_binmisc.c > ============================================================================== > --- head/sys/kern/imgact_binmisc.c Fri Jun 5 16:02:24 2015 (r284028) > +++ head/sys/kern/imgact_binmisc.c Fri Jun 5 16:21:43 2015 (r284029) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2013, Stacey D. Son > + * Copyright (c) 2013-15, Stacey D. Son > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > + > +#include > > /** > * Miscellaneous binary interpreter image activator. > @@ -95,11 +98,68 @@ static SLIST_HEAD(, imgact_binmisc_entry > SLIST_HEAD_INITIALIZER(interpreter_list); > > static int interp_list_entry_count = 0; > - > +static int interp_list_rcount = 0; This should probably be volatile? > static struct mtx interp_list_mtx; > > int imgact_binmisc_exec(struct image_params *imgp); > > +static inline void > +interp_list_rlock() > +{ > + > + /* Don't use atomic_add() here. We must block if the mutex is held. */ > + mtx_lock(&interp_list_mtx); > + interp_list_rcount++; > + mtx_unlock(&interp_list_mtx); It's not really safe to not use an atomic here but use one in runlock. What happens if the compiler uses separate load - add - store here and another thread does the atomic subtract after the load but before the store? > +} > + > +static inline void > +interp_list_runlock() > +{ > + > + /* Decrement the reader count and wake up one writer, if any. */ > + atomic_subtract_int(&interp_list_rcount, 1); > + if (interp_list_rcount == 0) > + wakeup_one(&interp_list_rcount); Reading the variable after subtract is also racey. You can use atomic_fetchadd() instead (which is what refcount_release does). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 18:16:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3ECECB74; Fri, 5 Jun 2015 18:16:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2D3C31770; Fri, 5 Jun 2015 18:16:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55IGBfs056915; Fri, 5 Jun 2015 18:16:11 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55IGBRZ056914; Fri, 5 Jun 2015 18:16:11 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201506051816.t55IGBRZ056914@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 5 Jun 2015 18:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284043 - 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: Fri, 05 Jun 2015 18:16:11 -0000 Author: sbruno Date: Fri Jun 5 18:16:10 2015 New Revision: 284043 URL: https://svnweb.freebsd.org/changeset/base/284043 Log: Revert 284029, update imgact_binmisctl.c change mtx to reader count, at the request of the submitter. Will attempt to use an sx_lock for this fix to WITNESS crashes in a later revision. Submitted by: sson Modified: head/sys/kern/imgact_binmisc.c Modified: head/sys/kern/imgact_binmisc.c ============================================================================== --- head/sys/kern/imgact_binmisc.c Fri Jun 5 17:26:07 2015 (r284042) +++ head/sys/kern/imgact_binmisc.c Fri Jun 5 18:16:10 2015 (r284043) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-15, Stacey D. Son + * Copyright (c) 2013, Stacey D. Son * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include - -#include /** * Miscellaneous binary interpreter image activator. @@ -98,68 +95,11 @@ static SLIST_HEAD(, imgact_binmisc_entry SLIST_HEAD_INITIALIZER(interpreter_list); static int interp_list_entry_count = 0; -static int interp_list_rcount = 0; + static struct mtx interp_list_mtx; int imgact_binmisc_exec(struct image_params *imgp); -static inline void -interp_list_rlock() -{ - - /* Don't use atomic_add() here. We must block if the mutex is held. */ - mtx_lock(&interp_list_mtx); - interp_list_rcount++; - mtx_unlock(&interp_list_mtx); -} - -static inline void -interp_list_runlock() -{ - - /* Decrement the reader count and wake up one writer, if any. */ - atomic_subtract_int(&interp_list_rcount, 1); - if (interp_list_rcount == 0) - wakeup_one(&interp_list_rcount); -} - -static inline void -interp_list_wlock() -{ - - /* Wait until there are no readers. */ - mtx_lock(&interp_list_mtx); - while (interp_list_rcount) - mtx_sleep(&interp_list_rcount, &interp_list_mtx, 0, "IABM", 0); -} - -static inline void -interp_list_wunlock() -{ - - mtx_unlock(&interp_list_mtx); -} - -#define interp_list_assert_rlocked() \ - KASSERT(interp_list_rcount > 0, ("%s: interp_list lock not held " \ - "for read", __func__)) - -#define interp_list_assert_wlocked() mtx_assert(&interp_list_mtx, MA_OWNED) - -#ifdef INVARIANTS -#define interp_list_assert_locked() do { \ - if (interp_list_rcount == 0) \ - mtx_assert(&interp_list_mtx, MA_OWNED); \ - else \ - KASSERT(interp_list_rcount > 0, \ - ("%s: interp_list lock not held", __func__)); \ -} while(0) - -#else /* ! INVARIANTS */ - -#define interp_list_assert_locked() do { \ -} while(0) -#endif /* ! INVARIANTS */ /* * Populate the entry with the information about the interpreter. @@ -171,7 +111,7 @@ imgact_binmisc_populate_interp(char *str char t[IBE_INTERP_LEN_MAX]; char *sp, *tp; - memset(t, 0, sizeof(t)); + bzero(t, sizeof(t)); /* * Normalize interpreter string. Replace white space between args with @@ -212,6 +152,8 @@ imgact_binmisc_new_entry(ximgact_binmisc imgact_binmisc_entry_t *ibe = NULL; size_t namesz = min(strlen(xbe->xbe_name) + 1, IBE_NAME_MAX); + mtx_assert(&interp_list_mtx, MA_NOTOWNED); + ibe = malloc(sizeof(*ibe), M_BINMISC, M_WAITOK|M_ZERO); ibe->ibe_name = malloc(namesz, M_BINMISC, M_WAITOK|M_ZERO); @@ -261,7 +203,7 @@ imgact_binmisc_find_entry(char *name) { imgact_binmisc_entry_t *ibe; - interp_list_assert_locked(); + mtx_assert(&interp_list_mtx, MA_OWNED); SLIST_FOREACH(ibe, &interpreter_list, link) { if (strncmp(name, ibe->ibe_name, IBE_NAME_MAX) == 0) @@ -318,21 +260,21 @@ imgact_binmisc_add_entry(ximgact_binmisc } } - /* Preallocate a new entry. */ - ibe = imgact_binmisc_new_entry(xbe); - if (!ibe) - return (ENOMEM); - - interp_list_wlock(); + mtx_lock(&interp_list_mtx); if (imgact_binmisc_find_entry(xbe->xbe_name) != NULL) { - interp_list_wunlock(); - imgact_binmisc_destroy_entry(ibe); + mtx_unlock(&interp_list_mtx); return (EEXIST); } + mtx_unlock(&interp_list_mtx); + + ibe = imgact_binmisc_new_entry(xbe); + if (!ibe) + return (ENOMEM); + mtx_lock(&interp_list_mtx); SLIST_INSERT_HEAD(&interpreter_list, ibe, link); interp_list_entry_count++; - interp_list_wunlock(); + mtx_unlock(&interp_list_mtx); return (0); } @@ -346,14 +288,14 @@ imgact_binmisc_remove_entry(char *name) { imgact_binmisc_entry_t *ibe; - interp_list_wlock(); + mtx_lock(&interp_list_mtx); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - interp_list_wunlock(); + mtx_unlock(&interp_list_mtx); return (ENOENT); } SLIST_REMOVE(&interpreter_list, ibe, imgact_binmisc_entry, link); interp_list_entry_count--; - interp_list_wunlock(); + mtx_unlock(&interp_list_mtx); imgact_binmisc_destroy_entry(ibe); @@ -369,14 +311,14 @@ imgact_binmisc_disable_entry(char *name) { imgact_binmisc_entry_t *ibe; - interp_list_rlock(); + mtx_lock(&interp_list_mtx); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - interp_list_runlock(); + mtx_unlock(&interp_list_mtx); return (ENOENT); } - atomic_clear_32(&ibe->ibe_flags, IBF_ENABLED); - interp_list_runlock(); + ibe->ibe_flags &= ~IBF_ENABLED; + mtx_unlock(&interp_list_mtx); return (0); } @@ -390,14 +332,14 @@ imgact_binmisc_enable_entry(char *name) { imgact_binmisc_entry_t *ibe; - interp_list_rlock(); + mtx_lock(&interp_list_mtx); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - interp_list_runlock(); + mtx_unlock(&interp_list_mtx); return (ENOENT); } - atomic_set_32(&ibe->ibe_flags, IBF_ENABLED); - interp_list_runlock(); + ibe->ibe_flags |= IBF_ENABLED; + mtx_unlock(&interp_list_mtx); return (0); } @@ -408,9 +350,9 @@ imgact_binmisc_populate_xbe(ximgact_binm { uint32_t i; - interp_list_assert_rlocked(); + mtx_assert(&interp_list_mtx, MA_OWNED); - memset(xbe, 0, sizeof(*xbe)); + bzero(xbe, sizeof(*xbe)); strlcpy(xbe->xbe_name, ibe->ibe_name, IBE_NAME_MAX); /* Copy interpreter string. Replace NULL breaks with space. */ @@ -440,14 +382,14 @@ imgact_binmisc_lookup_entry(char *name, imgact_binmisc_entry_t *ibe; int error = 0; - interp_list_rlock(); + mtx_lock(&interp_list_mtx); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - interp_list_runlock(); + mtx_unlock(&interp_list_mtx); return (ENOENT); } error = imgact_binmisc_populate_xbe(xbe, ibe); - interp_list_runlock(); + mtx_unlock(&interp_list_mtx); return (error); } @@ -462,12 +404,12 @@ imgact_binmisc_get_all_entries(struct sy imgact_binmisc_entry_t *ibe; int error = 0, count; - interp_list_rlock(); + mtx_lock(&interp_list_mtx); count = interp_list_entry_count; /* Don't block in malloc() while holding lock. */ xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_NOWAIT|M_ZERO); if (!xbe) { - interp_list_runlock(); + mtx_unlock(&interp_list_mtx); return (ENOMEM); } @@ -477,7 +419,7 @@ imgact_binmisc_get_all_entries(struct sy if (error) break; } - interp_list_runlock(); + mtx_unlock(&interp_list_mtx); if (!error) error = SYSCTL_OUT(req, xbe, sizeof(*xbe) * count); @@ -614,7 +556,7 @@ imgact_binmisc_find_interpreter(const ch int i; size_t sz; - interp_list_assert_rlocked(); + mtx_assert(&interp_list_mtx, MA_OWNED); SLIST_FOREACH(ibe, &interpreter_list, link) { if (!(IBF_ENABLED & ibe->ibe_flags)) @@ -651,15 +593,15 @@ imgact_binmisc_exec(struct image_params char *s, *d; /* Do we have an interpreter for the given image header? */ - interp_list_rlock(); + mtx_lock(&interp_list_mtx); if ((ibe = imgact_binmisc_find_interpreter(image_header)) == NULL) { - interp_list_runlock(); + mtx_unlock(&interp_list_mtx); return (-1); } /* No interpreter nesting allowed. */ if (imgp->interpreted & IMGACT_BINMISC) { - interp_list_runlock(); + mtx_unlock(&interp_list_mtx); return (ENOEXEC); } @@ -707,7 +649,7 @@ imgact_binmisc_exec(struct image_params default: /* Hmm... This shouldn't happen. */ - interp_list_runlock(); + mtx_unlock(&interp_list_mtx); printf("%s: Unknown macro #%c sequence in " "interpreter string\n", KMOD_NAME, *(s + 1)); error = EINVAL; @@ -718,15 +660,12 @@ imgact_binmisc_exec(struct image_params /* Check to make sure we won't overrun the stringspace. */ if (offset > imgp->args->stringspace) { - interp_list_runlock(); + mtx_unlock(&interp_list_mtx); error = E2BIG; goto done; } - /* - * Make room for the interpreter. Doing an overlapping copy so - * bcopy() must be used. - */ + /* Make room for the interpreter */ bcopy(imgp->args->begin_argv, imgp->args->begin_argv + offset, imgp->args->endp - imgp->args->begin_argv); @@ -781,7 +720,7 @@ imgact_binmisc_exec(struct image_params s++; } *d = '\0'; - interp_list_runlock(); + mtx_unlock(&interp_list_mtx); if (!error) imgp->interpreter_name = imgp->args->begin_argv; @@ -806,13 +745,13 @@ imgact_binmisc_fini(void *arg) imgact_binmisc_entry_t *ibe, *ibe_tmp; /* Free all the interpreters. */ - interp_list_wlock(); + mtx_lock(&interp_list_mtx); SLIST_FOREACH_SAFE(ibe, &interpreter_list, link, ibe_tmp) { SLIST_REMOVE(&interpreter_list, ibe, imgact_binmisc_entry, link); imgact_binmisc_destroy_entry(ibe); } - interp_list_wunlock(); + mtx_unlock(&interp_list_mtx); mtx_destroy(&interp_list_mtx); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 20:30:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B97C41C; Fri, 5 Jun 2015 20:30:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6A82D177E; Fri, 5 Jun 2015 20:30:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55KUbPX026674; Fri, 5 Jun 2015 20:30:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55KUbFc026673; Fri, 5 Jun 2015 20:30:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201506052030.t55KUbFc026673@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 5 Jun 2015 20:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284044 - head/sys/cam/ctl 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, 05 Jun 2015 20:30:37 -0000 Author: mav Date: Fri Jun 5 20:30:36 2015 New Revision: 284044 URL: https://svnweb.freebsd.org/changeset/base/284044 Log: Fix wrong function name in error message. MFC after: 3 days Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Jun 5 18:16:10 2015 (r284043) +++ head/sys/cam/ctl/ctl.c Fri Jun 5 20:30:36 2015 (r284044) @@ -5011,9 +5011,9 @@ ctl_disable_lun(struct ctl_be_lun *be_lu lun->lun); mtx_lock(&softc->ctl_lock); if (retval != 0) { - printf("ctl_alloc_lun: FETD %s port %d returned error " + printf("%s: FETD %s port %d returned error " "%d for lun_disable on target %ju lun %jd\n", - port->port_name, port->targ_port, retval, + __func__, port->port_name, port->targ_port, retval, (uintmax_t)lun->target.id, (intmax_t)lun->lun); } } From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 21:22:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C4CC6FC; Fri, 5 Jun 2015 21:22:27 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3B2071530; Fri, 5 Jun 2015 21:22:27 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55LMRfT056331; Fri, 5 Jun 2015 21:22:27 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55LMR7u056330; Fri, 5 Jun 2015 21:22:27 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201506052122.t55LMR7u056330@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Fri, 5 Jun 2015 21:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284046 - head/sys/amd64/vmm 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, 05 Jun 2015 21:22:27 -0000 Author: neel Date: Fri Jun 5 21:22:26 2015 New Revision: 284046 URL: https://svnweb.freebsd.org/changeset/base/284046 Log: The 'verify_gla()' function is used to ensure that the effective address after decoding the instruction matches the one provided by hardware. Prior to r283293 'vie->num_valid' used to contain the actual length of the instruction whereas now it contains the maximum instruction length possible. This introduced a bug when calculating a RIP-relative base address. Fix this by using 'vie->num_processed' rather than 'vie->num_valid' as the length of the emulated instruction. Reported and tested by: tychon MFC after: 1 week Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Fri Jun 5 20:38:22 2015 (r284045) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Fri Jun 5 21:22:26 2015 (r284046) @@ -2342,7 +2342,7 @@ verify_gla(struct vm *vm, int cpuid, uin * instruction */ if (vie->base_register == VM_REG_GUEST_RIP) - base += vie->num_valid; + base += vie->num_processed; } idx = 0; From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 21:35:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F8D19FB; Fri, 5 Jun 2015 21:35:21 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5E2B01787; Fri, 5 Jun 2015 21:35:21 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55LZLM1061701; Fri, 5 Jun 2015 21:35:21 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55LZL8C061700; Fri, 5 Jun 2015 21:35:21 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506052135.t55LZL8C061700@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 5 Jun 2015 21:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284047 - head/usr.bin/vgrind 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, 05 Jun 2015 21:35:21 -0000 Author: bapt Date: Fri Jun 5 21:35:20 2015 New Revision: 284047 URL: https://svnweb.freebsd.org/changeset/base/284047 Log: Fix typos Modified: head/usr.bin/vgrind/regexp.c Modified: head/usr.bin/vgrind/regexp.c ============================================================================== --- head/usr.bin/vgrind/regexp.c Fri Jun 5 21:22:26 2015 (r284046) +++ head/usr.bin/vgrind/regexp.c Fri Jun 5 21:35:20 2015 (r284047) @@ -91,7 +91,7 @@ STRNCMP(register char *s1, register char * internal format. * * Either meta symbols (\a \d or \p) or character strings or - * operations ( alternation or perenthesizing ) can be + * operations ( alternation or parenthesizing ) can be * specified. Each starts with a descriptor byte. The descriptor * byte has STR set for strings, META set for meta symbols * and OPER set for operations. @@ -110,7 +110,7 @@ STRNCMP(register char *s1, register char * character count * the string * - * operatins := descriptor + * operations := descriptor * symbol * character count */ From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 21:45:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70F78C48; Fri, 5 Jun 2015 21:45:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5F83719C7; Fri, 5 Jun 2015 21:45:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55LjavD066671; Fri, 5 Jun 2015 21:45:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55Lja1F066670; Fri, 5 Jun 2015 21:45:36 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506052145.t55Lja1F066670@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 5 Jun 2015 21:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284048 - head/usr.bin/vgrind 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, 05 Jun 2015 21:45:36 -0000 Author: bapt Date: Fri Jun 5 21:45:35 2015 New Revision: 284048 URL: https://svnweb.freebsd.org/changeset/base/284048 Log: Fix some clang warnings: Add missing headers Add parenthesis when using the result of an assignment as a condition Modified: head/usr.bin/vgrind/vgrindefs.c Modified: head/usr.bin/vgrind/vgrindefs.c ============================================================================== --- head/usr.bin/vgrind/vgrindefs.c Fri Jun 5 21:35:20 2015 (r284047) +++ head/usr.bin/vgrind/vgrindefs.c Fri Jun 5 21:45:35 2015 (r284048) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #define MAXHOP 32 /* max number of tc= indirections */ #include +#include +#include #include /* @@ -308,7 +310,7 @@ tdecode(register char *str, char **area) register int c; cp = *area; - while (c = *str++) { + while ((c = *str++)) { if (c == ':' && *(cp-1) != '\\') break; *cp++ = c; From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 22:52:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0828E806; Fri, 5 Jun 2015 22:52:44 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E4D0C1A36; Fri, 5 Jun 2015 22:52:43 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55MqhPD000864; Fri, 5 Jun 2015 22:52:43 GMT (envelope-from jfv@FreeBSD.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55MqgOT000856; Fri, 5 Jun 2015 22:52:42 GMT (envelope-from jfv@FreeBSD.org) Message-Id: <201506052252.t55MqgOT000856@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jfv set sender to jfv@FreeBSD.org using -f From: Jack F Vogel Date: Fri, 5 Jun 2015 22:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284049 - in head/sys: dev/ixl modules/ixl modules/ixlv 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, 05 Jun 2015 22:52:44 -0000 Author: jfv Date: Fri Jun 5 22:52:42 2015 New Revision: 284049 URL: https://svnweb.freebsd.org/changeset/base/284049 Log: Update SW4 to the Intel ixl/ixlv drivers. This is primarily a shared code update, with supporting changes in the CORE. Changes for the extended media types, VF driver has virtual channel protocol changes, and some register use corrections. This software change should be coordinated with Firmware updates to your hardware, contact your support channels for that. MFC after: 1 week Added: head/sys/dev/ixl/i40e_devids.h (contents, props changed) Modified: head/sys/dev/ixl/i40e_adminq.c head/sys/dev/ixl/i40e_adminq.h head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_hmc.c head/sys/dev/ixl/i40e_hmc.h head/sys/dev/ixl/i40e_lan_hmc.c head/sys/dev/ixl/i40e_nvm.c head/sys/dev/ixl/i40e_osdep.h head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/i40e_register.h head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/i40e_virtchnl.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixlv.h head/sys/dev/ixl/ixlvc.c head/sys/modules/ixl/Makefile head/sys/modules/ixlv/Makefile Modified: head/sys/dev/ixl/i40e_adminq.c ============================================================================== --- head/sys/dev/ixl/i40e_adminq.c Fri Jun 5 21:45:35 2015 (r284048) +++ head/sys/dev/ixl/i40e_adminq.c Fri Jun 5 22:52:42 2015 (r284049) @@ -315,8 +315,12 @@ static enum i40e_status_code i40e_config wr32(hw, hw->aq.asq.tail, 0); /* set starting point */ - wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries | - I40E_PF_ATQLEN_ATQENABLE_MASK)); + if (!i40e_is_vf(hw)) + wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries | + I40E_PF_ATQLEN_ATQENABLE_MASK)); + if (i40e_is_vf(hw)) + wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries | + I40E_VF_ATQLEN1_ATQENABLE_MASK)); wr32(hw, hw->aq.asq.bal, I40E_LO_DWORD(hw->aq.asq.desc_buf.pa)); wr32(hw, hw->aq.asq.bah, I40E_HI_DWORD(hw->aq.asq.desc_buf.pa)); @@ -344,8 +348,12 @@ static enum i40e_status_code i40e_config wr32(hw, hw->aq.arq.tail, 0); /* set starting point */ - wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries | - I40E_PF_ARQLEN_ARQENABLE_MASK)); + if (!i40e_is_vf(hw)) + wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries | + I40E_PF_ARQLEN_ARQENABLE_MASK)); + if (i40e_is_vf(hw)) + wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries | + I40E_VF_ARQLEN1_ARQENABLE_MASK)); wr32(hw, hw->aq.arq.bal, I40E_LO_DWORD(hw->aq.arq.desc_buf.pa)); wr32(hw, hw->aq.arq.bah, I40E_HI_DWORD(hw->aq.arq.desc_buf.pa)); @@ -559,6 +567,7 @@ enum i40e_status_code i40e_init_adminq(s { enum i40e_status_code ret_code; u16 eetrack_lo, eetrack_hi; + u16 cfg_ptr, oem_hi, oem_lo; int retry = 0; /* verify input for valid configuration */ if ((hw->aq.num_arq_entries == 0) || @@ -619,6 +628,12 @@ enum i40e_status_code i40e_init_adminq(s i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_LO, &eetrack_lo); i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_HI, &eetrack_hi); hw->nvm.eetrack = (eetrack_hi << 16) | eetrack_lo; + i40e_read_nvm_word(hw, I40E_SR_BOOT_CONFIG_PTR, &cfg_ptr); + i40e_read_nvm_word(hw, (cfg_ptr + I40E_NVM_OEM_VER_OFF), + &oem_hi); + i40e_read_nvm_word(hw, (cfg_ptr + (I40E_NVM_OEM_VER_OFF + 1)), + &oem_lo); + hw->nvm.oem_ver = ((u32)oem_hi << 16) | oem_lo; if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) { ret_code = I40E_ERR_FIRMWARE_API_VERSION; @@ -669,6 +684,9 @@ enum i40e_status_code i40e_shutdown_admi i40e_destroy_spinlock(&hw->aq.asq_spinlock); i40e_destroy_spinlock(&hw->aq.arq_spinlock); + if (hw->nvm_buff.va) + i40e_free_virt_mem(hw, &hw->nvm_buff); + return ret_code; } @@ -688,16 +706,16 @@ u16 i40e_clean_asq(struct i40e_hw *hw) desc = I40E_ADMINQ_DESC(*asq, ntc); details = I40E_ADMINQ_DETAILS(*asq, ntc); + while (rd32(hw, hw->aq.asq.head) != ntc) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, - "%s: ntc %d head %d.\n", __FUNCTION__, ntc, - rd32(hw, hw->aq.asq.head)); + "ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head)); if (details->callback) { I40E_ADMINQ_CALLBACK cb_func = (I40E_ADMINQ_CALLBACK)details->callback; - i40e_memcpy(&desc_cb, desc, - sizeof(struct i40e_aq_desc), I40E_DMA_TO_DMA); + i40e_memcpy(&desc_cb, desc, sizeof(struct i40e_aq_desc), + I40E_DMA_TO_DMA); cb_func(hw, &desc_cb); } i40e_memset(desc, 0, sizeof(*desc), I40E_DMA_MEM); @@ -755,6 +773,8 @@ enum i40e_status_code i40e_asq_send_comm u16 retval = 0; u32 val = 0; + hw->aq.asq_last_status = I40E_AQ_RC_OK; + val = rd32(hw, hw->aq.asq.head); if (val >= hw->aq.num_asq_entries) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, @@ -912,6 +932,11 @@ enum i40e_status_code i40e_asq_send_comm "AQTX: desc and buffer writeback:\n"); i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff, buff_size); + /* save writeback aq if requested */ + if (details->wb_desc) + i40e_memcpy(details->wb_desc, desc_on_ring, + sizeof(struct i40e_aq_desc), I40E_DMA_TO_NONDMA); + /* update the error if time out occurred */ if ((!cmd_completed) && (!details->async && !details->postpone)) { @@ -971,7 +996,10 @@ enum i40e_status_code i40e_clean_arq_ele i40e_acquire_spinlock(&hw->aq.arq_spinlock); /* set next_to_use to head */ - ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK); + if (!i40e_is_vf(hw)) + ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK); + if (i40e_is_vf(hw)) + ntu = (rd32(hw, hw->aq.arq.head) & I40E_VF_ARQH1_ARQH_MASK); if (ntu == ntc) { /* nothing to do - shouldn't need to update ring's values */ ret_code = I40E_ERR_ADMIN_QUEUE_NO_WORK; @@ -1040,6 +1068,19 @@ clean_arq_element_out: i40e_release_nvm(hw); hw->aq.nvm_release_on_done = FALSE; } + + switch (hw->nvmupd_state) { + case I40E_NVMUPD_STATE_INIT_WAIT: + hw->nvmupd_state = I40E_NVMUPD_STATE_INIT; + break; + + case I40E_NVMUPD_STATE_WRITE_WAIT: + hw->nvmupd_state = I40E_NVMUPD_STATE_WRITING; + break; + + default: + break; + } } return ret_code; @@ -1051,9 +1092,6 @@ void i40e_resume_aq(struct i40e_hw *hw) hw->aq.asq.next_to_use = 0; hw->aq.asq.next_to_clean = 0; -#if (I40E_VF_ATQLEN_ATQENABLE_MASK != I40E_PF_ATQLEN_ATQENABLE_MASK) -#error I40E_VF_ATQLEN_ATQENABLE_MASK != I40E_PF_ATQLEN_ATQENABLE_MASK -#endif i40e_config_asq_regs(hw); hw->aq.arq.next_to_use = 0; Modified: head/sys/dev/ixl/i40e_adminq.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq.h Fri Jun 5 21:45:35 2015 (r284048) +++ head/sys/dev/ixl/i40e_adminq.h Fri Jun 5 22:52:42 2015 (r284049) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -77,6 +77,7 @@ struct i40e_asq_cmd_details { u16 flags_dis; bool async; bool postpone; + struct i40e_aq_desc *wb_desc; }; #define I40E_ADMINQ_DETAILS(R, i) \ Modified: head/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq_cmd.h Fri Jun 5 21:45:35 2015 (r284048) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Fri Jun 5 22:52:42 2015 (r284049) @@ -42,7 +42,11 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR 0x0002 +#ifdef X722_SUPPORT +#define I40E_FW_API_VERSION_MINOR 0x0003 +#else +#define I40E_FW_API_VERSION_MINOR 0x0004 +#endif struct i40e_aq_desc { __le16 flags; @@ -140,12 +144,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_list_func_capabilities = 0x000A, i40e_aqc_opc_list_dev_capabilities = 0x000B, - i40e_aqc_opc_set_cppm_configuration = 0x0103, - i40e_aqc_opc_set_arp_proxy_entry = 0x0104, - i40e_aqc_opc_set_ns_proxy_entry = 0x0105, - /* LAA */ - i40e_aqc_opc_mng_laa = 0x0106, /* AQ obsolete */ i40e_aqc_opc_mac_address_read = 0x0107, i40e_aqc_opc_mac_address_write = 0x0108, @@ -240,6 +239,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_nvm_update = 0x0703, i40e_aqc_opc_nvm_config_read = 0x0704, i40e_aqc_opc_nvm_config_write = 0x0705, + i40e_aqc_opc_oem_post_update = 0x0720, /* virtualization commands */ i40e_aqc_opc_send_msg_to_pf = 0x0801, @@ -270,7 +270,12 @@ enum i40e_admin_queue_opc { /* Tunnel commands */ i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, - i40e_aqc_opc_tunnel_key_structure = 0x0B10, +#ifdef X722_SUPPORT + i40e_aqc_opc_set_rss_key = 0x0B02, + i40e_aqc_opc_set_rss_lut = 0x0B03, + i40e_aqc_opc_get_rss_key = 0x0B04, + i40e_aqc_opc_get_rss_lut = 0x0B05, +#endif /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, @@ -282,8 +287,6 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_oem_ocbb_initialize = 0xFE03, /* debug commands */ - i40e_aqc_opc_debug_get_deviceid = 0xFF00, - i40e_aqc_opc_debug_set_mode = 0xFF01, i40e_aqc_opc_debug_read_reg = 0xFF03, i40e_aqc_opc_debug_write_reg = 0xFF04, i40e_aqc_opc_debug_modify_reg = 0xFF07, @@ -517,7 +520,8 @@ struct i40e_aqc_mac_address_read { #define I40E_AQC_SAN_ADDR_VALID 0x20 #define I40E_AQC_PORT_ADDR_VALID 0x40 #define I40E_AQC_WOL_ADDR_VALID 0x80 -#define I40E_AQC_ADDR_VALID_MASK 0xf0 +#define I40E_AQC_MC_MAG_EN_VALID 0x100 +#define I40E_AQC_ADDR_VALID_MASK 0x1F0 u8 reserved[6]; __le32 addr_high; __le32 addr_low; @@ -540,7 +544,9 @@ struct i40e_aqc_mac_address_write { #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x0000 #define I40E_AQC_WRITE_TYPE_LAA_WOL 0x4000 #define I40E_AQC_WRITE_TYPE_PORT 0x8000 -#define I40E_AQC_WRITE_TYPE_MASK 0xc000 +#define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000 +#define I40E_AQC_WRITE_TYPE_MASK 0xC000 + __le16 mac_sah; __le32 mac_sal; u8 reserved[8]; @@ -834,8 +840,16 @@ struct i40e_aqc_vsi_properties_data { I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT) /* queueing option section */ u8 queueing_opt_flags; +#ifdef X722_SUPPORT +#define I40E_AQ_VSI_QUE_OPT_MULTICAST_UDP_ENA 0x04 +#define I40E_AQ_VSI_QUE_OPT_UNICAST_UDP_ENA 0x08 +#endif #define I40E_AQ_VSI_QUE_OPT_TCP_ENA 0x10 #define I40E_AQ_VSI_QUE_OPT_FCOE_ENA 0x20 +#ifdef X722_SUPPORT +#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_PF 0x00 +#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_VSI 0x40 +#endif u8 queueing_opt_reserved[3]; /* scheduler section */ u8 up_enable_bits; @@ -1076,6 +1090,7 @@ struct i40e_aqc_set_vsi_promiscuous_mode __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; +#define I40E_AQC_SET_VSI_VLAN_MASK 0x0FFF #define I40E_AQC_SET_VSI_VLAN_VALID 0x8000 u8 reserved[8]; }; @@ -1725,11 +1740,13 @@ struct i40e_aqc_get_link_status { u8 phy_type; /* i40e_aq_phy_type */ u8 link_speed; /* i40e_aq_link_speed */ u8 link_info; -#define I40E_AQ_LINK_UP 0x01 +#define I40E_AQ_LINK_UP 0x01 /* obsolete */ +#define I40E_AQ_LINK_UP_FUNCTION 0x01 #define I40E_AQ_LINK_FAULT 0x02 #define I40E_AQ_LINK_FAULT_TX 0x04 #define I40E_AQ_LINK_FAULT_RX 0x08 #define I40E_AQ_LINK_FAULT_REMOTE 0x10 +#define I40E_AQ_LINK_UP_PORT 0x20 #define I40E_AQ_MEDIA_AVAILABLE 0x40 #define I40E_AQ_SIGNAL_DETECT 0x80 u8 an_info; @@ -1891,6 +1908,26 @@ struct i40e_aqc_nvm_config_data_immediat I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field); +/* OEM Post Update (indirect 0x0720) + * no command data struct used + */ + struct i40e_aqc_nvm_oem_post_update { +#define I40E_AQ_NVM_OEM_POST_UPDATE_EXTERNAL_DATA 0x01 + u8 sel_data; + u8 reserved[7]; +}; + +I40E_CHECK_STRUCT_LEN(0x8, i40e_aqc_nvm_oem_post_update); + +struct i40e_aqc_nvm_oem_post_update_buffer { + u8 str_len; + u8 dev_addr; + __le16 eeprom_addr; + u8 data[36]; +}; + +I40E_CHECK_STRUCT_LEN(0x28, i40e_aqc_nvm_oem_post_update_buffer); + /* Send to PF command (indirect 0x0801) id is only used by PF * Send to VF command (indirect 0x0802) id is only used by PF * Send to Peer PF command (indirect 0x0803) @@ -2064,12 +2101,28 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_star #define I40E_AQC_CEE_APP_ISCSI_MASK (0x7 << I40E_AQC_CEE_APP_ISCSI_SHIFT) #define I40E_AQC_CEE_APP_FIP_SHIFT 0x8 #define I40E_AQC_CEE_APP_FIP_MASK (0x7 << I40E_AQC_CEE_APP_FIP_SHIFT) + #define I40E_AQC_CEE_PG_STATUS_SHIFT 0x0 #define I40E_AQC_CEE_PG_STATUS_MASK (0x7 << I40E_AQC_CEE_PG_STATUS_SHIFT) #define I40E_AQC_CEE_PFC_STATUS_SHIFT 0x3 #define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT) #define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8 #define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT) +#define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8 +#define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT) +#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT 0xB +#define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT) +#define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10 +#define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT) + +/* struct i40e_aqc_get_cee_dcb_cfg_v1_resp was originally defined with + * word boundary layout issues, which the Linux compilers silently deal + * with by adding padding, making the actual struct larger than designed. + * However, the FW compiler for the NIC is less lenient and complains + * about the struct. Hence, the struct defined here has an extra byte in + * fields reserved3 and reserved4 to directly acknowledge that padding, + * and the new length is used in the length check macro. + */ struct i40e_aqc_get_cee_dcb_cfg_v1_resp { u8 reserved1; u8 oper_num_tc; @@ -2077,9 +2130,9 @@ struct i40e_aqc_get_cee_dcb_cfg_v1_resp u8 reserved2; u8 oper_tc_bw[8]; u8 oper_pfc_en; - u8 reserved3; + u8 reserved3[2]; __le16 oper_app_prio; - u8 reserved4; + u8 reserved4[2]; __le16 tlv_status; }; @@ -2168,6 +2221,48 @@ struct i40e_aqc_del_udp_tunnel_completio }; I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion); +#ifdef X722_SUPPORT + +struct i40e_aqc_get_set_rss_key { +#define I40E_AQC_SET_RSS_KEY_VSI_VALID (0x1 << 15) +#define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT 0 +#define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK (0x3FF << \ + I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) + __le16 vsi_id; + u8 reserved[6]; + __le32 addr_high; + __le32 addr_low; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_key); + +struct i40e_aqc_get_set_rss_key_data { + u8 standard_rss_key[0x28]; + u8 extended_hash_key[0xc]; +}; + +I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data); + +struct i40e_aqc_get_set_rss_lut { +#define I40E_AQC_SET_RSS_LUT_VSI_VALID (0x1 << 15) +#define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT 0 +#define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK (0x3FF << \ + I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) + __le16 vsi_id; +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT 0 +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK (0x1 << \ + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) + +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI 0 +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF 1 + __le16 flags; + u8 reserved[4]; + __le32 addr_high; + __le32 addr_low; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_lut); +#endif /* tunnel key structure 0x0B10 */ Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Fri Jun 5 21:45:35 2015 (r284048) +++ head/sys/dev/ixl/i40e_common.c Fri Jun 5 22:52:42 2015 (r284049) @@ -62,9 +62,24 @@ enum i40e_status_code i40e_set_mac_type( case I40E_DEV_ID_QSFP_B: case I40E_DEV_ID_QSFP_C: case I40E_DEV_ID_10G_BASE_T: + case I40E_DEV_ID_10G_BASE_T4: case I40E_DEV_ID_20G_KR2: + case I40E_DEV_ID_20G_KR2_A: hw->mac.type = I40E_MAC_XL710; break; +#ifdef X722_SUPPORT + case I40E_DEV_ID_SFP_X722: + case I40E_DEV_ID_1G_BASE_T_X722: + case I40E_DEV_ID_10G_BASE_T_X722: + hw->mac.type = I40E_MAC_X722; + break; +#endif +#ifdef X722_SUPPORT + case I40E_DEV_ID_X722_VF: + case I40E_DEV_ID_X722_VF_HV: + hw->mac.type = I40E_MAC_X722_VF; + break; +#endif case I40E_DEV_ID_VF: case I40E_DEV_ID_VF_HV: hw->mac.type = I40E_MAC_VF; @@ -83,6 +98,212 @@ enum i40e_status_code i40e_set_mac_type( } /** + * i40e_aq_str - convert AQ err code to a string + * @hw: pointer to the HW structure + * @aq_err: the AQ error code to convert + **/ +char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err) +{ + switch (aq_err) { + case I40E_AQ_RC_OK: + return "OK"; + case I40E_AQ_RC_EPERM: + return "I40E_AQ_RC_EPERM"; + case I40E_AQ_RC_ENOENT: + return "I40E_AQ_RC_ENOENT"; + case I40E_AQ_RC_ESRCH: + return "I40E_AQ_RC_ESRCH"; + case I40E_AQ_RC_EINTR: + return "I40E_AQ_RC_EINTR"; + case I40E_AQ_RC_EIO: + return "I40E_AQ_RC_EIO"; + case I40E_AQ_RC_ENXIO: + return "I40E_AQ_RC_ENXIO"; + case I40E_AQ_RC_E2BIG: + return "I40E_AQ_RC_E2BIG"; + case I40E_AQ_RC_EAGAIN: + return "I40E_AQ_RC_EAGAIN"; + case I40E_AQ_RC_ENOMEM: + return "I40E_AQ_RC_ENOMEM"; + case I40E_AQ_RC_EACCES: + return "I40E_AQ_RC_EACCES"; + case I40E_AQ_RC_EFAULT: + return "I40E_AQ_RC_EFAULT"; + case I40E_AQ_RC_EBUSY: + return "I40E_AQ_RC_EBUSY"; + case I40E_AQ_RC_EEXIST: + return "I40E_AQ_RC_EEXIST"; + case I40E_AQ_RC_EINVAL: + return "I40E_AQ_RC_EINVAL"; + case I40E_AQ_RC_ENOTTY: + return "I40E_AQ_RC_ENOTTY"; + case I40E_AQ_RC_ENOSPC: + return "I40E_AQ_RC_ENOSPC"; + case I40E_AQ_RC_ENOSYS: + return "I40E_AQ_RC_ENOSYS"; + case I40E_AQ_RC_ERANGE: + return "I40E_AQ_RC_ERANGE"; + case I40E_AQ_RC_EFLUSHED: + return "I40E_AQ_RC_EFLUSHED"; + case I40E_AQ_RC_BAD_ADDR: + return "I40E_AQ_RC_BAD_ADDR"; + case I40E_AQ_RC_EMODE: + return "I40E_AQ_RC_EMODE"; + case I40E_AQ_RC_EFBIG: + return "I40E_AQ_RC_EFBIG"; + } + + snprintf(hw->err_str, sizeof(hw->err_str), "%d", aq_err); + return hw->err_str; +} + +/** + * i40e_stat_str - convert status err code to a string + * @hw: pointer to the HW structure + * @stat_err: the status error code to convert + **/ +char *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err) +{ + switch (stat_err) { + case I40E_SUCCESS: + return "OK"; + case I40E_ERR_NVM: + return "I40E_ERR_NVM"; + case I40E_ERR_NVM_CHECKSUM: + return "I40E_ERR_NVM_CHECKSUM"; + case I40E_ERR_PHY: + return "I40E_ERR_PHY"; + case I40E_ERR_CONFIG: + return "I40E_ERR_CONFIG"; + case I40E_ERR_PARAM: + return "I40E_ERR_PARAM"; + case I40E_ERR_MAC_TYPE: + return "I40E_ERR_MAC_TYPE"; + case I40E_ERR_UNKNOWN_PHY: + return "I40E_ERR_UNKNOWN_PHY"; + case I40E_ERR_LINK_SETUP: + return "I40E_ERR_LINK_SETUP"; + case I40E_ERR_ADAPTER_STOPPED: + return "I40E_ERR_ADAPTER_STOPPED"; + case I40E_ERR_INVALID_MAC_ADDR: + return "I40E_ERR_INVALID_MAC_ADDR"; + case I40E_ERR_DEVICE_NOT_SUPPORTED: + return "I40E_ERR_DEVICE_NOT_SUPPORTED"; + case I40E_ERR_MASTER_REQUESTS_PENDING: + return "I40E_ERR_MASTER_REQUESTS_PENDING"; + case I40E_ERR_INVALID_LINK_SETTINGS: + return "I40E_ERR_INVALID_LINK_SETTINGS"; + case I40E_ERR_AUTONEG_NOT_COMPLETE: + return "I40E_ERR_AUTONEG_NOT_COMPLETE"; + case I40E_ERR_RESET_FAILED: + return "I40E_ERR_RESET_FAILED"; + case I40E_ERR_SWFW_SYNC: + return "I40E_ERR_SWFW_SYNC"; + case I40E_ERR_NO_AVAILABLE_VSI: + return "I40E_ERR_NO_AVAILABLE_VSI"; + case I40E_ERR_NO_MEMORY: + return "I40E_ERR_NO_MEMORY"; + case I40E_ERR_BAD_PTR: + return "I40E_ERR_BAD_PTR"; + case I40E_ERR_RING_FULL: + return "I40E_ERR_RING_FULL"; + case I40E_ERR_INVALID_PD_ID: + return "I40E_ERR_INVALID_PD_ID"; + case I40E_ERR_INVALID_QP_ID: + return "I40E_ERR_INVALID_QP_ID"; + case I40E_ERR_INVALID_CQ_ID: + return "I40E_ERR_INVALID_CQ_ID"; + case I40E_ERR_INVALID_CEQ_ID: + return "I40E_ERR_INVALID_CEQ_ID"; + case I40E_ERR_INVALID_AEQ_ID: + return "I40E_ERR_INVALID_AEQ_ID"; + case I40E_ERR_INVALID_SIZE: + return "I40E_ERR_INVALID_SIZE"; + case I40E_ERR_INVALID_ARP_INDEX: + return "I40E_ERR_INVALID_ARP_INDEX"; + case I40E_ERR_INVALID_FPM_FUNC_ID: + return "I40E_ERR_INVALID_FPM_FUNC_ID"; + case I40E_ERR_QP_INVALID_MSG_SIZE: + return "I40E_ERR_QP_INVALID_MSG_SIZE"; + case I40E_ERR_QP_TOOMANY_WRS_POSTED: + return "I40E_ERR_QP_TOOMANY_WRS_POSTED"; + case I40E_ERR_INVALID_FRAG_COUNT: + return "I40E_ERR_INVALID_FRAG_COUNT"; + case I40E_ERR_QUEUE_EMPTY: + return "I40E_ERR_QUEUE_EMPTY"; + case I40E_ERR_INVALID_ALIGNMENT: + return "I40E_ERR_INVALID_ALIGNMENT"; + case I40E_ERR_FLUSHED_QUEUE: + return "I40E_ERR_FLUSHED_QUEUE"; + case I40E_ERR_INVALID_PUSH_PAGE_INDEX: + return "I40E_ERR_INVALID_PUSH_PAGE_INDEX"; + case I40E_ERR_INVALID_IMM_DATA_SIZE: + return "I40E_ERR_INVALID_IMM_DATA_SIZE"; + case I40E_ERR_TIMEOUT: + return "I40E_ERR_TIMEOUT"; + case I40E_ERR_OPCODE_MISMATCH: + return "I40E_ERR_OPCODE_MISMATCH"; + case I40E_ERR_CQP_COMPL_ERROR: + return "I40E_ERR_CQP_COMPL_ERROR"; + case I40E_ERR_INVALID_VF_ID: + return "I40E_ERR_INVALID_VF_ID"; + case I40E_ERR_INVALID_HMCFN_ID: + return "I40E_ERR_INVALID_HMCFN_ID"; + case I40E_ERR_BACKING_PAGE_ERROR: + return "I40E_ERR_BACKING_PAGE_ERROR"; + case I40E_ERR_NO_PBLCHUNKS_AVAILABLE: + return "I40E_ERR_NO_PBLCHUNKS_AVAILABLE"; + case I40E_ERR_INVALID_PBLE_INDEX: + return "I40E_ERR_INVALID_PBLE_INDEX"; + case I40E_ERR_INVALID_SD_INDEX: + return "I40E_ERR_INVALID_SD_INDEX"; + case I40E_ERR_INVALID_PAGE_DESC_INDEX: + return "I40E_ERR_INVALID_PAGE_DESC_INDEX"; + case I40E_ERR_INVALID_SD_TYPE: + return "I40E_ERR_INVALID_SD_TYPE"; + case I40E_ERR_MEMCPY_FAILED: + return "I40E_ERR_MEMCPY_FAILED"; + case I40E_ERR_INVALID_HMC_OBJ_INDEX: + return "I40E_ERR_INVALID_HMC_OBJ_INDEX"; + case I40E_ERR_INVALID_HMC_OBJ_COUNT: + return "I40E_ERR_INVALID_HMC_OBJ_COUNT"; + case I40E_ERR_INVALID_SRQ_ARM_LIMIT: + return "I40E_ERR_INVALID_SRQ_ARM_LIMIT"; + case I40E_ERR_SRQ_ENABLED: + return "I40E_ERR_SRQ_ENABLED"; + case I40E_ERR_ADMIN_QUEUE_ERROR: + return "I40E_ERR_ADMIN_QUEUE_ERROR"; + case I40E_ERR_ADMIN_QUEUE_TIMEOUT: + return "I40E_ERR_ADMIN_QUEUE_TIMEOUT"; + case I40E_ERR_BUF_TOO_SHORT: + return "I40E_ERR_BUF_TOO_SHORT"; + case I40E_ERR_ADMIN_QUEUE_FULL: + return "I40E_ERR_ADMIN_QUEUE_FULL"; + case I40E_ERR_ADMIN_QUEUE_NO_WORK: + return "I40E_ERR_ADMIN_QUEUE_NO_WORK"; + case I40E_ERR_BAD_IWARP_CQE: + return "I40E_ERR_BAD_IWARP_CQE"; + case I40E_ERR_NVM_BLANK_MODE: + return "I40E_ERR_NVM_BLANK_MODE"; + case I40E_ERR_NOT_IMPLEMENTED: + return "I40E_ERR_NOT_IMPLEMENTED"; + case I40E_ERR_PE_DOORBELL_NOT_ENABLED: + return "I40E_ERR_PE_DOORBELL_NOT_ENABLED"; + case I40E_ERR_DIAG_TEST_FAILED: + return "I40E_ERR_DIAG_TEST_FAILED"; + case I40E_ERR_NOT_READY: + return "I40E_ERR_NOT_READY"; + case I40E_NOT_SUPPORTED: + return "I40E_NOT_SUPPORTED"; + case I40E_ERR_FIRMWARE_API_VERSION: + return "I40E_ERR_FIRMWARE_API_VERSION"; + } + + snprintf(hw->err_str, sizeof(hw->err_str), "%d", stat_err); + return hw->err_str; +} + +/** * i40e_debug_aq * @hw: debug mask related to admin queue * @mask: debug mask @@ -154,9 +375,13 @@ void i40e_debug_aq(struct i40e_hw *hw, e bool i40e_check_asq_alive(struct i40e_hw *hw) { if (hw->aq.asq.len) - return !!(rd32(hw, hw->aq.asq.len) & I40E_PF_ATQLEN_ATQENABLE_MASK); - else - return FALSE; + if (!i40e_is_vf(hw)) + return !!(rd32(hw, hw->aq.asq.len) & + I40E_PF_ATQLEN_ATQENABLE_MASK); + if (i40e_is_vf(hw)) + return !!(rd32(hw, hw->aq.asq.len) & + I40E_VF_ATQLEN1_ATQENABLE_MASK); + return FALSE; } /** @@ -184,6 +409,171 @@ enum i40e_status_code i40e_aq_queue_shut return status; } +#ifdef X722_SUPPORT + +/** + * i40e_aq_get_set_rss_lut + * @hw: pointer to the hardware structure + * @vsi_id: vsi fw index + * @pf_lut: for PF table set TRUE, for VSI table set FALSE + * @lut: pointer to the lut buffer provided by the caller + * @lut_size: size of the lut buffer + * @set: set TRUE to set the table, FALSE to get the table + * + * Internal function to get or set RSS look up table + **/ +static enum i40e_status_code i40e_aq_get_set_rss_lut(struct i40e_hw *hw, + u16 vsi_id, bool pf_lut, + u8 *lut, u16 lut_size, + bool set) +{ + enum i40e_status_code status; + struct i40e_aq_desc desc; + struct i40e_aqc_get_set_rss_lut *cmd_resp = + (struct i40e_aqc_get_set_rss_lut *)&desc.params.raw; + + if (set) + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_set_rss_lut); + else + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_get_rss_lut); + + /* Indirect command */ + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD); + + cmd_resp->vsi_id = + CPU_TO_LE16((u16)((vsi_id << + I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) & + I40E_AQC_SET_RSS_LUT_VSI_ID_MASK)); + cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_LUT_VSI_VALID); + + if (pf_lut) + cmd_resp->flags |= CPU_TO_LE16((u16) + ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF << + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) & + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK)); + else + cmd_resp->flags |= CPU_TO_LE16((u16) + ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI << + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) & + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK)); + + cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)lut)); + cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)lut)); + + status = i40e_asq_send_command(hw, &desc, lut, lut_size, NULL); + + return status; +} + +/** + * i40e_aq_get_rss_lut + * @hw: pointer to the hardware structure + * @vsi_id: vsi fw index + * @pf_lut: for PF table set TRUE, for VSI table set FALSE + * @lut: pointer to the lut buffer provided by the caller + * @lut_size: size of the lut buffer + * + * get the RSS lookup table, PF or VSI type + **/ +enum i40e_status_code i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 vsi_id, + bool pf_lut, u8 *lut, u16 lut_size) +{ + return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, + FALSE); +} + +/** + * i40e_aq_set_rss_lut + * @hw: pointer to the hardware structure + * @vsi_id: vsi fw index + * @pf_lut: for PF table set TRUE, for VSI table set FALSE + * @lut: pointer to the lut buffer provided by the caller + * @lut_size: size of the lut buffer + * + * set the RSS lookup table, PF or VSI type + **/ +enum i40e_status_code i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 vsi_id, + bool pf_lut, u8 *lut, u16 lut_size) +{ + return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, TRUE); +} + +/** + * i40e_aq_get_set_rss_key + * @hw: pointer to the hw struct + * @vsi_id: vsi fw index + * @key: pointer to key info struct + * @set: set TRUE to set the key, FALSE to get the key + * + * get the RSS key per VSI + **/ +static enum i40e_status_code i40e_aq_get_set_rss_key(struct i40e_hw *hw, + u16 vsi_id, + struct i40e_aqc_get_set_rss_key_data *key, + bool set) +{ + enum i40e_status_code status; + struct i40e_aq_desc desc; + struct i40e_aqc_get_set_rss_key *cmd_resp = + (struct i40e_aqc_get_set_rss_key *)&desc.params.raw; + u16 key_size = sizeof(struct i40e_aqc_get_set_rss_key_data); + + if (set) + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_set_rss_key); + else + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_get_rss_key); + + /* Indirect command */ + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD); + + cmd_resp->vsi_id = + CPU_TO_LE16((u16)((vsi_id << + I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) & + I40E_AQC_SET_RSS_KEY_VSI_ID_MASK)); + cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_KEY_VSI_VALID); + cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)key)); + cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)key)); + + status = i40e_asq_send_command(hw, &desc, key, key_size, NULL); + + return status; +} + +/** + * i40e_aq_get_rss_key + * @hw: pointer to the hw struct + * @vsi_id: vsi fw index + * @key: pointer to key info struct + * + **/ +enum i40e_status_code i40e_aq_get_rss_key(struct i40e_hw *hw, + u16 vsi_id, + struct i40e_aqc_get_set_rss_key_data *key) +{ + return i40e_aq_get_set_rss_key(hw, vsi_id, key, FALSE); +} + +/** + * i40e_aq_set_rss_key + * @hw: pointer to the hw struct + * @vsi_id: vsi fw index + * @key: pointer to key info struct + * + * set the RSS key per VSI + **/ +enum i40e_status_code i40e_aq_set_rss_key(struct i40e_hw *hw, + u16 vsi_id, + struct i40e_aqc_get_set_rss_key_data *key) +{ + return i40e_aq_get_set_rss_key(hw, vsi_id, key, TRUE); +} +#endif /* X722_SUPPORT */ /* The i40e_ptype_lookup table is used to convert from the 8-bit ptype in the * hardware to a bit-field that can be used by SW to more easily determine the @@ -598,6 +988,9 @@ enum i40e_status_code i40e_init_shared_c switch (hw->mac.type) { case I40E_MAC_XL710: +#ifdef X722_SUPPORT + case I40E_MAC_X722: +#endif break; default: return I40E_ERR_DEVICE_NOT_SUPPORTED; @@ -888,7 +1281,7 @@ enum i40e_status_code i40e_pf_reset(stru grst_del = (rd32(hw, I40E_GLGEN_RSTCTL) & I40E_GLGEN_RSTCTL_GRSTDEL_MASK) >> I40E_GLGEN_RSTCTL_GRSTDEL_SHIFT; - for (cnt = 0; cnt < grst_del + 2; cnt++) { + for (cnt = 0; cnt < grst_del + 10; cnt++) { reg = rd32(hw, I40E_GLGEN_RSTAT); if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK)) break; @@ -1108,9 +1501,11 @@ u32 i40e_led_get(struct i40e_hw *hw) if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity LEDs */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> - I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); + /* ignore gpio LED src mode entries related to the activity + * LEDs + */ + current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) + >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); switch (current_mode) { case I40E_COMBINED_ACTIVITY: case I40E_FILTER_ACTIVITY: @@ -1154,9 +1549,11 @@ void i40e_led_set(struct i40e_hw *hw, u3 if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity LEDs */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> - I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); + /* ignore gpio LED src mode entries related to the activity + * LEDs + */ + current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) + >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); switch (current_mode) { case I40E_COMBINED_ACTIVITY: case I40E_FILTER_ACTIVITY: @@ -1175,9 +1572,9 @@ void i40e_led_set(struct i40e_hw *hw, u3 blink = FALSE; if (blink) - gpio_val |= (1 << I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); + gpio_val |= BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); else - gpio_val &= ~(1 << I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); + gpio_val &= ~BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); wr32(hw, I40E_GLGEN_GPIO_CTL(i), gpio_val); break; @@ -1329,14 +1726,14 @@ enum i40e_status_code i40e_set_fc(struct *aq_failures |= I40E_SET_FC_AQ_FAIL_SET; } /* Update the link info */ - status = i40e_aq_get_link_info(hw, TRUE, NULL, NULL); + status = i40e_update_link_info(hw); if (status) { /* Wait a little bit (on 40G cards it sometimes takes a really * long time for link to come back from the atomic reset) * and try once more */ i40e_msec_delay(1000); - status = i40e_aq_get_link_info(hw, TRUE, NULL, NULL); + status = i40e_update_link_info(hw); } if (status) *aq_failures |= I40E_SET_FC_AQ_FAIL_UPDATE; @@ -1525,7 +1922,6 @@ aq_get_link_info_exit: return status; } - /** * i40e_aq_set_phy_int_mask * @hw: pointer to the hw struct @@ -1837,6 +2233,74 @@ enum i40e_status_code i40e_aq_set_vsi_mu } /** + * i40e_aq_set_vsi_mc_promisc_on_vlan + * @hw: pointer to the hw struct + * @seid: vsi number + * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN + * @vid: The VLAN tag filter - capture any multicast packet with this VLAN tag + * @cmd_details: pointer to command details structure or NULL + **/ +enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw, + u16 seid, bool enable, u16 vid, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_set_vsi_promiscuous_modes *cmd = + (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; + enum i40e_status_code status; + u16 flags = 0; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_set_vsi_promiscuous_modes); + + if (enable) + flags |= I40E_AQC_SET_VSI_PROMISC_MULTICAST; + + cmd->promiscuous_flags = CPU_TO_LE16(flags); + cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_MULTICAST); + cmd->seid = CPU_TO_LE16(seid); + cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + +/** + * i40e_aq_set_vsi_uc_promisc_on_vlan + * @hw: pointer to the hw struct + * @seid: vsi number + * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN + * @vid: The VLAN tag filter - capture any unicast packet with this VLAN tag + * @cmd_details: pointer to command details structure or NULL + **/ +enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, + u16 seid, bool enable, u16 vid, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_set_vsi_promiscuous_modes *cmd = + (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; + enum i40e_status_code status; + u16 flags = 0; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_set_vsi_promiscuous_modes); + + if (enable) + flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; + + cmd->promiscuous_flags = CPU_TO_LE16(flags); + cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); + cmd->seid = CPU_TO_LE16(seid); + cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + +/** * i40e_aq_set_vsi_broadcast * @hw: pointer to the hw struct * @seid: vsi number @@ -2067,30 +2531,56 @@ enum i40e_status_code i40e_aq_send_drive /** * i40e_get_link_status - get status of the HW network link * @hw: pointer to the hw struct + * @link_up: pointer to bool (TRUE/FALSE = linkup/linkdown) * - * Returns TRUE if link is up, FALSE if link is down. + * Variable link_up TRUE if link is up, FALSE if link is down. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 23:07:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 738BDB07; Fri, 5 Jun 2015 23:07:40 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ie0-x236.google.com (mail-ie0-x236.google.com [IPv6:2607:f8b0:4001:c03::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 3BBDD1CBA; Fri, 5 Jun 2015 23:07:40 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iebgx4 with SMTP id gx4so67372668ieb.0; Fri, 05 Jun 2015 16:07:39 -0700 (PDT) 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=t7o8FO0Gmf8tMpHWHNCUqomg/ANMvYITmSI6vXhcj/o=; b=QXzKuJN9m73LutuJZADs4dQvfiNNxw0ACpRG1QCvRvdTznxZTnp1cUcdqddZIA5y12 ljIGX2JZWIRPgdD+F2aUQQvDqo3wOkqxp9Tob08Ppev6zjliIXWa3adP+epFT3Z93ORb oT6aFRrNHS6DAATjotG81YC2BAv+F8cnMSSKitvKlRCW8wgfgral2aOGZk8PDNuwwabR mkih/Nt412CfnxcNZ1wLuoE8JNRGN+0QW6FpvmiwVkDibYWWx5nZc0X+mvxJLr/Doqbj fykGgF5bRzRUgC5j8pjskIgFozxwzZeOB7CktH6knoJI+JaGytTucOvQeiFAlRNVz6Ej B3hg== MIME-Version: 1.0 X-Received: by 10.50.73.198 with SMTP id n6mr793680igv.32.1433545659643; Fri, 05 Jun 2015 16:07:39 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.38.133 with HTTP; Fri, 5 Jun 2015 16:07:39 -0700 (PDT) In-Reply-To: <201506052252.t55MqgOT000856@svn.freebsd.org> References: <201506052252.t55MqgOT000856@svn.freebsd.org> Date: Fri, 5 Jun 2015 16:07:39 -0700 X-Google-Sender-Auth: 5dJBD28d4yjacoMJYyP24hVGsMI Message-ID: Subject: Re: svn commit: r284049 - in head/sys: dev/ixl modules/ixl modules/ixlv From: Adrian Chadd To: Jack F Vogel 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: Fri, 05 Jun 2015 23:07:40 -0000 Hi! Is there any public information / firmware on this? Or do we have to have some commercial arrangement with Intel to get the updated firmware? My support channel is "whoever gave me the two ixv 40g nics to test netmap on soon" and I don't think they have firmware. :) Thanks, -adrian On 5 June 2015 at 15:52, Jack F Vogel wrote: > Author: jfv > Date: Fri Jun 5 22:52:42 2015 > New Revision: 284049 > URL: https://svnweb.freebsd.org/changeset/base/284049 > > Log: > Update SW4 to the Intel ixl/ixlv drivers. This is primarily a shared > code update, with supporting changes in the CORE. Changes for the extended > media types, VF driver has virtual channel protocol changes, and some > register use corrections. This software change should be coordinated with > Firmware updates to your hardware, contact your support channels for that. > > MFC after: 1 week > > Added: > head/sys/dev/ixl/i40e_devids.h (contents, props changed) > Modified: > head/sys/dev/ixl/i40e_adminq.c > head/sys/dev/ixl/i40e_adminq.h > head/sys/dev/ixl/i40e_adminq_cmd.h > head/sys/dev/ixl/i40e_common.c > head/sys/dev/ixl/i40e_hmc.c > head/sys/dev/ixl/i40e_hmc.h > head/sys/dev/ixl/i40e_lan_hmc.c > head/sys/dev/ixl/i40e_nvm.c > head/sys/dev/ixl/i40e_osdep.h > head/sys/dev/ixl/i40e_prototype.h > head/sys/dev/ixl/i40e_register.h > head/sys/dev/ixl/i40e_type.h > head/sys/dev/ixl/i40e_virtchnl.h > head/sys/dev/ixl/if_ixl.c > head/sys/dev/ixl/if_ixlv.c > head/sys/dev/ixl/ixlv.h > head/sys/dev/ixl/ixlvc.c > head/sys/modules/ixl/Makefile > head/sys/modules/ixlv/Makefile > > Modified: head/sys/dev/ixl/i40e_adminq.c > ============================================================================== > --- head/sys/dev/ixl/i40e_adminq.c Fri Jun 5 21:45:35 2015 (r284048) > +++ head/sys/dev/ixl/i40e_adminq.c Fri Jun 5 22:52:42 2015 (r284049) > @@ -315,8 +315,12 @@ static enum i40e_status_code i40e_config > wr32(hw, hw->aq.asq.tail, 0); > > /* set starting point */ > - wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries | > - I40E_PF_ATQLEN_ATQENABLE_MASK)); > + if (!i40e_is_vf(hw)) > + wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries | > + I40E_PF_ATQLEN_ATQENABLE_MASK)); > + if (i40e_is_vf(hw)) > + wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries | > + I40E_VF_ATQLEN1_ATQENABLE_MASK)); > wr32(hw, hw->aq.asq.bal, I40E_LO_DWORD(hw->aq.asq.desc_buf.pa)); > wr32(hw, hw->aq.asq.bah, I40E_HI_DWORD(hw->aq.asq.desc_buf.pa)); > > @@ -344,8 +348,12 @@ static enum i40e_status_code i40e_config > wr32(hw, hw->aq.arq.tail, 0); > > /* set starting point */ > - wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries | > - I40E_PF_ARQLEN_ARQENABLE_MASK)); > + if (!i40e_is_vf(hw)) > + wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries | > + I40E_PF_ARQLEN_ARQENABLE_MASK)); > + if (i40e_is_vf(hw)) > + wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries | > + I40E_VF_ARQLEN1_ARQENABLE_MASK)); > wr32(hw, hw->aq.arq.bal, I40E_LO_DWORD(hw->aq.arq.desc_buf.pa)); > wr32(hw, hw->aq.arq.bah, I40E_HI_DWORD(hw->aq.arq.desc_buf.pa)); > > @@ -559,6 +567,7 @@ enum i40e_status_code i40e_init_adminq(s > { > enum i40e_status_code ret_code; > u16 eetrack_lo, eetrack_hi; > + u16 cfg_ptr, oem_hi, oem_lo; > int retry = 0; > /* verify input for valid configuration */ > if ((hw->aq.num_arq_entries == 0) || > @@ -619,6 +628,12 @@ enum i40e_status_code i40e_init_adminq(s > i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_LO, &eetrack_lo); > i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_HI, &eetrack_hi); > hw->nvm.eetrack = (eetrack_hi << 16) | eetrack_lo; > + i40e_read_nvm_word(hw, I40E_SR_BOOT_CONFIG_PTR, &cfg_ptr); > + i40e_read_nvm_word(hw, (cfg_ptr + I40E_NVM_OEM_VER_OFF), > + &oem_hi); > + i40e_read_nvm_word(hw, (cfg_ptr + (I40E_NVM_OEM_VER_OFF + 1)), > + &oem_lo); > + hw->nvm.oem_ver = ((u32)oem_hi << 16) | oem_lo; > > if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) { > ret_code = I40E_ERR_FIRMWARE_API_VERSION; > @@ -669,6 +684,9 @@ enum i40e_status_code i40e_shutdown_admi > i40e_destroy_spinlock(&hw->aq.asq_spinlock); > i40e_destroy_spinlock(&hw->aq.arq_spinlock); > > + if (hw->nvm_buff.va) > + i40e_free_virt_mem(hw, &hw->nvm_buff); > + > return ret_code; > } > > @@ -688,16 +706,16 @@ u16 i40e_clean_asq(struct i40e_hw *hw) > > desc = I40E_ADMINQ_DESC(*asq, ntc); > details = I40E_ADMINQ_DETAILS(*asq, ntc); > + > while (rd32(hw, hw->aq.asq.head) != ntc) { > i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, > - "%s: ntc %d head %d.\n", __FUNCTION__, ntc, > - rd32(hw, hw->aq.asq.head)); > + "ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head)); > > if (details->callback) { > I40E_ADMINQ_CALLBACK cb_func = > (I40E_ADMINQ_CALLBACK)details->callback; > - i40e_memcpy(&desc_cb, desc, > - sizeof(struct i40e_aq_desc), I40E_DMA_TO_DMA); > + i40e_memcpy(&desc_cb, desc, sizeof(struct i40e_aq_desc), > + I40E_DMA_TO_DMA); > cb_func(hw, &desc_cb); > } > i40e_memset(desc, 0, sizeof(*desc), I40E_DMA_MEM); > @@ -755,6 +773,8 @@ enum i40e_status_code i40e_asq_send_comm > u16 retval = 0; > u32 val = 0; > > + hw->aq.asq_last_status = I40E_AQ_RC_OK; > + > val = rd32(hw, hw->aq.asq.head); > if (val >= hw->aq.num_asq_entries) { > i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, > @@ -912,6 +932,11 @@ enum i40e_status_code i40e_asq_send_comm > "AQTX: desc and buffer writeback:\n"); > i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff, buff_size); > > + /* save writeback aq if requested */ > + if (details->wb_desc) > + i40e_memcpy(details->wb_desc, desc_on_ring, > + sizeof(struct i40e_aq_desc), I40E_DMA_TO_NONDMA); > + > /* update the error if time out occurred */ > if ((!cmd_completed) && > (!details->async && !details->postpone)) { > @@ -971,7 +996,10 @@ enum i40e_status_code i40e_clean_arq_ele > i40e_acquire_spinlock(&hw->aq.arq_spinlock); > > /* set next_to_use to head */ > - ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK); > + if (!i40e_is_vf(hw)) > + ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK); > + if (i40e_is_vf(hw)) > + ntu = (rd32(hw, hw->aq.arq.head) & I40E_VF_ARQH1_ARQH_MASK); > if (ntu == ntc) { > /* nothing to do - shouldn't need to update ring's values */ > ret_code = I40E_ERR_ADMIN_QUEUE_NO_WORK; > @@ -1040,6 +1068,19 @@ clean_arq_element_out: > i40e_release_nvm(hw); > hw->aq.nvm_release_on_done = FALSE; > } > + > + switch (hw->nvmupd_state) { > + case I40E_NVMUPD_STATE_INIT_WAIT: > + hw->nvmupd_state = I40E_NVMUPD_STATE_INIT; > + break; > + > + case I40E_NVMUPD_STATE_WRITE_WAIT: > + hw->nvmupd_state = I40E_NVMUPD_STATE_WRITING; > + break; > + > + default: > + break; > + } > } > > return ret_code; > @@ -1051,9 +1092,6 @@ void i40e_resume_aq(struct i40e_hw *hw) > hw->aq.asq.next_to_use = 0; > hw->aq.asq.next_to_clean = 0; > > -#if (I40E_VF_ATQLEN_ATQENABLE_MASK != I40E_PF_ATQLEN_ATQENABLE_MASK) > -#error I40E_VF_ATQLEN_ATQENABLE_MASK != I40E_PF_ATQLEN_ATQENABLE_MASK > -#endif > i40e_config_asq_regs(hw); > > hw->aq.arq.next_to_use = 0; > > Modified: head/sys/dev/ixl/i40e_adminq.h > ============================================================================== > --- head/sys/dev/ixl/i40e_adminq.h Fri Jun 5 21:45:35 2015 (r284048) > +++ head/sys/dev/ixl/i40e_adminq.h Fri Jun 5 22:52:42 2015 (r284049) > @@ -1,6 +1,6 @@ > /****************************************************************************** > > - Copyright (c) 2013-2014, Intel Corporation > + Copyright (c) 2013-2015, Intel Corporation > All rights reserved. > > Redistribution and use in source and binary forms, with or without > @@ -77,6 +77,7 @@ struct i40e_asq_cmd_details { > u16 flags_dis; > bool async; > bool postpone; > + struct i40e_aq_desc *wb_desc; > }; > > #define I40E_ADMINQ_DETAILS(R, i) \ > > Modified: head/sys/dev/ixl/i40e_adminq_cmd.h > ============================================================================== > --- head/sys/dev/ixl/i40e_adminq_cmd.h Fri Jun 5 21:45:35 2015 (r284048) > +++ head/sys/dev/ixl/i40e_adminq_cmd.h Fri Jun 5 22:52:42 2015 (r284049) > @@ -42,7 +42,11 @@ > */ > > #define I40E_FW_API_VERSION_MAJOR 0x0001 > -#define I40E_FW_API_VERSION_MINOR 0x0002 > +#ifdef X722_SUPPORT > +#define I40E_FW_API_VERSION_MINOR 0x0003 > +#else > +#define I40E_FW_API_VERSION_MINOR 0x0004 > +#endif > > struct i40e_aq_desc { > __le16 flags; > @@ -140,12 +144,7 @@ enum i40e_admin_queue_opc { > i40e_aqc_opc_list_func_capabilities = 0x000A, > i40e_aqc_opc_list_dev_capabilities = 0x000B, > > - i40e_aqc_opc_set_cppm_configuration = 0x0103, > - i40e_aqc_opc_set_arp_proxy_entry = 0x0104, > - i40e_aqc_opc_set_ns_proxy_entry = 0x0105, > - > /* LAA */ > - i40e_aqc_opc_mng_laa = 0x0106, /* AQ obsolete */ > i40e_aqc_opc_mac_address_read = 0x0107, > i40e_aqc_opc_mac_address_write = 0x0108, > > @@ -240,6 +239,7 @@ enum i40e_admin_queue_opc { > i40e_aqc_opc_nvm_update = 0x0703, > i40e_aqc_opc_nvm_config_read = 0x0704, > i40e_aqc_opc_nvm_config_write = 0x0705, > + i40e_aqc_opc_oem_post_update = 0x0720, > > /* virtualization commands */ > i40e_aqc_opc_send_msg_to_pf = 0x0801, > @@ -270,7 +270,12 @@ enum i40e_admin_queue_opc { > /* Tunnel commands */ > i40e_aqc_opc_add_udp_tunnel = 0x0B00, > i40e_aqc_opc_del_udp_tunnel = 0x0B01, > - i40e_aqc_opc_tunnel_key_structure = 0x0B10, > +#ifdef X722_SUPPORT > + i40e_aqc_opc_set_rss_key = 0x0B02, > + i40e_aqc_opc_set_rss_lut = 0x0B03, > + i40e_aqc_opc_get_rss_key = 0x0B04, > + i40e_aqc_opc_get_rss_lut = 0x0B05, > +#endif > > /* Async Events */ > i40e_aqc_opc_event_lan_overflow = 0x1001, > @@ -282,8 +287,6 @@ enum i40e_admin_queue_opc { > i40e_aqc_opc_oem_ocbb_initialize = 0xFE03, > > /* debug commands */ > - i40e_aqc_opc_debug_get_deviceid = 0xFF00, > - i40e_aqc_opc_debug_set_mode = 0xFF01, > i40e_aqc_opc_debug_read_reg = 0xFF03, > i40e_aqc_opc_debug_write_reg = 0xFF04, > i40e_aqc_opc_debug_modify_reg = 0xFF07, > @@ -517,7 +520,8 @@ struct i40e_aqc_mac_address_read { > #define I40E_AQC_SAN_ADDR_VALID 0x20 > #define I40E_AQC_PORT_ADDR_VALID 0x40 > #define I40E_AQC_WOL_ADDR_VALID 0x80 > -#define I40E_AQC_ADDR_VALID_MASK 0xf0 > +#define I40E_AQC_MC_MAG_EN_VALID 0x100 > +#define I40E_AQC_ADDR_VALID_MASK 0x1F0 > u8 reserved[6]; > __le32 addr_high; > __le32 addr_low; > @@ -540,7 +544,9 @@ struct i40e_aqc_mac_address_write { > #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x0000 > #define I40E_AQC_WRITE_TYPE_LAA_WOL 0x4000 > #define I40E_AQC_WRITE_TYPE_PORT 0x8000 > -#define I40E_AQC_WRITE_TYPE_MASK 0xc000 > +#define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000 > +#define I40E_AQC_WRITE_TYPE_MASK 0xC000 > + > __le16 mac_sah; > __le32 mac_sal; > u8 reserved[8]; > @@ -834,8 +840,16 @@ struct i40e_aqc_vsi_properties_data { > I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT) > /* queueing option section */ > u8 queueing_opt_flags; > +#ifdef X722_SUPPORT > +#define I40E_AQ_VSI_QUE_OPT_MULTICAST_UDP_ENA 0x04 > +#define I40E_AQ_VSI_QUE_OPT_UNICAST_UDP_ENA 0x08 > +#endif > #define I40E_AQ_VSI_QUE_OPT_TCP_ENA 0x10 > #define I40E_AQ_VSI_QUE_OPT_FCOE_ENA 0x20 > +#ifdef X722_SUPPORT > +#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_PF 0x00 > +#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_VSI 0x40 > +#endif > u8 queueing_opt_reserved[3]; > /* scheduler section */ > u8 up_enable_bits; > @@ -1076,6 +1090,7 @@ struct i40e_aqc_set_vsi_promiscuous_mode > __le16 seid; > #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF > __le16 vlan_tag; > +#define I40E_AQC_SET_VSI_VLAN_MASK 0x0FFF > #define I40E_AQC_SET_VSI_VLAN_VALID 0x8000 > u8 reserved[8]; > }; > @@ -1725,11 +1740,13 @@ struct i40e_aqc_get_link_status { > u8 phy_type; /* i40e_aq_phy_type */ > u8 link_speed; /* i40e_aq_link_speed */ > u8 link_info; > -#define I40E_AQ_LINK_UP 0x01 > +#define I40E_AQ_LINK_UP 0x01 /* obsolete */ > +#define I40E_AQ_LINK_UP_FUNCTION 0x01 > #define I40E_AQ_LINK_FAULT 0x02 > #define I40E_AQ_LINK_FAULT_TX 0x04 > #define I40E_AQ_LINK_FAULT_RX 0x08 > #define I40E_AQ_LINK_FAULT_REMOTE 0x10 > +#define I40E_AQ_LINK_UP_PORT 0x20 > #define I40E_AQ_MEDIA_AVAILABLE 0x40 > #define I40E_AQ_SIGNAL_DETECT 0x80 > u8 an_info; > @@ -1891,6 +1908,26 @@ struct i40e_aqc_nvm_config_data_immediat > > I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field); > > +/* OEM Post Update (indirect 0x0720) > + * no command data struct used > + */ > + struct i40e_aqc_nvm_oem_post_update { > +#define I40E_AQ_NVM_OEM_POST_UPDATE_EXTERNAL_DATA 0x01 > + u8 sel_data; > + u8 reserved[7]; > +}; > + > +I40E_CHECK_STRUCT_LEN(0x8, i40e_aqc_nvm_oem_post_update); > + > +struct i40e_aqc_nvm_oem_post_update_buffer { > + u8 str_len; > + u8 dev_addr; > + __le16 eeprom_addr; > + u8 data[36]; > +}; > + > +I40E_CHECK_STRUCT_LEN(0x28, i40e_aqc_nvm_oem_post_update_buffer); > + > /* Send to PF command (indirect 0x0801) id is only used by PF > * Send to VF command (indirect 0x0802) id is only used by PF > * Send to Peer PF command (indirect 0x0803) > @@ -2064,12 +2101,28 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_star > #define I40E_AQC_CEE_APP_ISCSI_MASK (0x7 << I40E_AQC_CEE_APP_ISCSI_SHIFT) > #define I40E_AQC_CEE_APP_FIP_SHIFT 0x8 > #define I40E_AQC_CEE_APP_FIP_MASK (0x7 << I40E_AQC_CEE_APP_FIP_SHIFT) > + > #define I40E_AQC_CEE_PG_STATUS_SHIFT 0x0 > #define I40E_AQC_CEE_PG_STATUS_MASK (0x7 << I40E_AQC_CEE_PG_STATUS_SHIFT) > #define I40E_AQC_CEE_PFC_STATUS_SHIFT 0x3 > #define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT) > #define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8 > #define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT) > +#define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8 > +#define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT) > +#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT 0xB > +#define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT) > +#define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10 > +#define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT) > + > +/* struct i40e_aqc_get_cee_dcb_cfg_v1_resp was originally defined with > + * word boundary layout issues, which the Linux compilers silently deal > + * with by adding padding, making the actual struct larger than designed. > + * However, the FW compiler for the NIC is less lenient and complains > + * about the struct. Hence, the struct defined here has an extra byte in > + * fields reserved3 and reserved4 to directly acknowledge that padding, > + * and the new length is used in the length check macro. > + */ > struct i40e_aqc_get_cee_dcb_cfg_v1_resp { > u8 reserved1; > u8 oper_num_tc; > @@ -2077,9 +2130,9 @@ struct i40e_aqc_get_cee_dcb_cfg_v1_resp > u8 reserved2; > u8 oper_tc_bw[8]; > u8 oper_pfc_en; > - u8 reserved3; > + u8 reserved3[2]; > __le16 oper_app_prio; > - u8 reserved4; > + u8 reserved4[2]; > __le16 tlv_status; > }; > > @@ -2168,6 +2221,48 @@ struct i40e_aqc_del_udp_tunnel_completio > }; > > I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion); > +#ifdef X722_SUPPORT > + > +struct i40e_aqc_get_set_rss_key { > +#define I40E_AQC_SET_RSS_KEY_VSI_VALID (0x1 << 15) > +#define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT 0 > +#define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK (0x3FF << \ > + I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) > + __le16 vsi_id; > + u8 reserved[6]; > + __le32 addr_high; > + __le32 addr_low; > +}; > + > +I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_key); > + > +struct i40e_aqc_get_set_rss_key_data { > + u8 standard_rss_key[0x28]; > + u8 extended_hash_key[0xc]; > +}; > + > +I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data); > + > +struct i40e_aqc_get_set_rss_lut { > +#define I40E_AQC_SET_RSS_LUT_VSI_VALID (0x1 << 15) > +#define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT 0 > +#define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK (0x3FF << \ > + I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) > + __le16 vsi_id; > +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT 0 > +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK (0x1 << \ > + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) > + > +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI 0 > +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF 1 > + __le16 flags; > + u8 reserved[4]; > + __le32 addr_high; > + __le32 addr_low; > +}; > + > +I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_lut); > +#endif > > /* tunnel key structure 0x0B10 */ > > > Modified: head/sys/dev/ixl/i40e_common.c > ============================================================================== > --- head/sys/dev/ixl/i40e_common.c Fri Jun 5 21:45:35 2015 (r284048) > +++ head/sys/dev/ixl/i40e_common.c Fri Jun 5 22:52:42 2015 (r284049) > @@ -62,9 +62,24 @@ enum i40e_status_code i40e_set_mac_type( > case I40E_DEV_ID_QSFP_B: > case I40E_DEV_ID_QSFP_C: > case I40E_DEV_ID_10G_BASE_T: > + case I40E_DEV_ID_10G_BASE_T4: > case I40E_DEV_ID_20G_KR2: > + case I40E_DEV_ID_20G_KR2_A: > hw->mac.type = I40E_MAC_XL710; > break; > +#ifdef X722_SUPPORT > + case I40E_DEV_ID_SFP_X722: > + case I40E_DEV_ID_1G_BASE_T_X722: > + case I40E_DEV_ID_10G_BASE_T_X722: > + hw->mac.type = I40E_MAC_X722; > + break; > +#endif > +#ifdef X722_SUPPORT > + case I40E_DEV_ID_X722_VF: > + case I40E_DEV_ID_X722_VF_HV: > + hw->mac.type = I40E_MAC_X722_VF; > + break; > +#endif > case I40E_DEV_ID_VF: > case I40E_DEV_ID_VF_HV: > hw->mac.type = I40E_MAC_VF; > @@ -83,6 +98,212 @@ enum i40e_status_code i40e_set_mac_type( > } > > /** > + * i40e_aq_str - convert AQ err code to a string > + * @hw: pointer to the HW structure > + * @aq_err: the AQ error code to convert > + **/ > +char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err) > +{ > + switch (aq_err) { > + case I40E_AQ_RC_OK: > + return "OK"; > + case I40E_AQ_RC_EPERM: > + return "I40E_AQ_RC_EPERM"; > + case I40E_AQ_RC_ENOENT: > + return "I40E_AQ_RC_ENOENT"; > + case I40E_AQ_RC_ESRCH: > + return "I40E_AQ_RC_ESRCH"; > + case I40E_AQ_RC_EINTR: > + return "I40E_AQ_RC_EINTR"; > + case I40E_AQ_RC_EIO: > + return "I40E_AQ_RC_EIO"; > + case I40E_AQ_RC_ENXIO: > + return "I40E_AQ_RC_ENXIO"; > + case I40E_AQ_RC_E2BIG: > + return "I40E_AQ_RC_E2BIG"; > + case I40E_AQ_RC_EAGAIN: > + return "I40E_AQ_RC_EAGAIN"; > + case I40E_AQ_RC_ENOMEM: > + return "I40E_AQ_RC_ENOMEM"; > + case I40E_AQ_RC_EACCES: > + return "I40E_AQ_RC_EACCES"; > + case I40E_AQ_RC_EFAULT: > + return "I40E_AQ_RC_EFAULT"; > + case I40E_AQ_RC_EBUSY: > + return "I40E_AQ_RC_EBUSY"; > + case I40E_AQ_RC_EEXIST: > + return "I40E_AQ_RC_EEXIST"; > + case I40E_AQ_RC_EINVAL: > + return "I40E_AQ_RC_EINVAL"; > + case I40E_AQ_RC_ENOTTY: > + return "I40E_AQ_RC_ENOTTY"; > + case I40E_AQ_RC_ENOSPC: > + return "I40E_AQ_RC_ENOSPC"; > + case I40E_AQ_RC_ENOSYS: > + return "I40E_AQ_RC_ENOSYS"; > + case I40E_AQ_RC_ERANGE: > + return "I40E_AQ_RC_ERANGE"; > + case I40E_AQ_RC_EFLUSHED: > + return "I40E_AQ_RC_EFLUSHED"; > + case I40E_AQ_RC_BAD_ADDR: > + return "I40E_AQ_RC_BAD_ADDR"; > + case I40E_AQ_RC_EMODE: > + return "I40E_AQ_RC_EMODE"; > + case I40E_AQ_RC_EFBIG: > + return "I40E_AQ_RC_EFBIG"; > + } > + > + snprintf(hw->err_str, sizeof(hw->err_str), "%d", aq_err); > + return hw->err_str; > +} > + > +/** > + * i40e_stat_str - convert status err code to a string > + * @hw: pointer to the HW structure > + * @stat_err: the status error code to convert > + **/ > +char *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err) > +{ > + switch (stat_err) { > + case I40E_SUCCESS: > + return "OK"; > + case I40E_ERR_NVM: > + return "I40E_ERR_NVM"; > + case I40E_ERR_NVM_CHECKSUM: > + return "I40E_ERR_NVM_CHECKSUM"; > + case I40E_ERR_PHY: > + return "I40E_ERR_PHY"; > + case I40E_ERR_CONFIG: > + return "I40E_ERR_CONFIG"; > + case I40E_ERR_PARAM: > + return "I40E_ERR_PARAM"; > + case I40E_ERR_MAC_TYPE: > + return "I40E_ERR_MAC_TYPE"; > + case I40E_ERR_UNKNOWN_PHY: > + return "I40E_ERR_UNKNOWN_PHY"; > + case I40E_ERR_LINK_SETUP: > + return "I40E_ERR_LINK_SETUP"; > + case I40E_ERR_ADAPTER_STOPPED: > + return "I40E_ERR_ADAPTER_STOPPED"; > + case I40E_ERR_INVALID_MAC_ADDR: > + return "I40E_ERR_INVALID_MAC_ADDR"; > + case I40E_ERR_DEVICE_NOT_SUPPORTED: > + return "I40E_ERR_DEVICE_NOT_SUPPORTED"; > + case I40E_ERR_MASTER_REQUESTS_PENDING: > + return "I40E_ERR_MASTER_REQUESTS_PENDING"; > + case I40E_ERR_INVALID_LINK_SETTINGS: > + return "I40E_ERR_INVALID_LINK_SETTINGS"; > + case I40E_ERR_AUTONEG_NOT_COMPLETE: > + return "I40E_ERR_AUTONEG_NOT_COMPLETE"; > + case I40E_ERR_RESET_FAILED: > + return "I40E_ERR_RESET_FAILED"; > + case I40E_ERR_SWFW_SYNC: > + return "I40E_ERR_SWFW_SYNC"; > + case I40E_ERR_NO_AVAILABLE_VSI: > + return "I40E_ERR_NO_AVAILABLE_VSI"; > + case I40E_ERR_NO_MEMORY: > + return "I40E_ERR_NO_MEMORY"; > + case I40E_ERR_BAD_PTR: > + return "I40E_ERR_BAD_PTR"; > + case I40E_ERR_RING_FULL: > + return "I40E_ERR_RING_FULL"; > + case I40E_ERR_INVALID_PD_ID: > + return "I40E_ERR_INVALID_PD_ID"; > + case I40E_ERR_INVALID_QP_ID: > + return "I40E_ERR_INVALID_QP_ID"; > + case I40E_ERR_INVALID_CQ_ID: > + return "I40E_ERR_INVALID_CQ_ID"; > + case I40E_ERR_INVALID_CEQ_ID: > + return "I40E_ERR_INVALID_CEQ_ID"; > + case I40E_ERR_INVALID_AEQ_ID: > + return "I40E_ERR_INVALID_AEQ_ID"; > + case I40E_ERR_INVALID_SIZE: > + return "I40E_ERR_INVALID_SIZE"; > + case I40E_ERR_INVALID_ARP_INDEX: > + return "I40E_ERR_INVALID_ARP_INDEX"; > + case I40E_ERR_INVALID_FPM_FUNC_ID: > + return "I40E_ERR_INVALID_FPM_FUNC_ID"; > + case I40E_ERR_QP_INVALID_MSG_SIZE: > + return "I40E_ERR_QP_INVALID_MSG_SIZE"; > + case I40E_ERR_QP_TOOMANY_WRS_POSTED: > + return "I40E_ERR_QP_TOOMANY_WRS_POSTED"; > + case I40E_ERR_INVALID_FRAG_COUNT: > + return "I40E_ERR_INVALID_FRAG_COUNT"; > + case I40E_ERR_QUEUE_EMPTY: > + return "I40E_ERR_QUEUE_EMPTY"; > + case I40E_ERR_INVALID_ALIGNMENT: > + return "I40E_ERR_INVALID_ALIGNMENT"; > + case I40E_ERR_FLUSHED_QUEUE: > + return "I40E_ERR_FLUSHED_QUEUE"; > + case I40E_ERR_INVALID_PUSH_PAGE_INDEX: > + return "I40E_ERR_INVALID_PUSH_PAGE_INDEX"; > + case I40E_ERR_INVALID_IMM_DATA_SIZE: > + return "I40E_ERR_INVALID_IMM_DATA_SIZE"; > + case I40E_ERR_TIMEOUT: > + return "I40E_ERR_TIMEOUT"; > + case I40E_ERR_OPCODE_MISMATCH: > + return "I40E_ERR_OPCODE_MISMATCH"; > + case I40E_ERR_CQP_COMPL_ERROR: > + return "I40E_ERR_CQP_COMPL_ERROR"; > + case I40E_ERR_INVALID_VF_ID: > + return "I40E_ERR_INVALID_VF_ID"; > + case I40E_ERR_INVALID_HMCFN_ID: > + return "I40E_ERR_INVALID_HMCFN_ID"; > + case I40E_ERR_BACKING_PAGE_ERROR: > + return "I40E_ERR_BACKING_PAGE_ERROR"; > + case I40E_ERR_NO_PBLCHUNKS_AVAILABLE: > + return "I40E_ERR_NO_PBLCHUNKS_AVAILABLE"; > + case I40E_ERR_INVALID_PBLE_INDEX: > + return "I40E_ERR_INVALID_PBLE_INDEX"; > + case I40E_ERR_INVALID_SD_INDEX: > + return "I40E_ERR_INVALID_SD_INDEX"; > + case I40E_ERR_INVALID_PAGE_DESC_INDEX: > + return "I40E_ERR_INVALID_PAGE_DESC_INDEX"; > + case I40E_ERR_INVALID_SD_TYPE: > + return "I40E_ERR_INVALID_SD_TYPE"; > + case I40E_ERR_MEMCPY_FAILED: > + return "I40E_ERR_MEMCPY_FAILED"; > + case I40E_ERR_INVALID_HMC_OBJ_INDEX: > + return "I40E_ERR_INVALID_HMC_OBJ_INDEX"; > + case I40E_ERR_INVALID_HMC_OBJ_COUNT: > + return "I40E_ERR_INVALID_HMC_OBJ_COUNT"; > + case I40E_ERR_INVALID_SRQ_ARM_LIMIT: > + return "I40E_ERR_INVALID_SRQ_ARM_LIMIT"; > + case I40E_ERR_SRQ_ENABLED: > + return "I40E_ERR_SRQ_ENABLED"; > + case I40E_ERR_ADMIN_QUEUE_ERROR: > + return "I40E_ERR_ADMIN_QUEUE_ERROR"; > + case I40E_ERR_ADMIN_QUEUE_TIMEOUT: > + return "I40E_ERR_ADMIN_QUEUE_TIMEOUT"; > + case I40E_ERR_BUF_TOO_SHORT: > + return "I40E_ERR_BUF_TOO_SHORT"; > + case I40E_ERR_ADMIN_QUEUE_FULL: > + return "I40E_ERR_ADMIN_QUEUE_FULL"; > + case I40E_ERR_ADMIN_QUEUE_NO_WORK: > + return "I40E_ERR_ADMIN_QUEUE_NO_WORK"; > + case I40E_ERR_BAD_IWARP_CQE: > + return "I40E_ERR_BAD_IWARP_CQE"; > + case I40E_ERR_NVM_BLANK_MODE: > + return "I40E_ERR_NVM_BLANK_MODE"; > + case I40E_ERR_NOT_IMPLEMENTED: > + return "I40E_ERR_NOT_IMPLEMENTED"; > + case I40E_ERR_PE_DOORBELL_NOT_ENABLED: > + return "I40E_ERR_PE_DOORBELL_NOT_ENABLED"; > + case I40E_ERR_DIAG_TEST_FAILED: > + return "I40E_ERR_DIAG_TEST_FAILED"; > + case I40E_ERR_NOT_READY: > + return "I40E_ERR_NOT_READY"; > + case I40E_NOT_SUPPORTED: > + return "I40E_NOT_SUPPORTED"; > + case I40E_ERR_FIRMWARE_API_VERSION: > + return "I40E_ERR_FIRMWARE_API_VERSION"; > + } > + > + snprintf(hw->err_str, sizeof(hw->err_str), "%d", stat_err); > + return hw->err_str; > +} > + > +/** > * i40e_debug_aq > * @hw: debug mask related to admin queue > * @mask: debug mask > @@ -154,9 +375,13 @@ void i40e_debug_aq(struct i40e_hw *hw, e > bool i40e_check_asq_alive(struct i40e_hw *hw) > { > if (hw->aq.asq.len) > - return !!(rd32(hw, hw->aq.asq.len) & I40E_PF_ATQLEN_ATQENABLE_MASK); > - else > - return FALSE; > + if (!i40e_is_vf(hw)) > + return !!(rd32(hw, hw->aq.asq.len) & > + I40E_PF_ATQLEN_ATQENABLE_MASK); > + if (i40e_is_vf(hw)) > + return !!(rd32(hw, hw->aq.asq.len) & > + I40E_VF_ATQLEN1_ATQENABLE_MASK); > + return FALSE; > } > > /** > @@ -184,6 +409,171 @@ enum i40e_status_code i40e_aq_queue_shut > > return status; > } > +#ifdef X722_SUPPORT > + > +/** > + * i40e_aq_get_set_rss_lut > + * @hw: pointer to the hardware structure > + * @vsi_id: vsi fw index > + * @pf_lut: for PF table set TRUE, for VSI table set FALSE > + * @lut: pointer to the lut buffer provided by the caller > + * @lut_size: size of the lut buffer > + * @set: set TRUE to set the table, FALSE to get the table > + * > + * Internal function to get or set RSS look up table > + **/ > +static enum i40e_status_code i40e_aq_get_set_rss_lut(struct i40e_hw *hw, > + u16 vsi_id, bool pf_lut, > + u8 *lut, u16 lut_size, > + bool set) > +{ > + enum i40e_status_code status; > + struct i40e_aq_desc desc; > + struct i40e_aqc_get_set_rss_lut *cmd_resp = > + (struct i40e_aqc_get_set_rss_lut *)&desc.params.raw; > + > + if (set) > + i40e_fill_default_direct_cmd_desc(&desc, > + i40e_aqc_opc_set_rss_lut); > + else > + i40e_fill_default_direct_cmd_desc(&desc, > + i40e_aqc_opc_get_rss_lut); > + > + /* Indirect command */ > + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); > + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD); > + > + cmd_resp->vsi_id = > + CPU_TO_LE16((u16)((vsi_id << > + I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) & > + I40E_AQC_SET_RSS_LUT_VSI_ID_MASK)); > + cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_LUT_VSI_VALID); > + > + if (pf_lut) > + cmd_resp->flags |= CPU_TO_LE16((u16) > + ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF << > + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) & > + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK)); > + else > + cmd_resp->flags |= CPU_TO_LE16((u16) > + ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI << > + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) & > + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK)); > + > + cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)lut)); > + cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)lut)); > + > + status = i40e_asq_send_command(hw, &desc, lut, lut_size, NULL); > + > + return status; > +} > + > +/** > + * i40e_aq_get_rss_lut > + * @hw: pointer to the hardware structure > + * @vsi_id: vsi fw index > + * @pf_lut: for PF table set TRUE, for VSI table set FALSE > + * @lut: pointer to the lut buffer provided by the caller > + * @lut_size: size of the lut buffer > + * > + * get the RSS lookup table, PF or VSI type > + **/ > +enum i40e_status_code i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 vsi_id, > + bool pf_lut, u8 *lut, u16 lut_size) > +{ > + return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, > + FALSE); > +} > + > +/** > + * i40e_aq_set_rss_lut > + * @hw: pointer to the hardware structure > + * @vsi_id: vsi fw index > + * @pf_lut: for PF table set TRUE, for VSI table set FALSE > + * @lut: pointer to the lut buffer provided by the caller > + * @lut_size: size of the lut buffer > + * > + * set the RSS lookup table, PF or VSI type > + **/ > +enum i40e_status_code i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 vsi_id, > + bool pf_lut, u8 *lut, u16 lut_size) > +{ > + return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, TRUE); > +} > + > +/** > + * i40e_aq_get_set_rss_key > + * @hw: pointer to the hw struct > + * @vsi_id: vsi fw index > + * @key: pointer to key info struct > + * @set: set TRUE to set the key, FALSE to get the key > + * > + * get the RSS key per VSI > + **/ > +static enum i40e_status_code i40e_aq_get_set_rss_key(struct i40e_hw *hw, > + u16 vsi_id, > + struct i40e_aqc_get_set_rss_key_data *key, > + bool set) > +{ > + enum i40e_status_code status; > + struct i40e_aq_desc desc; > + struct i40e_aqc_get_set_rss_key *cmd_resp = > + (struct i40e_aqc_get_set_rss_key *)&desc.params.raw; > + u16 key_size = sizeof(struct i40e_aqc_get_set_rss_key_data); > + > + if (set) > + i40e_fill_default_direct_cmd_desc(&desc, > + i40e_aqc_opc_set_rss_key); > + else > + i40e_fill_default_direct_cmd_desc(&desc, > + i40e_aqc_opc_get_rss_key); > + > + /* Indirect command */ > + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); > + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD); > + > + cmd_resp->vsi_id = > + CPU_TO_LE16((u16)((vsi_id << > + I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) & > + I40E_AQC_SET_RSS_KEY_VSI_ID_MASK)); > + cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_KEY_VSI_VALID); > + cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)key)); > + cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)key)); > + > + status = i40e_asq_send_command(hw, &desc, key, key_size, NULL); > + > + return status; > +} > + > +/** > + * i40e_aq_get_rss_key > + * @hw: pointer to the hw struct > + * @vsi_id: vsi fw index > + * @key: pointer to key info struct > + * > + **/ > +enum i40e_status_code i40e_aq_get_rss_key(struct i40e_hw *hw, > + u16 vsi_id, > + struct i40e_aqc_get_set_rss_key_data *key) > +{ > + return i40e_aq_get_set_rss_key(hw, vsi_id, key, FALSE); > +} > + > +/** > + * i40e_aq_set_rss_key > + * @hw: pointer to the hw struct > + * @vsi_id: vsi fw index > + * @key: pointer to key info struct > + * > + * set the RSS key per VSI > + **/ > +enum i40e_status_code i40e_aq_set_rss_key(struct i40e_hw *hw, > + u16 vsi_id, > + struct i40e_aqc_get_set_rss_key_data *key) > +{ > + return i40e_aq_get_set_rss_key(hw, vsi_id, key, TRUE); > +} > +#endif /* X722_SUPPORT */ > > /* The i40e_ptype_lookup table is used to convert from the 8-bit ptype in the > * hardware to a bit-field that can be used by SW to more easily determine the > @@ -598,6 +988,9 @@ enum i40e_status_code i40e_init_shared_c > > switch (hw->mac.type) { > case I40E_MAC_XL710: > +#ifdef X722_SUPPORT > + case I40E_MAC_X722: > +#endif > break; > default: > return I40E_ERR_DEVICE_NOT_SUPPORTED; > @@ -888,7 +1281,7 @@ enum i40e_status_code i40e_pf_reset(stru > grst_del = (rd32(hw, I40E_GLGEN_RSTCTL) & > I40E_GLGEN_RSTCTL_GRSTDEL_MASK) >> > I40E_GLGEN_RSTCTL_GRSTDEL_SHIFT; > - for (cnt = 0; cnt < grst_del + 2; cnt++) { > + for (cnt = 0; cnt < grst_del + 10; cnt++) { > reg = rd32(hw, I40E_GLGEN_RSTAT); > if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK)) > break; > @@ -1108,9 +1501,11 @@ u32 i40e_led_get(struct i40e_hw *hw) > if (!gpio_val) > continue; > > - /* ignore gpio LED src mode entries related to the activity LEDs */ > - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> > - I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); > + /* ignore gpio LED src mode entries related to the activity > + * LEDs > + */ > + current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) > + >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); > switch (current_mode) { > case I40E_COMBINED_ACTIVITY: > case I40E_FILTER_ACTIVITY: > @@ -1154,9 +1549,11 @@ void i40e_led_set(struct i40e_hw *hw, u3 > if (!gpio_val) > continue; > > - /* ignore gpio LED src mode entries related to the activity LEDs */ > - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> > - I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); > + /* ignore gpio LED src mode entries related to the activity > + * LEDs > + */ > + current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) > + >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); > switch (current_mode) { > case I40E_COMBINED_ACTIVITY: > case I40E_FILTER_ACTIVITY: > @@ -1175,9 +1572,9 @@ void i40e_led_set(struct i40e_hw *hw, u3 > blink = FALSE; > > if (blink) > - gpio_val |= (1 << I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); > + gpio_val |= BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); > else > - gpio_val &= ~(1 << I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); > + gpio_val &= ~BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); > > wr32(hw, I40E_GLGEN_GPIO_CTL(i), gpio_val); > break; > @@ -1329,14 +1726,14 @@ enum i40e_status_code i40e_set_fc(struct > *aq_failures |= I40E_SET_FC_AQ_FAIL_SET; > } > /* Update the link info */ > - status = i40e_aq_get_link_info(hw, TRUE, NULL, NULL); > + status = i40e_update_link_info(hw); > if (status) { > /* Wait a little bit (on 40G cards it sometimes takes a really > * long time for link to come back from the atomic reset) > * and try once more > */ > i40e_msec_delay(1000); > - status = i40e_aq_get_link_info(hw, TRUE, NULL, NULL); > + status = i40e_update_link_info(hw); > } > if (status) > *aq_failures |= I40E_SET_FC_AQ_FAIL_UPDATE; > @@ -1525,7 +1922,6 @@ aq_get_link_info_exit: > return status; > } > > - > /** > * i40e_aq_set_phy_int_mask > * @hw: pointer to the hw struct > @@ -1837,6 +2233,74 @@ enum i40e_status_code i40e_aq_set_vsi_mu > } > > /** > + * i40e_aq_set_vsi_mc_promisc_on_vlan > + * @hw: pointer to the hw struct > + * @seid: vsi number > + * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN > + * @vid: The VLAN tag filter - capture any multicast packet with this VLAN tag > + * @cmd_details: pointer to command details structure or NULL > + **/ > +enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw, > + u16 seid, bool enable, u16 vid, > + struct i40e_asq_cmd_details *cmd_details) > +{ > + struct i40e_aq_desc desc; > + struct i40e_aqc_set_vsi_promiscuous_modes *cmd = > + (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; > + enum i40e_status_code status; > + u16 flags = 0; > + > + i40e_fill_default_direct_cmd_desc(&desc, > + i40e_aqc_opc_set_vsi_promiscuous_modes); > + > + if (enable) > + flags |= I40E_AQC_SET_VSI_PROMISC_MULTICAST; > + > + cmd->promiscuous_flags = CPU_TO_LE16(flags); > + cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_MULTICAST); > + cmd->seid = CPU_TO_LE16(seid); > + cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); > + > + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); > + > + return status; > +} > + > +/** > + * i40e_aq_set_vsi_uc_promisc_on_vlan > + * @hw: pointer to the hw struct > + * @seid: vsi number > + * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN > + * @vid: The VLAN tag filter - capture any unicast packet with this VLAN tag > + * @cmd_details: pointer to command details structure or NULL > + **/ > +enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, > + u16 seid, bool enable, u16 vid, > + struct i40e_asq_cmd_details *cmd_details) > +{ > + struct i40e_aq_desc desc; > + struct i40e_aqc_set_vsi_promiscuous_modes *cmd = > + (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; > + enum i40e_status_code status; > + u16 flags = 0; > + > + i40e_fill_default_direct_cmd_desc(&desc, > + i40e_aqc_opc_set_vsi_promiscuous_modes); > + > + if (enable) > + flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; > + > + cmd->promiscuous_flags = CPU_TO_LE16(flags); > + cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); > + cmd->seid = CPU_TO_LE16(seid); > + cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); > + > + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); > + > + return status; > +} > + > +/** > * i40e_aq_set_vsi_broadcast > * @hw: pointer to the hw struct > * @seid: vsi number > @@ -2067,30 +2531,56 @@ enum i40e_status_code i40e_aq_send_drive > /** > * i40e_get_link_status - get status of the HW network link > * @hw: pointer to the hw struct > + * @link_up: pointer to bool (TRUE/FALSE = linkup/linkdown) > * > - * Returns TRUE if link is up, FALSE if link is down. > + * Variable link_up TRUE if link is up, FALSE if link is down. > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@FreeBSD.ORG Fri Jun 5 23:19:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E665D71; Fri, 5 Jun 2015 23:19:48 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::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 542BD1EEB; Fri, 5 Jun 2015 23:19:47 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: by wifx6 with SMTP id x6so34422514wif.0; Fri, 05 Jun 2015 16:19:45 -0700 (PDT) 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=1xNbOTciITc741PY8HxaooCxL+4sgHmth+48OVBmRbs=; b=k9sww2uEwA9PFVQlM7i9wTLe8i2vvPdELryx6P8u2MapES5oMHPn7VFsBVj+De0v3l Ui8hgQ1T45gbMlmSpBVld9il77+VWnvNdIFw+N1WiojJDFg3yjWAOJNRAHBeFEUVznfz cDYqWYyvt/JGBDRyuLqjN4ilmZjYZv9SUm2ox0qGj89AEi46U7IA74dCHFaLVKss8N8U 9RKX0CNqpHUaWjKxL4WZWXe9GY0ZCfzy9PFl45clQZmnN8Z8C+iPpnb2A+P2RY4/kWMY k43W7Wohk/9zz+uc97e0AHLamhBrDxTOi4yNF+7kpKY8IlW2qEYinyOMeP5Dd/30I/1Z 1AyQ== MIME-Version: 1.0 X-Received: by 10.180.91.40 with SMTP id cb8mr999148wib.64.1433546385774; Fri, 05 Jun 2015 16:19:45 -0700 (PDT) Received: by 10.194.162.8 with HTTP; Fri, 5 Jun 2015 16:19:45 -0700 (PDT) In-Reply-To: References: <201506052252.t55MqgOT000856@svn.freebsd.org> Date: Fri, 5 Jun 2015 16:19:45 -0700 Message-ID: Subject: Re: svn commit: r284049 - in head/sys: dev/ixl modules/ixl modules/ixlv From: Jack Vogel To: Adrian Chadd Cc: Jack F Vogel , "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: Fri, 05 Jun 2015 23:19:48 -0000 Well, you know me don't you :) Larger customers will have some kind of field engineer to contact, but if anyone here, ahem, doesn't you can work with me to get what you need. Cheers, Jack On Fri, Jun 5, 2015 at 4:07 PM, Adrian Chadd wrote: > Hi! > > Is there any public information / firmware on this? Or do we have to > have some commercial arrangement with Intel to get the updated > firmware? > > My support channel is "whoever gave me the two ixv 40g nics to test > netmap on soon" and I don't think they have firmware. :) > > Thanks, > > > > -adrian > > > On 5 June 2015 at 15:52, Jack F Vogel wrote: > > Author: jfv > > Date: Fri Jun 5 22:52:42 2015 > > New Revision: 284049 > > URL: https://svnweb.freebsd.org/changeset/base/284049 > > > > Log: > > Update SW4 to the Intel ixl/ixlv drivers. This is primarily a shared > > code update, with supporting changes in the CORE. Changes for the > extended > > media types, VF driver has virtual channel protocol changes, and some > > register use corrections. This software change should be coordinated > with > > Firmware updates to your hardware, contact your support channels for > that. > > > > MFC after: 1 week > > > > Added: > > head/sys/dev/ixl/i40e_devids.h (contents, props changed) > > Modified: > > head/sys/dev/ixl/i40e_adminq.c > > head/sys/dev/ixl/i40e_adminq.h > > head/sys/dev/ixl/i40e_adminq_cmd.h > > head/sys/dev/ixl/i40e_common.c > > head/sys/dev/ixl/i40e_hmc.c > > head/sys/dev/ixl/i40e_hmc.h > > head/sys/dev/ixl/i40e_lan_hmc.c > > head/sys/dev/ixl/i40e_nvm.c > > head/sys/dev/ixl/i40e_osdep.h > > head/sys/dev/ixl/i40e_prototype.h > > head/sys/dev/ixl/i40e_register.h > > head/sys/dev/ixl/i40e_type.h > > head/sys/dev/ixl/i40e_virtchnl.h > > head/sys/dev/ixl/if_ixl.c > > head/sys/dev/ixl/if_ixlv.c > > head/sys/dev/ixl/ixlv.h > > head/sys/dev/ixl/ixlvc.c > > head/sys/modules/ixl/Makefile > > head/sys/modules/ixlv/Makefile > > > > Modified: head/sys/dev/ixl/i40e_adminq.c > > > ============================================================================== > > --- head/sys/dev/ixl/i40e_adminq.c Fri Jun 5 21:45:35 2015 > (r284048) > > +++ head/sys/dev/ixl/i40e_adminq.c Fri Jun 5 22:52:42 2015 > (r284049) > > @@ -315,8 +315,12 @@ static enum i40e_status_code i40e_config > > wr32(hw, hw->aq.asq.tail, 0); > > > > /* set starting point */ > > - wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries | > > - I40E_PF_ATQLEN_ATQENABLE_MASK)); > > + if (!i40e_is_vf(hw)) > > + wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries | > > + > I40E_PF_ATQLEN_ATQENABLE_MASK)); > > + if (i40e_is_vf(hw)) > > + wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries | > > + > I40E_VF_ATQLEN1_ATQENABLE_MASK)); > > wr32(hw, hw->aq.asq.bal, I40E_LO_DWORD(hw->aq.asq.desc_buf.pa)); > > wr32(hw, hw->aq.asq.bah, I40E_HI_DWORD(hw->aq.asq.desc_buf.pa)); > > > > @@ -344,8 +348,12 @@ static enum i40e_status_code i40e_config > > wr32(hw, hw->aq.arq.tail, 0); > > > > /* set starting point */ > > - wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries | > > - I40E_PF_ARQLEN_ARQENABLE_MASK)); > > + if (!i40e_is_vf(hw)) > > + wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries | > > + > I40E_PF_ARQLEN_ARQENABLE_MASK)); > > + if (i40e_is_vf(hw)) > > + wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries | > > + > I40E_VF_ARQLEN1_ARQENABLE_MASK)); > > wr32(hw, hw->aq.arq.bal, I40E_LO_DWORD(hw->aq.arq.desc_buf.pa)); > > wr32(hw, hw->aq.arq.bah, I40E_HI_DWORD(hw->aq.arq.desc_buf.pa)); > > > > @@ -559,6 +567,7 @@ enum i40e_status_code i40e_init_adminq(s > > { > > enum i40e_status_code ret_code; > > u16 eetrack_lo, eetrack_hi; > > + u16 cfg_ptr, oem_hi, oem_lo; > > int retry = 0; > > /* verify input for valid configuration */ > > if ((hw->aq.num_arq_entries == 0) || > > @@ -619,6 +628,12 @@ enum i40e_status_code i40e_init_adminq(s > > i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_LO, &eetrack_lo); > > i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_HI, &eetrack_hi); > > hw->nvm.eetrack = (eetrack_hi << 16) | eetrack_lo; > > + i40e_read_nvm_word(hw, I40E_SR_BOOT_CONFIG_PTR, &cfg_ptr); > > + i40e_read_nvm_word(hw, (cfg_ptr + I40E_NVM_OEM_VER_OFF), > > + &oem_hi); > > + i40e_read_nvm_word(hw, (cfg_ptr + (I40E_NVM_OEM_VER_OFF + 1)), > > + &oem_lo); > > + hw->nvm.oem_ver = ((u32)oem_hi << 16) | oem_lo; > > > > if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) { > > ret_code = I40E_ERR_FIRMWARE_API_VERSION; > > @@ -669,6 +684,9 @@ enum i40e_status_code i40e_shutdown_admi > > i40e_destroy_spinlock(&hw->aq.asq_spinlock); > > i40e_destroy_spinlock(&hw->aq.arq_spinlock); > > > > + if (hw->nvm_buff.va) > > + i40e_free_virt_mem(hw, &hw->nvm_buff); > > + > > return ret_code; > > } > > > > @@ -688,16 +706,16 @@ u16 i40e_clean_asq(struct i40e_hw *hw) > > > > desc = I40E_ADMINQ_DESC(*asq, ntc); > > details = I40E_ADMINQ_DETAILS(*asq, ntc); > > + > > while (rd32(hw, hw->aq.asq.head) != ntc) { > > i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, > > - "%s: ntc %d head %d.\n", __FUNCTION__, ntc, > > - rd32(hw, hw->aq.asq.head)); > > + "ntc %d head %d.\n", ntc, rd32(hw, > hw->aq.asq.head)); > > > > if (details->callback) { > > I40E_ADMINQ_CALLBACK cb_func = > > > (I40E_ADMINQ_CALLBACK)details->callback; > > - i40e_memcpy(&desc_cb, desc, > > - sizeof(struct i40e_aq_desc), > I40E_DMA_TO_DMA); > > + i40e_memcpy(&desc_cb, desc, sizeof(struct > i40e_aq_desc), > > + I40E_DMA_TO_DMA); > > cb_func(hw, &desc_cb); > > } > > i40e_memset(desc, 0, sizeof(*desc), I40E_DMA_MEM); > > @@ -755,6 +773,8 @@ enum i40e_status_code i40e_asq_send_comm > > u16 retval = 0; > > u32 val = 0; > > > > + hw->aq.asq_last_status = I40E_AQ_RC_OK; > > + > > val = rd32(hw, hw->aq.asq.head); > > if (val >= hw->aq.num_asq_entries) { > > i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, > > @@ -912,6 +932,11 @@ enum i40e_status_code i40e_asq_send_comm > > "AQTX: desc and buffer writeback:\n"); > > i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff, > buff_size); > > > > + /* save writeback aq if requested */ > > + if (details->wb_desc) > > + i40e_memcpy(details->wb_desc, desc_on_ring, > > + sizeof(struct i40e_aq_desc), > I40E_DMA_TO_NONDMA); > > + > > /* update the error if time out occurred */ > > if ((!cmd_completed) && > > (!details->async && !details->postpone)) { > > @@ -971,7 +996,10 @@ enum i40e_status_code i40e_clean_arq_ele > > i40e_acquire_spinlock(&hw->aq.arq_spinlock); > > > > /* set next_to_use to head */ > > - ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK); > > + if (!i40e_is_vf(hw)) > > + ntu = (rd32(hw, hw->aq.arq.head) & > I40E_PF_ARQH_ARQH_MASK); > > + if (i40e_is_vf(hw)) > > + ntu = (rd32(hw, hw->aq.arq.head) & > I40E_VF_ARQH1_ARQH_MASK); > > if (ntu == ntc) { > > /* nothing to do - shouldn't need to update ring's > values */ > > ret_code = I40E_ERR_ADMIN_QUEUE_NO_WORK; > > @@ -1040,6 +1068,19 @@ clean_arq_element_out: > > i40e_release_nvm(hw); > > hw->aq.nvm_release_on_done = FALSE; > > } > > + > > + switch (hw->nvmupd_state) { > > + case I40E_NVMUPD_STATE_INIT_WAIT: > > + hw->nvmupd_state = I40E_NVMUPD_STATE_INIT; > > + break; > > + > > + case I40E_NVMUPD_STATE_WRITE_WAIT: > > + hw->nvmupd_state = I40E_NVMUPD_STATE_WRITING; > > + break; > > + > > + default: > > + break; > > + } > > } > > > > return ret_code; > > @@ -1051,9 +1092,6 @@ void i40e_resume_aq(struct i40e_hw *hw) > > hw->aq.asq.next_to_use = 0; > > hw->aq.asq.next_to_clean = 0; > > > > -#if (I40E_VF_ATQLEN_ATQENABLE_MASK != I40E_PF_ATQLEN_ATQENABLE_MASK) > > -#error I40E_VF_ATQLEN_ATQENABLE_MASK != I40E_PF_ATQLEN_ATQENABLE_MASK > > -#endif > > i40e_config_asq_regs(hw); > > > > hw->aq.arq.next_to_use = 0; > > > > Modified: head/sys/dev/ixl/i40e_adminq.h > > > ============================================================================== > > --- head/sys/dev/ixl/i40e_adminq.h Fri Jun 5 21:45:35 2015 > (r284048) > > +++ head/sys/dev/ixl/i40e_adminq.h Fri Jun 5 22:52:42 2015 > (r284049) > > @@ -1,6 +1,6 @@ > > > /****************************************************************************** > > > > - Copyright (c) 2013-2014, Intel Corporation > > + Copyright (c) 2013-2015, Intel Corporation > > All rights reserved. > > > > Redistribution and use in source and binary forms, with or without > > @@ -77,6 +77,7 @@ struct i40e_asq_cmd_details { > > u16 flags_dis; > > bool async; > > bool postpone; > > + struct i40e_aq_desc *wb_desc; > > }; > > > > #define I40E_ADMINQ_DETAILS(R, i) \ > > > > Modified: head/sys/dev/ixl/i40e_adminq_cmd.h > > > ============================================================================== > > --- head/sys/dev/ixl/i40e_adminq_cmd.h Fri Jun 5 21:45:35 2015 > (r284048) > > +++ head/sys/dev/ixl/i40e_adminq_cmd.h Fri Jun 5 22:52:42 2015 > (r284049) > > @@ -42,7 +42,11 @@ > > */ > > > > #define I40E_FW_API_VERSION_MAJOR 0x0001 > > -#define I40E_FW_API_VERSION_MINOR 0x0002 > > +#ifdef X722_SUPPORT > > +#define I40E_FW_API_VERSION_MINOR 0x0003 > > +#else > > +#define I40E_FW_API_VERSION_MINOR 0x0004 > > +#endif > > > > struct i40e_aq_desc { > > __le16 flags; > > @@ -140,12 +144,7 @@ enum i40e_admin_queue_opc { > > i40e_aqc_opc_list_func_capabilities = 0x000A, > > i40e_aqc_opc_list_dev_capabilities = 0x000B, > > > > - i40e_aqc_opc_set_cppm_configuration = 0x0103, > > - i40e_aqc_opc_set_arp_proxy_entry = 0x0104, > > - i40e_aqc_opc_set_ns_proxy_entry = 0x0105, > > - > > /* LAA */ > > - i40e_aqc_opc_mng_laa = 0x0106, /* AQ obsolete */ > > i40e_aqc_opc_mac_address_read = 0x0107, > > i40e_aqc_opc_mac_address_write = 0x0108, > > > > @@ -240,6 +239,7 @@ enum i40e_admin_queue_opc { > > i40e_aqc_opc_nvm_update = 0x0703, > > i40e_aqc_opc_nvm_config_read = 0x0704, > > i40e_aqc_opc_nvm_config_write = 0x0705, > > + i40e_aqc_opc_oem_post_update = 0x0720, > > > > /* virtualization commands */ > > i40e_aqc_opc_send_msg_to_pf = 0x0801, > > @@ -270,7 +270,12 @@ enum i40e_admin_queue_opc { > > /* Tunnel commands */ > > i40e_aqc_opc_add_udp_tunnel = 0x0B00, > > i40e_aqc_opc_del_udp_tunnel = 0x0B01, > > - i40e_aqc_opc_tunnel_key_structure = 0x0B10, > > +#ifdef X722_SUPPORT > > + i40e_aqc_opc_set_rss_key = 0x0B02, > > + i40e_aqc_opc_set_rss_lut = 0x0B03, > > + i40e_aqc_opc_get_rss_key = 0x0B04, > > + i40e_aqc_opc_get_rss_lut = 0x0B05, > > +#endif > > > > /* Async Events */ > > i40e_aqc_opc_event_lan_overflow = 0x1001, > > @@ -282,8 +287,6 @@ enum i40e_admin_queue_opc { > > i40e_aqc_opc_oem_ocbb_initialize = 0xFE03, > > > > /* debug commands */ > > - i40e_aqc_opc_debug_get_deviceid = 0xFF00, > > - i40e_aqc_opc_debug_set_mode = 0xFF01, > > i40e_aqc_opc_debug_read_reg = 0xFF03, > > i40e_aqc_opc_debug_write_reg = 0xFF04, > > i40e_aqc_opc_debug_modify_reg = 0xFF07, > > @@ -517,7 +520,8 @@ struct i40e_aqc_mac_address_read { > > #define I40E_AQC_SAN_ADDR_VALID 0x20 > > #define I40E_AQC_PORT_ADDR_VALID 0x40 > > #define I40E_AQC_WOL_ADDR_VALID 0x80 > > -#define I40E_AQC_ADDR_VALID_MASK 0xf0 > > +#define I40E_AQC_MC_MAG_EN_VALID 0x100 > > +#define I40E_AQC_ADDR_VALID_MASK 0x1F0 > > u8 reserved[6]; > > __le32 addr_high; > > __le32 addr_low; > > @@ -540,7 +544,9 @@ struct i40e_aqc_mac_address_write { > > #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x0000 > > #define I40E_AQC_WRITE_TYPE_LAA_WOL 0x4000 > > #define I40E_AQC_WRITE_TYPE_PORT 0x8000 > > -#define I40E_AQC_WRITE_TYPE_MASK 0xc000 > > +#define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000 > > +#define I40E_AQC_WRITE_TYPE_MASK 0xC000 > > + > > __le16 mac_sah; > > __le32 mac_sal; > > u8 reserved[8]; > > @@ -834,8 +840,16 @@ struct i40e_aqc_vsi_properties_data { > > I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT) > > /* queueing option section */ > > u8 queueing_opt_flags; > > +#ifdef X722_SUPPORT > > +#define I40E_AQ_VSI_QUE_OPT_MULTICAST_UDP_ENA 0x04 > > +#define I40E_AQ_VSI_QUE_OPT_UNICAST_UDP_ENA 0x08 > > +#endif > > #define I40E_AQ_VSI_QUE_OPT_TCP_ENA 0x10 > > #define I40E_AQ_VSI_QUE_OPT_FCOE_ENA 0x20 > > +#ifdef X722_SUPPORT > > +#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_PF 0x00 > > +#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_VSI 0x40 > > +#endif > > u8 queueing_opt_reserved[3]; > > /* scheduler section */ > > u8 up_enable_bits; > > @@ -1076,6 +1090,7 @@ struct i40e_aqc_set_vsi_promiscuous_mode > > __le16 seid; > > #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF > > __le16 vlan_tag; > > +#define I40E_AQC_SET_VSI_VLAN_MASK 0x0FFF > > #define I40E_AQC_SET_VSI_VLAN_VALID 0x8000 > > u8 reserved[8]; > > }; > > @@ -1725,11 +1740,13 @@ struct i40e_aqc_get_link_status { > > u8 phy_type; /* i40e_aq_phy_type */ > > u8 link_speed; /* i40e_aq_link_speed */ > > u8 link_info; > > -#define I40E_AQ_LINK_UP 0x01 > > +#define I40E_AQ_LINK_UP 0x01 /* obsolete */ > > +#define I40E_AQ_LINK_UP_FUNCTION 0x01 > > #define I40E_AQ_LINK_FAULT 0x02 > > #define I40E_AQ_LINK_FAULT_TX 0x04 > > #define I40E_AQ_LINK_FAULT_RX 0x08 > > #define I40E_AQ_LINK_FAULT_REMOTE 0x10 > > +#define I40E_AQ_LINK_UP_PORT 0x20 > > #define I40E_AQ_MEDIA_AVAILABLE 0x40 > > #define I40E_AQ_SIGNAL_DETECT 0x80 > > u8 an_info; > > @@ -1891,6 +1908,26 @@ struct i40e_aqc_nvm_config_data_immediat > > > > I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field); > > > > +/* OEM Post Update (indirect 0x0720) > > + * no command data struct used > > + */ > > + struct i40e_aqc_nvm_oem_post_update { > > +#define I40E_AQ_NVM_OEM_POST_UPDATE_EXTERNAL_DATA 0x01 > > + u8 sel_data; > > + u8 reserved[7]; > > +}; > > + > > +I40E_CHECK_STRUCT_LEN(0x8, i40e_aqc_nvm_oem_post_update); > > + > > +struct i40e_aqc_nvm_oem_post_update_buffer { > > + u8 str_len; > > + u8 dev_addr; > > + __le16 eeprom_addr; > > + u8 data[36]; > > +}; > > + > > +I40E_CHECK_STRUCT_LEN(0x28, i40e_aqc_nvm_oem_post_update_buffer); > > + > > /* Send to PF command (indirect 0x0801) id is only used by PF > > * Send to VF command (indirect 0x0802) id is only used by PF > > * Send to Peer PF command (indirect 0x0803) > > @@ -2064,12 +2101,28 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_star > > #define I40E_AQC_CEE_APP_ISCSI_MASK (0x7 << > I40E_AQC_CEE_APP_ISCSI_SHIFT) > > #define I40E_AQC_CEE_APP_FIP_SHIFT 0x8 > > #define I40E_AQC_CEE_APP_FIP_MASK (0x7 << > I40E_AQC_CEE_APP_FIP_SHIFT) > > + > > #define I40E_AQC_CEE_PG_STATUS_SHIFT 0x0 > > #define I40E_AQC_CEE_PG_STATUS_MASK (0x7 << > I40E_AQC_CEE_PG_STATUS_SHIFT) > > #define I40E_AQC_CEE_PFC_STATUS_SHIFT 0x3 > > #define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 << > I40E_AQC_CEE_PFC_STATUS_SHIFT) > > #define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8 > > #define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << > I40E_AQC_CEE_APP_STATUS_SHIFT) > > +#define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8 > > +#define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 << > I40E_AQC_CEE_FCOE_STATUS_SHIFT) > > +#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT 0xB > > +#define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 << > I40E_AQC_CEE_ISCSI_STATUS_SHIFT) > > +#define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10 > > +#define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 << > I40E_AQC_CEE_FIP_STATUS_SHIFT) > > + > > +/* struct i40e_aqc_get_cee_dcb_cfg_v1_resp was originally defined with > > + * word boundary layout issues, which the Linux compilers silently deal > > + * with by adding padding, making the actual struct larger than > designed. > > + * However, the FW compiler for the NIC is less lenient and complains > > + * about the struct. Hence, the struct defined here has an extra byte > in > > + * fields reserved3 and reserved4 to directly acknowledge that padding, > > + * and the new length is used in the length check macro. > > + */ > > struct i40e_aqc_get_cee_dcb_cfg_v1_resp { > > u8 reserved1; > > u8 oper_num_tc; > > @@ -2077,9 +2130,9 @@ struct i40e_aqc_get_cee_dcb_cfg_v1_resp > > u8 reserved2; > > u8 oper_tc_bw[8]; > > u8 oper_pfc_en; > > - u8 reserved3; > > + u8 reserved3[2]; > > __le16 oper_app_prio; > > - u8 reserved4; > > + u8 reserved4[2]; > > __le16 tlv_status; > > }; > > > > @@ -2168,6 +2221,48 @@ struct i40e_aqc_del_udp_tunnel_completio > > }; > > > > I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion); > > +#ifdef X722_SUPPORT > > + > > +struct i40e_aqc_get_set_rss_key { > > +#define I40E_AQC_SET_RSS_KEY_VSI_VALID (0x1 << 15) > > +#define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT 0 > > +#define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK (0x3FF << \ > > + > I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) > > + __le16 vsi_id; > > + u8 reserved[6]; > > + __le32 addr_high; > > + __le32 addr_low; > > +}; > > + > > +I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_key); > > + > > +struct i40e_aqc_get_set_rss_key_data { > > + u8 standard_rss_key[0x28]; > > + u8 extended_hash_key[0xc]; > > +}; > > + > > +I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data); > > + > > +struct i40e_aqc_get_set_rss_lut { > > +#define I40E_AQC_SET_RSS_LUT_VSI_VALID (0x1 << 15) > > +#define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT 0 > > +#define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK (0x3FF << \ > > + > I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) > > + __le16 vsi_id; > > +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT 0 > > +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK (0x1 << \ > > + > I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) > > + > > +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI 0 > > +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF 1 > > + __le16 flags; > > + u8 reserved[4]; > > + __le32 addr_high; > > + __le32 addr_low; > > +}; > > + > > +I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_lut); > > +#endif > > > > /* tunnel key structure 0x0B10 */ > > > > > > Modified: head/sys/dev/ixl/i40e_common.c > > > ============================================================================== > > --- head/sys/dev/ixl/i40e_common.c Fri Jun 5 21:45:35 2015 > (r284048) > > +++ head/sys/dev/ixl/i40e_common.c Fri Jun 5 22:52:42 2015 > (r284049) > > @@ -62,9 +62,24 @@ enum i40e_status_code i40e_set_mac_type( > > case I40E_DEV_ID_QSFP_B: > > case I40E_DEV_ID_QSFP_C: > > case I40E_DEV_ID_10G_BASE_T: > > + case I40E_DEV_ID_10G_BASE_T4: > > case I40E_DEV_ID_20G_KR2: > > + case I40E_DEV_ID_20G_KR2_A: > > hw->mac.type = I40E_MAC_XL710; > > break; > > +#ifdef X722_SUPPORT > > + case I40E_DEV_ID_SFP_X722: > > + case I40E_DEV_ID_1G_BASE_T_X722: > > + case I40E_DEV_ID_10G_BASE_T_X722: > > + hw->mac.type = I40E_MAC_X722; > > + break; > > +#endif > > +#ifdef X722_SUPPORT > > + case I40E_DEV_ID_X722_VF: > > + case I40E_DEV_ID_X722_VF_HV: > > + hw->mac.type = I40E_MAC_X722_VF; > > + break; > > +#endif > > case I40E_DEV_ID_VF: > > case I40E_DEV_ID_VF_HV: > > hw->mac.type = I40E_MAC_VF; > > @@ -83,6 +98,212 @@ enum i40e_status_code i40e_set_mac_type( > > } > > > > /** > > + * i40e_aq_str - convert AQ err code to a string > > + * @hw: pointer to the HW structure > > + * @aq_err: the AQ error code to convert > > + **/ > > +char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err) > > +{ > > + switch (aq_err) { > > + case I40E_AQ_RC_OK: > > + return "OK"; > > + case I40E_AQ_RC_EPERM: > > + return "I40E_AQ_RC_EPERM"; > > + case I40E_AQ_RC_ENOENT: > > + return "I40E_AQ_RC_ENOENT"; > > + case I40E_AQ_RC_ESRCH: > > + return "I40E_AQ_RC_ESRCH"; > > + case I40E_AQ_RC_EINTR: > > + return "I40E_AQ_RC_EINTR"; > > + case I40E_AQ_RC_EIO: > > + return "I40E_AQ_RC_EIO"; > > + case I40E_AQ_RC_ENXIO: > > + return "I40E_AQ_RC_ENXIO"; > > + case I40E_AQ_RC_E2BIG: > > + return "I40E_AQ_RC_E2BIG"; > > + case I40E_AQ_RC_EAGAIN: > > + return "I40E_AQ_RC_EAGAIN"; > > + case I40E_AQ_RC_ENOMEM: > > + return "I40E_AQ_RC_ENOMEM"; > > + case I40E_AQ_RC_EACCES: > > + return "I40E_AQ_RC_EACCES"; > > + case I40E_AQ_RC_EFAULT: > > + return "I40E_AQ_RC_EFAULT"; > > + case I40E_AQ_RC_EBUSY: > > + return "I40E_AQ_RC_EBUSY"; > > + case I40E_AQ_RC_EEXIST: > > + return "I40E_AQ_RC_EEXIST"; > > + case I40E_AQ_RC_EINVAL: > > + return "I40E_AQ_RC_EINVAL"; > > + case I40E_AQ_RC_ENOTTY: > > + return "I40E_AQ_RC_ENOTTY"; > > + case I40E_AQ_RC_ENOSPC: > > + return "I40E_AQ_RC_ENOSPC"; > > + case I40E_AQ_RC_ENOSYS: > > + return "I40E_AQ_RC_ENOSYS"; > > + case I40E_AQ_RC_ERANGE: > > + return "I40E_AQ_RC_ERANGE"; > > + case I40E_AQ_RC_EFLUSHED: > > + return "I40E_AQ_RC_EFLUSHED"; > > + case I40E_AQ_RC_BAD_ADDR: > > + return "I40E_AQ_RC_BAD_ADDR"; > > + case I40E_AQ_RC_EMODE: > > + return "I40E_AQ_RC_EMODE"; > > + case I40E_AQ_RC_EFBIG: > > + return "I40E_AQ_RC_EFBIG"; > > + } > > + > > + snprintf(hw->err_str, sizeof(hw->err_str), "%d", aq_err); > > + return hw->err_str; > > +} > > + > > +/** > > + * i40e_stat_str - convert status err code to a string > > + * @hw: pointer to the HW structure > > + * @stat_err: the status error code to convert > > + **/ > > +char *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err) > > +{ > > + switch (stat_err) { > > + case I40E_SUCCESS: > > + return "OK"; > > + case I40E_ERR_NVM: > > + return "I40E_ERR_NVM"; > > + case I40E_ERR_NVM_CHECKSUM: > > + return "I40E_ERR_NVM_CHECKSUM"; > > + case I40E_ERR_PHY: > > + return "I40E_ERR_PHY"; > > + case I40E_ERR_CONFIG: > > + return "I40E_ERR_CONFIG"; > > + case I40E_ERR_PARAM: > > + return "I40E_ERR_PARAM"; > > + case I40E_ERR_MAC_TYPE: > > + return "I40E_ERR_MAC_TYPE"; > > + case I40E_ERR_UNKNOWN_PHY: > > + return "I40E_ERR_UNKNOWN_PHY"; > > + case I40E_ERR_LINK_SETUP: > > + return "I40E_ERR_LINK_SETUP"; > > + case I40E_ERR_ADAPTER_STOPPED: > > + return "I40E_ERR_ADAPTER_STOPPED"; > > + case I40E_ERR_INVALID_MAC_ADDR: > > + return "I40E_ERR_INVALID_MAC_ADDR"; > > + case I40E_ERR_DEVICE_NOT_SUPPORTED: > > + return "I40E_ERR_DEVICE_NOT_SUPPORTED"; > > + case I40E_ERR_MASTER_REQUESTS_PENDING: > > + return "I40E_ERR_MASTER_REQUESTS_PENDING"; > > + case I40E_ERR_INVALID_LINK_SETTINGS: > > + return "I40E_ERR_INVALID_LINK_SETTINGS"; > > + case I40E_ERR_AUTONEG_NOT_COMPLETE: > > + return "I40E_ERR_AUTONEG_NOT_COMPLETE"; > > + case I40E_ERR_RESET_FAILED: > > + return "I40E_ERR_RESET_FAILED"; > > + case I40E_ERR_SWFW_SYNC: > > + return "I40E_ERR_SWFW_SYNC"; > > + case I40E_ERR_NO_AVAILABLE_VSI: > > + return "I40E_ERR_NO_AVAILABLE_VSI"; > > + case I40E_ERR_NO_MEMORY: > > + return "I40E_ERR_NO_MEMORY"; > > + case I40E_ERR_BAD_PTR: > > + return "I40E_ERR_BAD_PTR"; > > + case I40E_ERR_RING_FULL: > > + return "I40E_ERR_RING_FULL"; > > + case I40E_ERR_INVALID_PD_ID: > > + return "I40E_ERR_INVALID_PD_ID"; > > + case I40E_ERR_INVALID_QP_ID: > > + return "I40E_ERR_INVALID_QP_ID"; > > + case I40E_ERR_INVALID_CQ_ID: > > + return "I40E_ERR_INVALID_CQ_ID"; > > + case I40E_ERR_INVALID_CEQ_ID: > > + return "I40E_ERR_INVALID_CEQ_ID"; > > + case I40E_ERR_INVALID_AEQ_ID: > > + return "I40E_ERR_INVALID_AEQ_ID"; > > + case I40E_ERR_INVALID_SIZE: > > + return "I40E_ERR_INVALID_SIZE"; > > + case I40E_ERR_INVALID_ARP_INDEX: > > + return "I40E_ERR_INVALID_ARP_INDEX"; > > + case I40E_ERR_INVALID_FPM_FUNC_ID: > > + return "I40E_ERR_INVALID_FPM_FUNC_ID"; > > + case I40E_ERR_QP_INVALID_MSG_SIZE: > > + return "I40E_ERR_QP_INVALID_MSG_SIZE"; > > + case I40E_ERR_QP_TOOMANY_WRS_POSTED: > > + return "I40E_ERR_QP_TOOMANY_WRS_POSTED"; > > + case I40E_ERR_INVALID_FRAG_COUNT: > > + return "I40E_ERR_INVALID_FRAG_COUNT"; > > + case I40E_ERR_QUEUE_EMPTY: > > + return "I40E_ERR_QUEUE_EMPTY"; > > + case I40E_ERR_INVALID_ALIGNMENT: > > + return "I40E_ERR_INVALID_ALIGNMENT"; > > + case I40E_ERR_FLUSHED_QUEUE: > > + return "I40E_ERR_FLUSHED_QUEUE"; > > + case I40E_ERR_INVALID_PUSH_PAGE_INDEX: > > + return "I40E_ERR_INVALID_PUSH_PAGE_INDEX"; > > + case I40E_ERR_INVALID_IMM_DATA_SIZE: > > + return "I40E_ERR_INVALID_IMM_DATA_SIZE"; > > + case I40E_ERR_TIMEOUT: > > + return "I40E_ERR_TIMEOUT"; > > + case I40E_ERR_OPCODE_MISMATCH: > > + return "I40E_ERR_OPCODE_MISMATCH"; > > + case I40E_ERR_CQP_COMPL_ERROR: > > + return "I40E_ERR_CQP_COMPL_ERROR"; > > + case I40E_ERR_INVALID_VF_ID: > > + return "I40E_ERR_INVALID_VF_ID"; > > + case I40E_ERR_INVALID_HMCFN_ID: > > + return "I40E_ERR_INVALID_HMCFN_ID"; > > + case I40E_ERR_BACKING_PAGE_ERROR: > > + return "I40E_ERR_BACKING_PAGE_ERROR"; > > + case I40E_ERR_NO_PBLCHUNKS_AVAILABLE: > > + return "I40E_ERR_NO_PBLCHUNKS_AVAILABLE"; > > + case I40E_ERR_INVALID_PBLE_INDEX: > > + return "I40E_ERR_INVALID_PBLE_INDEX"; > > + case I40E_ERR_INVALID_SD_INDEX: > > + return "I40E_ERR_INVALID_SD_INDEX"; > > + case I40E_ERR_INVALID_PAGE_DESC_INDEX: > > + return "I40E_ERR_INVALID_PAGE_DESC_INDEX"; > > + case I40E_ERR_INVALID_SD_TYPE: > > + return "I40E_ERR_INVALID_SD_TYPE"; > > + case I40E_ERR_MEMCPY_FAILED: > > + return "I40E_ERR_MEMCPY_FAILED"; > > + case I40E_ERR_INVALID_HMC_OBJ_INDEX: > > + return "I40E_ERR_INVALID_HMC_OBJ_INDEX"; > > + case I40E_ERR_INVALID_HMC_OBJ_COUNT: > > + return "I40E_ERR_INVALID_HMC_OBJ_COUNT"; > > + case I40E_ERR_INVALID_SRQ_ARM_LIMIT: > > + return "I40E_ERR_INVALID_SRQ_ARM_LIMIT"; > > + case I40E_ERR_SRQ_ENABLED: > > + return "I40E_ERR_SRQ_ENABLED"; > > + case I40E_ERR_ADMIN_QUEUE_ERROR: > > + return "I40E_ERR_ADMIN_QUEUE_ERROR"; > > + case I40E_ERR_ADMIN_QUEUE_TIMEOUT: > > + return "I40E_ERR_ADMIN_QUEUE_TIMEOUT"; > > + case I40E_ERR_BUF_TOO_SHORT: > > + return "I40E_ERR_BUF_TOO_SHORT"; > > + case I40E_ERR_ADMIN_QUEUE_FULL: > > + return "I40E_ERR_ADMIN_QUEUE_FULL"; > > + case I40E_ERR_ADMIN_QUEUE_NO_WORK: > > + return "I40E_ERR_ADMIN_QUEUE_NO_WORK"; > > + case I40E_ERR_BAD_IWARP_CQE: > > + return "I40E_ERR_BAD_IWARP_CQE"; > > + case I40E_ERR_NVM_BLANK_MODE: > > + return "I40E_ERR_NVM_BLANK_MODE"; > > + case I40E_ERR_NOT_IMPLEMENTED: > > + return "I40E_ERR_NOT_IMPLEMENTED"; > > + case I40E_ERR_PE_DOORBELL_NOT_ENABLED: > > + return "I40E_ERR_PE_DOORBELL_NOT_ENABLED"; > > + case I40E_ERR_DIAG_TEST_FAILED: > > + return "I40E_ERR_DIAG_TEST_FAILED"; > > + case I40E_ERR_NOT_READY: > > + return "I40E_ERR_NOT_READY"; > > + case I40E_NOT_SUPPORTED: > > + return "I40E_NOT_SUPPORTED"; > > + case I40E_ERR_FIRMWARE_API_VERSION: > > + return "I40E_ERR_FIRMWARE_API_VERSION"; > > + } > > + > > + snprintf(hw->err_str, sizeof(hw->err_str), "%d", stat_err); > > + return hw->err_str; > > +} > > + > > +/** > > * i40e_debug_aq > > * @hw: debug mask related to admin queue > > * @mask: debug mask > > @@ -154,9 +375,13 @@ void i40e_debug_aq(struct i40e_hw *hw, e > > bool i40e_check_asq_alive(struct i40e_hw *hw) > > { > > if (hw->aq.asq.len) > > - return !!(rd32(hw, hw->aq.asq.len) & > I40E_PF_ATQLEN_ATQENABLE_MASK); > > - else > > - return FALSE; > > + if (!i40e_is_vf(hw)) > > + return !!(rd32(hw, hw->aq.asq.len) & > > + I40E_PF_ATQLEN_ATQENABLE_MASK); > > + if (i40e_is_vf(hw)) > > + return !!(rd32(hw, hw->aq.asq.len) & > > + I40E_VF_ATQLEN1_ATQENABLE_MASK); > > + return FALSE; > > } > > > > /** > > @@ -184,6 +409,171 @@ enum i40e_status_code i40e_aq_queue_shut > > > > return status; > > } > > +#ifdef X722_SUPPORT > > + > > +/** > > + * i40e_aq_get_set_rss_lut > > + * @hw: pointer to the hardware structure > > + * @vsi_id: vsi fw index > > + * @pf_lut: for PF table set TRUE, for VSI table set FALSE > > + * @lut: pointer to the lut buffer provided by the caller > > + * @lut_size: size of the lut buffer > > + * @set: set TRUE to set the table, FALSE to get the table > > + * > > + * Internal function to get or set RSS look up table > > + **/ > > +static enum i40e_status_code i40e_aq_get_set_rss_lut(struct i40e_hw *hw, > > + u16 vsi_id, bool > pf_lut, > > + u8 *lut, u16 > lut_size, > > + bool set) > > +{ > > + enum i40e_status_code status; > > + struct i40e_aq_desc desc; > > + struct i40e_aqc_get_set_rss_lut *cmd_resp = > > + (struct i40e_aqc_get_set_rss_lut *)&desc.params.raw; > > + > > + if (set) > > + i40e_fill_default_direct_cmd_desc(&desc, > > + > i40e_aqc_opc_set_rss_lut); > > + else > > + i40e_fill_default_direct_cmd_desc(&desc, > > + > i40e_aqc_opc_get_rss_lut); > > + > > + /* Indirect command */ > > + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); > > + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD); > > + > > + cmd_resp->vsi_id = > > + CPU_TO_LE16((u16)((vsi_id << > > + > I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) & > > + > I40E_AQC_SET_RSS_LUT_VSI_ID_MASK)); > > + cmd_resp->vsi_id |= > CPU_TO_LE16((u16)I40E_AQC_SET_RSS_LUT_VSI_VALID); > > + > > + if (pf_lut) > > + cmd_resp->flags |= CPU_TO_LE16((u16) > > + > ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF << > > + > I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) & > > + > I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK)); > > + else > > + cmd_resp->flags |= CPU_TO_LE16((u16) > > + > ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI << > > + > I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) & > > + > I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK)); > > + > > + cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)lut)); > > + cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)lut)); > > + > > + status = i40e_asq_send_command(hw, &desc, lut, lut_size, NULL); > > + > > + return status; > > +} > > + > > +/** > > + * i40e_aq_get_rss_lut > > + * @hw: pointer to the hardware structure > > + * @vsi_id: vsi fw index > > + * @pf_lut: for PF table set TRUE, for VSI table set FALSE > > + * @lut: pointer to the lut buffer provided by the caller > > + * @lut_size: size of the lut buffer > > + * > > + * get the RSS lookup table, PF or VSI type > > + **/ > > +enum i40e_status_code i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 > vsi_id, > > + bool pf_lut, u8 *lut, u16 > lut_size) > > +{ > > + return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, > > + FALSE); > > +} > > + > > +/** > > + * i40e_aq_set_rss_lut > > + * @hw: pointer to the hardware structure > > + * @vsi_id: vsi fw index > > + * @pf_lut: for PF table set TRUE, for VSI table set FALSE > > + * @lut: pointer to the lut buffer provided by the caller > > + * @lut_size: size of the lut buffer > > + * > > + * set the RSS lookup table, PF or VSI type > > + **/ > > +enum i40e_status_code i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 > vsi_id, > > + bool pf_lut, u8 *lut, u16 > lut_size) > > +{ > > + return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, > lut_size, TRUE); > > +} > > + > > +/** > > + * i40e_aq_get_set_rss_key > > + * @hw: pointer to the hw struct > > + * @vsi_id: vsi fw index > > + * @key: pointer to key info struct > > + * @set: set TRUE to set the key, FALSE to get the key > > + * > > + * get the RSS key per VSI > > + **/ > > +static enum i40e_status_code i40e_aq_get_set_rss_key(struct i40e_hw *hw, > > + u16 vsi_id, > > + struct > i40e_aqc_get_set_rss_key_data *key, > > + bool set) > > +{ > > + enum i40e_status_code status; > > + struct i40e_aq_desc desc; > > + struct i40e_aqc_get_set_rss_key *cmd_resp = > > + (struct i40e_aqc_get_set_rss_key > *)&desc.params.raw; > > + u16 key_size = sizeof(struct i40e_aqc_get_set_rss_key_data); > > + > > + if (set) > > + i40e_fill_default_direct_cmd_desc(&desc, > > + > i40e_aqc_opc_set_rss_key); > > + else > > + i40e_fill_default_direct_cmd_desc(&desc, > > + > i40e_aqc_opc_get_rss_key); > > + > > + /* Indirect command */ > > + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); > > + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD); > > + > > + cmd_resp->vsi_id = > > + CPU_TO_LE16((u16)((vsi_id << > > + > I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) & > > + > I40E_AQC_SET_RSS_KEY_VSI_ID_MASK)); > > + cmd_resp->vsi_id |= > CPU_TO_LE16((u16)I40E_AQC_SET_RSS_KEY_VSI_VALID); > > + cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)key)); > > + cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)key)); > > + > > + status = i40e_asq_send_command(hw, &desc, key, key_size, NULL); > > + > > + return status; > > +} > > + > > +/** > > + * i40e_aq_get_rss_key > > + * @hw: pointer to the hw struct > > + * @vsi_id: vsi fw index > > + * @key: pointer to key info struct > > + * > > + **/ > > +enum i40e_status_code i40e_aq_get_rss_key(struct i40e_hw *hw, > > + u16 vsi_id, > > + struct > i40e_aqc_get_set_rss_key_data *key) > > +{ > > + return i40e_aq_get_set_rss_key(hw, vsi_id, key, FALSE); > > +} > > + > > +/** > > + * i40e_aq_set_rss_key > > + * @hw: pointer to the hw struct > > + * @vsi_id: vsi fw index > > + * @key: pointer to key info struct > > + * > > + * set the RSS key per VSI > > + **/ > > +enum i40e_status_code i40e_aq_set_rss_key(struct i40e_hw *hw, > > + u16 vsi_id, > > + struct > i40e_aqc_get_set_rss_key_data *key) > > +{ > > + return i40e_aq_get_set_rss_key(hw, vsi_id, key, TRUE); > > +} > > +#endif /* X722_SUPPORT */ > > > > /* The i40e_ptype_lookup table is used to convert from the 8-bit ptype > in the > > * hardware to a bit-field that can be used by SW to more easily > determine the > > @@ -598,6 +988,9 @@ enum i40e_status_code i40e_init_shared_c > > > > switch (hw->mac.type) { > > case I40E_MAC_XL710: > > +#ifdef X722_SUPPORT > > + case I40E_MAC_X722: > > +#endif > > break; > > default: > > return I40E_ERR_DEVICE_NOT_SUPPORTED; > > @@ -888,7 +1281,7 @@ enum i40e_status_code i40e_pf_reset(stru > > grst_del = (rd32(hw, I40E_GLGEN_RSTCTL) & > > I40E_GLGEN_RSTCTL_GRSTDEL_MASK) >> > > I40E_GLGEN_RSTCTL_GRSTDEL_SHIFT; > > - for (cnt = 0; cnt < grst_del + 2; cnt++) { > > + for (cnt = 0; cnt < grst_del + 10; cnt++) { > > reg = rd32(hw, I40E_GLGEN_RSTAT); > > if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK)) > > break; > > @@ -1108,9 +1501,11 @@ u32 i40e_led_get(struct i40e_hw *hw) > > if (!gpio_val) > > continue; > > > > - /* ignore gpio LED src mode entries related to the > activity LEDs */ > > - current_mode = ((gpio_val & > I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> > > - I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); > > + /* ignore gpio LED src mode entries related to the > activity > > + * LEDs > > + */ > > + current_mode = ((gpio_val & > I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) > > + >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); > > switch (current_mode) { > > case I40E_COMBINED_ACTIVITY: > > case I40E_FILTER_ACTIVITY: > > @@ -1154,9 +1549,11 @@ void i40e_led_set(struct i40e_hw *hw, u3 > > if (!gpio_val) > > continue; > > > > - /* ignore gpio LED src mode entries related to the > activity LEDs */ > > - current_mode = ((gpio_val & > I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> > > - I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); > > + /* ignore gpio LED src mode entries related to the > activity > > + * LEDs > > + */ > > + current_mode = ((gpio_val & > I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) > > + >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); > > switch (current_mode) { > > case I40E_COMBINED_ACTIVITY: > > case I40E_FILTER_ACTIVITY: > > @@ -1175,9 +1572,9 @@ void i40e_led_set(struct i40e_hw *hw, u3 > > blink = FALSE; > > > > if (blink) > > - gpio_val |= (1 << > I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); > > + gpio_val |= > BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); > > else > > - gpio_val &= ~(1 << > I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); > > + gpio_val &= > ~BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); > > > > wr32(hw, I40E_GLGEN_GPIO_CTL(i), gpio_val); > > break; > > @@ -1329,14 +1726,14 @@ enum i40e_status_code i40e_set_fc(struct > > *aq_failures |= I40E_SET_FC_AQ_FAIL_SET; > > } > > /* Update the link info */ > > - status = i40e_aq_get_link_info(hw, TRUE, NULL, NULL); > > + status = i40e_update_link_info(hw); > > if (status) { > > /* Wait a little bit (on 40G cards it sometimes takes a > really > > * long time for link to come back from the atomic reset) > > * and try once more > > */ > > i40e_msec_delay(1000); > > - status = i40e_aq_get_link_info(hw, TRUE, NULL, NULL); > > + status = i40e_update_link_info(hw); > > } > > if (status) > > *aq_failures |= I40E_SET_FC_AQ_FAIL_UPDATE; > > @@ -1525,7 +1922,6 @@ aq_get_link_info_exit: > > return status; > > } > > > > - > > /** > > * i40e_aq_set_phy_int_mask > > * @hw: pointer to the hw struct > > @@ -1837,6 +2233,74 @@ enum i40e_status_code i40e_aq_set_vsi_mu > > } > > > > /** > > + * i40e_aq_set_vsi_mc_promisc_on_vlan > > + * @hw: pointer to the hw struct > > + * @seid: vsi number > > + * @enable: set MAC L2 layer unicast promiscuous enable/disable for a > given VLAN > > + * @vid: The VLAN tag filter - capture any multicast packet with this > VLAN tag > > + * @cmd_details: pointer to command details structure or NULL > > + **/ > > +enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw > *hw, > > + u16 seid, bool enable, u16 vid, > > + struct i40e_asq_cmd_details *cmd_details) > > +{ > > + struct i40e_aq_desc desc; > > + struct i40e_aqc_set_vsi_promiscuous_modes *cmd = > > + (struct i40e_aqc_set_vsi_promiscuous_modes > *)&desc.params.raw; > > + enum i40e_status_code status; > > + u16 flags = 0; > > + > > + i40e_fill_default_direct_cmd_desc(&desc, > > + > i40e_aqc_opc_set_vsi_promiscuous_modes); > > + > > + if (enable) > > + flags |= I40E_AQC_SET_VSI_PROMISC_MULTICAST; > > + > > + cmd->promiscuous_flags = CPU_TO_LE16(flags); > > + cmd->valid_flags = > CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_MULTICAST); > > + cmd->seid = CPU_TO_LE16(seid); > > + cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); > > + > > + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); > > + > > + return status; > > +} > > + > > +/** > > + * i40e_aq_set_vsi_uc_promisc_on_vlan > > + * @hw: pointer to the hw struct > > + * @seid: vsi number > > + * @enable: set MAC L2 layer unicast promiscuous enable/disable for a > given VLAN > > + * @vid: The VLAN tag filter - capture any unicast packet with this > VLAN tag > > + * @cmd_details: pointer to command details structure or NULL > > + **/ > > +enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw > *hw, > > + u16 seid, bool enable, u16 vid, > > + struct i40e_asq_cmd_details *cmd_details) > > +{ > > + struct i40e_aq_desc desc; > > + struct i40e_aqc_set_vsi_promiscuous_modes *cmd = > > + (struct i40e_aqc_set_vsi_promiscuous_modes > *)&desc.params.raw; > > + enum i40e_status_code status; > > + u16 flags = 0; > > + > > + i40e_fill_default_direct_cmd_desc(&desc, > > + > i40e_aqc_opc_set_vsi_promiscuous_modes); > > + > > + if (enable) > > + flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; > > + > > + cmd->promiscuous_flags = CPU_TO_LE16(flags); > > + cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); > > + cmd->seid = CPU_TO_LE16(seid); > > + cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); > > + > > + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); > > + > > + return status; > > +} > > + > > +/** > > * i40e_aq_set_vsi_broadcast > > * @hw: pointer to the hw struct > > * @seid: vsi number > > @@ -2067,30 +2531,56 @@ enum i40e_status_code i40e_aq_send_drive > > /** > > * i40e_get_link_status - get status of the HW network link > > * @hw: pointer to the hw struct > > + * @link_up: pointer to bool (TRUE/FALSE = linkup/linkdown) > > * > > - * Returns TRUE if link is up, FALSE if link is down. > > + * Variable link_up TRUE if link is up, FALSE if link is down. > > > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > > From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 01:18:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48CF0F76; Sat, 6 Jun 2015 01:18:29 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 370801A87; Sat, 6 Jun 2015 01:18:29 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t561ITAp078333; Sat, 6 Jun 2015 01:18:29 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t561ITC2078332; Sat, 6 Jun 2015 01:18:29 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201506060118.t561ITC2078332@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 6 Jun 2015 01:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284050 - 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: Sat, 06 Jun 2015 01:18:29 -0000 Author: sjg Date: Sat Jun 6 01:18:28 2015 New Revision: 284050 URL: https://svnweb.freebsd.org/changeset/base/284050 Log: Add support for dependent options Reviewed by: imp Modified: head/share/mk/bsd.mkopt.mk Modified: head/share/mk/bsd.mkopt.mk ============================================================================== --- head/share/mk/bsd.mkopt.mk Fri Jun 5 22:52:42 2015 (r284049) +++ head/share/mk/bsd.mkopt.mk Sat Jun 6 01:18:28 2015 (r284050) @@ -70,3 +70,16 @@ MK_${var}:= no .for var in ${BROKEN_OPTIONS} MK_${var}:= no .endfor + +.for vv in ${__DEFAULT_DEPENDENT_OPTIONS} +.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) +MK_${vv:H}?= no +.elif defined(WITH_${vv:H}) +MK_${vv:H}?= yes +.elif defined(WITHOUT_${vv:H}) +MK_${vv:H}?= no +.else +MK_${vv:H}?= ${MK_${vv:T}} +.endif +.endfor +.undef __DEFAULT_DEPENDENT_OPTIONS From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 06:12:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 458A2DE8; Sat, 6 Jun 2015 06:12:15 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 32A891E23; Sat, 6 Jun 2015 06:12:15 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t566CFuQ026493; Sat, 6 Jun 2015 06:12:15 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t566CF50026492; Sat, 6 Jun 2015 06:12:15 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201506060612.t566CF50026492@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 6 Jun 2015 06:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284051 - 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: Sat, 06 Jun 2015 06:12:15 -0000 Author: dchagin Date: Sat Jun 6 06:12:14 2015 New Revision: 284051 URL: https://svnweb.freebsd.org/changeset/base/284051 Log: Finish r283544. In exec case properly detach threads from user space before suicide. Modified: head/sys/compat/linux/linux_emul.c Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Sat Jun 6 01:18:28 2015 (r284050) +++ head/sys/compat/linux/linux_emul.c Sat Jun 6 06:12:14 2015 (r284051) @@ -219,6 +219,18 @@ void linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) { struct thread *td = curthread; + struct thread *othertd; + + /* + * In a case of execing from linux binary properly detach + * other threads from the user space. + */ + if (__predict_false(SV_PROC_ABI(p) == SV_ABI_LINUX)) { + FOREACH_THREAD_IN_PROC(p, othertd) { + if (td != othertd) + (p->p_sysent->sv_thread_detach)(othertd); + } + } /* * In a case of execing to linux binary we create linux From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 10:28:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 303E7E5D; Sat, 6 Jun 2015 10:28:39 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1DED915A5; Sat, 6 Jun 2015 10:28:39 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56AScoL051017; Sat, 6 Jun 2015 10:28:38 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56AScQ0051016; Sat, 6 Jun 2015 10:28:38 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201506061028.t56AScQ0051016@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 6 Jun 2015 10:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284053 - head/lib/libc/aarch64/gen 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, 06 Jun 2015 10:28:39 -0000 Author: andrew Date: Sat Jun 6 10:28:38 2015 New Revision: 284053 URL: https://svnweb.freebsd.org/changeset/base/284053 Log: Set the correct register when calling sigprocmask in longjmp. Submitted by: Patrick Wildt Obtained from: drahn@bitrig.org Modified: head/lib/libc/aarch64/gen/setjmp.S Modified: head/lib/libc/aarch64/gen/setjmp.S ============================================================================== --- head/lib/libc/aarch64/gen/setjmp.S Sat Jun 6 09:28:40 2015 (r284052) +++ head/lib/libc/aarch64/gen/setjmp.S Sat Jun 6 10:28:38 2015 (r284053) @@ -80,7 +80,7 @@ ENTRY(longjmp) str x1, [sp, #16] /* Restore the signal mask */ - mov x1, #0 /* oset */ + mov x2, #0 /* oset */ add x1, x0, #(_JB_SIGMASK * 8) /* set */ mov x0, #3 /* SIG_BLOCK */ bl sigprocmask From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 11:19:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17603697; Sat, 6 Jun 2015 11:19:22 +0000 (UTC) (envelope-from brnrd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DF823104E; Sat, 6 Jun 2015 11:19:21 +0000 (UTC) (envelope-from brnrd@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56BJLqT076267; Sat, 6 Jun 2015 11:19:21 GMT (envelope-from brnrd@FreeBSD.org) Received: (from brnrd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56BJL6o076266; Sat, 6 Jun 2015 11:19:21 GMT (envelope-from brnrd@FreeBSD.org) Message-Id: <201506061119.t56BJL6o076266@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brnrd set sender to brnrd@FreeBSD.org using -f From: Bernard Spil Date: Sat, 6 Jun 2015 11:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284054 - 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: Sat, 06 Jun 2015 11:19:22 -0000 Author: brnrd (ports committer) Date: Sat Jun 6 11:19:21 2015 New Revision: 284054 URL: https://svnweb.freebsd.org/changeset/base/284054 Log: Add myself (brnrd / Bernard Spil) to committers docs - Add myself and vsevolod (mentor) to committers-ports.dot - Add koobs and vsevolod as mentors to committers-ports.dot Submitted by: brnrd@freebsd.org Approved by: vsevolod (mentor), koobs (mentor) Differential Revision: https://reviews.freebsd.org/D2648 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sat Jun 6 10:28:38 2015 (r284053) +++ head/share/misc/committers-ports.dot Sat Jun 6 11:19:21 2015 (r284054) @@ -68,6 +68,7 @@ bf [label="Brendan Fabeny\nbf@FreeBSD.or bland [label="Alexander Nedotsukov\nbland@FreeBSD.org\n2003/08/14"] bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2000/08/23"] bofh [label="Muhammad Moinur Rahman\nbofh@FreeBSD.org\n2014/12/23"] +brnrd [label="Bernard Spil\nbrnrd@FreeBSD.org\n2015/05/24"] brix [label="Henrik Brix Andersen\nbrix@FreeBSD.org\n2007/10/31"] brooks [label="Brooks Davies\nbrooks@FreeBSD.org\n2004/05/03"] bsam [label="Boris Samorodov\nbsam@FreeBSD.org\n2006/07/20"] @@ -224,6 +225,7 @@ trociny [label="Mikolaj Golub\ntrociny@F uqs [label="Ulrich Spoerlein\nuqs@FreeBSD.org\n2012/01/19"] vd [label="Vasil Dimov\nvd@FreeBSD.org\n2006/01/19"] vg [label="Veniamin Gvozdikov\nvg@FreeBSD.org\n2013/06/11"] +vsevolod [label="Vsevolod Stakhov\nvsevolod@FreeBSD.org\n2005/07/22"] wen [label="Wen Heping\nwen@FreeBSD.org\n2010/12/13"] wg [label="William Grzybowski\nwg@FreeBSD.org\n2013/04/01"] wxs [label="Wesley Shields\nwxs@FreeBSD.org\n2008/01/03"] @@ -404,6 +406,7 @@ knu -> maho knu -> nobutaka knu -> nork +koobs -> brnrd koobs -> kami koobs -> xmj @@ -576,6 +579,8 @@ thierry -> riggs tmclaugh -> itetcu tmclaugh -> xride +vsevolod -> brnrd + wen -> cs wen -> culot wen -> pawel From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 11:42:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0B67962; Sat, 6 Jun 2015 11:42:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9E02D172A; Sat, 6 Jun 2015 11:42:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56Bgi2k090145; Sat, 6 Jun 2015 11:42:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56BgiwP090144; Sat, 6 Jun 2015 11:42:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061142.t56BgiwP090144@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 11:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284055 - head/usr.bin/colrm 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, 06 Jun 2015 11:42:44 -0000 Author: bapt Date: Sat Jun 6 11:42:43 2015 New Revision: 284055 URL: https://svnweb.freebsd.org/changeset/base/284055 Log: Fix history: colrm(1) appeared in 1BSD not 3.0BSD Add Author section Obtained from: OpenBSD (change by schwarze@) Modified: head/usr.bin/colrm/colrm.1 Modified: head/usr.bin/colrm/colrm.1 ============================================================================== --- head/usr.bin/colrm/colrm.1 Sat Jun 6 11:19:21 2015 (r284054) +++ head/usr.bin/colrm/colrm.1 Sat Jun 6 11:42:43 2015 (r284055) @@ -28,7 +28,7 @@ .\" @(#)colrm.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd August 4, 2004 +.Dd June 6, 2015 .Dt COLRM 1 .Os .Sh NAME @@ -83,5 +83,10 @@ as described in .Sh HISTORY The .Nm -command appeared in -.Bx 3.0 . +utility first appeared in +.Bx 1 . +.Sh AUTHORS +.An Jeff Schriebman +wrote the original version of +.Nm +in November 1974. From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 11:55:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7681B57; Sat, 6 Jun 2015 11:55:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B382F1964; Sat, 6 Jun 2015 11:55:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56BtaWi095526; Sat, 6 Jun 2015 11:55:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56BtaDm095525; Sat, 6 Jun 2015 11:55:36 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061155.t56BtaDm095525@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 11:55:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284056 - head/usr.bin/tset 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, 06 Jun 2015 11:55:37 -0000 Author: bapt Date: Sat Jun 6 11:55:35 2015 New Revision: 284056 URL: https://svnweb.freebsd.org/changeset/base/284056 Log: Complete documenting the HISTORY of what remains of the 1BSD heritage Obtained from: OpenBSD (by schwarze@) Modified: head/usr.bin/tset/tset.1 Modified: head/usr.bin/tset/tset.1 ============================================================================== --- head/usr.bin/tset/tset.1 Sat Jun 6 11:42:43 2015 (r284055) +++ head/usr.bin/tset/tset.1 Sat Jun 6 11:55:35 2015 (r284056) @@ -28,7 +28,7 @@ .\" @(#)tset.1 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 9, 1993 +.Dd June 6, 2015 .Dt TSET 1 .Os .Sh NAME @@ -400,5 +400,22 @@ older terminal interfaces. .Sh HISTORY The .Nm -command appeared in -.Bx 3.0 . +and +.Nm reset +utilities first appeared in +.Bx 1 . +.Sh AUTHORS +.An -nosplit +The original version of +.Nm tset +was written by +.An Eric P. Allman +in October 1977, and +.Nm reset +was originally written by +.An Kurt Shoens . +The current version also contains code by +.An Zeyd M. Ben-Halim , +.An Eric S. Raymond , +and +.An Thomas E. Dickey . From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 11:58:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32E75CAC; Sat, 6 Jun 2015 11:58:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 210781972; Sat, 6 Jun 2015 11:58:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56BwJdF095918; Sat, 6 Jun 2015 11:58:19 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56BwJBF095917; Sat, 6 Jun 2015 11:58:19 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061158.t56BwJBF095917@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 11:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284057 - head/usr.bin/expand 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, 06 Jun 2015 11:58:20 -0000 Author: bapt Date: Sat Jun 6 11:58:19 2015 New Revision: 284057 URL: https://svnweb.freebsd.org/changeset/base/284057 Log: Fix history (appeared in 1BSD) Obtained from: OpenBSD (by schwarze@) Modified: head/usr.bin/expand/expand.1 Modified: head/usr.bin/expand/expand.1 ============================================================================== --- head/usr.bin/expand/expand.1 Sat Jun 6 11:55:35 2015 (r284056) +++ head/usr.bin/expand/expand.1 Sat Jun 6 11:58:19 2015 (r284057) @@ -28,7 +28,7 @@ .\" @(#)expand.1 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd October 13, 2006 +.Dd June 6, 2015 .Dt EXPAND 1 .Os .Sh NAME @@ -110,5 +110,5 @@ utilities conform to .Sh HISTORY The .Nm -command appeared in -.Bx 3.0 . +utility first appeared in +.Bx 1 . From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 12:01:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01099FD6; Sat, 6 Jun 2015 12:01:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E35C61A90; Sat, 6 Jun 2015 12:01:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56C1Zki097719; Sat, 6 Jun 2015 12:01:35 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56C1ZgA097718; Sat, 6 Jun 2015 12:01:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061201.t56C1ZgA097718@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 12:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284058 - head/usr.bin/fold 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, 06 Jun 2015 12:01:36 -0000 Author: bapt Date: Sat Jun 6 12:01:35 2015 New Revision: 284058 URL: https://svnweb.freebsd.org/changeset/base/284058 Log: Complete documenting the HISTORY Obtained from: OpenBSD (by schwarze@) Modified: head/usr.bin/fold/fold.1 Modified: head/usr.bin/fold/fold.1 ============================================================================== --- head/usr.bin/fold/fold.1 Sat Jun 6 11:58:19 2015 (r284057) +++ head/usr.bin/fold/fold.1 Sat Jun 6 12:01:35 2015 (r284058) @@ -28,7 +28,7 @@ .\" @(#)fold.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 15, 2006 +.Dd June 6, 2015 .Dt FOLD 1 .Os .Sh NAME @@ -84,6 +84,33 @@ The .Nm utility conforms to .St -p1003.1-2001 . +.Sh HISTORY +The +.Nm +utility first appeared in +.Bx 1 . +It was rewritten for +.Bx 4.3 Reno +to improve speed and modernize style. +The +.Fl b +and +.Fl s +options were added to +.Nx 1.0 +for +.St -p1003.2 +compliance. +.Sh AUTHORS +.An -nosplit +.An Bill Joy +wrote the original version of +.Nm +on June 28, 1977. +.An Kevin Ruddy +rewrote the command in 1990, and +.An J. T. Conklin +added the missing options in 1993. .Sh BUGS If underlining (see .Xr ul 1 ) From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 12:04:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB4D01A1; Sat, 6 Jun 2015 12:04:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D913B1BA5; Sat, 6 Jun 2015 12:04:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56C4cWr000663; Sat, 6 Jun 2015 12:04:38 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56C4c7m000662; Sat, 6 Jun 2015 12:04:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061204.t56C4c7m000662@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 12:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284059 - head/usr.bin/last 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, 06 Jun 2015 12:04:39 -0000 Author: bapt Date: Sat Jun 6 12:04:38 2015 New Revision: 284059 URL: https://svnweb.freebsd.org/changeset/base/284059 Log: Fix history, add AUTHORS section Obtained from: OpenBSD (by schwarze@) Modified: head/usr.bin/last/last.1 Modified: head/usr.bin/last/last.1 ============================================================================== --- head/usr.bin/last/last.1 Sat Jun 6 12:01:35 2015 (r284058) +++ head/usr.bin/last/last.1 Sat Jun 6 12:04:38 2015 (r284059) @@ -28,7 +28,7 @@ .\" @(#)last.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd January 21, 2010 +.Dd June 6, 2015 .Dt LAST 1 .Os .Sh NAME @@ -202,10 +202,15 @@ login data base .Xr ac 8 , .Xr lastlogin 8 .Sh HISTORY -A .Nm -utility appeared in -.Bx 3.0 . +utility first appeared in +.Bx 1 . +.Sh AUTHORS +.An -nosplit +The original version was written by +.An Howard P. Katseff ; +.An Keith Bostic +rewrote it in 1986/87 to add functionality and to improve code quality. .Sh BUGS If a login shell should terminate abnormally for some reason, it is likely that a logout record will not be written to the From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 12:08:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85ADE314; Sat, 6 Jun 2015 12:08:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 72E0A1BCD; Sat, 6 Jun 2015 12:08:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56C8BeZ001207; Sat, 6 Jun 2015 12:08:11 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56C8Bml001206; Sat, 6 Jun 2015 12:08:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061208.t56C8Bml001206@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 12:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284060 - head/usr.bin/mkstr 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, 06 Jun 2015 12:08:11 -0000 Author: bapt Date: Sat Jun 6 12:08:10 2015 New Revision: 284060 URL: https://svnweb.freebsd.org/changeset/base/284060 Log: Fix HISTORY and add AUTHORS section Obtained from: OpenBSD (by schwarze@) Modified: head/usr.bin/mkstr/mkstr.1 Modified: head/usr.bin/mkstr/mkstr.1 ============================================================================== --- head/usr.bin/mkstr/mkstr.1 Sat Jun 6 12:04:38 2015 (r284059) +++ head/usr.bin/mkstr/mkstr.1 Sat Jun 6 12:08:10 2015 (r284060) @@ -28,7 +28,7 @@ .\" @(#)mkstr.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 1, 2002 +.Dd June 6, 2015 .Dt MKSTR 1 .Os .Sh NAME @@ -118,10 +118,16 @@ error(a1, a2, a3, a4) .Xr xstr 1 , .Xr lseek 2 .Sh HISTORY -An +The .Nm -utility appeared in -.Bx 3.0 . +utility first appeared in +.Bx 1 . +.Sh AUTHORS +.An -nosplit +.An Bill Joy +and +.An Chuck Haley , +1977. .Sh BUGS The .Nm From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 12:10:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C188474; Sat, 6 Jun 2015 12:10:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6A3B11BF5; Sat, 6 Jun 2015 12:10:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56CABRX001584; Sat, 6 Jun 2015 12:10:11 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56CABKi001583; Sat, 6 Jun 2015 12:10:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061210.t56CABKi001583@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 12:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284061 - head/usr.bin/colcrt 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, 06 Jun 2015 12:10:11 -0000 Author: bapt Date: Sat Jun 6 12:10:10 2015 New Revision: 284061 URL: https://svnweb.freebsd.org/changeset/base/284061 Log: Fix history Modified: head/usr.bin/colcrt/colcrt.1 Modified: head/usr.bin/colcrt/colcrt.1 ============================================================================== --- head/usr.bin/colcrt/colcrt.1 Sat Jun 6 12:08:10 2015 (r284060) +++ head/usr.bin/colcrt/colcrt.1 Sat Jun 6 12:10:10 2015 (r284061) @@ -28,7 +28,7 @@ .\" @(#)colcrt.1 8.1 (Berkeley) 6/30/93 .\" $FreeBSD$ .\" -.Dd July 31, 2004 +.Dd June 6, 2015 .Dt COLCRT 1 .Os .Sh NAME @@ -93,8 +93,8 @@ tbl exum2.n \&| nroff \-ms \&| colcrt \- .Sh HISTORY The .Nm -command appeared in -.Bx 3.0 . +utility first appeared in +.Bx 1 . .Sh BUGS Should fold underlines onto blanks even with the .Sq Fl From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 12:35:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A1457BB; Sat, 6 Jun 2015 12:35:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 689D2120C; Sat, 6 Jun 2015 12:35:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56CZ0dq015866; Sat, 6 Jun 2015 12:35:00 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56CZ0LP015865; Sat, 6 Jun 2015 12:35:00 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061235.t56CZ0LP015865@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 12:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284062 - head/usr.bin/vtfontcvt 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, 06 Jun 2015 12:35:00 -0000 Author: bapt Date: Sat Jun 6 12:34:59 2015 New Revision: 284062 URL: https://svnweb.freebsd.org/changeset/base/284062 Log: Remove WARNS vtfontcvt builds find with clang and gcc with maximum level warning Modified: head/usr.bin/vtfontcvt/Makefile Modified: head/usr.bin/vtfontcvt/Makefile ============================================================================== --- head/usr.bin/vtfontcvt/Makefile Sat Jun 6 12:10:10 2015 (r284061) +++ head/usr.bin/vtfontcvt/Makefile Sat Jun 6 12:34:59 2015 (r284062) @@ -3,6 +3,4 @@ PROG= vtfontcvt MAN8= vtfontcvt.8 -WARNS?= 6 - .include From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 12:39:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6217E914; Sat, 6 Jun 2015 12:39:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 505741224; Sat, 6 Jun 2015 12:39:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56Cd1dv016452; Sat, 6 Jun 2015 12:39:01 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56Cd0U4016445; Sat, 6 Jun 2015 12:39:00 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061239.t56Cd0U4016445@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 12:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284063 - head/usr.bin/mkstr 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, 06 Jun 2015 12:39:01 -0000 Author: bapt Date: Sat Jun 6 12:39:00 2015 New Revision: 284063 URL: https://svnweb.freebsd.org/changeset/base/284063 Log: Make global variables static Remove WARNS from Makefile Modified: head/usr.bin/mkstr/Makefile head/usr.bin/mkstr/mkstr.c Modified: head/usr.bin/mkstr/Makefile ============================================================================== --- head/usr.bin/mkstr/Makefile Sat Jun 6 12:34:59 2015 (r284062) +++ head/usr.bin/mkstr/Makefile Sat Jun 6 12:39:00 2015 (r284063) @@ -3,6 +3,4 @@ PROG= mkstr -WARNS?= 2 - .include Modified: head/usr.bin/mkstr/mkstr.c ============================================================================== --- head/usr.bin/mkstr/mkstr.c Sat Jun 6 12:34:59 2015 (r284062) +++ head/usr.bin/mkstr/mkstr.c Sat Jun 6 12:39:00 2015 (r284063) @@ -76,8 +76,8 @@ __FBSDID("$FreeBSD$"); * existing error message file for recompilation of single routines. */ -FILE *mesgread, *mesgwrite; -char name[100], *np; +static FILE *mesgread, *mesgwrite; +static char name[100], *np; void copystr(void); int fgetNUL(char *, int, FILE *); @@ -267,7 +267,7 @@ inithash(void) #define NBUCKETS 511 -struct hash { +static struct hash { long hval; unsigned hpt; struct hash *hnext; From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 12:41:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D77D0A62; Sat, 6 Jun 2015 12:41:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 ADA951341; Sat, 6 Jun 2015 12:41:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56CfQ1r018514; Sat, 6 Jun 2015 12:41:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56CfQWU018513; Sat, 6 Jun 2015 12:41:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061241.t56CfQWU018513@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 12:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284064 - head/usr.bin/rup 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, 06 Jun 2015 12:41:26 -0000 Author: bapt Date: Sat Jun 6 12:41:25 2015 New Revision: 284064 URL: https://svnweb.freebsd.org/changeset/base/284064 Log: Bump level WARNINGS to 3 Modified: head/usr.bin/rup/Makefile Modified: head/usr.bin/rup/Makefile ============================================================================== --- head/usr.bin/rup/Makefile Sat Jun 6 12:39:00 2015 (r284063) +++ head/usr.bin/rup/Makefile Sat Jun 6 12:41:25 2015 (r284064) @@ -2,8 +2,7 @@ PROG= rup -WARNS?= 1 - +WARNS?= 3 LIBADD= rpcsvc .include From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 12:43:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6298FBB6; Sat, 6 Jun 2015 12:43:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 50E171498; Sat, 6 Jun 2015 12:43:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56Ch6dR020681; Sat, 6 Jun 2015 12:43:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56Ch5Fr020678; Sat, 6 Jun 2015 12:43:05 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061243.t56Ch5Fr020678@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 12:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284065 - head/usr.bin/rsh 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, 06 Jun 2015 12:43:06 -0000 Author: bapt Date: Sat Jun 6 12:43:05 2015 New Revision: 284065 URL: https://svnweb.freebsd.org/changeset/base/284065 Log: Make global variables static Remove WARNS from Makefile Modified: head/usr.bin/rsh/Makefile head/usr.bin/rsh/rsh.c Modified: head/usr.bin/rsh/Makefile ============================================================================== --- head/usr.bin/rsh/Makefile Sat Jun 6 12:41:25 2015 (r284064) +++ head/usr.bin/rsh/Makefile Sat Jun 6 12:43:05 2015 (r284065) @@ -4,8 +4,6 @@ PROG= rsh CFLAGS+=-I${.CURDIR}/../../libexec/rlogind -WARNS?= 2 - BINOWN= root BINMODE=4555 Modified: head/usr.bin/rsh/rsh.c ============================================================================== --- head/usr.bin/rsh/rsh.c Sat Jun 6 12:41:25 2015 (r284064) +++ head/usr.bin/rsh/rsh.c Sat Jun 6 12:43:05 2015 (r284065) @@ -77,10 +77,10 @@ __FBSDID("$FreeBSD$"); /* * rsh - remote shell */ -int rfd2; +static int rfd2; -int family = PF_UNSPEC; -char rlogin[] = "rlogin"; +static int family = PF_UNSPEC; +static char rlogin[] = "rlogin"; void connect_timeout(int); char *copyargs(char * const *); From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 13:08:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CE93FF5; Sat, 6 Jun 2015 13:08:32 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6B23F1902; Sat, 6 Jun 2015 13:08:32 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56D8WsA031581; Sat, 6 Jun 2015 13:08:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56D8WnK031579; Sat, 6 Jun 2015 13:08:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061308.t56D8WnK031579@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 13:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284067 - head/usr.bin/systat 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, 06 Jun 2015 13:08:32 -0000 Author: bapt Date: Sat Jun 6 13:08:31 2015 New Revision: 284067 URL: https://svnweb.freebsd.org/changeset/base/284067 Log: Remove unused variable Modified: head/usr.bin/systat/main.c Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Sat Jun 6 12:44:42 2015 (r284066) +++ head/usr.bin/systat/main.c Sat Jun 6 13:08:31 2015 (r284067) @@ -138,7 +138,6 @@ main(int argc, char **argv) { char errbuf[_POSIX2_LINE_MAX], dummy; size_t size; - double t; struct cmdentry *cmd = NULL; (void) setlocale(LC_ALL, ""); From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 13:08:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A1AD1A2; Sat, 6 Jun 2015 13:08:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 189F51905; Sat, 6 Jun 2015 13:08:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56D8m2c031667; Sat, 6 Jun 2015 13:08:48 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56D8m6P031665; Sat, 6 Jun 2015 13:08:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061308.t56D8m6P031665@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 13:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284068 - head/usr.bin/systat 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, 06 Jun 2015 13:08:49 -0000 Author: bapt Date: Sat Jun 6 13:08:48 2015 New Revision: 284068 URL: https://svnweb.freebsd.org/changeset/base/284068 Log: Bump WARNS level to 1 Modified: head/usr.bin/systat/Makefile Modified: head/usr.bin/systat/Makefile ============================================================================== --- head/usr.bin/systat/Makefile Sat Jun 6 13:08:31 2015 (r284067) +++ head/usr.bin/systat/Makefile Sat Jun 6 13:08:48 2015 (r284068) @@ -14,7 +14,7 @@ SRCS+= icmp6.c ip6.c CFLAGS+= -DINET6 .endif -WARNS?= 0 +WARNS?= 1 LIBADD= ncursesw m devstat kvm From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 13:09:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFEC62E8; Sat, 6 Jun 2015 13:09:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DE83C190E; Sat, 6 Jun 2015 13:09:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56D9ntq031856; Sat, 6 Jun 2015 13:09:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56D9n8a031855; Sat, 6 Jun 2015 13:09:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061309.t56D9n8a031855@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 13:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284069 - head/usr.bin/keylogin 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, 06 Jun 2015 13:09:50 -0000 Author: bapt Date: Sat Jun 6 13:09:49 2015 New Revision: 284069 URL: https://svnweb.freebsd.org/changeset/base/284069 Log: Remove WARNS keylogin build fine with clang and gcc Modified: head/usr.bin/keylogin/Makefile Modified: head/usr.bin/keylogin/Makefile ============================================================================== --- head/usr.bin/keylogin/Makefile Sat Jun 6 13:08:48 2015 (r284068) +++ head/usr.bin/keylogin/Makefile Sat Jun 6 13:09:49 2015 (r284069) @@ -4,6 +4,4 @@ PROG= keylogin LIBADD= rpcsvc -WARNS?= 0 - .include From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 13:13:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F68E455; Sat, 6 Jun 2015 13:13:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3DD771AFA; Sat, 6 Jun 2015 13:13:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56DDeex036042; Sat, 6 Jun 2015 13:13:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56DDd0W036040; Sat, 6 Jun 2015 13:13:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061313.t56DDd0W036040@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 13:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284070 - head/usr.bin/mail 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, 06 Jun 2015 13:13:40 -0000 Author: bapt Date: Sat Jun 6 13:13:39 2015 New Revision: 284070 URL: https://svnweb.freebsd.org/changeset/base/284070 Log: Add const to the copyright variable Bump WARNS to level 2 Modified: head/usr.bin/mail/Makefile head/usr.bin/mail/main.c Modified: head/usr.bin/mail/Makefile ============================================================================== --- head/usr.bin/mail/Makefile Sat Jun 6 13:09:49 2015 (r284069) +++ head/usr.bin/mail/Makefile Sat Jun 6 13:13:39 2015 (r284070) @@ -11,7 +11,7 @@ EFILES= mail.rc LINKS= ${BINDIR}/mail ${BINDIR}/Mail ${BINDIR}/mail ${BINDIR}/mailx MLINKS= mail.1 Mail.1 mail.1 mailx.1 -WARNS?= 1 +WARNS?= 2 .PATH: ${.CURDIR}/misc Modified: head/usr.bin/mail/main.c ============================================================================== --- head/usr.bin/mail/main.c Sat Jun 6 13:09:49 2015 (r284069) +++ head/usr.bin/mail/main.c Sat Jun 6 13:13:39 2015 (r284070) @@ -28,7 +28,7 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1980, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 13:20:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD8695DF; Sat, 6 Jun 2015 13:20:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CC3861B31; Sat, 6 Jun 2015 13:20:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56DK2YI037039; Sat, 6 Jun 2015 13:20:02 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56DK2EU037038; Sat, 6 Jun 2015 13:20:02 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061320.t56DK2EU037038@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 13:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284071 - head/libexec/atrun 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, 06 Jun 2015 13:20:03 -0000 Author: bapt Date: Sat Jun 6 13:20:02 2015 New Revision: 284071 URL: https://svnweb.freebsd.org/changeset/base/284071 Log: Remove WARNS atrun builds fine with clang and gcc Modified: head/libexec/atrun/Makefile Modified: head/libexec/atrun/Makefile ============================================================================== --- head/libexec/atrun/Makefile Sat Jun 6 13:13:39 2015 (r284070) +++ head/libexec/atrun/Makefile Sat Jun 6 13:20:02 2015 (r284071) @@ -14,7 +14,6 @@ CLEANFILES= ${MAN} CFLAGS+=-I${MAINSRC} -I${.CURDIR} CFLAGS+=-DLOGIN_CAP -DPAM -WARNS?= 2 WFORMAT=0 LIBADD= pam util From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 13:49:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E54AA259; Sat, 6 Jun 2015 13:49:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BA6F8120D; Sat, 6 Jun 2015 13:49:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56DntZ4052141; Sat, 6 Jun 2015 13:49:55 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56Dnts4052140; Sat, 6 Jun 2015 13:49:55 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061349.t56Dnts4052140@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 13:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284076 - head/sbin/badsect 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, 06 Jun 2015 13:49:56 -0000 Author: bapt Date: Sat Jun 6 13:49:54 2015 New Revision: 284076 URL: https://svnweb.freebsd.org/changeset/base/284076 Log: Remove useless WARNS Modified: head/sbin/badsect/Makefile Modified: head/sbin/badsect/Makefile ============================================================================== --- head/sbin/badsect/Makefile Sat Jun 6 13:39:20 2015 (r284075) +++ head/sbin/badsect/Makefile Sat Jun 6 13:49:54 2015 (r284076) @@ -4,6 +4,5 @@ PROG= badsect LIBADD= ufs MAN= badsect.8 -WARNS?= 2 .include From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 14:26:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EEA8B6A3; Sat, 6 Jun 2015 14:26:40 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DD0F31AE5; Sat, 6 Jun 2015 14:26:40 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56EQef2071611; Sat, 6 Jun 2015 14:26:40 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56EQer6071610; Sat, 6 Jun 2015 14:26:40 GMT (envelope-from br@FreeBSD.org) Message-Id: <201506061426.t56EQer6071610@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sat, 6 Jun 2015 14:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284077 - head/sys/arm/freescale/imx 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, 06 Jun 2015 14:26:41 -0000 Author: br Date: Sat Jun 6 14:26:40 2015 New Revision: 284077 URL: https://svnweb.freebsd.org/changeset/base/284077 Log: Include a header required for vtophys(). Modified: head/sys/arm/freescale/imx/imx6_sdma.c Modified: head/sys/arm/freescale/imx/imx6_sdma.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_sdma.c Sat Jun 6 13:49:54 2015 (r284076) +++ head/sys/arm/freescale/imx/imx6_sdma.c Sat Jun 6 14:26:40 2015 (r284077) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 15:51:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C97F6E78; Sat, 6 Jun 2015 15:51:13 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 ABC401DF6; Sat, 6 Jun 2015 15:51:13 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56FpD2O014382; Sat, 6 Jun 2015 15:51:13 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56FpCbX013048; Sat, 6 Jun 2015 15:51:12 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201506061551.t56FpCbX013048@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 6 Jun 2015 15:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284078 - head/sys/dev/pci 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, 06 Jun 2015 15:51:14 -0000 Author: marcel Date: Sat Jun 6 15:51:11 2015 New Revision: 284078 URL: https://svnweb.freebsd.org/changeset/base/284078 Log: Don't return -10000 as the probe priority. That's lower than what BUS_PROBE_HOOVER is. Drivers like proto(4), when compiled into the kernel or preloaded, will render your system useless by virtue of attaching to your PCI busses. Return BUS_PROBE_GENERIC instead. It's just the next priority up from BUS_PROBE_HOOVER. No other meaning has been give to its use. While BUS_PROBE_DEFAULT seems like a better candidate, it's hard not to think that there must be some reason why these drivers return -10000 in the first place. Differential Revision: D2705 Modified: head/sys/dev/pci/eisa_pci.c head/sys/dev/pci/hostb_pci.c head/sys/dev/pci/ignore_pci.c head/sys/dev/pci/isa_pci.c head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/eisa_pci.c ============================================================================== --- head/sys/dev/pci/eisa_pci.c Sat Jun 6 14:26:40 2015 (r284077) +++ head/sys/dev/pci/eisa_pci.c Sat Jun 6 15:51:11 2015 (r284078) @@ -100,7 +100,7 @@ eisab_probe(device_t dev) if (matched) { device_set_desc(dev, "PCI-EISA bridge"); - return(-10000); + return (BUS_PROBE_GENERIC); } return(ENXIO); } Modified: head/sys/dev/pci/hostb_pci.c ============================================================================== --- head/sys/dev/pci/hostb_pci.c Sat Jun 6 14:26:40 2015 (r284077) +++ head/sys/dev/pci/hostb_pci.c Sat Jun 6 15:51:11 2015 (r284078) @@ -63,7 +63,7 @@ pci_hostb_probe(device_t dev) pci_get_subclass(dev) == PCIS_BRIDGE_HOST) { device_set_desc(dev, "Host to PCI bridge"); device_quiet(dev); - return (-10000); + return (BUS_PROBE_GENERIC); } return (ENXIO); } Modified: head/sys/dev/pci/ignore_pci.c ============================================================================== --- head/sys/dev/pci/ignore_pci.c Sat Jun 6 14:26:40 2015 (r284077) +++ head/sys/dev/pci/ignore_pci.c Sat Jun 6 15:51:11 2015 (r284078) @@ -66,7 +66,7 @@ ignore_pci_probe(device_t dev) case 0x10001042ul: /* SMC 37C665 */ device_set_desc(dev, "ignored"); device_quiet(dev); - return(-10000); + return (BUS_PROBE_GENERIC); } return(ENXIO); } Modified: head/sys/dev/pci/isa_pci.c ============================================================================== --- head/sys/dev/pci/isa_pci.c Sat Jun 6 14:26:40 2015 (r284077) +++ head/sys/dev/pci/isa_pci.c Sat Jun 6 15:51:11 2015 (r284078) @@ -154,7 +154,7 @@ isab_pci_probe(device_t dev) if (matched) { device_set_desc(dev, "PCI-ISA bridge"); - return(-10000); + return (BUS_PROBE_GENERIC); } return(ENXIO); } Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Sat Jun 6 14:26:40 2015 (r284077) +++ head/sys/dev/pci/pci_pci.c Sat Jun 6 15:51:11 2015 (r284078) @@ -890,7 +890,7 @@ pcib_probe(device_t dev) if ((pci_get_class(dev) == PCIC_BRIDGE) && (pci_get_subclass(dev) == PCIS_BRIDGE_PCI)) { device_set_desc(dev, "PCI-PCI bridge"); - return(-10000); + return (BUS_PROBE_GENERIC); } return(ENXIO); } From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 16:03:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB7F3242; Sat, 6 Jun 2015 16:03:47 +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 96AE81098; Sat, 6 Jun 2015 16:03:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 04F61B926; Sat, 6 Jun 2015 12:03:46 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284078 - head/sys/dev/pci Date: Sat, 06 Jun 2015 12:03:38 -0400 Message-ID: <14005803.mtbqcRkBJG@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201506061551.t56FpCbX013048@svn.freebsd.org> References: <201506061551.t56FpCbX013048@svn.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); Sat, 06 Jun 2015 12:03:46 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Jun 2015 16:03:47 -0000 On Saturday, June 06, 2015 03:51:12 PM Marcel Moolenaar wrote: > Author: marcel > Date: Sat Jun 6 15:51:11 2015 > New Revision: 284078 > URL: https://svnweb.freebsd.org/changeset/base/284078 > > Log: > Don't return -10000 as the probe priority. That's lower than what > BUS_PROBE_HOOVER is. Drivers like proto(4), when compiled into the > kernel or preloaded, will render your system useless by virtue of > attaching to your PCI busses. > > Return BUS_PROBE_GENERIC instead. It's just the next priority up > from BUS_PROBE_HOOVER. No other meaning has been give to its use. > While BUS_PROBE_DEFAULT seems like a better candidate, it's hard > not to think that there must be some reason why these drivers > return -10000 in the first place. BUS_PROBE_DEFAULT would conflict with other drivers that are supposed to override these, such as acpi_pcib_pci which should override pci_pci for PCI-PCI bridges in the ACPI namespace. That driver currently hardcodes -1000 itself. :-/ Then there's pcibios_pcib_probe for the $PIR PCI-PCI bridge driver for when ACPI isn't present. It returns -2000. The MPTable PCI-PCI bridge driver returns -1000 like ACPI. That relative order (ACPI and MPTable are most preferred, then $PIR, then generic PCI-PCI) is important for PCI INTx interrupt routing on x86. In general any platform which knows better how to route INTx interrupts than the swizzle defined for add-on cards that pci_pci uses should override the pci_pci driver via a higher probe value. In this case simply using the stock BUS_PROBE values doesn't quite work since there isn't just DEFAULT/GENERIC, but on x86 you have at least three levels. Also, BUS_PROBE_GENERIC does have a meaning and it is well suited to these drivers. It is for drivers that match large classes of devices rather than specific devices. In PCI terms that would mean a device that matches on class/subclass rather than vendor/device ID (which is true of these bridge drivers. ignore_pci is a different animal). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 16:09:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A6AA3DB; Sat, 6 Jun 2015 16:09:27 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4747310D2; Sat, 6 Jun 2015 16:09:27 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56G9Rcx021339; Sat, 6 Jun 2015 16:09:27 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56G9P66021328; Sat, 6 Jun 2015 16:09:25 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201506061609.t56G9P66021328@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 6 Jun 2015 16:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284079 - head/sys/dev/proto 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, 06 Jun 2015 16:09:27 -0000 Author: marcel Date: Sat Jun 6 16:09:25 2015 New Revision: 284079 URL: https://svnweb.freebsd.org/changeset/base/284079 Log: DMA support part 1: DMA tag create & destroy Create a special resource (= device special file) for management of tags and maps, as well as for mapping memory into the address space. DMA resources are managed using the PROTO_IOC_BUSDMA ioctl. Part 1 implements tag creation, derivation and destruction. Added: head/sys/dev/proto/proto_busdma.c (contents, props changed) head/sys/dev/proto/proto_busdma.h (contents, props changed) Modified: head/sys/dev/proto/proto.h head/sys/dev/proto/proto_bus_pci.c head/sys/dev/proto/proto_core.c head/sys/dev/proto/proto_dev.h Modified: head/sys/dev/proto/proto.h ============================================================================== --- head/sys/dev/proto/proto.h Sat Jun 6 15:51:11 2015 (r284078) +++ head/sys/dev/proto/proto.h Sat Jun 6 16:09:25 2015 (r284079) @@ -33,11 +33,15 @@ #define PROTO_RES_UNUSED 0 #define PROTO_RES_PCICFG 10 +#define PROTO_RES_BUSDMA 11 struct proto_res { int r_type; int r_rid; - struct resource *r_res; + union { + struct resource *res; + void *busdma; + } r_d; u_long r_size; union { void *cookie; Modified: head/sys/dev/proto/proto_bus_pci.c ============================================================================== --- head/sys/dev/proto/proto_bus_pci.c Sat Jun 6 15:51:11 2015 (r284078) +++ head/sys/dev/proto/proto_bus_pci.c Sat Jun 6 16:09:25 2015 (r284079) @@ -87,6 +87,7 @@ proto_pci_attach(device_t dev) sc = device_get_softc(dev); proto_add_resource(sc, PROTO_RES_PCICFG, 0, NULL); + proto_add_resource(sc, PROTO_RES_BUSDMA, 0, NULL); for (bar = 0; bar < PCIR_MAX_BAR_0; bar++) { rid = PCIR_BAR(bar); Added: head/sys/dev/proto/proto_busdma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/proto/proto_busdma.c Sat Jun 6 16:09:25 2015 (r284079) @@ -0,0 +1,167 @@ +/*- + * Copyright (c) 2015 Marcel Moolenaar + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +MALLOC_DEFINE(M_PROTO_BUSDMA, "proto_busdma", "DMA management data"); + +static int +proto_busdma_tag_create(struct proto_ioc_busdma *ioc, + struct proto_tag **tag_io, bus_dma_tag_t *busdma_tag_io) +{ + struct proto_tag *tag; + int error; + + error = bus_dma_tag_create(*busdma_tag_io, ioc->u.tag.align, + ioc->u.tag.bndry, ioc->u.tag.maxaddr, BUS_SPACE_MAXADDR, + NULL, NULL, ioc->u.tag.maxsz, ioc->u.tag.nsegs, + ioc->u.tag.maxsegsz, ioc->u.tag.flags, NULL, NULL, + busdma_tag_io); + if (error) + return (error); + + tag = malloc(sizeof(*tag), M_PROTO_BUSDMA, M_WAITOK | M_ZERO); + tag->parent = *tag_io; + tag->busdma_tag = *busdma_tag_io; + *tag_io = tag; + return (0); +} + +static void +proto_busdma_tag_destroy(struct proto_tag *tag) +{ + + bus_dma_tag_destroy(tag->busdma_tag); + free(tag, M_PROTO_BUSDMA); +} + +static struct proto_tag * +proto_busdma_tag_lookup(struct proto_busdma *busdma, u_long key) +{ + struct proto_tag *tag; + + LIST_FOREACH(tag, &busdma->tags, link) { + if ((void *)tag == (void *)key) + return (tag); + } + return (NULL); +} + +struct proto_busdma * +proto_busdma_attach(struct proto_softc *sc) +{ + struct proto_busdma *busdma; + + busdma = malloc(sizeof(*busdma), M_PROTO_BUSDMA, M_WAITOK | M_ZERO); + return (busdma); +} + +int +proto_busdma_detach(struct proto_softc *sc, struct proto_busdma *busdma) +{ + + proto_busdma_cleanup(sc, busdma); + free(busdma, M_PROTO_BUSDMA); + return (0); +} + +int +proto_busdma_cleanup(struct proto_softc *sc, struct proto_busdma *busdma) +{ + struct proto_tag *tag, *tag1; + + LIST_FOREACH_SAFE(tag, &busdma->tags, link, tag1) { + LIST_REMOVE(tag, link); + proto_busdma_tag_destroy(tag); + } + return (0); +} + +int +proto_busdma_ioctl(struct proto_softc *sc, struct proto_busdma *busdma, + struct proto_ioc_busdma *ioc) +{ + struct proto_tag *tag; + bus_dma_tag_t busdma_tag; + int error; + + error = 0; + switch (ioc->request) { + case PROTO_IOC_BUSDMA_TAG_CREATE: + busdma_tag = bus_get_dma_tag(sc->sc_dev); + tag = NULL; + error = proto_busdma_tag_create(ioc, &tag, &busdma_tag); + if (error) + break; + LIST_INSERT_HEAD(&busdma->tags, tag, link); + ioc->key = (uintptr_t)(void *)tag; + break; + case PROTO_IOC_BUSDMA_TAG_DERIVE: + tag = proto_busdma_tag_lookup(busdma, ioc->key); + if (tag == NULL) { + error = EINVAL; + break; + } + busdma_tag = tag->busdma_tag; + error = proto_busdma_tag_create(ioc, &tag, &busdma_tag); + if (error) + break; + LIST_INSERT_HEAD(&busdma->tags, tag, link); + ioc->key = (uintptr_t)(void *)tag; + break; + case PROTO_IOC_BUSDMA_TAG_DESTROY: + tag = proto_busdma_tag_lookup(busdma, ioc->key); + if (tag == NULL) { + error = EINVAL; + break; + } + LIST_REMOVE(tag, link); + proto_busdma_tag_destroy(tag); + break; + default: + error = EINVAL; + break; + } + return (error); +} Added: head/sys/dev/proto/proto_busdma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/proto/proto_busdma.h Sat Jun 6 16:09:25 2015 (r284079) @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 2015 Marcel Moolenaar + * 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_PROTO_BUSDMA_H_ +#define _DEV_PROTO_BUSDMA_H_ + +struct proto_tag { + LIST_ENTRY(proto_tag) link; + struct proto_tag *parent; + bus_dma_tag_t busdma_tag; +}; + +struct proto_busdma { + LIST_HEAD(,proto_tag) tags; +}; + +struct proto_busdma *proto_busdma_attach(struct proto_softc *); +int proto_busdma_detach(struct proto_softc *, struct proto_busdma *); + +int proto_busdma_cleanup(struct proto_softc *, struct proto_busdma *); + +int proto_busdma_ioctl(struct proto_softc *, struct proto_busdma *, + struct proto_ioc_busdma *); + +#endif /* _DEV_PROTO_BUSDMA_H_ */ Modified: head/sys/dev/proto/proto_core.c ============================================================================== --- head/sys/dev/proto/proto_core.c Sat Jun 6 15:51:11 2015 (r284078) +++ head/sys/dev/proto/proto_core.c Sat Jun 6 16:09:25 2015 (r284079) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include CTASSERT(SYS_RES_IRQ != PROTO_RES_UNUSED && SYS_RES_MEMORY != PROTO_RES_UNUSED && @@ -58,6 +59,9 @@ CTASSERT(SYS_RES_IRQ != PROTO_RES_UNUSED CTASSERT(SYS_RES_IRQ != PROTO_RES_PCICFG && SYS_RES_MEMORY != PROTO_RES_PCICFG && SYS_RES_IOPORT != PROTO_RES_PCICFG); +CTASSERT(SYS_RES_IRQ != PROTO_RES_BUSDMA && + SYS_RES_MEMORY != PROTO_RES_BUSDMA && + SYS_RES_IOPORT != PROTO_RES_BUSDMA); devclass_t proto_devclass; char proto_driver_name[] = "proto"; @@ -97,7 +101,7 @@ proto_add_resource(struct proto_softc *s r = sc->sc_res + sc->sc_rescnt++; r->r_type = type; r->r_rid = rid; - r->r_res = res; + r->r_d.res = res; return (0); } @@ -130,7 +134,7 @@ proto_attach(device_t dev) break; case SYS_RES_MEMORY: case SYS_RES_IOPORT: - r->r_size = rman_get_size(r->r_res); + r->r_size = rman_get_size(r->r_d.res); r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, "proto/%s/%02x.%s", device_get_desc(dev), r->r_rid, (r->r_type == SYS_RES_IOPORT) ? "io" : "mem"); @@ -144,6 +148,14 @@ proto_attach(device_t dev) r->r_u.cdev->si_drv1 = sc; r->r_u.cdev->si_drv2 = r; break; + case PROTO_RES_BUSDMA: + r->r_d.busdma = proto_busdma_attach(sc); + r->r_size = 0; /* no read(2) nor write(2) */ + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + "proto/%s/busdma", device_get_desc(dev)); + r->r_u.cdev->si_drv1 = sc; + r->r_u.cdev->si_drv2 = r; + break; } } return (0); @@ -158,7 +170,7 @@ proto_detach(device_t dev) sc = device_get_softc(dev); - /* Don't detach if we have open device filess. */ + /* Don't detach if we have open device files. */ for (res = 0; res < sc->sc_rescnt; res++) { r = sc->sc_res + res; if (r->r_opened) @@ -170,17 +182,22 @@ proto_detach(device_t dev) switch (r->r_type) { case SYS_RES_IRQ: /* XXX TODO */ + bus_release_resource(dev, r->r_type, r->r_rid, + r->r_d.res); break; case SYS_RES_MEMORY: case SYS_RES_IOPORT: + bus_release_resource(dev, r->r_type, r->r_rid, + r->r_d.res); + destroy_dev(r->r_u.cdev); + break; case PROTO_RES_PCICFG: destroy_dev(r->r_u.cdev); break; - } - if (r->r_res != NULL) { - bus_release_resource(dev, r->r_type, r->r_rid, - r->r_res); - r->r_res = NULL; + case PROTO_RES_BUSDMA: + proto_busdma_detach(sc, r->r_d.busdma); + destroy_dev(r->r_u.cdev); + break; } r->r_type = PROTO_RES_UNUSED; } @@ -207,10 +224,14 @@ static int proto_close(struct cdev *cdev, int fflag, int devtype, struct thread *td) { struct proto_res *r; + struct proto_softc *sc; + sc = cdev->si_drv1; r = cdev->si_drv2; if (!atomic_cmpset_acq_ptr(&r->r_opened, (uintptr_t)td->td_proc, 0UL)) return (ENXIO); + if (r->r_type == PROTO_RES_BUSDMA) + proto_busdma_cleanup(sc, r->r_d.busdma); return (0); } @@ -244,21 +265,21 @@ proto_read(struct cdev *cdev, struct uio switch (width) { case 1: buf.x1[0] = (r->r_type == PROTO_RES_PCICFG) ? - pci_read_config(dev, ofs, 1) : bus_read_1(r->r_res, ofs); + pci_read_config(dev, ofs, 1) : bus_read_1(r->r_d.res, ofs); break; case 2: buf.x2[0] = (r->r_type == PROTO_RES_PCICFG) ? - pci_read_config(dev, ofs, 2) : bus_read_2(r->r_res, ofs); + pci_read_config(dev, ofs, 2) : bus_read_2(r->r_d.res, ofs); break; case 4: buf.x4[0] = (r->r_type == PROTO_RES_PCICFG) ? - pci_read_config(dev, ofs, 4) : bus_read_4(r->r_res, ofs); + pci_read_config(dev, ofs, 4) : bus_read_4(r->r_d.res, ofs); break; #ifndef __i386__ case 8: if (r->r_type == PROTO_RES_PCICFG) return (EINVAL); - buf.x8[0] = bus_read_8(r->r_res, ofs); + buf.x8[0] = bus_read_8(r->r_d.res, ofs); break; #endif default: @@ -305,25 +326,25 @@ proto_write(struct cdev *cdev, struct ui if (r->r_type == PROTO_RES_PCICFG) pci_write_config(dev, ofs, buf.x1[0], 1); else - bus_write_1(r->r_res, ofs, buf.x1[0]); + bus_write_1(r->r_d.res, ofs, buf.x1[0]); break; case 2: if (r->r_type == PROTO_RES_PCICFG) pci_write_config(dev, ofs, buf.x2[0], 2); else - bus_write_2(r->r_res, ofs, buf.x2[0]); + bus_write_2(r->r_d.res, ofs, buf.x2[0]); break; case 4: if (r->r_type == PROTO_RES_PCICFG) pci_write_config(dev, ofs, buf.x4[0], 4); else - bus_write_4(r->r_res, ofs, buf.x4[0]); + bus_write_4(r->r_d.res, ofs, buf.x4[0]); break; #ifndef __i386__ case 8: if (r->r_type == PROTO_RES_PCICFG) return (EINVAL); - bus_write_8(r->r_res, ofs, buf.x8[0]); + bus_write_8(r->r_d.res, ofs, buf.x8[0]); break; #endif default: @@ -338,9 +359,12 @@ proto_ioctl(struct cdev *cdev, u_long cm struct thread *td) { struct proto_ioc_region *region; + struct proto_ioc_busdma *busdma; struct proto_res *r; + struct proto_softc *sc; int error; + sc = cdev->si_drv1; r = cdev->si_drv2; error = 0; @@ -351,7 +375,11 @@ proto_ioctl(struct cdev *cdev, u_long cm if (r->r_type == PROTO_RES_PCICFG) region->address = 0; else - region->address = rman_get_start(r->r_res); + region->address = rman_get_start(r->r_d.res); + break; + case PROTO_IOC_BUSDMA: + busdma = (struct proto_ioc_busdma *)data; + error = proto_busdma_ioctl(sc, r->r_d.busdma, busdma); break; default: error = ENOIOCTL; @@ -376,7 +404,7 @@ proto_mmap(struct cdev *cdev, vm_ooffset return (EACCES); if (offset >= r->r_size) return (EINVAL); - *paddr = rman_get_start(r->r_res) + offset; + *paddr = rman_get_start(r->r_d.res) + offset; #ifndef __sparc64__ *memattr = VM_MEMATTR_UNCACHEABLE; #endif Modified: head/sys/dev/proto/proto_dev.h ============================================================================== --- head/sys/dev/proto/proto_dev.h Sat Jun 6 15:51:11 2015 (r284078) +++ head/sys/dev/proto/proto_dev.h Sat Jun 6 16:09:25 2015 (r284079) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Marcel Moolenaar + * Copyright (c) 2014, 2015 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,4 +40,27 @@ struct proto_ioc_region { #define PROTO_IOC_REGION _IOWR(PROTO_IOC_CLASS, 1, struct proto_ioc_region) +struct proto_ioc_busdma { + unsigned int request; +#define PROTO_IOC_BUSDMA_TAG_CREATE 1 +#define PROTO_IOC_BUSDMA_TAG_DERIVE 2 +#define PROTO_IOC_BUSDMA_TAG_DESTROY 3 + unsigned long key; + union { + struct { + unsigned long align; + unsigned long bndry; + unsigned long maxaddr; + unsigned long maxsz; + unsigned long maxsegsz; + unsigned int nsegs; + unsigned int datarate; + unsigned int flags; + } tag; + } u; + unsigned long result; +}; + +#define PROTO_IOC_BUSDMA _IOWR(PROTO_IOC_CLASS, 2, struct proto_ioc_busdma) + #endif /* _DEV_PROTO_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 16:14:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B7F2571; Sat, 6 Jun 2015 16:14:06 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 080CA132B; Sat, 6 Jun 2015 16:14:06 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56GE5ND025634; Sat, 6 Jun 2015 16:14:05 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56GE4SV025621; Sat, 6 Jun 2015 16:14:04 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201506061614.t56GE4SV025621@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 6 Jun 2015 16:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284080 - in head/tools/bus_space: . C Python 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, 06 Jun 2015 16:14:06 -0000 Author: marcel Date: Sat Jun 6 16:14:03 2015 New Revision: 284080 URL: https://svnweb.freebsd.org/changeset/base/284080 Log: Add DMA tag management to the C library and Python binding. Added: head/tools/bus_space/busdma.c (contents, props changed) head/tools/bus_space/busdma.h (contents, props changed) Modified: head/tools/bus_space/C/Makefile head/tools/bus_space/C/lang.c head/tools/bus_space/C/libbus_space.h head/tools/bus_space/Makefile.inc head/tools/bus_space/Python/lang.c Modified: head/tools/bus_space/C/Makefile ============================================================================== --- head/tools/bus_space/C/Makefile Sat Jun 6 16:09:25 2015 (r284079) +++ head/tools/bus_space/C/Makefile Sat Jun 6 16:14:03 2015 (r284080) @@ -3,6 +3,7 @@ LIB= bus_space SHLIB_MAJOR= 0 SRCS= lang.c +INCS= libbus_space.h CFLAGS+= -I${.CURDIR}/.. Modified: head/tools/bus_space/C/lang.c ============================================================================== --- head/tools/bus_space/C/lang.c Sat Jun 6 16:09:25 2015 (r284079) +++ head/tools/bus_space/C/lang.c Sat Jun 6 16:14:03 2015 (r284080) @@ -31,9 +31,10 @@ __FBSDID("$FreeBSD$"); #include #include "bus_space.h" +#include "busdma.h" #include "libbus_space.h" -int +int16_t bus_space_read_1(int rid, long ofs) { uint8_t val; @@ -41,7 +42,7 @@ bus_space_read_1(int rid, long ofs) return ((!bs_read(rid, ofs, &val, sizeof(val))) ? -1 : (int)val); } -int +int32_t bus_space_read_2(int rid, long ofs) { uint16_t val; @@ -98,3 +99,41 @@ bus_space_subregion(int rid, long ofs, l return (bs_subregion(rid, ofs, sz)); } + +int +busdma_tag_create(const char *dev, bus_addr_t align, bus_addr_t bndry, + bus_addr_t maxaddr, bus_size_t maxsz, u_int nsegs, bus_size_t maxsegsz, + u_int datarate, u_int flags, busdma_tag_t *out_p) +{ + int res; + + res = bd_tag_create(dev, align, bndry, maxaddr, maxsz, nsegs, maxsegsz, + datarate, flags); + if (res == -1) + return (errno); + *out_p = res; + return (0); +} + +int +busdma_tag_derive(busdma_tag_t tag, bus_addr_t align, bus_addr_t bndry, + bus_addr_t maxaddr, bus_size_t maxsz, u_int nsegs, bus_size_t maxsegsz, + u_int datarate, u_int flags, busdma_tag_t *out_p) +{ + int res; + + res = bd_tag_derive(tag, align, bndry, maxaddr, maxsz, nsegs, maxsegsz, + datarate, flags); + if (res == -1) + return (errno); + *out_p = res; + return (0); +} + +int +busdma_tag_destroy(busdma_tag_t tag) +{ + + return (bd_tag_destroy(tag)); +} + Modified: head/tools/bus_space/C/libbus_space.h ============================================================================== --- head/tools/bus_space/C/libbus_space.h Sat Jun 6 16:09:25 2015 (r284079) +++ head/tools/bus_space/C/libbus_space.h Sat Jun 6 16:14:03 2015 (r284080) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Marcel Moolenaar + * Copyright (c) 2014, 2015 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,14 +29,28 @@ #ifndef _LIBBUS_SPACE_H_ #define _LIBBUS_SPACE_H_ -int bus_space_map(const char *dev); -int bus_space_read_1(int rid, long ofs); -int bus_space_read_2(int rid, long ofs); +int bus_space_map(const char *dev); +int16_t bus_space_read_1(int rid, long ofs); +int32_t bus_space_read_2(int rid, long ofs); int64_t bus_space_read_4(int rid, long ofs); -int bus_space_subregion(int rid, long ofs, long sz); -int bus_space_unmap(int rid); -int bus_space_write_1(int rid, long ofs, uint8_t val); -int bus_space_write_2(int rid, long ofs, uint16_t val); -int bus_space_write_4(int rid, long ofs, uint32_t val); +int bus_space_subregion(int rid, long ofs, long sz); +int bus_space_unmap(int rid); +int bus_space_write_1(int rid, long ofs, uint8_t val); +int bus_space_write_2(int rid, long ofs, uint16_t val); +int bus_space_write_4(int rid, long ofs, uint32_t val); + +typedef unsigned long bus_addr_t; +typedef unsigned long bus_size_t; +typedef int busdma_tag_t; + +int busdma_tag_create(const char *dev, bus_addr_t align, bus_addr_t bndry, + bus_addr_t maxaddr, bus_size_t maxsz, u_int nsegs, + bus_size_t maxsegsz, u_int datarate, u_int flags, + busdma_tag_t *out_p); +int busdma_tag_derive(busdma_tag_t tag, bus_addr_t align, bus_addr_t bndry, + bus_addr_t maxaddr, bus_size_t maxsz, u_int nsegs, + bus_size_t maxsegsz, u_int datarate, u_int flags, + busdma_tag_t *out_p); +int busdma_tag_destroy(busdma_tag_t tag); #endif /* _LIBBUS_SPACE_H_ */ Modified: head/tools/bus_space/Makefile.inc ============================================================================== --- head/tools/bus_space/Makefile.inc Sat Jun 6 16:09:25 2015 (r284079) +++ head/tools/bus_space/Makefile.inc Sat Jun 6 16:14:03 2015 (r284080) @@ -1,4 +1,4 @@ # $FreeBSD$ .PATH: ${.CURDIR}/.. -SRCS+= bus_space.c +SRCS+= bus_space.c busdma.c Modified: head/tools/bus_space/Python/lang.c ============================================================================== --- head/tools/bus_space/Python/lang.c Sat Jun 6 16:09:25 2015 (r284079) +++ head/tools/bus_space/Python/lang.c Sat Jun 6 16:14:03 2015 (r284080) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include "bus_space.h" +#include "busdma.h" static PyObject * bus_read_1(PyObject *self, PyObject *args) @@ -173,6 +174,58 @@ bus_subregion(PyObject *self, PyObject * return (Py_BuildValue("i", rid)); } +static PyObject * +busdma_tag_create(PyObject *self, PyObject *args) +{ + char *dev; + long align, bndry, maxaddr, maxsz, maxsegsz; + int tid, nsegs, datarate, flags; + + if (!PyArg_ParseTuple(args, "sllllilii", &dev, &align, &bndry, + &maxaddr, &maxsz, &nsegs, &maxsegsz, &datarate, &flags)) + return (NULL); + tid = bd_tag_create(dev, align, bndry, maxaddr, maxsz, nsegs, + maxsegsz, datarate, flags); + if (tid == -1) { + PyErr_SetString(PyExc_IOError, strerror(errno)); + return (NULL); + } + return (Py_BuildValue("i", tid)); +} + +static PyObject * +busdma_tag_derive(PyObject *self, PyObject *args) +{ + long align, bndry, maxaddr, maxsz, maxsegsz; + int ptid, tid, nsegs, datarate, flags; + + if (!PyArg_ParseTuple(args, "illllilii", &ptid, &align, &bndry, + &maxaddr, &maxsz, &nsegs, &maxsegsz, &datarate, &flags)) + return (NULL); + tid = bd_tag_derive(ptid, align, bndry, maxaddr, maxsz, nsegs, + maxsegsz, datarate, flags); + if (tid == -1) { + PyErr_SetString(PyExc_IOError, strerror(errno)); + return (NULL); + } + return (Py_BuildValue("i", tid)); +} + +static PyObject * +busdma_tag_destroy(PyObject *self, PyObject *args) +{ + int error, tid; + + if (!PyArg_ParseTuple(args, "i", &tid)) + return (NULL); + error = bd_tag_destroy(tid); + if (error) { + PyErr_SetString(PyExc_IOError, strerror(error)); + return (NULL); + } + Py_RETURN_NONE; +} + static PyMethodDef bus_space_methods[] = { { "read_1", bus_read_1, METH_VARARGS, "Read a 1-byte data item." }, { "read_2", bus_read_2, METH_VARARGS, "Read a 2-byte data item." }, @@ -192,9 +245,17 @@ static PyMethodDef bus_space_methods[] = { NULL, NULL, 0, NULL } }; +static PyMethodDef busdma_methods[] = { + { "tag_create", busdma_tag_create, METH_VARARGS, "Create a root tag." }, + { "tag_derive", busdma_tag_derive, METH_VARARGS, "Derive a child tag." }, + { "tag_destroy", busdma_tag_destroy, METH_VARARGS, "Destroy a tag." }, + { NULL, NULL, 0, NULL } +}; + PyMODINIT_FUNC initbus_space(void) { Py_InitModule("bus_space", bus_space_methods); + Py_InitModule("busdma", busdma_methods); } Added: head/tools/bus_space/busdma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bus_space/busdma.c Sat Jun 6 16:14:03 2015 (r284080) @@ -0,0 +1,218 @@ +/*- + * Copyright (c) 2015 Marcel Moolenaar + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "busdma.h" + +#include "../../sys/dev/proto/proto_dev.h" + +struct tag { + int tid; + u_int refcnt; + int fd; + struct tag *ptag; + u_long key; + u_long align; + u_long bndry; + u_long maxaddr; +}; + +static struct tag **tidtbl = NULL; +static int ntids = 0; + +static struct tag * +tag_alloc(void) +{ + struct tag **newtbl, *tag; + int tid; + + tag = malloc(sizeof(struct tag)); + tag->refcnt = 0; + + for (tid = 0; tid < ntids; tid++) { + if (tidtbl[tid] == 0) + break; + } + if (tid == ntids) { + newtbl = realloc(tidtbl, sizeof(struct tag *) * (ntids + 1)); + if (newtbl == NULL) { + free(tag); + return (NULL); + } + tidtbl = newtbl; + ntids++; + } + tidtbl[tid] = tag; + tag->tid = tid; + return (tag); +} + +static int +tag_free(struct tag *tag) +{ + + tidtbl[tag->tid] = NULL; + free(tag); + return (0); +} + +static struct tag * +tid_lookup(int tid) +{ + struct tag *tag; + + if (tid < 0 || tid >= ntids) { + errno = EINVAL; + return (NULL); + } + tag = tidtbl[tid]; + if (tag->refcnt == 0) { + errno = ENXIO; + return (NULL); + } + return (tag); +} + +struct tag * +bd_tag_new(struct tag *ptag, int fd, u_long align, u_long bndry, + u_long maxaddr, u_long maxsz, u_int nsegs, u_long maxsegsz, + u_int datarate, u_int flags) +{ + struct proto_ioc_busdma ioc; + struct tag *tag; + + tag = tag_alloc(); + if (tag == NULL) + return (NULL); + + memset(&ioc, 0, sizeof(ioc)); + ioc.request = (ptag != NULL) ? PROTO_IOC_BUSDMA_TAG_DERIVE : + PROTO_IOC_BUSDMA_TAG_CREATE; + ioc.key = (ptag != NULL) ? ptag->key : 0; + ioc.u.tag.align = align; + ioc.u.tag.bndry = bndry; + ioc.u.tag.maxaddr = maxaddr; + ioc.u.tag.maxsz = maxsz; + ioc.u.tag.nsegs = nsegs; + ioc.u.tag.maxsegsz = maxsegsz; + ioc.u.tag.datarate = datarate; + ioc.u.tag.flags = flags; + if (ioctl(fd, PROTO_IOC_BUSDMA, &ioc) == -1) { + tag_free(tag); + return (NULL); + } + tag->refcnt = 1; + tag->fd = fd; + tag->ptag = ptag; + tag->key = ioc.key; + tag->align = ioc.u.tag.align; + tag->bndry = ioc.u.tag.bndry; + tag->maxaddr = ioc.u.tag.maxaddr; + return (tag); +} + +int +bd_tag_create(const char *dev, u_long align, u_long bndry, u_long maxaddr, + u_long maxsz, u_int nsegs, u_long maxsegsz, u_int datarate, u_int flags) +{ + struct tag *tag; + int fd; + + fd = open(dev, O_RDWR); + if (fd == -1) + return (-1); + + tag = bd_tag_new(NULL, fd, align, bndry, maxaddr, maxsz, nsegs, + maxsegsz, datarate, flags); + if (tag == NULL) { + close(fd); + return (-1); + } + return (tag->tid); +} + +int +bd_tag_derive(int ptid, u_long align, u_long bndry, u_long maxaddr, + u_long maxsz, u_int nsegs, u_long maxsegsz, u_int datarate, u_int flags) +{ + struct tag *ptag, *tag; + + ptag = tid_lookup(ptid); + if (ptag == NULL) + return (-1); + + tag = bd_tag_new(ptag, ptag->fd, align, bndry, maxaddr, maxsz, nsegs, + maxsegsz, datarate, flags); + if (tag == NULL) + return (-1); + while (ptag != NULL) { + ptag->refcnt++; + ptag = ptag->ptag; + } + return (tag->tid); +} + +int +bd_tag_destroy(int tid) +{ + struct proto_ioc_busdma ioc; + struct tag *ptag, *tag; + + tag = tid_lookup(tid); + if (tag == NULL) + return (errno); + if (tag->refcnt > 1) + return (EBUSY); + + memset(&ioc, 0, sizeof(ioc)); + ioc.request = PROTO_IOC_BUSDMA_TAG_DESTROY; + ioc.key = tag->key; + if (ioctl(tag->fd, PROTO_IOC_BUSDMA, &ioc) == -1) + return (errno); + + ptag = tag->ptag; + if (ptag == NULL) + close(tag->fd); + else { + do { + ptag->refcnt--; + ptag = ptag->ptag; + } while (ptag != NULL); + } + tag_free(tag); + return (0); +} Added: head/tools/bus_space/busdma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bus_space/busdma.h Sat Jun 6 16:14:03 2015 (r284080) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2015 Marcel Moolenaar + * 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 _TOOLS_BUS_DMA_H_ +#define _TOOLS_BUS_DMA_H_ + +int bd_tag_create(const char *dev, u_long align, u_long bndry, + u_long maxaddr, u_long maxsz, u_int nsegs, u_long maxsegsz, + u_int datarate, u_int flags); +int bd_tag_derive(int tid, u_long align, u_long bndry, u_long maxaddr, + u_long maxsz, u_int nsegs, u_long maxsegsz, u_int datarate, + u_int flags); +int bd_tag_destroy(int tid); + +#endif /* _TOOLS_BUS_DMA_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 16:18:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71F576D5; Sat, 6 Jun 2015 16:18:30 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (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 3940E1346; Sat, 6 Jun 2015 16:18:29 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from [192.168.2.22] (atc.xcllnt.net [50.0.150.213]) (authenticated bits=0) by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id t56GIMGZ029319 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 6 Jun 2015 09:18:23 -0700 (PDT) (envelope-from marcel@xcllnt.net) Subject: Re: svn commit: r284078 - head/sys/dev/pci Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: multipart/signed; boundary="Apple-Mail=_207B226B-160B-4BE9-B25F-24AEBBBAFBC2"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Marcel Moolenaar In-Reply-To: <14005803.mtbqcRkBJG@ralph.baldwin.cx> Date: Sat, 6 Jun 2015 09:18:22 -0700 Cc: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201506061551.t56FpCbX013048@svn.freebsd.org> <14005803.mtbqcRkBJG@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Jun 2015 16:18:30 -0000 --Apple-Mail=_207B226B-160B-4BE9-B25F-24AEBBBAFBC2 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jun 6, 2015, at 9:03 AM, John Baldwin wrote: > > On Saturday, June 06, 2015 03:51:12 PM Marcel Moolenaar wrote: >> Author: marcel >> Date: Sat Jun 6 15:51:11 2015 >> New Revision: 284078 >> URL: https://svnweb.freebsd.org/changeset/base/284078 >> >> Log: >> Don't return -10000 as the probe priority. That's lower than what >> BUS_PROBE_HOOVER is. Drivers like proto(4), when compiled into the >> kernel or preloaded, will render your system useless by virtue of >> attaching to your PCI busses. >> >> Return BUS_PROBE_GENERIC instead. It's just the next priority up >> from BUS_PROBE_HOOVER. No other meaning has been give to its use. >> While BUS_PROBE_DEFAULT seems like a better candidate, it's hard >> not to think that there must be some reason why these drivers >> return -10000 in the first place. > > BUS_PROBE_DEFAULT would conflict with other drivers that are supposed to > override these, such as acpi_pcib_pci which should override pci_pci > for PCI-PCI bridges in the ACPI namespace. That driver currently hardcodes > -1000 itself. :-/ Then there's pcibios_pcib_probe for the $PIR PCI-PCI > bridge driver for when ACPI isn't present. It returns -2000. The > MPTable PCI-PCI bridge driver returns -1000 like ACPI. So that means we have a regression. Do you want me to back out or should we just move forward and fix those too. An alternative is to change BUS_PROBE_HOOVER to -100000 and be done with it. Thoughts? -- Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_207B226B-160B-4BE9-B25F-24AEBBBAFBC2 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 iQIcBAEBCgAGBQJVcx1OAAoJEIda8t8f0tjjCBUQANIz8UAlVPimSGYGez0HRsBm O5UJXOYArWcgNYfJesU5XkJ9eeLstcPtEZfo64S7iCC4hN1KhXIEI5HonlU8b4b5 GzNx4URq4f6yIZ+T1P3Lj354JaMlHrCVzP4fZ748GXB8YZJbaPFOMlZei/A2jKv2 X0ExIVHBLBLnAWtYFLMrtxkb8y2DqnbwcH5twVvD7q+tvne+syBBQCeWJRlA/4jI deWg8YwmbbQMK/c3xkIWE+YiOK/YwV3cbh+lGjokvWk/2SyQkE2XROwIIjE/bTI7 9oWF/HQPHl5HcGqWUNsWQe71whBxq2tQam6WnSk2iHNeKnDh7PSRY0S3fukAUuPI LWMLuMov5duoqumEcU8W+byT4kRIh0bZsXf/AEtrQ3/gwXRwnhNFyyGoAo3Twci9 GA2MJCXo9jZalhilrIg1r7bCR18ha7+LX7yUTH37BiJpB5z+r9jds9XCsm6lUjvV PsosuCmu/dDm7K88xUPwSCaqTWVvI5/T7roHF6+YOIAHW+ERs+qSMBCNttCbEGQJ YOKX37PfoGlaz4zNGOBA/3wiIvSi/Ks9SKBleTNONyA1ibajQhoWl/bgRUiFiIfz e8jOPn/FcqL3il+vLxzctbKRD1uwL8Vq0ogdFkuWGT46FQBNohALkDYXn6YsIdRa 2540SsBJlX5bwhNj7Jx7 =S0AO -----END PGP SIGNATURE----- --Apple-Mail=_207B226B-160B-4BE9-B25F-24AEBBBAFBC2-- From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 16:20:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F100A824; Sat, 6 Jun 2015 16:20:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DEA6D139C; Sat, 6 Jun 2015 16:20:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56GKdKF029143; Sat, 6 Jun 2015 16:20:39 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56GKdf8029142; Sat, 6 Jun 2015 16:20:39 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201506061620.t56GKdf8029142@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 6 Jun 2015 16:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284081 - head/sys/modules/proto 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, 06 Jun 2015 16:20:40 -0000 Author: marcel Date: Sat Jun 6 16:20:39 2015 New Revision: 284081 URL: https://svnweb.freebsd.org/changeset/base/284081 Log: Add proto_busdma.c to the module. Modified: head/sys/modules/proto/Makefile Modified: head/sys/modules/proto/Makefile ============================================================================== --- head/sys/modules/proto/Makefile Sat Jun 6 16:14:03 2015 (r284080) +++ head/sys/modules/proto/Makefile Sat Jun 6 16:20:39 2015 (r284081) @@ -5,6 +5,7 @@ KMOD= proto SRCS= \ proto_bus_pci.c \ + proto_busdma.c \ proto_core.c SRCS+= \ From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 16:36:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 014E9AF8; Sat, 6 Jun 2015 16:36:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E3E0217C7; Sat, 6 Jun 2015 16:36:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56GaD2X035921; Sat, 6 Jun 2015 16:36:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56GaDK0035920; Sat, 6 Jun 2015 16:36:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201506061636.t56GaDK0035920@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 6 Jun 2015 16:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284082 - head/sys/fs/unionfs 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, 06 Jun 2015 16:36:14 -0000 Author: markj Date: Sat Jun 6 16:36:13 2015 New Revision: 284082 URL: https://svnweb.freebsd.org/changeset/base/284082 Log: unionfs: fix suspendability check bugs - MNTK_SUSPENDABLE is set in mnt_kern_flag, not mnt_flag. - The lower layer of a unionfs mount is read-only, so the mount should be suspendable iff the upper layer is suspendable. - Remove a couple of superfluous comments. Differential Revision: https://reviews.freebsd.org/D2714 Reviewed by: kib, mjg Modified: head/sys/fs/unionfs/union_vfsops.c Modified: head/sys/fs/unionfs/union_vfsops.c ============================================================================== --- head/sys/fs/unionfs/union_vfsops.c Sat Jun 6 16:20:39 2015 (r284081) +++ head/sys/fs/unionfs/union_vfsops.c Sat Jun 6 16:36:13 2015 (r284082) @@ -291,18 +291,11 @@ unionfs_domount(struct mount *mp) } MNT_ILOCK(mp); - /* - * Check mnt_flag - */ if ((ump->um_lowervp->v_mount->mnt_flag & MNT_LOCAL) && (ump->um_uppervp->v_mount->mnt_flag & MNT_LOCAL)) mp->mnt_flag |= MNT_LOCAL; - /* - * Check mnt_kern_flag - */ - if ((ump->um_lowervp->v_mount->mnt_flag & MNTK_SUSPENDABLE) || - (ump->um_uppervp->v_mount->mnt_flag & MNTK_SUSPENDABLE)) + if ((ump->um_uppervp->v_mount->mnt_kern_flag & MNTK_SUSPENDABLE) != 0) mp->mnt_kern_flag |= MNTK_SUSPENDABLE; MNT_IUNLOCK(mp); From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 16:38:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04675C5D; Sat, 6 Jun 2015 16:38:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CDD4D17E8; Sat, 6 Jun 2015 16:38:40 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56GceMD036274; Sat, 6 Jun 2015 16:38:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56Gce9u036273; Sat, 6 Jun 2015 16:38:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201506061638.t56Gce9u036273@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 6 Jun 2015 16:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284083 - head/sys/dev/nand 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, 06 Jun 2015 16:38:41 -0000 Author: jhibbits Date: Sat Jun 6 16:38:40 2015 New Revision: 284083 URL: https://svnweb.freebsd.org/changeset/base/284083 Log: Map the LAW for the RouterBoard's NAND LBC memory. Without creating a LAW entry, any access to the NAND hangs the CPU. The original intent was to add a quirk to map all of the RouterBoard's LBC address space in one shot, which would fix it for both NAND and the CF, and that's probably still in the cards. However, for now, this makes NAND usable without a separate hack. Things left before the RouterBoard can run standalone: * Add partitions to the NAND (not specified by the FDT, which we currently require). * Create a YAFFS partition for the kernel. The Mikrotik boot loader requires a 4MB partition at the beginning of NAND, with a file called 'kernel' in the root. Modified: head/sys/dev/nand/nfc_rb.c Modified: head/sys/dev/nand/nfc_rb.c ============================================================================== --- head/sys/dev/nand/nfc_rb.c Sat Jun 6 16:36:13 2015 (r284082) +++ head/sys/dev/nand/nfc_rb.c Sat Jun 6 16:38:40 2015 (r284083) @@ -49,6 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include + +#include + #include "nfc_if.h" #include "gpio_if.h" @@ -128,6 +131,7 @@ rb_nand_attach(device_t dev) struct rb_nand_softc *sc; phandle_t node; uint32_t ale[2],cle[2],nce[2],rdy[2]; + u_long size,start; int err; sc = device_get_softc(dev); @@ -168,6 +172,14 @@ rb_nand_attach(device_t dev) return (ENXIO); } + start = rman_get_start(sc->sc_mem); + size = rman_get_size(sc->sc_mem); + if (law_enable(OCP85XX_TGTIF_LBC, start, size) != 0) { + bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->sc_mem); + device_printf(dev, "could not allocate local address window.\n"); + return (ENXIO); + } + nand_init(&sc->nand_dev, dev, NAND_ECC_SOFT, 0, 0, NULL, NULL); err = nandbus_create(dev); From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 16:45:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2478EF0; Sat, 6 Jun 2015 16:45:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C13321A3C; Sat, 6 Jun 2015 16:45:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56GjxBx041056; Sat, 6 Jun 2015 16:45:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56GjxWP041055; Sat, 6 Jun 2015 16:45:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201506061645.t56GjxWP041055@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 6 Jun 2015 16:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284084 - head/sys/modules 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, 06 Jun 2015 16:45:59 -0000 Author: imp Date: Sat Jun 6 16:45:59 2015 New Revision: 284084 URL: https://svnweb.freebsd.org/changeset/base/284084 Log: ix module doesn't compile on i386, so remove it from the build. It can be restored when it builds again. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Jun 6 16:38:40 2015 (r284083) +++ head/sys/modules/Makefile Sat Jun 6 16:45:59 2015 (r284084) @@ -512,7 +512,6 @@ _io= io .if ${MK_OFED} != "no" || defined(ALL_MODULES) _ipoib= ipoib .endif -_ix= ix _ixv= ixv _linprocfs= linprocfs _linsysfs= linsysfs @@ -619,6 +618,7 @@ _x86bios= x86bios .endif .if ${MACHINE_CPUARCH} == "amd64" +_ix= ix _ixl= ixl _ixlv= ixlv _linux64= linux64 From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 16:47:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13483AB; Sat, 6 Jun 2015 16:47:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E8A5B1A49; Sat, 6 Jun 2015 16:47:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56GlkNO041384; Sat, 6 Jun 2015 16:47:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56GljPD041378; Sat, 6 Jun 2015 16:47:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201506061647.t56GljPD041378@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 6 Jun 2015 16:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284085 - head/cddl/contrib/opensolaris/lib/libdtrace/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: Sat, 06 Jun 2015 16:47:47 -0000 Author: markj Date: Sat Jun 6 16:47:45 2015 New Revision: 284085 URL: https://svnweb.freebsd.org/changeset/base/284085 Log: libdtrace: allow D libraries to declare dependencies on kernel modules The "depends_on module" pragma can be used to declare a dependency on a DTrace module, which for kernel probes corresponds to a KLD. Such dependencies cannot be checked if the KLD is compiled into the kernel. Therefore, allow a module dependency to be satisfied if either a kernel module or a KLD with the specified name is loaded. Differential Revision: https://reviews.freebsd.org/D2653 Reviewed by: gnn, rpaulo Reported by: gnn Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Sat Jun 6 16:45:59 2015 (r284084) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Sat Jun 6 16:47:45 2015 (r284085) @@ -156,6 +156,21 @@ typedef struct dt_module { #define DT_DM_KERNEL 0x2 /* module is associated with a kernel object */ #define DT_DM_PRIMARY 0x4 /* module is a krtld primary kernel object */ +#ifdef __FreeBSD__ +/* + * A representation of a FreeBSD kernel module, used when checking module + * dependencies. This differs from dt_module_t, which refers to a KLD in the + * case of kernel probes. Since modules can be identified regardless of whether + * they've been compiled into the kernel, we use them to identify DTrace + * modules. + */ +typedef struct dt_kmodule { + struct dt_kmodule *dkm_next; /* hash table entry */ + char *dkm_name; /* string name of module */ + dt_module_t *dkm_module; /* corresponding KLD module */ +} dt_kmodule_t; +#endif + typedef struct dt_provmod { char *dp_name; /* name of provider module */ struct dt_provmod *dp_next; /* next module */ @@ -235,6 +250,9 @@ struct dtrace_hdl { dt_idhash_t *dt_tls; /* hash table of thread-local identifiers */ dt_list_t dt_modlist; /* linked list of dt_module_t's */ dt_module_t **dt_mods; /* hash table of dt_module_t's */ +#ifdef __FreeBSD__ + dt_kmodule_t **dt_kmods; /* hash table of dt_kmodule_t's */ +#endif uint_t dt_modbuckets; /* number of module hash buckets */ uint_t dt_nmods; /* number of modules in hash and list */ dt_provmod_t *dt_provmod; /* linked list of provider modules */ Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Sat Jun 6 16:45:59 2015 (r284084) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Sat Jun 6 16:47:45 2015 (r284085) @@ -37,6 +37,7 @@ #else #include #include +#include #include #endif @@ -542,6 +543,22 @@ dt_module_lookup_by_ctf(dtrace_hdl_t *dt return (ctfp ? ctf_getspecific(ctfp) : NULL); } +#ifdef __FreeBSD__ +dt_kmodule_t * +dt_kmodule_lookup(dtrace_hdl_t *dtp, const char *name) +{ + uint_t h = dt_strtab_hash(name, NULL) % dtp->dt_modbuckets; + dt_kmodule_t *dkmp; + + for (dkmp = dtp->dt_kmods[h]; dkmp != NULL; dkmp = dkmp->dkm_next) { + if (strcmp(dkmp->dkm_name, name) == 0) + return (dkmp); + } + + return (NULL); +} +#endif + static int dt_module_load_sect(dtrace_hdl_t *dtp, dt_module_t *dmp, ctf_sect_t *ctsp) { @@ -1124,6 +1141,12 @@ dt_module_update(dtrace_hdl_t *dtp, stru char fname[MAXPATHLEN]; struct stat64 st; int fd, err, bits; +#ifdef __FreeBSD__ + struct module_stat ms; + dt_kmodule_t *dkmp; + uint_t h; + int modid; +#endif dt_module_t *dmp; const char *s; @@ -1270,6 +1293,33 @@ dt_module_update(dtrace_hdl_t *dtp, stru if (dmp->dm_info.objfs_info_primary) dmp->dm_flags |= DT_DM_PRIMARY; +#ifdef __FreeBSD__ + ms.version = sizeof(ms); + for (modid = kldfirstmod(k_stat->id); modid > 0; + modid = modnext(modid)) { + if (modstat(modid, &ms) != 0) { + dt_dprintf("modstat failed for id %d in %s: %s\n", + modid, k_stat->name, strerror(errno)); + continue; + } + if (dt_kmodule_lookup(dtp, ms.name) != NULL) + continue; + + dkmp = malloc(sizeof (*dkmp)); + if (dkmp == NULL) { + dt_dprintf("failed to allocate memory\n"); + dt_module_destroy(dtp, dmp); + return; + } + + h = dt_strtab_hash(ms.name, NULL) % dtp->dt_modbuckets; + dkmp->dkm_next = dtp->dt_kmods[h]; + dkmp->dkm_name = strdup(ms.name); + dkmp->dkm_module = dmp; + dtp->dt_kmods[h] = dkmp; + } +#endif + dt_dprintf("opened %d-bit module %s (%s) [%d]\n", bits, dmp->dm_name, dmp->dm_file, dmp->dm_modid); } Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h Sat Jun 6 16:45:59 2015 (r284084) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h Sat Jun 6 16:47:45 2015 (r284085) @@ -44,6 +44,10 @@ extern void dt_module_destroy(dtrace_hdl extern dt_module_t *dt_module_lookup_by_name(dtrace_hdl_t *, const char *); extern dt_module_t *dt_module_lookup_by_ctf(dtrace_hdl_t *, ctf_file_t *); +#ifdef __FreeBSD__ +extern dt_kmodule_t *dt_kmodule_lookup(dtrace_hdl_t *, const char *); +#endif + extern int dt_module_hasctf(dtrace_hdl_t *, dt_module_t *); extern ctf_file_t *dt_module_getctf(dtrace_hdl_t *, dt_module_t *); extern dt_ident_t *dt_module_extern(dtrace_hdl_t *, dt_module_t *, Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Sat Jun 6 16:45:59 2015 (r284084) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Sat Jun 6 16:47:45 2015 (r284085) @@ -1178,6 +1178,9 @@ alloc: #endif dtp->dt_modbuckets = _dtrace_strbuckets; dtp->dt_mods = calloc(dtp->dt_modbuckets, sizeof (dt_module_t *)); +#ifdef __FreeBSD__ + dtp->dt_kmods = calloc(dtp->dt_modbuckets, sizeof (dt_module_t *)); +#endif dtp->dt_provbuckets = _dtrace_strbuckets; dtp->dt_provs = calloc(dtp->dt_provbuckets, sizeof (dt_provider_t *)); dt_proc_hash_create(dtp); @@ -1199,6 +1202,7 @@ alloc: if (dtp->dt_mods == NULL || dtp->dt_provs == NULL || dtp->dt_procs == NULL || dtp->dt_ld_path == NULL || #ifdef __FreeBSD__ + dtp->dt_kmods == NULL || dtp->dt_objcopy_path == NULL || #endif dtp->dt_cpp_path == NULL || dtp->dt_cpp_argv == NULL) @@ -1621,6 +1625,10 @@ dtrace_close(dtrace_hdl_t *dtp) dtrace_prog_t *pgp; dt_xlator_t *dxp; dt_dirpath_t *dirp; +#ifdef __FreeBSD__ + dt_kmodule_t *dkm; + uint_t h; +#endif int i; if (dtp->dt_procs != NULL) @@ -1648,6 +1656,15 @@ dtrace_close(dtrace_hdl_t *dtp) if (dtp->dt_tls != NULL) dt_idhash_destroy(dtp->dt_tls); +#ifdef __FreeBSD__ + for (h = 0; h < dtp->dt_modbuckets; h++) + while ((dkm = dtp->dt_kmods[h]) != NULL) { + dtp->dt_kmods[h] = dkm->dkm_next; + free(dkm->dkm_name); + free(dkm); + } +#endif + while ((dmp = dt_list_next(&dtp->dt_modlist)) != NULL) dt_module_destroy(dtp, dmp); @@ -1697,6 +1714,9 @@ dtrace_close(dtrace_hdl_t *dtp) #endif free(dtp->dt_mods); +#ifdef __FreeBSD__ + free(dtp->dt_kmods); +#endif free(dtp->dt_provs); free(dtp); } Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Sat Jun 6 16:45:59 2015 (r284084) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Sat Jun 6 16:47:45 2015 (r284085) @@ -278,6 +278,14 @@ dt_pragma_depends(const char *prname, dt } else if (strcmp(cnp->dn_string, "module") == 0) { dt_module_t *mp = dt_module_lookup_by_name(dtp, nnp->dn_string); found = mp != NULL && dt_module_getctf(dtp, mp) != NULL; +#ifdef __FreeBSD__ + if (!found) { + dt_kmodule_t *dkmp = dt_kmodule_lookup(dtp, + nnp->dn_string); + found = dkmp != NULL && + dt_module_getctf(dtp, dkmp->dkm_module) != NULL; + } +#endif } else if (strcmp(cnp->dn_string, "library") == 0) { if (yypcb->pcb_cflags & DTRACE_C_CTL) { assert(dtp->dt_filetag != NULL); From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 17:04:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3995B3F1; Sat, 6 Jun 2015 17:04:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1B36D1E9C; Sat, 6 Jun 2015 17:04:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56H4bIc051015; Sat, 6 Jun 2015 17:04:37 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56H4a4E051007; Sat, 6 Jun 2015 17:04:36 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201506061704.t56H4a4E051007@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 6 Jun 2015 17:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284086 - head/sys/dev/pci 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, 06 Jun 2015 17:04:38 -0000 Author: marcel Date: Sat Jun 6 17:04:36 2015 New Revision: 284086 URL: https://svnweb.freebsd.org/changeset/base/284086 Log: Revert previous change. The magical constants can't be changed (easily) without having to go to other drivers to change the magical return values. This wouldn't be so bad if there were proper defines for these constants. In particular dev/acpica/acpi_pcib_pci.c returns -1000 as the probe priority and it's expected that this driver gets to attach over the common PCI bus drivers. Modified: head/sys/dev/pci/eisa_pci.c head/sys/dev/pci/hostb_pci.c head/sys/dev/pci/ignore_pci.c head/sys/dev/pci/isa_pci.c head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/eisa_pci.c ============================================================================== --- head/sys/dev/pci/eisa_pci.c Sat Jun 6 16:47:45 2015 (r284085) +++ head/sys/dev/pci/eisa_pci.c Sat Jun 6 17:04:36 2015 (r284086) @@ -100,7 +100,7 @@ eisab_probe(device_t dev) if (matched) { device_set_desc(dev, "PCI-EISA bridge"); - return (BUS_PROBE_GENERIC); + return(-10000); } return(ENXIO); } Modified: head/sys/dev/pci/hostb_pci.c ============================================================================== --- head/sys/dev/pci/hostb_pci.c Sat Jun 6 16:47:45 2015 (r284085) +++ head/sys/dev/pci/hostb_pci.c Sat Jun 6 17:04:36 2015 (r284086) @@ -63,7 +63,7 @@ pci_hostb_probe(device_t dev) pci_get_subclass(dev) == PCIS_BRIDGE_HOST) { device_set_desc(dev, "Host to PCI bridge"); device_quiet(dev); - return (BUS_PROBE_GENERIC); + return (-10000); } return (ENXIO); } Modified: head/sys/dev/pci/ignore_pci.c ============================================================================== --- head/sys/dev/pci/ignore_pci.c Sat Jun 6 16:47:45 2015 (r284085) +++ head/sys/dev/pci/ignore_pci.c Sat Jun 6 17:04:36 2015 (r284086) @@ -66,7 +66,7 @@ ignore_pci_probe(device_t dev) case 0x10001042ul: /* SMC 37C665 */ device_set_desc(dev, "ignored"); device_quiet(dev); - return (BUS_PROBE_GENERIC); + return(-10000); } return(ENXIO); } Modified: head/sys/dev/pci/isa_pci.c ============================================================================== --- head/sys/dev/pci/isa_pci.c Sat Jun 6 16:47:45 2015 (r284085) +++ head/sys/dev/pci/isa_pci.c Sat Jun 6 17:04:36 2015 (r284086) @@ -154,7 +154,7 @@ isab_pci_probe(device_t dev) if (matched) { device_set_desc(dev, "PCI-ISA bridge"); - return (BUS_PROBE_GENERIC); + return(-10000); } return(ENXIO); } Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Sat Jun 6 16:47:45 2015 (r284085) +++ head/sys/dev/pci/pci_pci.c Sat Jun 6 17:04:36 2015 (r284086) @@ -890,7 +890,7 @@ pcib_probe(device_t dev) if ((pci_get_class(dev) == PCIC_BRIDGE) && (pci_get_subclass(dev) == PCIS_BRIDGE_PCI)) { device_set_desc(dev, "PCI-PCI bridge"); - return (BUS_PROBE_GENERIC); + return(-10000); } return(ENXIO); } From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 17:08:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 981B3548; Sat, 6 Jun 2015 17:08:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 86D061EB2; Sat, 6 Jun 2015 17:08:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56H87re051532; Sat, 6 Jun 2015 17:08:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56H87b8051531; Sat, 6 Jun 2015 17:08:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201506061708.t56H87b8051531@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 6 Jun 2015 17:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284087 - head/sys/modules 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, 06 Jun 2015 17:08:07 -0000 Author: imp Date: Sat Jun 6 17:08:06 2015 New Revision: 284087 URL: https://svnweb.freebsd.org/changeset/base/284087 Log: Turns out amd64 is hit too by ix. When it works, turn it back on. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Jun 6 17:04:36 2015 (r284086) +++ head/sys/modules/Makefile Sat Jun 6 17:08:06 2015 (r284087) @@ -618,7 +618,6 @@ _x86bios= x86bios .endif .if ${MACHINE_CPUARCH} == "amd64" -_ix= ix _ixl= ixl _ixlv= ixlv _linux64= linux64 From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 17:08:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E9B9685; Sat, 6 Jun 2015 17:08:27 +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 479441EB8; Sat, 6 Jun 2015 17:08:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B0046B93A; Sat, 6 Jun 2015 13:08:25 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Cc: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284078 - head/sys/dev/pci Date: Sat, 06 Jun 2015 13:08:16 -0400 Message-ID: <5117505.v1AmJczBtP@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201506061551.t56FpCbX013048@svn.freebsd.org> <14005803.mtbqcRkBJG@ralph.baldwin.cx> 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); Sat, 06 Jun 2015 13:08:25 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Jun 2015 17:08:27 -0000 On Saturday, June 06, 2015 09:18:22 AM Marcel Moolenaar wrote: > > > On Jun 6, 2015, at 9:03 AM, John Baldwin wrote: > > > > On Saturday, June 06, 2015 03:51:12 PM Marcel Moolenaar wrote: > >> Author: marcel > >> Date: Sat Jun 6 15:51:11 2015 > >> New Revision: 284078 > >> URL: https://svnweb.freebsd.org/changeset/base/284078 > >> > >> Log: > >> Don't return -10000 as the probe priority. That's lower than what > >> BUS_PROBE_HOOVER is. Drivers like proto(4), when compiled into the > >> kernel or preloaded, will render your system useless by virtue of > >> attaching to your PCI busses. > >> > >> Return BUS_PROBE_GENERIC instead. It's just the next priority up > >> from BUS_PROBE_HOOVER. No other meaning has been give to its use. > >> While BUS_PROBE_DEFAULT seems like a better candidate, it's hard > >> not to think that there must be some reason why these drivers > >> return -10000 in the first place. > > > > BUS_PROBE_DEFAULT would conflict with other drivers that are supposed to > > override these, such as acpi_pcib_pci which should override pci_pci > > for PCI-PCI bridges in the ACPI namespace. That driver currently hardcodes > > -1000 itself. :-/ Then there's pcibios_pcib_probe for the $PIR PCI-PCI > > bridge driver for when ACPI isn't present. It returns -2000. The > > MPTable PCI-PCI bridge driver returns -1000 like ACPI. > > So that means we have a regression. Do you want me to back out > or should we just move forward and fix those too. Yeah, I just now realized this. If you can fix this quickly it's probably ok to just fix it vs backing it out and committing a larger change. For the x86 PCI bridge drivers, I think you can probably use BUS_PROBE_DEFAULT for ACPI and MPTable and BUS_PROBE_LOW_PRIORITY for the pcibios one. However, I haven't looked at other platforms. I believe there are some other PCI-PCI bridge drivers kicking around (for OFW on sparc64 and powerpc at least, not sure if there are others). It might be fine to lower HOOVER as well, but it's probably worth it to fix all drivers to use one of the BUS_PROBE constants (perhaps with an offset like 'BUS_PROBE_GENERIC - 10 or some such') rather than magic values. Unfortunately sweeping all device_probe calls is likely to be a bit tedious. :-/ -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 17:15:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 010F2991; Sat, 6 Jun 2015 17:15:24 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (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 C532E10BB; Sat, 6 Jun 2015 17:15:24 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from [192.168.2.22] (atc.xcllnt.net [50.0.150.213]) (authenticated bits=0) by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id t56HFN2t029628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 6 Jun 2015 10:15:24 -0700 (PDT) (envelope-from marcel@xcllnt.net) Subject: Re: svn commit: r284078 - head/sys/dev/pci Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: multipart/signed; boundary="Apple-Mail=_FBE037D9-E3C9-4A6D-9C9A-5524928D5E16"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Marcel Moolenaar In-Reply-To: <5117505.v1AmJczBtP@ralph.baldwin.cx> Date: Sat, 6 Jun 2015 10:15:23 -0700 Cc: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <683C7AD0-A2E7-4EA8-8F98-D1D52F40C073@xcllnt.net> References: <201506061551.t56FpCbX013048@svn.freebsd.org> <14005803.mtbqcRkBJG@ralph.baldwin.cx> <5117505.v1AmJczBtP@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Jun 2015 17:15:25 -0000 --Apple-Mail=_FBE037D9-E3C9-4A6D-9C9A-5524928D5E16 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 6, 2015, at 10:08 AM, John Baldwin wrote: >=20 > On Saturday, June 06, 2015 09:18:22 AM Marcel Moolenaar wrote: >>=20 >>> On Jun 6, 2015, at 9:03 AM, John Baldwin wrote: >>>=20 >>> On Saturday, June 06, 2015 03:51:12 PM Marcel Moolenaar wrote: >>>> Author: marcel >>>> Date: Sat Jun 6 15:51:11 2015 >>>> New Revision: 284078 >>>> URL: https://svnweb.freebsd.org/changeset/base/284078 >>>>=20 >>>> Log: >>>> Don't return -10000 as the probe priority. That's lower than what >>>> BUS_PROBE_HOOVER is. Drivers like proto(4), when compiled into the >>>> kernel or preloaded, will render your system useless by virtue of >>>> attaching to your PCI busses. >>>>=20 >>>> Return BUS_PROBE_GENERIC instead. It's just the next priority up >>>> from BUS_PROBE_HOOVER. No other meaning has been give to its use. >>>> While BUS_PROBE_DEFAULT seems like a better candidate, it's hard >>>> not to think that there must be some reason why these drivers >>>> return -10000 in the first place. >>>=20 >>> BUS_PROBE_DEFAULT would conflict with other drivers that are = supposed to >>> override these, such as acpi_pcib_pci which should override pci_pci >>> for PCI-PCI bridges in the ACPI namespace. That driver currently = hardcodes >>> -1000 itself. :-/ Then there's pcibios_pcib_probe for the $PIR = PCI-PCI >>> bridge driver for when ACPI isn't present. It returns -2000. The >>> MPTable PCI-PCI bridge driver returns -1000 like ACPI. >>=20 >> So that means we have a regression. Do you want me to back out >> or should we just move forward and fix those too. >=20 > Yeah, I just now realized this. If you can fix this quickly it's = probably ok > to just fix it vs backing it out and committing a larger change. I opted to back it out. I searched for all drivers that use BUS_PROBE_HOOVER and it=E2=80=99s exactly one: proto(4). That=E2=80=99s = a lot easier then finding all drivers that return some negative value that has some relation to PCI busses... I=E2=80=99m just going to change BUS_PROBE_HOOVER to -1000000 instead. In follow-up rounds we can change magical constants to defines to make the whole pecking order more obvious/visible. -- Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_FBE037D9-E3C9-4A6D-9C9A-5524928D5E16 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 iQIcBAEBCgAGBQJVcyqrAAoJEIda8t8f0tjjfU4P/iy/9ndUZZSrzUucN3QeaeMs n3Clkr02dE0e6PFNiJat8ENfB/oE+CUiFiqzR+3Fr9DAerPmrWsnVaF0U7jpgJd5 YSMS9y32h93Rng0fnB2w1UMU3UTqNp0m2ulc8tSz69igMAq65rfHEPnIIW5z/CAq pne41DLIqWDCam73MUao+BsPfSPy/9A4MBSYEvJyVQfa4UHXJkdMYqEIidz9ps0T 2AWI0nzpoJd5p04EAqWD86FYt/DKP3tigmBKv0kkrf/Dn5AprcjWFeIAQDa1rLHs MjMP6jaKf81m9lf3XMzmz93m5GItapwLHmlUK8rkX19BvfQgSXyJYIgYtDDBU0i2 c4aJorl8Zes6Ovk2gThYVAgZb4Lw4J6YZdqSvdBH9j5ok8j91SOgrnROzmaBmuIu /jKt6xhK6SwyhsZpSSSt0g9oO+l5eYXQmUJ2J88fKrm5X3eGOC5OzJucHCh/NuoL rC9y42o+bm7pcSmhww959+rrFYulYs673OgTdYT+ldvY7vwFN18qE1iYmtXZNVo5 XQReKjbyfnopc5DJrtiA4ra9v3Ikr1Ca8xN4hM+UTRJiJkTbYnUTJJ/HjY5Hk1rV 4Rb1kWqLhYCchLGvCNKh/F7alJ7LE2DIKkLPTaEuWEi+BAhyRasrZZhccdJxz9Em dysTP8MaNoP3TZtdJ7kz =AG/H -----END PGP SIGNATURE----- --Apple-Mail=_FBE037D9-E3C9-4A6D-9C9A-5524928D5E16-- From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 17:21:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87E4DC27; Sat, 6 Jun 2015 17:21:27 +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 650B311E3; Sat, 6 Jun 2015 17:21:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7D552B93C; Sat, 6 Jun 2015 13:21:26 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284087 - head/sys/modules Date: Sat, 06 Jun 2015 13:19:27 -0400 Message-ID: <2201763.WufPS8uA2S@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201506061708.t56H87b8051531@svn.freebsd.org> References: <201506061708.t56H87b8051531@svn.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); Sat, 06 Jun 2015 13:21:26 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Jun 2015 17:21:27 -0000 On Saturday, June 06, 2015 05:08:07 PM Warner Losh wrote: > Author: imp > Date: Sat Jun 6 17:08:06 2015 > New Revision: 284087 > URL: https://svnweb.freebsd.org/changeset/base/284087 > > Log: > Turns out amd64 is hit too by ix. When it works, turn it back on. Can you post your errors? It builds fine for me and Jenkins hasn't been reporting any build errors since yesterday afternoon/evening. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 17:21:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0586CC25; Sat, 6 Jun 2015 17:21:27 +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 D2A5311E2; Sat, 6 Jun 2015 17:21:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E2A5AB939; Sat, 6 Jun 2015 13:21:25 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Cc: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284078 - head/sys/dev/pci Date: Sat, 06 Jun 2015 13:21:21 -0400 Message-ID: <9581407.amWtf3FX4v@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <683C7AD0-A2E7-4EA8-8F98-D1D52F40C073@xcllnt.net> References: <201506061551.t56FpCbX013048@svn.freebsd.org> <5117505.v1AmJczBtP@ralph.baldwin.cx> <683C7AD0-A2E7-4EA8-8F98-D1D52F40C073@xcllnt.net> 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); Sat, 06 Jun 2015 13:21:26 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Jun 2015 17:21:27 -0000 On Saturday, June 06, 2015 10:15:23 AM Marcel Moolenaar wrote: >=20 > > On Jun 6, 2015, at 10:08 AM, John Baldwin wrote: > >=20 > > On Saturday, June 06, 2015 09:18:22 AM Marcel Moolenaar wrote: > >>=20 > >>> On Jun 6, 2015, at 9:03 AM, John Baldwin wrote:= > >>>=20 > >>> On Saturday, June 06, 2015 03:51:12 PM Marcel Moolenaar wrote: > >>>> Author: marcel > >>>> Date: Sat Jun 6 15:51:11 2015 > >>>> New Revision: 284078 > >>>> URL: https://svnweb.freebsd.org/changeset/base/284078 > >>>>=20 > >>>> Log: > >>>> Don't return -10000 as the probe priority. That's lower than wha= t > >>>> BUS_PROBE_HOOVER is. Drivers like proto(4), when compiled into t= he > >>>> kernel or preloaded, will render your system useless by virtue o= f > >>>> attaching to your PCI busses. > >>>>=20 > >>>> Return BUS_PROBE_GENERIC instead. It's just the next priority up= > >>>> from BUS_PROBE_HOOVER. No other meaning has been give to its use= . > >>>> While BUS_PROBE_DEFAULT seems like a better candidate, it's hard= > >>>> not to think that there must be some reason why these drivers > >>>> return -10000 in the first place. > >>>=20 > >>> BUS_PROBE_DEFAULT would conflict with other drivers that are supp= osed to > >>> override these, such as acpi_pcib_pci which should override pci_p= ci > >>> for PCI-PCI bridges in the ACPI namespace. That driver currently= hardcodes > >>> -1000 itself. :-/ Then there's pcibios_pcib_probe for the $PIR P= CI-PCI > >>> bridge driver for when ACPI isn't present. It returns -2000. Th= e > >>> MPTable PCI-PCI bridge driver returns -1000 like ACPI. > >>=20 > >> So that means we have a regression. Do you want me to back out > >> or should we just move forward and fix those too. > >=20 > > Yeah, I just now realized this. If you can fix this quickly it's p= robably ok > > to just fix it vs backing it out and committing a larger change. >=20 > I opted to back it out. I searched for all drivers that use > BUS_PROBE_HOOVER and it=E2=80=99s exactly one: proto(4). That=E2=80=99= s a lot > easier then finding all drivers that return some negative > value that has some relation to PCI busses... >=20 > I=E2=80=99m just going to change BUS_PROBE_HOOVER to -1000000 instead= . > In follow-up rounds we can change magical constants to defines > to make the whole pecking order more obvious/visible. Ok. --=20 John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 17:25:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67CA1F2D; Sat, 6 Jun 2015 17:25:46 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 563041344; Sat, 6 Jun 2015 17:25:46 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56HPkhq061033; Sat, 6 Jun 2015 17:25:46 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56HPkmf061032; Sat, 6 Jun 2015 17:25:46 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201506061725.t56HPkmf061032@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 6 Jun 2015 17:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284088 - head/sys/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: Sat, 06 Jun 2015 17:25:46 -0000 Author: marcel Date: Sat Jun 6 17:25:45 2015 New Revision: 284088 URL: https://svnweb.freebsd.org/changeset/base/284088 Log: Change BUS_PROBE_HOOVER from -500 to -1000000. We have PCI bus drivers return -1000 and -10000 to establish a pecking order and we don't want catch-all or match-all drivers to attach instead of them. With this change poto(4) can be compiled into the kernel (or preloaded from the loader), without impact. Modified: head/sys/sys/bus.h Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Sat Jun 6 17:08:06 2015 (r284087) +++ head/sys/sys/bus.h Sat Jun 6 17:25:45 2015 (r284088) @@ -612,7 +612,7 @@ void bus_data_generation_update(void); #define BUS_PROBE_DEFAULT (-20) /* Base OS default driver */ #define BUS_PROBE_LOW_PRIORITY (-40) /* Older, less desirable drivers */ #define BUS_PROBE_GENERIC (-100) /* generic driver for dev */ -#define BUS_PROBE_HOOVER (-500) /* Generic dev for all devs on bus */ +#define BUS_PROBE_HOOVER (-1000000) /* Driver for any dev on bus */ #define BUS_PROBE_NOWILDCARD (-2000000000) /* No wildcard device matches */ /** From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 19:09:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F292E18; Sat, 6 Jun 2015 19:09:37 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::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 18B891AAA; Sat, 6 Jun 2015 19:09:37 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igbpi8 with SMTP id pi8so37175537igb.1; Sat, 06 Jun 2015 12:09:36 -0700 (PDT) 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=CJfq6wAIB8ALDoxAZRQBLOudewHQFB/bw1/rgWLXIqk=; b=NQ4spwC4Jx+JCs1urc/ra0uPYFSCVS8zsh4CHiympBZWlVLBCm7xy+VLoefuatGBQM LKEaS4pKrLe34zKMH3tDiB6A2nb6ovP0cAUGXi8cjC8j5bymL2jAhURTjnwBQ933Uo09 oJBLhI9wCv7BXcFDwTbF6MvwzML8XjUzuw8/Z1lx3hVyWnCgT4Yn+DHcW1wyAhppI3LQ CeOQPE9si8//QKwL0zlQ+UzLbMQNxAUBFcYu7LDEpMUM1j7NDP96C+HVgDSm6JJpAAU1 1V7V2fR/LlyGHLktVw3N7L7U9dHubkrWXpDi0NYYq90dDU+i0lpdPaghg2FRz1bIPNIg WWBA== MIME-Version: 1.0 X-Received: by 10.50.114.9 with SMTP id jc9mr4766834igb.49.1433617776490; Sat, 06 Jun 2015 12:09:36 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.38.133 with HTTP; Sat, 6 Jun 2015 12:09:36 -0700 (PDT) In-Reply-To: <201506061320.t56DK2EU037038@svn.freebsd.org> References: <201506061320.t56DK2EU037038@svn.freebsd.org> Date: Sat, 6 Jun 2015 12:09:36 -0700 X-Google-Sender-Auth: GXo4OeYPH3nGrKshsBJ9A8kkLU0 Message-ID: Subject: Re: svn commit: r284071 - head/libexec/atrun From: Adrian Chadd To: Baptiste Daroussin 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: Sat, 06 Jun 2015 19:09:37 -0000 bad bapt, bad bapt. -------------------------------------------------------------- >>> stage 4.4: building everything -------------------------------------------------------------- ===> lib (all) ===> libexec (all) ===> libexec/atrun (all) => lib/csu (all) ===> lib/csu/mips (all) cc1: warnings being treated as errors /usr/home/adrian/work/freebsd/head-embedded-2/src/libexec/atrun/atrun.c: In function 'run_file': /usr/home/adrian/work/freebsd/head-embedded-2/src/libexec/atrun/atrun.c:241: warning: comparison between signed and unsigned /usr/home/adrian/work/freebsd/head-embedded-2/src/libexec/atrun/atrun.c:245: warning: comparison between signed and unsigned -adrian On 6 June 2015 at 06:20, Baptiste Daroussin wrote: > Author: bapt > Date: Sat Jun 6 13:20:02 2015 > New Revision: 284071 > URL: https://svnweb.freebsd.org/changeset/base/284071 > > Log: > Remove WARNS atrun builds fine with clang and gcc > > Modified: > head/libexec/atrun/Makefile > > Modified: head/libexec/atrun/Makefile > ============================================================================== > --- head/libexec/atrun/Makefile Sat Jun 6 13:13:39 2015 (r284070) > +++ head/libexec/atrun/Makefile Sat Jun 6 13:20:02 2015 (r284071) > @@ -14,7 +14,6 @@ CLEANFILES= ${MAN} > CFLAGS+=-I${MAINSRC} -I${.CURDIR} > CFLAGS+=-DLOGIN_CAP -DPAM > > -WARNS?= 2 > WFORMAT=0 > > LIBADD= pam util > From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 19:15:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5512B10B; Sat, 6 Jun 2015 19:15:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 42CC31CDE; Sat, 6 Jun 2015 19:15:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56JF9E5018268; Sat, 6 Jun 2015 19:15:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56JF9Rq018267; Sat, 6 Jun 2015 19:15:09 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201506061915.t56JF9Rq018267@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 6 Jun 2015 19:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284095 - head/libexec/atrun 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, 06 Jun 2015 19:15:09 -0000 Author: adrian Date: Sat Jun 6 19:15:08 2015 New Revision: 284095 URL: https://svnweb.freebsd.org/changeset/base/284095 Log: Re-introduce this - it doesn't compile clean on a mips target (eg CARAMBOLA2.) Modified: head/libexec/atrun/Makefile Modified: head/libexec/atrun/Makefile ============================================================================== --- head/libexec/atrun/Makefile Sat Jun 6 18:49:02 2015 (r284094) +++ head/libexec/atrun/Makefile Sat Jun 6 19:15:08 2015 (r284095) @@ -14,6 +14,7 @@ CLEANFILES= ${MAN} CFLAGS+=-I${MAINSRC} -I${.CURDIR} CFLAGS+=-DLOGIN_CAP -DPAM +WARNS?= 2 WFORMAT=0 LIBADD= pam util From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 19:43:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64AE26E2; Sat, 6 Jun 2015 19:43:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3922C1396; Sat, 6 Jun 2015 19:43:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56JhgTb032978; Sat, 6 Jun 2015 19:43:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56Jhg7L032977; Sat, 6 Jun 2015 19:43:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506061943.t56Jhg7L032977@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Jun 2015 19:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284097 - head/usr.bin/mkstr 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, 06 Jun 2015 19:43:42 -0000 Author: bapt Date: Sat Jun 6 19:43:41 2015 New Revision: 284097 URL: https://svnweb.freebsd.org/changeset/base/284097 Log: Readd the warning level gcc 4.2 still complains Modified: head/usr.bin/mkstr/Makefile Modified: head/usr.bin/mkstr/Makefile ============================================================================== --- head/usr.bin/mkstr/Makefile Sat Jun 6 19:15:48 2015 (r284096) +++ head/usr.bin/mkstr/Makefile Sat Jun 6 19:43:41 2015 (r284097) @@ -3,4 +3,6 @@ PROG= mkstr +WARNS?= 2 + .include From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 19:47:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF4DB8F4; Sat, 6 Jun 2015 19:47:06 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::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 8543C13BE; Sat, 6 Jun 2015 19:47:06 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wibut5 with SMTP id ut5so49782683wib.1; Sat, 06 Jun 2015 12:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=znOlqRGrM/ZLPyD3Tbetb9R9KjYHfE0R/yvPIa62eZg=; b=KOTIj8XVE8teIPbw2HN0gLkhpDqDTpUgv1YtSeU9Xv0ckyOY/GUd3sRr2G/sTSMrbZ lL7GiPrsR7iRDCS9Rp0WsSBindFUQC0aqBvWalf+zNlklw2NubmaqN+XMpqZc4g4Hmd5 SnLhco2FmBWW+HOp6kJkIs9p5F0bk3LFdIobtuif+vs4VODsQwltbVXKzGOAiyH1+NHn Wzm/V1P+4M2/5dPcbwYzU6ceMod5YIySXft6sH/TFY/cZcQZlt8l/GK9KL349E4ksetw 8FT8BOTNNKKtRzwJqS352xWfFdOrXElpEofGMhqlfi6fBGLrjLhXAoNfn5lcTHbqGTFL e8cA== X-Received: by 10.194.235.100 with SMTP id ul4mr17112423wjc.33.1433620025124; Sat, 06 Jun 2015 12:47:05 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id u7sm3828714wif.3.2015.06.06.12.47.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Jun 2015 12:47:04 -0700 (PDT) Sender: Baptiste Daroussin Date: Sat, 6 Jun 2015 21:47:02 +0200 From: Baptiste Daroussin To: Adrian Chadd Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r284071 - head/libexec/atrun Message-ID: <20150606194700.GA61276@ivaldir.etoilebsd.net> References: <201506061320.t56DK2EU037038@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline In-Reply-To: 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: Sat, 06 Jun 2015 19:47:07 -0000 --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 06, 2015 at 12:09:36PM -0700, Adrian Chadd wrote: > bad bapt, bad bapt. >=20 Yeah I forgot bloody gcc 4.2 does yell at things a more recent gcc does not= yell at... I fixed another one I have buildworld finishing on mips now Best regards, Bapt --+QahgC5+KEYLbs62 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlVzTjQACgkQ8kTtMUmk6Ey0DgCfdHLI2RJiiKOv3r7lqt5fa3uO kHsAoK7gMNdPZJZgprf+92yuoYNWUqxk =jhIe -----END PGP SIGNATURE----- --+QahgC5+KEYLbs62-- From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 19:50:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73F98BBD; Sat, 6 Jun 2015 19:50:47 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ie0-x22f.google.com (mail-ie0-x22f.google.com [IPv6:2607:f8b0:4001: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 3C79E14EB; Sat, 6 Jun 2015 19:50:47 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by ieclw1 with SMTP id lw1so77165776iec.3; Sat, 06 Jun 2015 12:50:46 -0700 (PDT) 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=OPKce2eKYyIwt2Are+gEvH67XDlIzzhwL9HUHqDiY5Q=; b=iRRBh1BVBSWENWfJNAttpxcuKHMnmy+RFYCio3Jg3/6PZ5jOUteMxhchjQzj4YES74 eIbuzj8jvTBE8/hZLrSmU1Syp70wMKJVB2oULrSlBxA46kB3kecr6bEgkSBZkGuxa95S JxmHFvLp1B1lo3NlfYkbcVqT+x2k61QZ/ieWpL1/oa6zGaMDpgrGigT+ViLc+38h552E 75GIdIdg0WbqmXDLweZ6JdIpKsKiQEmSrVt7tu5R+BNexwGwndKdOey662VIRny4biyF vye3QyIfmMMsvDOALsHpFVKL3SWZNbWJ3SXMPV87jKJxjV6GbhFpsapYdiDZq75HbkEG I28A== MIME-Version: 1.0 X-Received: by 10.50.97.105 with SMTP id dz9mr4897931igb.49.1433620246511; Sat, 06 Jun 2015 12:50:46 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.38.133 with HTTP; Sat, 6 Jun 2015 12:50:46 -0700 (PDT) In-Reply-To: <20150606194700.GA61276@ivaldir.etoilebsd.net> References: <201506061320.t56DK2EU037038@svn.freebsd.org> <20150606194700.GA61276@ivaldir.etoilebsd.net> Date: Sat, 6 Jun 2015 12:50:46 -0700 X-Google-Sender-Auth: _wkhWmrS8p2tLnpfeGA3MHPl3HI Message-ID: Subject: Re: svn commit: r284071 - head/libexec/atrun From: Adrian Chadd To: Baptiste Daroussin 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: Sat, 06 Jun 2015 19:50:47 -0000 Sweet, thanks! -a On 6 June 2015 at 12:47, Baptiste Daroussin wrote: > On Sat, Jun 06, 2015 at 12:09:36PM -0700, Adrian Chadd wrote: >> bad bapt, bad bapt. >> > Yeah I forgot bloody gcc 4.2 does yell at things a more recent gcc does not yell > at... > > I fixed another one I have buildworld finishing on mips now > > Best regards, > Bapt From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 21:11:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C0A5EEF; Sat, 6 Jun 2015 21:11:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3A6BC175B; Sat, 6 Jun 2015 21:11:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56LBIVk075378; Sat, 6 Jun 2015 21:11:18 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56LBHct075091; Sat, 6 Jun 2015 21:11:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201506062111.t56LBHct075091@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 6 Jun 2015 21:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284102 - head/release/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: Sat, 06 Jun 2015 21:11:18 -0000 Author: gjb Date: Sat Jun 6 21:11:17 2015 New Revision: 284102 URL: https://svnweb.freebsd.org/changeset/base/284102 Log: Set the correct UBLDR_LOADADDR for the Wandboard and Cubox/Hummingboard images. Submitted by: ian MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/arm/CUBOX-HUMMINGBOARD.conf head/release/arm/WANDBOARD.conf Modified: head/release/arm/CUBOX-HUMMINGBOARD.conf ============================================================================== --- head/release/arm/CUBOX-HUMMINGBOARD.conf Sat Jun 6 20:54:41 2015 (r284101) +++ head/release/arm/CUBOX-HUMMINGBOARD.conf Sat Jun 6 21:11:17 2015 (r284102) @@ -8,7 +8,7 @@ EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard" KERNEL="IMX6" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" FAT_SIZE="50m -b 16384" Modified: head/release/arm/WANDBOARD.conf ============================================================================== --- head/release/arm/WANDBOARD.conf Sat Jun 6 20:54:41 2015 (r284101) +++ head/release/arm/WANDBOARD.conf Sat Jun 6 21:11:17 2015 (r284102) @@ -8,7 +8,7 @@ EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-wandboard" KERNEL="IMX6" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" FAT_SIZE="50m -b 16384" From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 21:52:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 868355D3; Sat, 6 Jun 2015 21:52:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 73C2F133A; Sat, 6 Jun 2015 21:52:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56LqlKC096734; Sat, 6 Jun 2015 21:52:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56LqlOl096733; Sat, 6 Jun 2015 21:52:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201506062152.t56LqlOl096733@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 6 Jun 2015 21:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284103 - head/sys/arm64/arm64 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, 06 Jun 2015 21:52:47 -0000 Author: andrew Date: Sat Jun 6 21:52:46 2015 New Revision: 284103 URL: https://svnweb.freebsd.org/changeset/base/284103 Log: Rework exception entry to help with DTrace. We now store the stack pointer before adjusting it to store any registers. This is needed as DTrace may need to adjust the kernel stack pointer, and previously the new stack pointer would have needed to be checked incase it was changed. Modified: head/sys/arm64/arm64/exception.S Modified: head/sys/arm64/arm64/exception.S ============================================================================== --- head/sys/arm64/arm64/exception.S Sat Jun 6 21:11:17 2015 (r284102) +++ head/sys/arm64/arm64/exception.S Sat Jun 6 21:52:46 2015 (r284103) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); .text .macro save_registers el +.if \el == 1 + mov x18, sp +.endif stp x28, x29, [sp, #-16]! stp x26, x27, [sp, #-16]! stp x24, x25, [sp, #-16]! @@ -51,22 +54,20 @@ __FBSDID("$FreeBSD$"); mrs x10, elr_el1 mrs x11, spsr_el1 .if \el == 0 - mrs x12, sp_el0 -.else - mov x12, sp + mrs x18, sp_el0 .endif stp x10, x11, [sp, #-16]! - stp x12, lr, [sp, #-16]! + stp x18, lr, [sp, #-16]! mrs x18, tpidr_el1 .endm .macro restore_registers el - ldp x12, lr, [sp], #16 + msr daifset, #2 /* Disable interrupts, x18 may change + * in the interrupt exception handler */ + ldp x18, lr, [sp], #16 ldp x10, x11, [sp], #16 .if \el == 0 - msr sp_el0, x12 -.else - mov sp, x12 + msr sp_el0, x18 .endif msr spsr_el1, x11 msr elr_el1, x10 @@ -89,6 +90,10 @@ __FBSDID("$FreeBSD$"); ldp x24, x25, [sp], #16 ldp x26, x27, [sp], #16 ldp x28, x29, [sp], #16 +.if \el == 1 + mov sp, x18 + mrs x18, tpidr_el1 +.endif .endm .macro do_ast From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 22:03:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2903B7F9; Sat, 6 Jun 2015 22:03:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1575815F8; Sat, 6 Jun 2015 22:03:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t56M3PVf001916; Sat, 6 Jun 2015 22:03:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t56M3ONo001911; Sat, 6 Jun 2015 22:03:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506062203.t56M3ONo001911@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 6 Jun 2015 22:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284104 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include 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: Sat, 06 Jun 2015 22:03:26 -0000 Author: kib Date: Sat Jun 6 22:03:24 2015 New Revision: 284104 URL: https://svnweb.freebsd.org/changeset/base/284104 Log: Update print_INTEL_TLB() by the tag values from the Intel SDM rev. 55. The modern CPUs cache and TLB descriptions looked quite questionable without the update, e.g. Haswell i7 4770S reported: Data TLB: 4 KB pages, 4-way set associative, 64 entries L2 cache: 256 kbytes, 8-way associative, 64 bytes/line After the update, the report is: Data TLB: 1 GByte pages, 4-way set associative, 4 entries Data TLB: 4 KB pages, 4-way set associative, 64 entries Instruction TLB: 2M/4M pages, fully associative, 8 entries Instruction TLB: 4KByte pages, 8-way set associative, 64 entries 64-Byte prefetching Shared 2nd-Level TLB: 4 KByte/2MByte pages, 8-way associative, 1024 entries L2 cache: 256 kbytes, 8-way associative, 64 bytes/line Some tags were apparently removed from the table 3-21, Vol. 2A. Keep them around, but add a comment stating the removal. Update the format line for cpu_stdext_feature according to the bits from the SDM rev.55. It appears that Haswells do not store %cs and %ds values in the FPU save area. Store content of the %ecx register from the CPUID leaf 0x7 subleaf 0 as cpu_stdext_feature2 and print defined bits from it, again acording to SDM rev. 55. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/initcpu.c head/sys/amd64/include/md_var.h head/sys/i386/i386/initcpu.c head/sys/i386/include/md_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Sat Jun 6 21:52:46 2015 (r284103) +++ head/sys/amd64/amd64/initcpu.c Sat Jun 6 22:03:24 2015 (r284104) @@ -74,6 +74,7 @@ u_int cpu_fxsr; /* SSE enabled */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ u_int cpu_clflush_line_size = 32; u_int cpu_stdext_feature; +u_int cpu_stdext_feature2; u_int cpu_max_ext_state_size; u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Sat Jun 6 21:52:46 2015 (r284103) +++ head/sys/amd64/include/md_var.h Sat Jun 6 22:03:24 2015 (r284104) @@ -49,6 +49,7 @@ extern u_int via_feature_rng; extern u_int via_feature_xcrypt; extern u_int cpu_clflush_line_size; extern u_int cpu_stdext_feature; +extern u_int cpu_stdext_feature2; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Sat Jun 6 21:52:46 2015 (r284103) +++ head/sys/i386/i386/initcpu.c Sat Jun 6 22:03:24 2015 (r284104) @@ -102,6 +102,7 @@ u_int cpu_mxcsr_mask; /* Valid bits in #endif u_int cpu_clflush_line_size = 32; u_int cpu_stdext_feature; +u_int cpu_stdext_feature2; u_int cpu_max_ext_state_size; u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Sat Jun 6 21:52:46 2015 (r284103) +++ head/sys/i386/include/md_var.h Sat Jun 6 22:03:24 2015 (r284104) @@ -49,6 +49,7 @@ extern u_int via_feature_rng; extern u_int via_feature_xcrypt; extern u_int cpu_clflush_line_size; extern u_int cpu_stdext_feature; +extern u_int cpu_stdext_feature2; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Sat Jun 6 21:52:46 2015 (r284103) +++ head/sys/x86/x86/identcpu.c Sat Jun 6 22:03:24 2015 (r284104) @@ -903,6 +903,9 @@ printcpuinfo(void) "\013INVPCID" /* Restricted Transactional Memory */ "\014RTM" + "\015PQM" + "\016NFPUSG" + "\020PQE" /* Intel Memory Protection Extensions */ "\017MPX" /* AVX512 Foundation */ @@ -922,6 +925,16 @@ printcpuinfo(void) ); } + if (cpu_stdext_feature2 != 0) { + printf("\n Structured Extended Features2=0x%b", + cpu_stdext_feature2, + "\020" + "\001PREFETCHWT1" + "\004PKU" + "\005OSPKE" + ); + } + if ((cpu_feature2 & CPUID2_XSAVE) != 0) { cpuid_count(0xd, 0x1, regs); if (regs[0] != 0) { @@ -1357,6 +1370,7 @@ identify_cpu(void) cpu_stdext_disable = 0; TUNABLE_INT_FETCH("hw.cpu_stdext_disable", &cpu_stdext_disable); cpu_stdext_feature &= ~cpu_stdext_disable; + cpu_stdext_feature2 = regs[2]; } #ifdef __i386__ @@ -1701,18 +1715,39 @@ print_INTEL_TLB(u_int data) case 0x8: printf("1st-level instruction cache: 16 KB, 4-way set associative, 32 byte line size\n"); break; + case 0x9: + printf("1st-level instruction cache: 32 KB, 4-way set associative, 64 byte line size\n"); + break; case 0xa: printf("1st-level data cache: 8 KB, 2-way set associative, 32 byte line size\n"); break; + case 0xb: + printf("Instruction TLB: 4 MByte pages, 4-way set associative, 4 entries\n"); + break; case 0xc: printf("1st-level data cache: 16 KB, 4-way set associative, 32 byte line size\n"); break; + case 0xd: + printf("1st-level data cache: 16 KBytes, 4-way set associative, 64 byte line size"); + break; + case 0xe: + printf("1st-level data cache: 24 KBytes, 6-way set associative, 64 byte line size\n"); + break; + case 0x1d: + printf("2nd-level cache: 128 KBytes, 2-way set associative, 64 byte line size\n"); + break; + case 0x21: + printf("2nd-level cache: 256 KBytes, 8-way set associative, 64 byte line size\n"); + break; case 0x22: printf("3rd-level cache: 512 KB, 4-way set associative, sectored cache, 64 byte line size\n"); break; case 0x23: printf("3rd-level cache: 1 MB, 8-way set associative, sectored cache, 64 byte line size\n"); break; + case 0x24: + printf("2nd-level cache: 1 MBytes, 16-way set associative, 64 byte line size\n"); + break; case 0x25: printf("3rd-level cache: 2 MB, 8-way set associative, sectored cache, 64 byte line size\n"); break; @@ -1725,13 +1760,13 @@ print_INTEL_TLB(u_int data) case 0x30: printf("1st-level instruction cache: 32 KB, 8-way set associative, 64 byte line size\n"); break; - case 0x39: + case 0x39: /* De-listed in SDM rev. 54 */ printf("2nd-level cache: 128 KB, 4-way set associative, sectored cache, 64 byte line size\n"); break; - case 0x3b: + case 0x3b: /* De-listed in SDM rev. 54 */ printf("2nd-level cache: 128 KB, 2-way set associative, sectored cache, 64 byte line size\n"); break; - case 0x3c: + case 0x3c: /* De-listed in SDM rev. 54 */ printf("2nd-level cache: 256 KB, 4-way set associative, sectored cache, 64 byte line size\n"); break; case 0x41: @@ -1755,6 +1790,34 @@ print_INTEL_TLB(u_int data) case 0x47: printf("3rd-level cache: 8 MB, 8-way set associative, 64 byte line size\n"); break; + case 0x48: + printf("2nd-level cache: 3MByte, 12-way set associative, 64 byte line size\n"); + break; + case 0x49: + if (CPUID_TO_FAMILY(cpu_id) == 0xf && + CPUID_TO_MODEL(cpu_id) == 0x6) + printf("3rd-level cache: 4MB, 16-way set associative, 64-byte line size\n"); + else + printf("2nd-level cache: 4 MByte, 16-way set associative, 64 byte line size"); + break; + case 0x4a: + printf("3rd-level cache: 6MByte, 12-way set associative, 64 byte line size\n"); + break; + case 0x4b: + printf("3rd-level cache: 8MByte, 16-way set associative, 64 byte line size\n"); + break; + case 0x4c: + printf("3rd-level cache: 12MByte, 12-way set associative, 64 byte line size\n"); + break; + case 0x4d: + printf("3rd-level cache: 16MByte, 16-way set associative, 64 byte line size\n"); + break; + case 0x4e: + printf("2nd-level cache: 6MByte, 24-way set associative, 64 byte line size\n"); + break; + case 0x4f: + printf("Instruction TLB: 4 KByte pages, 32 entries\n"); + break; case 0x50: printf("Instruction TLB: 4 KB, 2 MB or 4 MB pages, fully associative, 64 entries\n"); break; @@ -1764,6 +1827,21 @@ print_INTEL_TLB(u_int data) case 0x52: printf("Instruction TLB: 4 KB, 2 MB or 4 MB pages, fully associative, 256 entries\n"); break; + case 0x55: + printf("Instruction TLB: 2-MByte or 4-MByte pages, fully associative, 7 entries\n"); + break; + case 0x56: + printf("Data TLB0: 4 MByte pages, 4-way set associative, 16 entries\n"); + break; + case 0x57: + printf("Data TLB0: 4 KByte pages, 4-way associative, 16 entries\n"); + break; + case 0x59: + printf("Data TLB0: 4 KByte pages, fully associative, 16 entries\n"); + break; + case 0x5a: + printf("Data TLB0: 2-MByte or 4 MByte pages, 4-way set associative, 32 entries\n"); + break; case 0x5b: printf("Data TLB: 4 KB or 4 MB pages, fully associative, 64 entries\n"); break; @@ -1776,6 +1854,12 @@ print_INTEL_TLB(u_int data) case 0x60: printf("1st-level data cache: 16 KB, 8-way set associative, sectored cache, 64 byte line size\n"); break; + case 0x61: + printf("Instruction TLB: 4 KByte pages, fully associative, 48 entries\n"); + break; + case 0x63: + printf("Data TLB: 1 GByte pages, 4-way set associative, 4 entries\n"); + break; case 0x66: printf("1st-level data cache: 8 KB, 4-way set associative, sectored cache, 64 byte line size\n"); break; @@ -1794,6 +1878,9 @@ print_INTEL_TLB(u_int data) case 0x72: printf("Trace cache: 32K-uops, 8-way set associative\n"); break; + case 0x76: + printf("Instruction TLB: 2M/4M pages, fully associative, 8 entries\n"); + break; case 0x78: printf("2nd-level cache: 1 MB, 4-way set associative, 64-byte line size\n"); break; @@ -1815,6 +1902,9 @@ print_INTEL_TLB(u_int data) case 0x7f: printf("2nd-level cache: 512-KB, 2-way set associative, 64-byte line size\n"); break; + case 0x80: + printf("2nd-level cache: 512 KByte, 8-way set associative, 64-byte line size\n"); + break; case 0x82: printf("2nd-level cache: 256 KB, 8-way set associative, 32 byte line size\n"); break; @@ -1833,12 +1923,99 @@ print_INTEL_TLB(u_int data) case 0x87: printf("2nd-level cache: 1 MB, 8-way set associative, 64 byte line size\n"); break; + case 0xa0: + printf("DTLB: 4k pages, fully associative, 32 entries\n"); + break; case 0xb0: printf("Instruction TLB: 4 KB Pages, 4-way set associative, 128 entries\n"); break; + case 0xb1: + printf("Instruction TLB: 2M pages, 4-way, 8 entries or 4M pages, 4-way, 4 entries\n"); + break; + case 0xb2: + printf("Instruction TLB: 4KByte pages, 4-way set associative, 64 entries\n"); + break; case 0xb3: printf("Data TLB: 4 KB Pages, 4-way set associative, 128 entries\n"); break; + case 0xb4: + printf("Data TLB1: 4 KByte pages, 4-way associative, 256 entries\n"); + break; + case 0xb5: + printf("Instruction TLB: 4KByte pages, 8-way set associative, 64 entries\n"); + break; + case 0xb6: + printf("Instruction TLB: 4KByte pages, 8-way set associative, 128 entries\n"); + break; + case 0xba: + printf("Data TLB1: 4 KByte pages, 4-way associative, 64 entries\n"); + break; + case 0xc0: + printf("Data TLB: 4 KByte and 4 MByte pages, 4-way associative, 8 entries\n"); + break; + case 0xc1: + printf("Shared 2nd-Level TLB: 4 KByte/2MByte pages, 8-way associative, 1024 entries\n"); + break; + case 0xc2: + printf("DTLB: 4 KByte/2 MByte pages, 4-way associative, 16 entries\n"); + break; + case 0xc3: + printf("Shared 2nd-Level TLB: 4 KByte /2 MByte pages, 6-way associative, 1536 entries. Also 1GBbyte pages, 4-way, 16 entries\n"); + break; + case 0xca: + printf("Shared 2nd-Level TLB: 4 KByte pages, 4-way associative, 512 entries\n"); + break; + case 0xd0: + printf("3rd-level cache: 512 KByte, 4-way set associative, 64 byte line size\n"); + break; + case 0xd1: + printf("3rd-level cache: 1 MByte, 4-way set associative, 64 byte line size\n"); + break; + case 0xd2: + printf("3rd-level cache: 2 MByte, 4-way set associative, 64 byte line size\n"); + break; + case 0xd6: + printf("3rd-level cache: 1 MByte, 8-way set associative, 64 byte line size\n"); + break; + case 0xd7: + printf("3rd-level cache: 2 MByte, 8-way set associative, 64 byte line size\n"); + break; + case 0xd8: + printf("3rd-level cache: 4 MByte, 8-way set associative, 64 byte line size\n"); + break; + case 0xdc: + printf("3rd-level cache: 1.5 MByte, 12-way set associative, 64 byte line size\n"); + break; + case 0xdd: + printf("3rd-level cache: 3 MByte, 12-way set associative, 64 byte line size\n"); + break; + case 0xde: + printf("3rd-level cache: 6 MByte, 12-way set associative, 64 byte line size\n"); + break; + case 0xe2: + printf("3rd-level cache: 2 MByte, 16-way set associative, 64 byte line size\n"); + break; + case 0xe3: + printf("3rd-level cache: 4 MByte, 16-way set associative, 64 byte line size\n"); + break; + case 0xe4: + printf("3rd-level cache: 8 MByte, 16-way set associative, 64 byte line size\n"); + break; + case 0xea: + printf("3rd-level cache: 12MByte, 24-way set associative, 64 byte line size\n"); + break; + case 0xeb: + printf("3rd-level cache: 18MByte, 24-way set associative, 64 byte line size\n"); + break; + case 0xec: + printf("3rd-level cache: 24MByte, 24-way set associative, 64 byte line size\n"); + break; + case 0xf0: + printf("64-Byte prefetching\n"); + break; + case 0xf1: + printf("128-Byte prefetching\n"); + break; } } From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 22:03:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E685EA58 for ; Sat, 6 Jun 2015 22:03:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ig0-f177.google.com (mail-ig0-f177.google.com [209.85.213.177]) (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 B105415FD for ; Sat, 6 Jun 2015 22:03:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by igbsb11 with SMTP id sb11so36050325igb.0 for ; Sat, 06 Jun 2015 15:03:38 -0700 (PDT) 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=VVBszvsg0c1S/tncf5C4CmMJG+Vb8Ebxg8TUPyVBsIE=; b=ghcNivjLvn+eyO1xiKTUuY7XwnhNMQewMhNTLFwDeWI2myx3lhDE5oMmhld8ZFRVq0 zkm0mZvFGaGNEmVwWuUbTTZm8RlqpnhW8RdHrS01rizOLfgSzDh+fmfDX4fv6Pbn52XQ rO2lofbjri3FFO3v8bzRpyqVpymKv8FHUnMoHY6dC6osOz+VpRNg7RfxXTCAm7581Lug Blgb9JbsTU/uJ55Appawq7Su3Ejka/ZhV69/0vMnA+ReZSu88j6LpN/cZ2h/vh+CJkNU jrTGW+4xzjk7D730M5zmFxe6ANPabuw9cBQSSu4f+CkOxpLH4BRc7oMCqTDiXRuuAx/c 1n7g== X-Gm-Message-State: ALoCoQkSogj5vgpxAFF2BJNX3vzWqejZm0PiPX0g6ShnQnyhy9Hp3YWIAVl+0ShpQRWxe+fyWRDd X-Received: by 10.50.27.6 with SMTP id p6mr5332823igg.46.1433628218061; Sat, 06 Jun 2015 15:03:38 -0700 (PDT) Received: from netflix-mac-wired.bsdimp.com ([50.253.99.174]) by mx.google.com with ESMTPSA id l6sm1774437igx.10.2015.06.06.15.03.37 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 06 Jun 2015 15:03:37 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r284087 - head/sys/modules Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: multipart/signed; boundary="Apple-Mail=_4BCCFAE0-A4AB-4F6E-85F9-17A13E52726B"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Warner Losh In-Reply-To: <2201763.WufPS8uA2S@ralph.baldwin.cx> Date: Sat, 6 Jun 2015 16:03:35 -0600 Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <7599E3D2-B8D8-46E1-BF28-0E8AE20DA73E@bsdimp.com> References: <201506061708.t56H87b8051531@svn.freebsd.org> <2201763.WufPS8uA2S@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Jun 2015 22:03:45 -0000 --Apple-Mail=_4BCCFAE0-A4AB-4F6E-85F9-17A13E52726B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 6, 2015, at 11:19 AM, John Baldwin wrote: >=20 > On Saturday, June 06, 2015 05:08:07 PM Warner Losh wrote: >> Author: imp >> Date: Sat Jun 6 17:08:06 2015 >> New Revision: 284087 >> URL: https://svnweb.freebsd.org/changeset/base/284087 >>=20 >> Log: >> Turns out amd64 is hit too by ix. When it works, turn it back on. >=20 > Can you post your errors? It builds fine for me and Jenkins hasn't = been > reporting any build errors since yesterday afternoon/evening. Will do. it was very consistent, even after refreshing my tree. I=E2=80=99= ll investigate more. Warner --Apple-Mail=_4BCCFAE0-A4AB-4F6E-85F9-17A13E52726B 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 iQIcBAEBCgAGBQJVc244AAoJEGwc0Sh9sBEA4aUP/3+JHBu8RJFJQvzit4qFIeCN hAOag6qv+vXh7dGAoBPtSSveMSjRAQks8MHTsHc95bX8nnL57aOGrz6s+dmIdOnk H/ZN9kvXLIJdQMG+f8n2QK/Q9kMGJOccrp69IOP7ya4k8NC72qzdldNH1huO48ou jnwYsBJDRKYdpQplH7JI67dx/9M31X7XgSD1xERdPB1G5oh7qOGrFkXtUW3erOXW DciLEjc6IjqZbHnCT1+OhV0oCx3eA6jPT3EVr2tb+aeonrzd81uo/HfbTNwYPCY3 E5qcTJSy5/0HgGgAKPKcNq3P3sZj3cvmc2sxJLoaUEmYCYmU8D9RF09xkIamta/5 hGQfFG0JCVkVcXR8Gn8kEKtKpLgmbkAIn2BZtM6vmxnJDKIPEFDjsm2tGWpGmkkd oPn+TYsjrPk2A2SLYiyfVNpsHXf+Z7Ljqf6nZuZKD9Sgd9ypF40bET1w94U9GIrA vMGrJafGJ7AU0/GGVvdTseswgyw7AyPzgtpmk0uX52ZhbEyBqf1JNbJz8YqYu64r tSL8xbrSxOARdF+yHZ9Pxnu44slRrKSja5LYWBxwp4r3j/MJfnIPw6dEANAw8iQm YE7Kirk7xjqv7mF6Z/BhEItSlafqIgESRZxH3mY35MFRIbH50lz2o/O7evzpFBGm uCWHJfaKW6yu+rjcsyVf =JULJ -----END PGP SIGNATURE----- --Apple-Mail=_4BCCFAE0-A4AB-4F6E-85F9-17A13E52726B--