From owner-svn-src-stable-10@freebsd.org Mon Nov 14 18:42:13 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7609C41E91; Mon, 14 Nov 2016 18:42:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A934568F; Mon, 14 Nov 2016 18:42:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAEIgCZF028563; Mon, 14 Nov 2016 18:42:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAEIgCUG028562; Mon, 14 Nov 2016 18:42:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611141842.uAEIgCUG028562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 14 Nov 2016 18:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308646 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2016 18:42:13 -0000 Author: mav Date: Mon Nov 14 18:42:12 2016 New Revision: 308646 URL: https://svnweb.freebsd.org/changeset/base/308646 Log: MFC r308133, r308134: Fix wrong copy/paste in error message. Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Mon Nov 14 18:41:34 2016 (r308645) +++ stable/10/usr.sbin/ctld/ctld.c Mon Nov 14 18:42:12 2016 (r308646) @@ -197,7 +197,7 @@ auth_check_secret_length(struct auth *au auth->a_auth_group->ag_name); else log_warnx("secret for user \"%s\", target \"%s\", " - "is too short; it should be at least 16 characters " + "is too short; it should be at least 12 characters " "long", auth->a_user, auth->a_auth_group->ag_target->t_name); } @@ -226,7 +226,7 @@ auth_check_secret_length(struct auth *au else log_warnx("mutual secret for user \"%s\", " "target \"%s\", is too short; it should be " - "at least 16 characters long", + "at least 12 characters long", auth->a_user, auth->a_auth_group->ag_target->t_name); } From owner-svn-src-stable-10@freebsd.org Tue Nov 15 08:56:20 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C00C432EC; Tue, 15 Nov 2016 08:56:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA2B869D; Tue, 15 Nov 2016 08:56:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAF8uJbS065956; Tue, 15 Nov 2016 08:56:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAF8uJNA065955; Tue, 15 Nov 2016 08:56:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611150856.uAF8uJNA065955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 Nov 2016 08:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308680 - stable/10/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2016 08:56:20 -0000 Author: hselasky Date: Tue Nov 15 08:56:18 2016 New Revision: 308680 URL: https://svnweb.freebsd.org/changeset/base/308680 Log: MFC r308409: When a firmware command times out do not free the command structure to avoid use after free. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Tue Nov 15 08:54:03 2016 (r308679) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Tue Nov 15 08:56:18 2016 (r308680) @@ -1245,8 +1245,11 @@ static int cmd_exec_helper(struct mlx5_c err = mlx5_cmd_invoke(dev, inb, outb, out, out_size, callback, context, pages_queue, &status); - if (err) + if (err) { + if (err == -ETIMEDOUT) + return err; goto out_out; + } mlx5_core_dbg(dev, "err %d, status %d\n", err, status); if (status) { From owner-svn-src-stable-10@freebsd.org Tue Nov 15 08:57:00 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D7A0C4334C; Tue, 15 Nov 2016 08:57:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1969D856; Tue, 15 Nov 2016 08:57:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAF8uxY8066036; Tue, 15 Nov 2016 08:56:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAF8ux9Q066035; Tue, 15 Nov 2016 08:56:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611150856.uAF8ux9Q066035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 Nov 2016 08:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308681 - stable/10/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2016 08:57:00 -0000 Author: hselasky Date: Tue Nov 15 08:56:59 2016 New Revision: 308681 URL: https://svnweb.freebsd.org/changeset/base/308681 Log: MFC r308411: Ensure the firmware is notified of any host memory allocation failures. Else firmware commands may time out waiting for host memory. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Tue Nov 15 08:56:18 2016 (r308680) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Tue Nov 15 08:56:59 2016 (r308681) @@ -246,13 +246,14 @@ static int give_pages(struct mlx5_core_d int inlen; u64 addr; int err; - int i; + int i = 0; inlen = sizeof(*in) + npages * sizeof(in->pas[0]); in = mlx5_vzalloc(inlen); if (!in) { mlx5_core_warn(dev, "vzalloc failed %d\n", inlen); - return -ENOMEM; + err = -ENOMEM; + goto out_alloc; } memset(&out, 0, sizeof(out)); @@ -263,7 +264,7 @@ retry: if (err == -ENOMEM) err = alloc_system_page(dev, func_id); if (err) - goto out_4k; + goto out_alloc; goto retry; } @@ -301,12 +302,11 @@ out_alloc: memset(&out, 0, sizeof(out)); nin->hdr.opcode = cpu_to_be16(MLX5_CMD_OP_MANAGE_PAGES); nin->hdr.opmod = cpu_to_be16(MLX5_PAGES_CANT_GIVE); + nin->func_id = cpu_to_be16(func_id); if (mlx5_cmd_exec(dev, nin, sizeof(*nin), &out, sizeof(out))) mlx5_core_warn(dev, "page notify failed\n"); kfree(nin); } - -out_4k: for (i--; i >= 0; i--) free_4k(dev, be64_to_cpu(in->pas[i])); out_free: From owner-svn-src-stable-10@freebsd.org Tue Nov 15 08:57:37 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EEF5C4339A; Tue, 15 Nov 2016 08:57:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 105809B1; Tue, 15 Nov 2016 08:57:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAF8vaCh066118; Tue, 15 Nov 2016 08:57:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAF8vaPC066117; Tue, 15 Nov 2016 08:57:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611150857.uAF8vaPC066117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 Nov 2016 08:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308682 - stable/10/sys/dev/mlx5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2016 08:57:37 -0000 Author: hselasky Date: Tue Nov 15 08:57:36 2016 New Revision: 308682 URL: https://svnweb.freebsd.org/changeset/base/308682 Log: MFC r308412: Correct checksum fields in the "mlx5_mini_cqe8" structure. The fields in question are currently not used. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/device.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/device.h ============================================================================== --- stable/10/sys/dev/mlx5/device.h Tue Nov 15 08:56:59 2016 (r308681) +++ stable/10/sys/dev/mlx5/device.h Tue Nov 15 08:57:36 2016 (r308682) @@ -1348,15 +1348,16 @@ struct mlx5_ifc_mcia_reg_bits { struct mlx5_mini_cqe8 { union { - u32 rx_hash_result; - u32 checksum; + __be32 rx_hash_result; + __be16 checksum; + __be16 rsvd; struct { - u16 wqe_counter; + __be16 wqe_counter; u8 s_wqe_opcode; u8 reserved; } s_wqe_info; }; - u32 byte_cnt; + __be32 byte_cnt; }; enum { From owner-svn-src-stable-10@freebsd.org Tue Nov 15 08:58:13 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98754C433FB; Tue, 15 Nov 2016 08:58:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 670CBB14; Tue, 15 Nov 2016 08:58:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAF8wCgX066199; Tue, 15 Nov 2016 08:58:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAF8wC5s066198; Tue, 15 Nov 2016 08:58:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611150858.uAF8wC5s066198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 Nov 2016 08:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308683 - stable/10/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2016 08:58:13 -0000 Author: hselasky Date: Tue Nov 15 08:58:12 2016 New Revision: 308683 URL: https://svnweb.freebsd.org/changeset/base/308683 Log: MFC r308413: Query flow table capabilities according to the correct capability bit for infiniband. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_fw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_fw.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_fw.c Tue Nov 15 08:57:36 2016 (r308682) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_fw.c Tue Nov 15 08:58:12 2016 (r308683) @@ -167,7 +167,11 @@ int mlx5_query_hca_caps(struct mlx5_core return err; } - if (MLX5_CAP_GEN(dev, nic_flow_table)) { + if ((MLX5_CAP_GEN(dev, port_type) == + MLX5_CMD_HCA_CAP_PORT_TYPE_ETHERNET && + MLX5_CAP_GEN(dev, nic_flow_table)) || + (MLX5_CAP_GEN(dev, port_type) == MLX5_CMD_HCA_CAP_PORT_TYPE_IB && + MLX5_CAP_GEN(dev, ipoib_enhanced_offloads))) { err = mlx5_core_get_caps(dev, MLX5_CAP_FLOW_TABLE, HCA_CAP_OPMOD_GET_CUR); if (err) From owner-svn-src-stable-10@freebsd.org Tue Nov 15 08:58:52 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0858C4348A; Tue, 15 Nov 2016 08:58:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC63ECBA; Tue, 15 Nov 2016 08:58:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAF8wp14066281; Tue, 15 Nov 2016 08:58:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAF8wpPZ066276; Tue, 15 Nov 2016 08:58:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611150858.uAF8wpPZ066276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 Nov 2016 08:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308684 - in stable/10/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2016 08:58:53 -0000 Author: hselasky Date: Tue Nov 15 08:58:51 2016 New Revision: 308684 URL: https://svnweb.freebsd.org/changeset/base/308684 Log: MFC r308414: Add more firmware related structures and update existing ones in the MLX5 core module. Update the set and query diagnostics counter API. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/device.h stable/10/sys/dev/mlx5/driver.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_port.c stable/10/sys/dev/mlx5/mlx5_ifc.h stable/10/sys/dev/mlx5/qp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/device.h ============================================================================== --- stable/10/sys/dev/mlx5/device.h Tue Nov 15 08:58:12 2016 (r308683) +++ stable/10/sys/dev/mlx5/device.h Tue Nov 15 08:58:51 2016 (r308684) @@ -1271,9 +1271,11 @@ enum { MLX5_RFC_2819_COUNTERS_GROUP = 0x2, MLX5_RFC_3635_COUNTERS_GROUP = 0x3, MLX5_ETHERNET_EXTENDED_COUNTERS_GROUP = 0x5, + MLX5_ETHERNET_DISCARD_COUNTERS_GROUP = 0x6, MLX5_PER_PRIORITY_COUNTERS_GROUP = 0x10, MLX5_PER_TRAFFIC_CLASS_COUNTERS_GROUP = 0x11, MLX5_PHYSICAL_LAYER_COUNTERS_GROUP = 0x12, + MLX5_INFINIBAND_PORT_COUNTERS_GROUP = 0x20, }; enum { Modified: stable/10/sys/dev/mlx5/driver.h ============================================================================== --- stable/10/sys/dev/mlx5/driver.h Tue Nov 15 08:58:12 2016 (r308683) +++ stable/10/sys/dev/mlx5/driver.h Tue Nov 15 08:58:51 2016 (r308684) @@ -120,6 +120,7 @@ enum { MLX5_REG_QETCR = 0x4005, MLX5_REG_QPDP = 0x4007, MLX5_REG_QTCT = 0x400A, + MLX5_REG_QHLL = 0x4016, MLX5_REG_DCBX_PARAM = 0x4020, MLX5_REG_DCBX_APP = 0x4021, MLX5_REG_PCAP = 0x5001, @@ -954,9 +955,11 @@ int mlx5_modify_port_cong_params(struct void *in, int in_size); int mlx5_query_port_cong_statistics(struct mlx5_core_dev *mdev, int clear, void *out, int out_size); -int mlx5_set_diagnostics(struct mlx5_core_dev *mdev, void *in, int in_size); -int mlx5_query_diagnostics(struct mlx5_core_dev *mdev, u8 num_of_samples, - u16 sample_index, void *out, int out_size); +int mlx5_set_diagnostic_params(struct mlx5_core_dev *mdev, void *in, + int in_size); +int mlx5_query_diagnostic_counters(struct mlx5_core_dev *mdev, + u8 num_of_samples, u16 sample_index, + void *out, int out_size); static inline u32 mlx5_mkey_to_idx(u32 mkey) { return mkey >> 8; Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_port.c Tue Nov 15 08:58:12 2016 (r308683) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_port.c Tue Nov 15 08:58:51 2016 (r308684) @@ -831,28 +831,32 @@ int mlx5_query_port_cong_statistics(stru out, out_size); } -int mlx5_set_diagnostics(struct mlx5_core_dev *mdev, void *in, int in_size) +int mlx5_set_diagnostic_params(struct mlx5_core_dev *mdev, void *in, + int in_size) { - u32 out[MLX5_ST_SZ_DW(set_diagnostics_out)]; + u32 out[MLX5_ST_SZ_DW(set_diagnostic_params_out)]; memset(out, 0, sizeof(out)); - MLX5_SET(set_diagnostics_in, in, opcode, MLX5_CMD_OP_SET_DIAGNOSTICS); + MLX5_SET(set_diagnostic_params_in, in, opcode, + MLX5_CMD_OP_SET_DIAGNOSTICS); return mlx5_cmd_exec_check_status(mdev, in, in_size, out, sizeof(out)); } -int mlx5_query_diagnostics(struct mlx5_core_dev *mdev, u8 num_of_samples, - u16 sample_index, void *out, int out_size) +int mlx5_query_diagnostic_counters(struct mlx5_core_dev *mdev, + u8 num_of_samples, u16 sample_index, + void *out, int out_size) { - u32 in[MLX5_ST_SZ_DW(query_diagnostics_in)]; + u32 in[MLX5_ST_SZ_DW(query_diagnostic_counters_in)]; memset(in, 0, sizeof(in)); - MLX5_SET(query_diagnostics_in, in, opcode, + MLX5_SET(query_diagnostic_counters_in, in, opcode, MLX5_CMD_OP_QUERY_DIAGNOSTICS); - MLX5_SET(query_diagnostics_in, in, num_of_samples, num_of_samples); - MLX5_SET(query_diagnostics_in, in, sample_index, sample_index); + MLX5_SET(query_diagnostic_counters_in, in, num_of_samples, + num_of_samples); + MLX5_SET(query_diagnostic_counters_in, in, sample_index, sample_index); return mlx5_cmd_exec_check_status(mdev, in, sizeof(in), out, out_size); } Modified: stable/10/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_ifc.h Tue Nov 15 08:58:12 2016 (r308683) +++ stable/10/sys/dev/mlx5/mlx5_ifc.h Tue Nov 15 08:58:51 2016 (r308684) @@ -149,6 +149,12 @@ enum { MLX5_CMD_OP_QUERY_Q_COUNTER = 0x773, MLX5_CMD_OP_SET_RATE_LIMIT = 0x780, MLX5_CMD_OP_QUERY_RATE_LIMIT = 0x781, + MLX5_CMD_OP_CREATE_SCHEDULING_ELEMENT = 0x782, + MLX5_CMD_OP_DESTROY_SCHEDULING_ELEMENT = 0x783, + MLX5_CMD_OP_QUERY_SCHEDULING_ELEMENT = 0x784, + MLX5_CMD_OP_MODIFY_SCHEDULING_ELEMENT = 0x785, + MLX5_CMD_OP_CREATE_QOS_PARA_VPORT = 0x786, + MLX5_CMD_OP_DESTROY_QOS_PARA_VPORT = 0x787, MLX5_CMD_OP_ALLOC_PD = 0x800, MLX5_CMD_OP_DEALLOC_PD = 0x801, MLX5_CMD_OP_ALLOC_UAR = 0x802, @@ -299,6 +305,59 @@ struct mlx5_ifc_flow_table_fields_suppor u8 reserved_7[0x20]; }; +struct mlx5_ifc_eth_discard_cntrs_grp_bits { + u8 ingress_general_high[0x20]; + + u8 ingress_general_low[0x20]; + + u8 ingress_policy_engine_high[0x20]; + + u8 ingress_policy_engine_low[0x20]; + + u8 ingress_vlan_membership_high[0x20]; + + u8 ingress_vlan_membership_low[0x20]; + + u8 ingress_tag_frame_type_high[0x20]; + + u8 ingress_tag_frame_type_low[0x20]; + + u8 egress_vlan_membership_high[0x20]; + + u8 egress_vlan_membership_low[0x20]; + + u8 loopback_filter_high[0x20]; + + u8 loopback_filter_low[0x20]; + + u8 egress_general_high[0x20]; + + u8 egress_general_low[0x20]; + + u8 reserved_at_1c0[0x40]; + + u8 egress_hoq_high[0x20]; + + u8 egress_hoq_low[0x20]; + + u8 port_isolation_high[0x20]; + + u8 port_isolation_low[0x20]; + + u8 egress_policy_engine_high[0x20]; + + u8 egress_policy_engine_low[0x20]; + + u8 ingress_tx_link_down_high[0x20]; + + u8 ingress_tx_link_down_low[0x20]; + + u8 egress_stp_filter_high[0x20]; + + u8 egress_stp_filter_low[0x20]; + + u8 reserved_at_340[0x480]; +}; struct mlx5_ifc_flow_table_prop_layout_bits { u8 ft_support[0x1]; u8 flow_tag[0x1]; @@ -421,7 +480,9 @@ struct mlx5_ifc_fte_match_set_misc_bits u8 vxlan_vni[0x18]; u8 reserved_3[0x8]; - u8 reserved_4[0x20]; + u8 geneve_vni[0x18]; + u8 reserved4[0x7]; + u8 geneve_oam[0x1]; u8 reserved_5[0xc]; u8 outer_ipv6_flow_label[0x14]; @@ -429,7 +490,9 @@ struct mlx5_ifc_fte_match_set_misc_bits u8 reserved_6[0xc]; u8 inner_ipv6_flow_label[0x14]; - u8 reserved_7[0xe0]; + u8 reserved7[0x10]; + u8 geneve_protocol_type[0x10]; + u8 reserved8[0xc0]; }; struct mlx5_ifc_cmd_pas_bits { @@ -535,6 +598,35 @@ struct mlx5_ifc_debug_cap_bits { struct mlx5_ifc_diagnostic_counter_cap_bits diagnostic_counter[0x1f0]; }; +struct mlx5_ifc_qos_cap_bits { + u8 packet_pacing[0x1]; + u8 esw_scheduling[0x1]; + u8 esw_bw_share[0x1]; + u8 esw_rate_limit[0x1]; + u8 hll[0x1]; + u8 packet_pacing_burst_bound[0x1]; + u8 reserved_at_6[0x1a]; + + u8 reserved_at_20[0x20]; + + u8 packet_pacing_max_rate[0x20]; + + u8 packet_pacing_min_rate[0x20]; + + u8 reserved_at_80[0x10]; + u8 packet_pacing_rate_table_size[0x10]; + + u8 esw_element_type[0x10]; + u8 esw_tsar_type[0x10]; + + u8 reserved_at_c0[0x10]; + u8 max_qos_para_vport[0x10]; + + u8 max_tsar_bw_share[0x20]; + + u8 reserved_at_100[0x700]; +}; + struct mlx5_ifc_snapshot_cap_bits { u8 reserved_0[0x1d]; u8 suspend_qp_uc[0x1]; @@ -599,17 +691,6 @@ struct mlx5_ifc_flow_table_nic_cap_bits u8 reserved_1[0x7200]; }; -struct mlx5_ifc_qos_cap_bits { - u8 packet_pacing[0x1]; - u8 reserved_0[0x1f]; - u8 reserved_1[0x20]; - u8 packet_pacing_max_rate[0x20]; - u8 packet_pacing_min_rate[0x20]; - u8 reserved_2[0x10]; - u8 packet_pacing_rate_table_size[0x10]; - u8 reserved_3[0x760]; -}; - struct mlx5_ifc_per_protocol_networking_offload_caps_bits { u8 csum_cap[0x1]; u8 vlan_cap[0x1]; @@ -631,7 +712,11 @@ struct mlx5_ifc_per_protocol_networking_ u8 tunnel_statless_gre[0x1]; u8 tunnel_stateless_vxlan[0x1]; - u8 reserved_2[0x20]; + u8 swp[0x1]; + u8 swp_csum[0x1]; + u8 swp_lso[0x1]; + u8 reserved_2[0x1c]; + u8 tunnel_stateless_geneve_rx[0x1]; u8 reserved_3[0x10]; u8 lro_min_mss_size[0x10]; @@ -1350,6 +1435,19 @@ struct mlx5_ifc_dcbx_param_reg_bits { u8 reserved_11[0x160]; }; +struct mlx5_ifc_qhll_bits { + u8 reserved_at_0[0x8]; + u8 local_port[0x8]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x1b]; + u8 hll_time[0x5]; + + u8 stall_en[0x1]; + u8 reserved_at_41[0x1c]; + u8 stall_cnt[0x3]; +}; + struct mlx5_ifc_qetcr_reg_bits { u8 operation_type[0x2]; u8 cap_local_admin[0x1]; @@ -2031,14 +2129,16 @@ enum { }; struct mlx5_ifc_sqc_bits { - u8 rlky[0x1]; + u8 rlkey[0x1]; u8 cd_master[0x1]; u8 fre[0x1]; u8 flush_in_error_en[0x1]; u8 allow_multi_pkt_send_wqe[0x1]; u8 min_wqe_inline_mode[0x3]; u8 state[0x4]; - u8 reserved_0[0x14]; + u8 reg_umr[0x1]; + u8 allow_swp[0x1]; + u8 reserved_0[0x12]; u8 reserved_1[0x8]; u8 user_index[0x18]; @@ -2046,7 +2146,9 @@ struct mlx5_ifc_sqc_bits { u8 reserved_2[0x8]; u8 cqn[0x18]; - u8 reserved_3[0x90]; + u8 reserved_3[0x80]; + + u8 qos_para_vport_number[0x10]; u8 packet_pacing_rate_limit_index[0x10]; u8 tis_lst_sz[0x10]; @@ -2060,6 +2162,58 @@ struct mlx5_ifc_sqc_bits { struct mlx5_ifc_wq_bits wq; }; +enum { + MLX5_TSAR_TYPE_DWRR = 0, + MLX5_TSAR_TYPE_ROUND_ROUBIN = 1, + MLX5_TSAR_TYPE_ETS = 2 +}; + +struct mlx5_ifc_tsar_element_attributes_bits { + u8 reserved_0[0x8]; + u8 tsar_type[0x8]; + u8 reserved_1[0x10]; +}; + +struct mlx5_ifc_vport_element_attributes_bits { + u8 reserved_0[0x10]; + u8 vport_number[0x10]; +}; + +struct mlx5_ifc_vport_tc_element_attributes_bits { + u8 traffic_class[0x10]; + u8 vport_number[0x10]; +}; + +struct mlx5_ifc_para_vport_tc_element_attributes_bits { + u8 reserved_0[0x0C]; + u8 traffic_class[0x04]; + u8 qos_para_vport_number[0x10]; +}; + +enum { + MLX5_SCHEDULING_CONTEXT_ELEMENT_TYPE_TSAR = 0x0, + MLX5_SCHEDULING_CONTEXT_ELEMENT_TYPE_VPORT = 0x1, + MLX5_SCHEDULING_CONTEXT_ELEMENT_TYPE_VPORT_TC = 0x2, + MLX5_SCHEDULING_CONTEXT_ELEMENT_TYPE_PARA_VPORT_TC = 0x3, +}; + +struct mlx5_ifc_scheduling_context_bits { + u8 element_type[0x8]; + u8 reserved_at_8[0x18]; + + u8 element_attributes[0x20]; + + u8 parent_element_id[0x20]; + + u8 reserved_at_60[0x40]; + + u8 bw_share[0x20]; + + u8 max_average_bw[0x20]; + + u8 reserved_at_e0[0x120]; +}; + struct mlx5_ifc_rqtc_bits { u8 reserved_0[0xa0]; @@ -3709,6 +3863,38 @@ struct mlx5_ifc_query_special_contexts_i u8 reserved_2[0x40]; }; +struct mlx5_ifc_query_scheduling_element_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0xc0]; + + struct mlx5_ifc_scheduling_context_bits scheduling_context; + + u8 reserved_at_300[0x100]; +}; + +enum { + MLX5_SCHEDULING_ELEMENT_IN_HIERARCHY_E_SWITCH = 0x2, +}; + +struct mlx5_ifc_query_scheduling_element_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 scheduling_hierarchy[0x8]; + u8 reserved_at_48[0x18]; + + u8 scheduling_element_id[0x20]; + + u8 reserved_at_80[0x180]; +}; + struct mlx5_ifc_query_rqt_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -4687,6 +4873,12 @@ struct mlx5_ifc_qp_2err_in_bits { u8 reserved_3[0x20]; }; +struct mlx5_ifc_para_vport_element_bits { + u8 reserved_at_0[0xc]; + u8 traffic_class[0x4]; + u8 qos_para_vport_number[0x10]; +}; + struct mlx5_ifc_page_fault_resume_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -4806,6 +4998,12 @@ struct mlx5_ifc_modify_tir_out_bits { u8 reserved_1[0x40]; }; +enum +{ + MLX5_MODIFY_SQ_BITMASK_PACKET_PACING_RATE_LIMIT_INDEX = 0x1 << 0, + MLX5_MODIFY_SQ_BITMASK_QOS_PARA_VPORT_NUMBER = 0x1 << 1 +}; + struct mlx5_ifc_modify_tir_in_bits { u8 opcode[0x10]; u8 reserved_0[0x10]; @@ -4854,6 +5052,47 @@ struct mlx5_ifc_modify_sq_in_bits { struct mlx5_ifc_sqc_bits ctx; }; +struct mlx5_ifc_modify_scheduling_element_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x1c0]; +}; + +enum { + MLX5_MODIFY_SCHEDULING_ELEMENT_IN_SCHEDULING_HIERARCHY_E_SWITCH = 0x2, +}; + +enum { + MLX5_MODIFY_SCHEDULING_ELEMENT_BITMASK_BW_SHARE = 0x1, + MLX5_MODIFY_SCHEDULING_ELEMENT_BITMASK_MAX_AVERAGE_BW = 0x2, +}; + +struct mlx5_ifc_modify_scheduling_element_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 scheduling_hierarchy[0x8]; + u8 reserved_at_48[0x18]; + + u8 scheduling_element_id[0x20]; + + u8 reserved_at_80[0x20]; + + u8 modify_bitmask[0x20]; + + u8 reserved_at_c0[0x40]; + + struct mlx5_ifc_scheduling_context_bits scheduling_context; + + u8 reserved_at_300[0x100]; +}; + struct mlx5_ifc_modify_rqt_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -5568,6 +5807,34 @@ struct mlx5_ifc_destroy_sq_in_bits { u8 reserved_3[0x20]; }; +struct mlx5_ifc_destroy_scheduling_element_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x1c0]; +}; + +enum { + MLX5_DESTROY_SCHEDULING_ELEMENT_IN_SCHEDULING_HIERARCHY_E_SWITCH = 0x2, +}; + +struct mlx5_ifc_destroy_scheduling_element_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 scheduling_hierarchy[0x8]; + u8 reserved_at_48[0x18]; + + u8 scheduling_element_id[0x20]; + + u8 reserved_at_80[0x180]; +}; + struct mlx5_ifc_destroy_rqt_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -5656,6 +5923,30 @@ struct mlx5_ifc_destroy_qp_in_bits { u8 reserved_3[0x20]; }; +struct mlx5_ifc_destroy_qos_para_vport_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x1c0]; +}; + +struct mlx5_ifc_destroy_qos_para_vport_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x20]; + + u8 reserved_at_60[0x10]; + u8 qos_para_vport_number[0x10]; + + u8 reserved_at_80[0x180]; +}; + struct mlx5_ifc_destroy_psv_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -5991,13 +6282,7 @@ struct mlx5_ifc_counter_id_bits { u8 counter_id[0x10]; }; -struct mlx5_ifc_set_diagnostics_in_bits { - u8 opcode[0x10]; - u8 reserved_0[0x10]; - - u8 reserved_1[0x10]; - u8 op_mod[0x10]; - +struct mlx5_ifc_diagnostic_params_context_bits { u8 num_of_counters[0x10]; u8 reserved_2[0x8]; u8 log_num_of_samples[0x8]; @@ -6016,7 +6301,17 @@ struct mlx5_ifc_set_diagnostics_in_bits struct mlx5_ifc_counter_id_bits counter_id[0]; }; -struct mlx5_ifc_set_diagnostics_out_bits { +struct mlx5_ifc_set_diagnostic_params_in_bits { + u8 opcode[0x10]; + u8 reserved_0[0x10]; + + u8 reserved_1[0x10]; + u8 op_mod[0x10]; + + struct mlx5_ifc_diagnostic_params_context_bits diagnostic_params_ctx; +}; + +struct mlx5_ifc_set_diagnostic_params_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -6025,7 +6320,7 @@ struct mlx5_ifc_set_diagnostics_out_bits u8 reserved_1[0x40]; }; -struct mlx5_ifc_query_diagnostics_in_bits { +struct mlx5_ifc_query_diagnostic_counters_in_bits { u8 opcode[0x10]; u8 reserved_0[0x10]; @@ -6049,7 +6344,7 @@ struct mlx5_ifc_diagnostic_counter_bits u8 counter_value_l[0x20]; }; -struct mlx5_ifc_query_diagnostics_out_bits { +struct mlx5_ifc_query_diagnostic_counters_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -6266,6 +6561,40 @@ struct mlx5_ifc_create_sq_in_bits { struct mlx5_ifc_sqc_bits ctx; }; +struct mlx5_ifc_create_scheduling_element_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x40]; + + u8 scheduling_element_id[0x20]; + + u8 reserved_at_a0[0x160]; +}; + +enum { + MLX5_CREATE_SCHEDULING_ELEMENT_IN_SCHEDULING_HIERARCHY_E_SWITCH = 0x2, +}; + +struct mlx5_ifc_create_scheduling_element_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 scheduling_hierarchy[0x8]; + u8 reserved_at_48[0x18]; + + u8 reserved_at_60[0xa0]; + + struct mlx5_ifc_scheduling_context_bits scheduling_context; + + u8 reserved_at_300[0x100]; +}; + struct mlx5_ifc_create_rqt_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -6373,6 +6702,30 @@ struct mlx5_ifc_create_qp_in_bits { u8 pas[0][0x40]; }; +struct mlx5_ifc_create_qos_para_vport_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x20]; + + u8 reserved_at_60[0x10]; + u8 qos_para_vport_number[0x10]; + + u8 reserved_at_80[0x180]; +}; + +struct mlx5_ifc_create_qos_para_vport_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x1c0]; +}; + struct mlx5_ifc_create_psv_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -6951,6 +7304,7 @@ struct mlx5_ifc_set_rate_limit_in_bits { u8 reserved_at_60[0x20]; u8 rate_limit[0x20]; + u8 burst_upper_bound[0x20]; }; struct mlx5_ifc_access_register_out_bits { @@ -7604,6 +7958,39 @@ struct mlx5_ifc_phys_layer_cntrs_bits { u8 reserved_0[0x180]; }; +struct mlx5_ifc_infiniband_port_cntrs_bits { + u8 symbol_error_counter[0x10]; + u8 link_error_recovery_counter[0x8]; + u8 link_downed_counter[0x8]; + + u8 port_rcv_errors[0x10]; + u8 port_rcv_remote_physical_errors[0x10]; + + u8 port_rcv_switch_relay_errors[0x10]; + u8 port_xmit_discards[0x10]; + + u8 port_xmit_constraint_errors[0x8]; + u8 port_rcv_constraint_errors[0x8]; + u8 reserved_0[0x8]; + u8 local_link_integrity_errors[0x4]; + u8 excessive_buffer_overrun_errors[0x4]; + + u8 reserved_1[0x10]; + u8 vl_15_dropped[0x10]; + + u8 port_xmit_data[0x20]; + + u8 port_rcv_data[0x20]; + + u8 port_xmit_pkts[0x20]; + + u8 port_rcv_pkts[0x20]; + + u8 port_xmit_wait[0x20]; + + u8 reserved_2[0x680]; +}; + struct mlx5_ifc_phrr_reg_bits { u8 clr[0x1]; u8 reserved_0[0x7]; @@ -7692,7 +8079,10 @@ struct mlx5_ifc_pfcc_reg_bits { u8 reserved_7[0x8]; u8 cbfrx[0x8]; - u8 reserved_8[0x80]; + u8 device_stall_minor_watermark[0x10]; + u8 device_stall_critical_watermark[0x10]; + + u8 reserved_8[0x60]; }; struct mlx5_ifc_pelc_reg_bits { @@ -7885,7 +8275,19 @@ struct mlx5_ifc_eth_per_prio_grp_data_la u8 rx_pause_transition_low[0x20]; - u8 reserved_2[0x400]; + u8 rx_discards_high[0x20]; + + u8 rx_discards_low[0x20]; + + u8 device_stall_minor_watermark_cnt_high[0x20]; + + u8 device_stall_minor_watermark_cnt_low[0x20]; + + u8 device_stall_critical_watermark_cnt_high[0x20]; + + u8 device_stall_critical_watermark_cnt_low[0x20]; + + u8 reserved_2[0x340]; }; struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits { @@ -8782,8 +9184,10 @@ union mlx5_ifc_eth_cntrs_grp_data_layout struct mlx5_ifc_eth_2819_cntrs_grp_data_layout_bits eth_2819_cntrs_grp_data_layout; struct mlx5_ifc_eth_3635_cntrs_grp_data_layout_bits eth_3635_cntrs_grp_data_layout; struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits eth_extended_cntrs_grp_data_layout; + struct mlx5_ifc_eth_discard_cntrs_grp_bits eth_discard_cntrs_grp; struct mlx5_ifc_eth_per_prio_grp_data_layout_bits eth_per_prio_grp_data_layout; struct mlx5_ifc_phys_layer_cntrs_bits phys_layer_cntrs; + struct mlx5_ifc_infiniband_port_cntrs_bits infiniband_port_cntrs; u8 reserved_0[0x7c0]; }; @@ -8941,6 +9345,7 @@ union mlx5_ifc_ports_control_registers_d struct mlx5_ifc_eth_2863_cntrs_grp_data_layout_bits eth_2863_cntrs_grp_data_layout; struct mlx5_ifc_eth_3635_cntrs_grp_data_layout_bits eth_3635_cntrs_grp_data_layout; struct mlx5_ifc_eth_802_3_cntrs_grp_data_layout_bits eth_802_3_cntrs_grp_data_layout; + struct mlx5_ifc_eth_discard_cntrs_grp_bits eth_discard_cntrs_grp; struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits eth_extended_cntrs_grp_data_layout; struct mlx5_ifc_eth_per_prio_grp_data_layout_bits eth_per_prio_grp_data_layout; struct mlx5_ifc_eth_per_traffic_class_cong_layout_bits eth_per_traffic_class_cong_layout; Modified: stable/10/sys/dev/mlx5/qp.h ============================================================================== --- stable/10/sys/dev/mlx5/qp.h Tue Nov 15 08:58:12 2016 (r308683) +++ stable/10/sys/dev/mlx5/qp.h Tue Nov 15 08:58:51 2016 (r308684) @@ -220,10 +220,20 @@ enum { MLX5_ETH_WQE_L4_CSUM = 1 << 7, }; +enum { + MLX5_ETH_WQE_SWP_OUTER_L3_TYPE = 1 << 0, + MLX5_ETH_WQE_SWP_OUTER_L4_TYPE = 1 << 1, + MLX5_ETH_WQE_SWP_INNER_L3_TYPE = 1 << 4, + MLX5_ETH_WQE_SWP_INNER_L4_TYPE = 1 << 5, +}; + struct mlx5_wqe_eth_seg { - u8 rsvd0[4]; + u8 swp_outer_l4_offset; + u8 swp_outer_l3_offset; + u8 swp_inner_l4_offset; + u8 swp_inner_l3_offset; u8 cs_flags; - u8 rsvd1; + u8 swp_flags; __be16 mss; __be32 rsvd2; __be16 inline_hdr_sz; From owner-svn-src-stable-10@freebsd.org Tue Nov 15 09:00:03 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04BC5C4369B; Tue, 15 Nov 2016 09:00:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9776E49; Tue, 15 Nov 2016 09:00:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAF901qY066430; Tue, 15 Nov 2016 09:00:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAF901nq066427; Tue, 15 Nov 2016 09:00:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611150900.uAF901nq066427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 Nov 2016 09:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308685 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2016 09:00:03 -0000 Author: hselasky Date: Tue Nov 15 09:00:01 2016 New Revision: 308685 URL: https://svnweb.freebsd.org/changeset/base/308685 Log: MFC r308416: Add timer to watch the RQ when we are out of mbufs. The firmware/hardware does not generate additional completion events unless we post new buffers. Use a timer to try to post more buffers in case we are temporarily out of mbufs. Else the receive schedule completely stops. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Tue Nov 15 08:58:51 2016 (r308684) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Tue Nov 15 09:00:01 2016 (r308685) @@ -488,6 +488,7 @@ struct mlx5e_rq { struct mlx5_wq_ctrl wq_ctrl; u32 rqn; struct mlx5e_channel *channel; + struct callout watchdog; } __aligned(MLX5E_CACHELINE_SIZE); struct mlx5e_sq_mbuf { Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Nov 15 08:58:51 2016 (r308684) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Nov 15 09:00:01 2016 (r308685) @@ -861,7 +861,13 @@ err_destroy_rq: static void mlx5e_close_rq(struct mlx5e_rq *rq) { + mtx_lock(&rq->mtx); rq->enabled = 0; + callout_stop(&rq->watchdog); + mtx_unlock(&rq->mtx); + + callout_drain(&rq->watchdog); + mlx5e_modify_rq(rq, MLX5_RQC_STATE_RDY, MLX5_RQC_STATE_ERR); } @@ -1445,6 +1451,8 @@ mlx5e_chan_mtx_init(struct mlx5e_channel mtx_init(&c->rq.mtx, "mlx5rx", MTX_NETWORK_LOCK, MTX_DEF); + callout_init_mtx(&c->rq.watchdog, &c->rq.mtx, 0); + for (tc = 0; tc < c->num_tc; tc++) { struct mlx5e_sq *sq = c->sq + tc; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Nov 15 08:58:51 2016 (r308684) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Nov 15 09:00:01 2016 (r308685) @@ -82,9 +82,10 @@ mlx5e_post_rx_wqes(struct mlx5e_rq *rq) while (!mlx5_wq_ll_is_full(&rq->wq)) { struct mlx5e_rx_wqe *wqe = mlx5_wq_ll_get_wqe(&rq->wq, rq->wq.head); - if (unlikely(mlx5e_alloc_rx_wqe(rq, wqe, rq->wq.head))) + if (unlikely(mlx5e_alloc_rx_wqe(rq, wqe, rq->wq.head))) { + callout_reset_curcpu(&rq->watchdog, 1, (void *)&mlx5e_post_rx_wqes, rq); break; - + } mlx5_wq_ll_push(&rq->wq, be16_to_cpu(wqe->next.next_wqe_index)); } From owner-svn-src-stable-10@freebsd.org Wed Nov 16 03:51:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89395C42AAE; Wed, 16 Nov 2016 03:51:16 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59514859; Wed, 16 Nov 2016 03:51:16 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAG3pFQN023110; Wed, 16 Nov 2016 03:51:15 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAG3pFti023109; Wed, 16 Nov 2016 03:51:15 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201611160351.uAG3pFti023109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 16 Nov 2016 03:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308715 - stable/10/usr.sbin/traceroute6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2016 03:51:16 -0000 Author: hrs Date: Wed Nov 16 03:51:15 2016 New Revision: 308715 URL: https://svnweb.freebsd.org/changeset/base/308715 Log: MFC r308347: Fix an infinite loop at an non-responding hop when other echo replies are kept arriving in the waittime time window. Submitted by: Denny Page PR: 210286 Modified: stable/10/usr.sbin/traceroute6/traceroute6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- stable/10/usr.sbin/traceroute6/traceroute6.c Wed Nov 16 03:51:05 2016 (r308714) +++ stable/10/usr.sbin/traceroute6/traceroute6.c Wed Nov 16 03:51:15 2016 (r308715) @@ -955,6 +955,9 @@ main(argc, argv) break; } break; + } else if (deltaT(&t1, &t2) > waittime * 1000) { + cc = 0; + break; } } if (cc == 0) From owner-svn-src-stable-10@freebsd.org Wed Nov 16 03:54:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38976C42D85; Wed, 16 Nov 2016 03:54:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0881EC8F; Wed, 16 Nov 2016 03:54:41 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAG3sfof026744; Wed, 16 Nov 2016 03:54:41 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAG3sfXY026743; Wed, 16 Nov 2016 03:54:41 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201611160354.uAG3sfXY026743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 16 Nov 2016 03:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308717 - stable/10/usr.sbin/rtadvd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2016 03:54:42 -0000 Author: hrs Date: Wed Nov 16 03:54:41 2016 New Revision: 308717 URL: https://svnweb.freebsd.org/changeset/base/308717 Log: MFC r308348: Add link-layer address option in RA even for IFT_L2VLAN and IFT_BRIDGE. Reported by: philip Modified: stable/10/usr.sbin/rtadvd/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtadvd/if.c ============================================================================== --- stable/10/usr.sbin/rtadvd/if.c Wed Nov 16 03:54:30 2016 (r308716) +++ stable/10/usr.sbin/rtadvd/if.c Wed Nov 16 03:54:41 2016 (r308717) @@ -115,6 +115,8 @@ lladdropt_length(struct sockaddr_dl *sdl { switch (sdl->sdl_type) { case IFT_ETHER: + case IFT_L2VLAN: + case IFT_BRIDGE: return (ROUNDUP8(ETHER_ADDR_LEN + 2)); default: return (0); @@ -130,6 +132,8 @@ lladdropt_fill(struct sockaddr_dl *sdl, switch (sdl->sdl_type) { case IFT_ETHER: + case IFT_L2VLAN: + case IFT_BRIDGE: ndopt->nd_opt_len = (ROUNDUP8(ETHER_ADDR_LEN + 2)) >> 3; addr = (char *)(ndopt + 1); memcpy(addr, LLADDR(sdl), ETHER_ADDR_LEN); From owner-svn-src-stable-10@freebsd.org Wed Nov 16 18:39:28 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C657CC44007; Wed, 16 Nov 2016 18:39:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 845D6DF2; Wed, 16 Nov 2016 18:39:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAGIdR6e080465; Wed, 16 Nov 2016 18:39:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAGIdRaP080460; Wed, 16 Nov 2016 18:39:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611161839.uAGIdRaP080460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 16 Nov 2016 18:39:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308739 - in stable/10/sys/dev: ichsmb sound/pci/hda usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2016 18:39:28 -0000 Author: mav Date: Wed Nov 16 18:39:26 2016 New Revision: 308739 URL: https://svnweb.freebsd.org/changeset/base/308739 Log: MFC r308464, r308471: Add some device IDs found in my new laptop. Modified: stable/10/sys/dev/ichsmb/ichsmb_pci.c stable/10/sys/dev/sound/pci/hda/hdac.c stable/10/sys/dev/sound/pci/hda/hdac.h stable/10/sys/dev/sound/pci/hda/hdacc.c stable/10/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/10/sys/dev/ichsmb/ichsmb_pci.c Wed Nov 16 18:38:40 2016 (r308738) +++ stable/10/sys/dev/ichsmb/ichsmb_pci.c Wed Nov 16 18:39:26 2016 (r308739) @@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$"); #define ID_WCPTLP 0x9ca28086 #define ID_WELLSBURG 0x8d228086 #define ID_SRPT 0xa1238086 +#define ID_SRPTLP 0x9d238086 #define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 @@ -220,6 +221,9 @@ ichsmb_pci_probe(device_t dev) case ID_SRPT: device_set_desc(dev, "Intel Sunrise Point-H SMBus controller"); break; + case ID_SRPTLP: + device_set_desc(dev, "Intel Sunrise Point-LP SMBus controller"); + break; default: return (ENXIO); } Modified: stable/10/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.c Wed Nov 16 18:38:40 2016 (r308738) +++ stable/10/sys/dev/sound/pci/hda/hdac.c Wed Nov 16 18:39:26 2016 (r308739) @@ -94,7 +94,9 @@ static const struct { { HDA_INTEL_LPTLP1, "Intel Lynx Point-LP", 0, 0 }, { HDA_INTEL_LPTLP2, "Intel Lynx Point-LP", 0, 0 }, { HDA_INTEL_SRPTLP, "Intel Sunrise Point-LP", 0, 0 }, + { HDA_INTEL_KBLKLP, "Intel Kabylake-LP", 0, 0 }, { HDA_INTEL_SRPT, "Intel Sunrise Point", 0, 0 }, + { HDA_INTEL_KBLK, "Intel Kabylake", 0, 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0, 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0, 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0, 0 }, Modified: stable/10/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.h Wed Nov 16 18:38:40 2016 (r308738) +++ stable/10/sys/dev/sound/pci/hda/hdac.h Wed Nov 16 18:39:26 2016 (r308739) @@ -70,7 +70,9 @@ #define HDA_INTEL_LPTLP2 HDA_MODEL_CONSTRUCT(INTEL, 0x9c21) #define HDA_INTEL_BDW2 HDA_MODEL_CONSTRUCT(INTEL, 0x9ca0) #define HDA_INTEL_SRPTLP HDA_MODEL_CONSTRUCT(INTEL, 0x9d70) +#define HDA_INTEL_KBLKLP HDA_MODEL_CONSTRUCT(INTEL, 0x9d71) #define HDA_INTEL_SRPT HDA_MODEL_CONSTRUCT(INTEL, 0xa170) +#define HDA_INTEL_KBLK HDA_MODEL_CONSTRUCT(INTEL, 0xa171) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) /* Nvidia */ @@ -347,6 +349,7 @@ #define HDA_CODEC_ALC275 HDA_CODEC_CONSTRUCT(REALTEK, 0x0275) #define HDA_CODEC_ALC276 HDA_CODEC_CONSTRUCT(REALTEK, 0x0276) #define HDA_CODEC_ALC292 HDA_CODEC_CONSTRUCT(REALTEK, 0x0292) +#define HDA_CODEC_ALC295 HDA_CODEC_CONSTRUCT(REALTEK, 0x0295) #define HDA_CODEC_ALC660 HDA_CODEC_CONSTRUCT(REALTEK, 0x0660) #define HDA_CODEC_ALC662 HDA_CODEC_CONSTRUCT(REALTEK, 0x0662) #define HDA_CODEC_ALC663 HDA_CODEC_CONSTRUCT(REALTEK, 0x0663) @@ -632,6 +635,8 @@ #define HDA_CODEC_INTELPPT HDA_CODEC_CONSTRUCT(INTEL, 0x2806) #define HDA_CODEC_INTELHSW HDA_CODEC_CONSTRUCT(INTEL, 0x2807) #define HDA_CODEC_INTELBDW HDA_CODEC_CONSTRUCT(INTEL, 0x2808) +#define HDA_CODEC_INTELSKLK HDA_CODEC_CONSTRUCT(INTEL, 0x2809) +#define HDA_CODEC_INTELKBLK HDA_CODEC_CONSTRUCT(INTEL, 0x280b) #define HDA_CODEC_INTELCL HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) Modified: stable/10/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdacc.c Wed Nov 16 18:38:40 2016 (r308738) +++ stable/10/sys/dev/sound/pci/hda/hdacc.c Wed Nov 16 18:39:26 2016 (r308739) @@ -88,6 +88,7 @@ static const struct { { HDA_CODEC_ALC275, 0, "Realtek ALC275" }, { HDA_CODEC_ALC276, 0, "Realtek ALC276" }, { HDA_CODEC_ALC292, 0, "Realtek ALC292" }, + { HDA_CODEC_ALC295, 0, "Realtek ALC295" }, { HDA_CODEC_ALC660, 0, "Realtek ALC660-VD" }, { HDA_CODEC_ALC662, 0x0002, "Realtek ALC662 rev2" }, { HDA_CODEC_ALC662, 0, "Realtek ALC662" }, @@ -321,6 +322,8 @@ static const struct { { HDA_CODEC_INTELPPT, 0, "Intel Panther Point" }, { HDA_CODEC_INTELHSW, 0, "Intel Haswell" }, { HDA_CODEC_INTELBDW, 0, "Intel Broadwell" }, + { HDA_CODEC_INTELSKLK, 0, "Intel Skylake" }, + { HDA_CODEC_INTELKBLK, 0, "Intel Kabylake" }, { HDA_CODEC_INTELCL, 0, "Intel Crestline" }, { HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" }, { HDA_CODEC_SII1392, 0, "Silicon Image SiI1392" }, Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Wed Nov 16 18:38:40 2016 (r308738) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Wed Nov 16 18:39:26 2016 (r308739) @@ -122,6 +122,8 @@ xhci_pci_match(device_t self) return ("Intel Wellsburg USB 3.0 controller"); case 0x9cb18086: return ("Broadwell Integrated PCH-LP chipset USB 3.0 controller"); + case 0x9d2f8086: + return ("Intel Sunrise Point-LP USB 3.0 controller"); case 0xa12f8086: return ("Intel Sunrise Point USB 3.0 controller"); From owner-svn-src-stable-10@freebsd.org Thu Nov 17 15:10:34 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A23BC456B6; Thu, 17 Nov 2016 15:10:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CD7C1C58; Thu, 17 Nov 2016 15:10:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAHFAXA7068349; Thu, 17 Nov 2016 15:10:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAHFAXLb068347; Thu, 17 Nov 2016 15:10:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611171510.uAHFAXLb068347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 17 Nov 2016 15:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308753 - in stable/10: sys/cddl/contrib/opensolaris/uts/common/fs/zfs usr.sbin/watchdogd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 15:10:34 -0000 Author: avg Date: Thu Nov 17 15:10:33 2016 New Revision: 308753 URL: https://svnweb.freebsd.org/changeset/base/308753 Log: MFC r308040,308479: nap time between pats is forced to be at most half of the timeout Note that in this branch the default nap period is 1 second unlike the head where the period is 10 seconds. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/usr.sbin/watchdogd/watchdogd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Nov 17 15:08:30 2016 (r308752) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Nov 17 15:10:33 2016 (r308753) @@ -6945,7 +6945,22 @@ l2arc_write_buffers(spa_t *spa, l2arc_de continue; } - if ((write_asize + HDR_GET_LSIZE(hdr)) > target_sz) { + /* + * We rely on the L1 portion of the header below, so + * it's invalid for this header to have been evicted out + * of the ghost cache, prior to being written out. The + * ARC_FLAG_L2_WRITING bit ensures this won't happen. + */ + ASSERT(HDR_HAS_L1HDR(hdr)); + + ASSERT3U(HDR_GET_PSIZE(hdr), >, 0); + ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL); + ASSERT3U(arc_hdr_size(hdr), >, 0); + uint64_t size = arc_hdr_size(hdr); + uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev, + size); + + if ((write_psize + asize) > target_sz) { full = B_TRUE; mutex_exit(hash_lock); ARCSTAT_BUMP(arcstat_l2_write_full); @@ -6980,21 +6995,6 @@ l2arc_write_buffers(spa_t *spa, l2arc_de list_insert_head(&dev->l2ad_buflist, hdr); mutex_exit(&dev->l2ad_mtx); - /* - * We rely on the L1 portion of the header below, so - * it's invalid for this header to have been evicted out - * of the ghost cache, prior to being written out. The - * ARC_FLAG_L2_WRITING bit ensures this won't happen. - */ - ASSERT(HDR_HAS_L1HDR(hdr)); - - ASSERT3U(HDR_GET_PSIZE(hdr), >, 0); - ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL); - ASSERT3U(arc_hdr_size(hdr), >, 0); - uint64_t size = arc_hdr_size(hdr); - uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev, - size); - (void) refcount_add_many(&dev->l2ad_alloc, size, hdr); /* Modified: stable/10/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- stable/10/usr.sbin/watchdogd/watchdogd.c Thu Nov 17 15:08:30 2016 (r308752) +++ stable/10/usr.sbin/watchdogd/watchdogd.c Thu Nov 17 15:10:33 2016 (r308753) @@ -80,7 +80,8 @@ static u_int timeout = WD_TO_128SEC; static u_int exit_timeout = WD_TO_NEVER; static u_int pretimeout = 0; static u_int timeout_sec; -static u_int passive = 0; +static u_int nap = 1; +static int passive = 0; static int is_daemon = 0; static int is_dry_run = 0; /* do not arm the watchdog, only report on timing of the watch @@ -88,7 +89,6 @@ static int is_dry_run = 0; /* do not ar static int do_timedog = 0; static int do_syslog = 1; static int fd = -1; -static int nap = 1; static int carp_thresh_seconds = -1; static char *test_cmd = NULL; @@ -685,10 +685,15 @@ seconds_to_pow2ns(int seconds) static void parseargs(int argc, char *argv[]) { + struct timespec ts; int longindex; int c; const char *lopt; + /* Get the default value of timeout_sec from the default timeout. */ + pow2ns_to_ts(timeout, &ts); + timeout_sec = ts.tv_sec; + /* * if we end with a 'd' aka 'watchdogd' then we are the daemon program, * otherwise run as a command line utility. @@ -731,9 +736,9 @@ parseargs(int argc, char *argv[]) case 't': timeout_sec = atoi(optarg); timeout = parse_timeout_to_pow2ns(c, NULL, optarg); - if (debugging) - printf("Timeout is 2^%d nanoseconds\n", - timeout); + if (debugging) + printf("Timeout is 2^%d nanoseconds\n", + timeout); break; case 'T': carp_thresh_seconds = @@ -771,6 +776,9 @@ parseargs(int argc, char *argv[]) } } + if (nap > timeout_sec / 2) + nap = timeout_sec / 2; + if (carp_thresh_seconds == -1) carp_thresh_seconds = nap; @@ -779,10 +787,7 @@ parseargs(int argc, char *argv[]) if (is_daemon && timeout < WD_TO_1SEC) errx(EX_USAGE, "-t argument is less than one second."); if (pretimeout_set) { - struct timespec ts; - - pow2ns_to_ts(timeout, &ts); - if (pretimeout >= (uintmax_t)ts.tv_sec) { + if (pretimeout >= timeout_sec) { errx(EX_USAGE, "pretimeout (%d) >= timeout (%d -> %ld)\n" "see manual section TIMEOUT RESOLUTION", From owner-svn-src-stable-10@freebsd.org Thu Nov 17 15:13:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F05DC45996; Thu, 17 Nov 2016 15:13:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1167D3B0; Thu, 17 Nov 2016 15:13:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAHFDLuO072391; Thu, 17 Nov 2016 15:13:21 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAHFDLcO072390; Thu, 17 Nov 2016 15:13:21 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611171513.uAHFDLcO072390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 17 Nov 2016 15:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308757 - stable/10/sys/dev/iicbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 15:13:22 -0000 Author: avg Date: Thu Nov 17 15:13:20 2016 New Revision: 308757 URL: https://svnweb.freebsd.org/changeset/base/308757 Log: MFC r307195: convert iicsmb to use iicbus_transfer for all operations Modified: stable/10/sys/dev/iicbus/iicsmb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iicbus/iicsmb.c ============================================================================== --- stable/10/sys/dev/iicbus/iicsmb.c Thu Nov 17 15:13:16 2016 (r308756) +++ stable/10/sys/dev/iicbus/iicsmb.c Thu Nov 17 15:13:20 2016 (r308757) @@ -131,8 +131,6 @@ static driver_t iicsmb_driver = { sizeof(struct iicsmb_softc), }; -#define IICBUS_TIMEOUT 100 /* us */ - static void iicsmb_identify(driver_t *driver, device_t parent) { @@ -276,237 +274,213 @@ iicsmb_callback(device_t dev, int index, } static int +iic2smb_error(int error) +{ + switch (error) { + case IIC_NOERR: + return (SMB_ENOERR); + case IIC_EBUSERR: + return (SMB_EBUSERR); + case IIC_ENOACK: + return (SMB_ENOACK); + case IIC_ETIMEOUT: + return (SMB_ETIMEOUT); + case IIC_EBUSBSY: + return (SMB_EBUSY); + case IIC_ESTATUS: + return (SMB_EBUSERR); + case IIC_EUNDERFLOW: + return (SMB_EBUSERR); + case IIC_EOVERFLOW: + return (SMB_EBUSERR); + case IIC_ENOTSUPP: + return (SMB_ENOTSUPP); + case IIC_ENOADDR: + return (SMB_EBUSERR); + case IIC_ERESOURCE: + return (SMB_EBUSERR); + default: + return (SMB_EBUSERR); + } +} + +#define TRANSFER_MSGS(dev, msgs) iicbus_transfer(dev, msgs, nitems(msgs)) + +static int iicsmb_quick(device_t dev, u_char slave, int how) { - device_t parent = device_get_parent(dev); + struct iic_msg msgs[] = { + { slave, how == SMB_QWRITE ? IIC_M_WR : IIC_M_RD, 0, NULL }, + }; int error; switch (how) { case SMB_QWRITE: - error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT); - break; - case SMB_QREAD: - error = iicbus_start(parent, slave | LSB, IICBUS_TIMEOUT); break; - default: - error = EINVAL; - break; + return (SMB_EINVAL); } - if (!error) - error = iicbus_stop(parent); - - return (error); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } static int iicsmb_sendb(device_t dev, u_char slave, char byte) { - device_t parent = device_get_parent(dev); - int error, sent; - - error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT); - - if (!error) { - error = iicbus_write(parent, &byte, 1, &sent, IICBUS_TIMEOUT); - - iicbus_stop(parent); - } + struct iic_msg msgs[] = { + { slave, IIC_M_WR, 1, &byte }, + }; + int error; - return (error); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } static int iicsmb_recvb(device_t dev, u_char slave, char *byte) { - device_t parent = device_get_parent(dev); - int error, read; - - error = iicbus_start(parent, slave | LSB, 0); - - if (!error) { - error = iicbus_read(parent, byte, 1, &read, IIC_LAST_READ, IICBUS_TIMEOUT); - - iicbus_stop(parent); - } + struct iic_msg msgs[] = { + { slave, IIC_M_RD, 1, byte }, + }; + int error; - return (error); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } static int iicsmb_writeb(device_t dev, u_char slave, char cmd, char byte) { - device_t parent = device_get_parent(dev); - int error, sent; - - error = iicbus_start(parent, slave & ~LSB, 0); - - if (!error) { - if (!(error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - error = iicbus_write(parent, &byte, 1, &sent, IICBUS_TIMEOUT); - - iicbus_stop(parent); - } + uint8_t bytes[] = { cmd, byte }; + struct iic_msg msgs[] = { + { slave, IIC_M_WR, nitems(bytes), bytes }, + }; + int error; - return (error); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } static int iicsmb_writew(device_t dev, u_char slave, char cmd, short word) { - device_t parent = device_get_parent(dev); - int error, sent; - - char low = (char)(word & 0xff); - char high = (char)((word & 0xff00) >> 8); - - error = iicbus_start(parent, slave & ~LSB, 0); - - if (!error) { - if (!(error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - if (!(error = iicbus_write(parent, &low, 1, &sent, IICBUS_TIMEOUT))) - error = iicbus_write(parent, &high, 1, &sent, IICBUS_TIMEOUT); - - iicbus_stop(parent); - } + uint8_t bytes[] = { cmd, word & 0xff, word >> 8 }; + struct iic_msg msgs[] = { + { slave, IIC_M_WR, nitems(bytes), bytes }, + }; + int error; - return (error); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } static int iicsmb_readb(device_t dev, u_char slave, char cmd, char *byte) { - device_t parent = device_get_parent(dev); - int error, sent, read; - - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) - return (error); - - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_repeated_start(parent, slave | LSB, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_read(parent, byte, 1, &read, IIC_LAST_READ, IICBUS_TIMEOUT))) - goto error; + struct iic_msg msgs[] = { + { slave, IIC_M_WR | IIC_M_NOSTOP, 1, &cmd }, + { slave, IIC_M_RD, 1, byte }, + }; + int error; -error: - iicbus_stop(parent); - return (error); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } -#define BUF2SHORT(low,high) \ - ((short)(((high) & 0xff) << 8) | (short)((low) & 0xff)) - static int iicsmb_readw(device_t dev, u_char slave, char cmd, short *word) { - device_t parent = device_get_parent(dev); - int error, sent, read; - char buf[2]; - - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) - return (error); - - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_repeated_start(parent, slave | LSB, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_read(parent, buf, 2, &read, IIC_LAST_READ, IICBUS_TIMEOUT))) - goto error; - - /* first, receive low, then high byte */ - *word = BUF2SHORT(buf[0], buf[1]); + uint8_t buf[2]; + struct iic_msg msgs[] = { + { slave, IIC_M_WR | IIC_M_NOSTOP, 1, &cmd }, + { slave, IIC_M_RD, nitems(buf), buf }, + }; + int error; -error: - iicbus_stop(parent); - return (error); + error = TRANSFER_MSGS(dev, msgs); + if (error == 0) + *word = ((uint16_t)buf[1] << 8) | buf[0]; + return (iic2smb_error(error)); } static int iicsmb_pcall(device_t dev, u_char slave, char cmd, short sdata, short *rdata) { - device_t parent = device_get_parent(dev); - int error, sent, read; - char buf[2]; - - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) - return (error); - - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - goto error; - - /* first, send low, then high byte */ - buf[0] = (char)(sdata & 0xff); - buf[1] = (char)((sdata & 0xff00) >> 8); - - if ((error = iicbus_write(parent, buf, 2, &sent, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_repeated_start(parent, slave | LSB, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_read(parent, buf, 2, &read, IIC_LAST_READ, IICBUS_TIMEOUT))) - goto error; - - /* first, receive low, then high byte */ - *rdata = BUF2SHORT(buf[0], buf[1]); + uint8_t in[3] = { cmd, sdata & 0xff, sdata >> 8 }; + uint8_t out[2]; + struct iic_msg msgs[] = { + { slave, IIC_M_WR | IIC_M_NOSTOP, nitems(in), in }, + { slave, IIC_M_RD, nitems(out), out }, + }; + int error; -error: - iicbus_stop(parent); - return (error); + error = TRANSFER_MSGS(dev, msgs); + if (error == 0) + *rdata = ((uint16_t)out[1] << 8) | out[0]; + return (iic2smb_error(error)); } static int iicsmb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf) { - device_t parent = device_get_parent(dev); - int error, sent; - - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_write(parent, buf, (int)count, &sent, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_stop(parent))) - goto error; + uint8_t bytes[2] = { cmd, count }; + struct iic_msg msgs[] = { + { slave, IIC_M_WR | IIC_M_NOSTOP, nitems(bytes), bytes }, + { slave, IIC_M_WR | IIC_M_NOSTART, count, buf }, + }; + int error; -error: - return (error); + if (count > 32 || count == 0) + return (SMB_EINVAL); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } static int iicsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf) { + struct iic_msg msgs[] = { + { slave, IIC_M_WR | IIC_M_NOSTOP, 1, &cmd }, + { slave, IIC_M_RD | IIC_M_NOSTOP, 1, count }, + }; + struct iic_msg block_msg[] = { + { slave, IIC_M_RD | IIC_M_NOSTART, 0, buf }, + }; device_t parent = device_get_parent(dev); - int error, sent, read; - - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) - return (error); - - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_repeated_start(parent, slave | LSB, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_read(parent, buf, (int)*count, &read, - IIC_LAST_READ, IICBUS_TIMEOUT))) - goto error; - *count = read; + int error; + u_char bufsz; -error: - iicbus_stop(parent); - return (error); + /* Stash output buffer size before overwriting it. */ + bufsz = *count; + if (bufsz == 0) + return (SMB_EINVAL); + + /* Have to do this because the command is split in two transfers. */ + error = iicbus_request_bus(parent, dev, IIC_WAIT); + if (error == 0) + error = TRANSFER_MSGS(dev, msgs); + if (error == 0) { + /* + * If the slave offers an empty or a too long reply, + * read one byte to generate the stop or abort. + * XXX 32 is hardcoded until SMB_MAXBLOCKSIZE is restored + * to sanity. + */ + if (*count > 32 || *count == 0) + block_msg[0].len = 1; + /* If longer than the buffer, then clamp at the buffer size. */ + if (*count > bufsz) + block_msg[0].len = bufsz; + else + block_msg[0].len = *count; + error = TRANSFER_MSGS(dev, block_msg); + if (*count > 32 || *count == 0) + error = SMB_EINVAL; + } + (void)iicbus_release_bus(parent, dev); + return (iic2smb_error(error)); } DRIVER_MODULE(iicsmb, iicbus, iicsmb_driver, iicsmb_devclass, 0, 0); From owner-svn-src-stable-10@freebsd.org Thu Nov 17 15:15:00 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B9EFC45A97; Thu, 17 Nov 2016 15:15:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B283921; Thu, 17 Nov 2016 15:15:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAHFExIU072551; Thu, 17 Nov 2016 15:14:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAHFExT6072550; Thu, 17 Nov 2016 15:14:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611171514.uAHFExT6072550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 17 Nov 2016 15:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308759 - stable/10/sys/dev/hwpmc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 15:15:00 -0000 Author: avg Date: Thu Nov 17 15:14:59 2016 New Revision: 308759 URL: https://svnweb.freebsd.org/changeset/base/308759 Log: MFC r308101: hwpmc: fix a race between amd_stop_pmc and amd_intr Modified: stable/10/sys/dev/hwpmc/hwpmc_amd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_amd.c Thu Nov 17 15:14:54 2016 (r308758) +++ stable/10/sys/dev/hwpmc/hwpmc_amd.c Thu Nov 17 15:14:59 2016 (r308759) @@ -690,12 +690,13 @@ amd_intr(int cpu, struct trapframe *tf) error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, TRAPF_USERMODE(tf)); if (error == 0) - wrmsr(evsel, config | AMD_PMC_ENABLE); + wrmsr(evsel, config); } atomic_add_int(retval ? &pmc_stats.pm_intr_processed : &pmc_stats.pm_intr_ignored, 1); + PMCDBG1(MDP,INT,2, "retval=%d", retval); return (retval); } From owner-svn-src-stable-10@freebsd.org Thu Nov 17 15:17:03 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64E79C45BAF; Thu, 17 Nov 2016 15:17:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04AB6CB3; Thu, 17 Nov 2016 15:17:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAHFH2Fu072745; Thu, 17 Nov 2016 15:17:02 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAHFH13T072740; Thu, 17 Nov 2016 15:17:01 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611171517.uAHFH13T072740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 17 Nov 2016 15:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308761 - in stable/10: sys/dev/cpuctl usr.sbin/cpucontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 15:17:03 -0000 Author: avg Date: Thu Nov 17 15:17:01 2016 New Revision: 308761 URL: https://svnweb.freebsd.org/changeset/base/308761 Log: MFC r308218: Add support for microcode update on newer AMD CPUs (10h+) Added: stable/10/usr.sbin/cpucontrol/amd10h.c - copied unchanged from r308218, head/usr.sbin/cpucontrol/amd10h.c Modified: stable/10/sys/dev/cpuctl/cpuctl.c stable/10/usr.sbin/cpucontrol/Makefile stable/10/usr.sbin/cpucontrol/amd.h stable/10/usr.sbin/cpucontrol/cpucontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/10/sys/dev/cpuctl/cpuctl.c Thu Nov 17 15:16:52 2016 (r308760) +++ stable/10/sys/dev/cpuctl/cpuctl.c Thu Nov 17 15:17:01 2016 (r308761) @@ -377,13 +377,24 @@ fail: return (ret); } +/* + * NB: MSR 0xc0010020, MSR_K8_UCODE_UPDATE, is not documented by AMD. + * Coreboot, illumos and Linux source code was used to understand + * its workings. + */ +static void +amd_ucode_wrmsr(void *ucode_ptr) +{ + uint32_t tmp[4]; + + wrmsr_safe(MSR_K8_UCODE_UPDATE, (uintptr_t)ucode_ptr); + do_cpuid(0, tmp); +} + static int update_amd(int cpu, cpuctl_update_args_t *args, struct thread *td) { - void *ptr = NULL; - uint32_t tmp[4]; - int is_bound = 0; - int oldcpu; + void *ptr; int ret; if (args->size == 0 || args->data == NULL) { @@ -394,41 +405,23 @@ update_amd(int cpu, cpuctl_update_args_t DPRINTF("[cpuctl,%d]: firmware image too large", __LINE__); return (EINVAL); } + /* - * XXX Might not require contignous address space - needs check + * 16 byte alignment required. Rely on the fact that + * malloc(9) always returns the pointer aligned at least on + * the size of the allocation. */ - ptr = contigmalloc(args->size, M_CPUCTL, 0, 0, 0xffffffff, 16, 0); - if (ptr == NULL) { - DPRINTF("[cpuctl,%d]: cannot allocate %zd bytes of memory", - __LINE__, args->size); - return (ENOMEM); - } + ptr = malloc(args->size + 16, M_CPUCTL, M_ZERO | M_WAITOK); if (copyin(args->data, ptr, args->size) != 0) { DPRINTF("[cpuctl,%d]: copyin %p->%p of %zd bytes failed", __LINE__, args->data, ptr, args->size); ret = EFAULT; goto fail; } - oldcpu = td->td_oncpu; - is_bound = cpu_sched_is_bound(td); - set_cpu(cpu, td); - critical_enter(); - - /* - * Perform update. - */ - wrmsr_safe(MSR_K8_UCODE_UPDATE, (uintptr_t)ptr); - - /* - * Serialize instruction flow. - */ - do_cpuid(0, tmp); - critical_exit(); - restore_cpu(oldcpu, is_bound, td); + smp_rendezvous(NULL, amd_ucode_wrmsr, NULL, ptr); ret = 0; fail: - if (ptr != NULL) - contigfree(ptr, args->size, M_CPUCTL); + free(ptr, M_CPUCTL); return (ret); } Modified: stable/10/usr.sbin/cpucontrol/Makefile ============================================================================== --- stable/10/usr.sbin/cpucontrol/Makefile Thu Nov 17 15:16:52 2016 (r308760) +++ stable/10/usr.sbin/cpucontrol/Makefile Thu Nov 17 15:17:01 2016 (r308761) @@ -2,7 +2,7 @@ PROG= cpucontrol MAN= cpucontrol.8 -SRCS= cpucontrol.c intel.c amd.c via.c +SRCS= cpucontrol.c intel.c amd.c amd10h.c via.c NO_WCAST_ALIGN= Modified: stable/10/usr.sbin/cpucontrol/amd.h ============================================================================== --- stable/10/usr.sbin/cpucontrol/amd.h Thu Nov 17 15:16:52 2016 (r308760) +++ stable/10/usr.sbin/cpucontrol/amd.h Thu Nov 17 15:17:01 2016 (r308761) @@ -33,6 +33,8 @@ */ ucode_probe_t amd_probe; ucode_update_t amd_update; +ucode_probe_t amd10h_probe; +ucode_update_t amd10h_update; typedef struct amd_fw_header { uint32_t date; /* Update creation date. */ @@ -46,4 +48,45 @@ typedef struct amd_fw_header { #define AMD_MAGIC 0xaaaaaa +/* + * AMD family 10h and later. + */ +typedef struct amd_10h_fw_header { + uint32_t data_code; + uint32_t patch_id; + uint16_t mc_patch_data_id; + uint8_t mc_patch_data_len; + uint8_t init_flag; + uint32_t mc_patch_data_checksum; + uint32_t nb_dev_id; + uint32_t sb_dev_id; + uint16_t processor_rev_id; + uint8_t nb_rev_id; + uint8_t sb_rev_id; + uint8_t bios_api_rev; + uint8_t reserved1[3]; + uint32_t match_reg[8]; +} amd_10h_fw_header_t; + +typedef struct equiv_cpu_entry { + uint32_t installed_cpu; + uint32_t fixed_errata_mask; + uint32_t fixed_errata_compare; + uint16_t equiv_cpu; + uint16_t res; +} equiv_cpu_entry_t; + +typedef struct section_header { + uint32_t type; + uint32_t size; +} section_header_t; + +typedef struct container_header { + uint32_t magic; +} container_header_t; + +#define AMD_10H_MAGIC 0x414d44 +#define AMD_10H_EQUIV_TABLE_TYPE 0 +#define AMD_10H_uCODE_TYPE 1 + #endif /* !AMD_H */ Copied: stable/10/usr.sbin/cpucontrol/amd10h.c (from r308218, head/usr.sbin/cpucontrol/amd10h.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/cpucontrol/amd10h.c Thu Nov 17 15:17:01 2016 (r308761, copy of r308218, head/usr.sbin/cpucontrol/amd10h.c) @@ -0,0 +1,307 @@ +/*- + * Copyright (c) 2012 Andriy Gapon . + * 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 "cpucontrol.h" +#include "amd.h" + +int +amd10h_probe(int fd) +{ + char vendor[13]; + cpuctl_cpuid_args_t idargs; + uint32_t family; + uint32_t signature; + int error; + + idargs.level = 0; + error = ioctl(fd, CPUCTL_CPUID, &idargs); + if (error < 0) { + WARN(0, "ioctl()"); + return (1); + } + ((uint32_t *)vendor)[0] = idargs.data[1]; + ((uint32_t *)vendor)[1] = idargs.data[3]; + ((uint32_t *)vendor)[2] = idargs.data[2]; + vendor[12] = '\0'; + if (strncmp(vendor, AMD_VENDOR_ID, sizeof(AMD_VENDOR_ID)) != 0) + return (1); + + idargs.level = 1; + error = ioctl(fd, CPUCTL_CPUID, &idargs); + if (error < 0) { + WARN(0, "ioctl()"); + return (1); + } + signature = idargs.data[0]; + family = ((signature >> 8) & 0x0f) + ((signature >> 20) & 0xff); + if (family < 0x10) + return (1); + return (0); +} + +/* + * NB: the format of microcode update files is not documented by AMD. + * It has been reverse engineered from studying Coreboot, illumos and Linux + * source code. + */ +void +amd10h_update(const char *dev, const char *path) +{ + struct stat st; + cpuctl_cpuid_args_t idargs; + cpuctl_msr_args_t msrargs; + cpuctl_update_args_t args; + const amd_10h_fw_header_t *fw_header; + const amd_10h_fw_header_t *selected_fw; + const equiv_cpu_entry_t *equiv_cpu_table; + const section_header_t *section_header; + const container_header_t *container_header; + const uint8_t *fw_data; + uint8_t *fw_image; + size_t fw_size; + size_t selected_size; + uint32_t revision; + uint32_t new_rev; + uint32_t signature; + uint16_t equiv_id; + int fd, devfd; + unsigned int i; + int error; + + assert(path); + assert(dev); + + fd = -1; + fw_image = MAP_FAILED; + devfd = open(dev, O_RDWR); + if (devfd < 0) { + WARN(0, "could not open %s for writing", dev); + return; + } + idargs.level = 1; + error = ioctl(devfd, CPUCTL_CPUID, &idargs); + if (error < 0) { + WARN(0, "ioctl()"); + goto done; + } + signature = idargs.data[0]; + + msrargs.msr = 0x0000008b; + error = ioctl(devfd, CPUCTL_RDMSR, &msrargs); + if (error < 0) { + WARN(0, "ioctl(%s)", dev); + goto done; + } + revision = (uint32_t)msrargs.data; + + WARNX(1, "found cpu family %#x model %#x " + "stepping %#x extfamily %#x extmodel %#x.", + (signature >> 8) & 0x0f, (signature >> 4) & 0x0f, + (signature >> 0) & 0x0f, (signature >> 20) & 0xff, + (signature >> 16) & 0x0f); + WARNX(1, "microcode revision %#x", revision); + + /* + * Open the firmware file. + */ + fd = open(path, O_RDONLY, 0); + if (fd < 0) { + WARN(0, "open(%s)", path); + goto done; + } + error = fstat(fd, &st); + if (error != 0) { + WARN(0, "fstat(%s)", path); + goto done; + } + if (st.st_size < 0 || (size_t)st.st_size < + (sizeof(*container_header) + sizeof(*section_header))) { + WARNX(2, "file too short: %s", path); + goto done; + } + fw_size = st.st_size; + + /* + * mmap the whole image. + */ + fw_image = (uint8_t *)mmap(NULL, st.st_size, PROT_READ, + MAP_PRIVATE, fd, 0); + if (fw_image == MAP_FAILED) { + WARN(0, "mmap(%s)", path); + goto done; + } + + fw_data = fw_image; + container_header = (const container_header_t *)fw_data; + if (container_header->magic != AMD_10H_MAGIC) { + WARNX(2, "%s is not a valid amd firmware: bad magic", path); + goto done; + } + fw_data += sizeof(*container_header); + fw_size -= sizeof(*container_header); + + section_header = (const section_header_t *)fw_data; + if (section_header->type != AMD_10H_EQUIV_TABLE_TYPE) { + WARNX(2, "%s is not a valid amd firmware: " + "first section is not CPU equivalence table", path); + goto done; + } + if (section_header->size == 0) { + WARNX(2, "%s is not a valid amd firmware: " + "first section is empty", path); + goto done; + } + fw_data += sizeof(*section_header); + fw_size -= sizeof(*section_header); + + if (section_header->size > fw_size) { + WARNX(2, "%s is not a valid amd firmware: " + "file is truncated", path); + goto done; + } + if (section_header->size < sizeof(*equiv_cpu_table)) { + WARNX(2, "%s is not a valid amd firmware: " + "first section is too short", path); + goto done; + } + equiv_cpu_table = (const equiv_cpu_entry_t *)fw_data; + fw_data += section_header->size; + fw_size -= section_header->size; + + equiv_id = 0; + for (i = 0; equiv_cpu_table[i].installed_cpu != 0; i++) { + if (signature == equiv_cpu_table[i].installed_cpu) { + equiv_id = equiv_cpu_table[i].equiv_cpu; + WARNX(3, "equiv_id: %x", equiv_id); + break; + } + } + if (equiv_id == 0) { + WARNX(2, "CPU is not found in the equivalence table"); + goto done; + } + + selected_fw = NULL; + selected_size = 0; + while (fw_size >= sizeof(*section_header)) { + section_header = (const section_header_t *)fw_data; + fw_data += sizeof(*section_header); + fw_size -= sizeof(*section_header); + if (section_header->type != AMD_10H_uCODE_TYPE) { + WARNX(2, "%s is not a valid amd firmware: " + "section has incorret type", path); + goto done; + } + if (section_header->size > fw_size) { + WARNX(2, "%s is not a valid amd firmware: " + "file is truncated", path); + goto done; + } + if (section_header->size < sizeof(*fw_header)) { + WARNX(2, "%s is not a valid amd firmware: " + "section is too short", path); + goto done; + } + fw_header = (const amd_10h_fw_header_t *)fw_data; + fw_data += section_header->size; + fw_size -= section_header->size; + + if (fw_header->processor_rev_id != equiv_id) + continue; /* different cpu */ + if (fw_header->patch_id <= revision) + continue; /* not newer revision */ + if (fw_header->nb_dev_id != 0 || fw_header->sb_dev_id != 0) { + WARNX(2, "Chipset-specific microcode is not supported"); + } + + WARNX(3, "selecting revision: %x", fw_header->patch_id); + revision = fw_header->patch_id; + selected_fw = fw_header; + selected_size = section_header->size; + } + + if (fw_size != 0) { + WARNX(2, "%s is not a valid amd firmware: " + "file is truncated", path); + goto done; + } + + if (selected_fw != NULL) { + WARNX(1, "selected ucode size is %zu", selected_size); + fprintf(stderr, "%s: updating cpu %s to revision %#x... ", + path, dev, revision); + + args.data = __DECONST(void *, selected_fw); + args.size = selected_size; + error = ioctl(devfd, CPUCTL_UPDATE, &args); + if (error < 0) { + fprintf(stderr, "failed.\n"); + warn("ioctl()"); + goto done; + } + fprintf(stderr, "done.\n"); + } + + msrargs.msr = 0x0000008b; + error = ioctl(devfd, CPUCTL_RDMSR, &msrargs); + if (error < 0) { + WARN(0, "ioctl(%s)", dev); + goto done; + } + new_rev = (uint32_t)msrargs.data; + if (new_rev != revision) + WARNX(0, "revision after update %#x", new_rev); + +done: + if (fd >= 0) + close(fd); + if (devfd >= 0) + close(devfd); + if (fw_image != MAP_FAILED) + if (munmap(fw_image, st.st_size) != 0) + warn("munmap(%s)", path); + return; +} Modified: stable/10/usr.sbin/cpucontrol/cpucontrol.c ============================================================================== --- stable/10/usr.sbin/cpucontrol/cpucontrol.c Thu Nov 17 15:16:52 2016 (r308760) +++ stable/10/usr.sbin/cpucontrol/cpucontrol.c Thu Nov 17 15:17:01 2016 (r308761) @@ -91,6 +91,7 @@ static struct ucode_handler { ucode_update_t *update; } handlers[] = { { intel_probe, intel_update }, + { amd10h_probe, amd10h_update }, { amd_probe, amd_update }, { via_probe, via_update }, }; From owner-svn-src-stable-10@freebsd.org Thu Nov 17 15:19:34 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C13C8C45D82; Thu, 17 Nov 2016 15:19:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7280711EA; Thu, 17 Nov 2016 15:19:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAHFJXlg072984; Thu, 17 Nov 2016 15:19:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAHFJXsV072982; Thu, 17 Nov 2016 15:19:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611171519.uAHFJXsV072982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 17 Nov 2016 15:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308764 - stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 15:19:35 -0000 Author: avg Date: Thu Nov 17 15:19:33 2016 New Revision: 308764 URL: https://svnweb.freebsd.org/changeset/base/308764 Log: MFC r308247: MFV r308222: 6051 lzc_receive: allow the caller to read the begin record Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Thu Nov 17 15:19:27 2016 (r308763) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Thu Nov 17 15:19:33 2016 (r308764) @@ -596,8 +596,9 @@ recv_read(int fd, void *buf, int ilen) } static int -lzc_receive_impl(const char *snapname, nvlist_t *props, const char *origin, - boolean_t force, boolean_t resumable, int fd) +recv_impl(const char *snapname, nvlist_t *props, const char *origin, + boolean_t force, boolean_t resumable, int fd, + const dmu_replay_record_t *begin_record) { /* * The receive ioctl is still legacy, so we need to construct our own @@ -642,9 +643,14 @@ lzc_receive_impl(const char *snapname, n (void) strlcpy(zc.zc_string, origin, sizeof (zc.zc_string)); /* zc_begin_record is non-byteswapped BEGIN record */ - error = recv_read(fd, &zc.zc_begin_record, sizeof (zc.zc_begin_record)); - if (error != 0) - goto out; + if (begin_record == NULL) { + error = recv_read(fd, &zc.zc_begin_record, + sizeof (zc.zc_begin_record)); + if (error != 0) + goto out; + } else { + zc.zc_begin_record = *begin_record; + } /* zc_cookie is fd to read from */ zc.zc_cookie = fd; @@ -685,7 +691,7 @@ int lzc_receive(const char *snapname, nvlist_t *props, const char *origin, boolean_t force, int fd) { - return (lzc_receive_impl(snapname, props, origin, force, B_FALSE, fd)); + return (recv_impl(snapname, props, origin, force, B_FALSE, fd, NULL)); } /* @@ -698,7 +704,29 @@ int lzc_receive_resumable(const char *snapname, nvlist_t *props, const char *origin, boolean_t force, int fd) { - return (lzc_receive_impl(snapname, props, origin, force, B_TRUE, fd)); + return (recv_impl(snapname, props, origin, force, B_TRUE, fd, NULL)); +} + +/* + * Like lzc_receive, but allows the caller to read the begin record and then to + * pass it in. That could be useful if the caller wants to derive, for example, + * the snapname or the origin parameters based on the information contained in + * the begin record. + * The begin record must be in its original form as read from the stream, + * in other words, it should not be byteswapped. + * + * The 'resumable' parameter allows to obtain the same behavior as with + * lzc_receive_resumable. + */ +int +lzc_receive_with_header(const char *snapname, nvlist_t *props, + const char *origin, boolean_t force, boolean_t resumable, int fd, + const dmu_replay_record_t *begin_record) +{ + if (begin_record == NULL) + return (EINVAL); + return (recv_impl(snapname, props, origin, force, resumable, fd, + begin_record)); } /* Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Thu Nov 17 15:19:27 2016 (r308763) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Thu Nov 17 15:19:33 2016 (r308764) @@ -68,10 +68,15 @@ enum lzc_send_flags { int lzc_send(const char *, const char *, int, enum lzc_send_flags); int lzc_send_resume(const char *, const char *, int, enum lzc_send_flags, uint64_t, uint64_t); +int lzc_send_space(const char *, const char *, uint64_t *); + +struct dmu_replay_record; + int lzc_receive(const char *, nvlist_t *, const char *, boolean_t, int); int lzc_receive_resumable(const char *, nvlist_t *, const char *, boolean_t, int); -int lzc_send_space(const char *, const char *, uint64_t *); +int lzc_receive_with_header(const char *, nvlist_t *, const char *, boolean_t, + boolean_t, int, const struct dmu_replay_record *); boolean_t lzc_exists(const char *); From owner-svn-src-stable-10@freebsd.org Thu Nov 17 15:22:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 215BAC460F9; Thu, 17 Nov 2016 15:22:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFCB517B2; Thu, 17 Nov 2016 15:22:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAHFMuJb076587; Thu, 17 Nov 2016 15:22:56 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAHFMtn9076585; Thu, 17 Nov 2016 15:22:55 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611171522.uAHFMtn9076585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 17 Nov 2016 15:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308765 - in stable/10: sys/cddl/contrib/opensolaris/uts/common/fs/zfs usr.sbin/watchdogd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 15:22:57 -0000 Author: avg Date: Thu Nov 17 15:22:55 2016 New Revision: 308765 URL: https://svnweb.freebsd.org/changeset/base/308765 Log: Revert r308753: some unrelated changes were included into the commit Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/usr.sbin/watchdogd/watchdogd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Nov 17 15:19:33 2016 (r308764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Nov 17 15:22:55 2016 (r308765) @@ -6945,22 +6945,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de continue; } - /* - * We rely on the L1 portion of the header below, so - * it's invalid for this header to have been evicted out - * of the ghost cache, prior to being written out. The - * ARC_FLAG_L2_WRITING bit ensures this won't happen. - */ - ASSERT(HDR_HAS_L1HDR(hdr)); - - ASSERT3U(HDR_GET_PSIZE(hdr), >, 0); - ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL); - ASSERT3U(arc_hdr_size(hdr), >, 0); - uint64_t size = arc_hdr_size(hdr); - uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev, - size); - - if ((write_psize + asize) > target_sz) { + if ((write_asize + HDR_GET_LSIZE(hdr)) > target_sz) { full = B_TRUE; mutex_exit(hash_lock); ARCSTAT_BUMP(arcstat_l2_write_full); @@ -6995,6 +6980,21 @@ l2arc_write_buffers(spa_t *spa, l2arc_de list_insert_head(&dev->l2ad_buflist, hdr); mutex_exit(&dev->l2ad_mtx); + /* + * We rely on the L1 portion of the header below, so + * it's invalid for this header to have been evicted out + * of the ghost cache, prior to being written out. The + * ARC_FLAG_L2_WRITING bit ensures this won't happen. + */ + ASSERT(HDR_HAS_L1HDR(hdr)); + + ASSERT3U(HDR_GET_PSIZE(hdr), >, 0); + ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL); + ASSERT3U(arc_hdr_size(hdr), >, 0); + uint64_t size = arc_hdr_size(hdr); + uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev, + size); + (void) refcount_add_many(&dev->l2ad_alloc, size, hdr); /* Modified: stable/10/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- stable/10/usr.sbin/watchdogd/watchdogd.c Thu Nov 17 15:19:33 2016 (r308764) +++ stable/10/usr.sbin/watchdogd/watchdogd.c Thu Nov 17 15:22:55 2016 (r308765) @@ -80,8 +80,7 @@ static u_int timeout = WD_TO_128SEC; static u_int exit_timeout = WD_TO_NEVER; static u_int pretimeout = 0; static u_int timeout_sec; -static u_int nap = 1; -static int passive = 0; +static u_int passive = 0; static int is_daemon = 0; static int is_dry_run = 0; /* do not arm the watchdog, only report on timing of the watch @@ -89,6 +88,7 @@ static int is_dry_run = 0; /* do not ar static int do_timedog = 0; static int do_syslog = 1; static int fd = -1; +static int nap = 1; static int carp_thresh_seconds = -1; static char *test_cmd = NULL; @@ -685,15 +685,10 @@ seconds_to_pow2ns(int seconds) static void parseargs(int argc, char *argv[]) { - struct timespec ts; int longindex; int c; const char *lopt; - /* Get the default value of timeout_sec from the default timeout. */ - pow2ns_to_ts(timeout, &ts); - timeout_sec = ts.tv_sec; - /* * if we end with a 'd' aka 'watchdogd' then we are the daemon program, * otherwise run as a command line utility. @@ -736,9 +731,9 @@ parseargs(int argc, char *argv[]) case 't': timeout_sec = atoi(optarg); timeout = parse_timeout_to_pow2ns(c, NULL, optarg); - if (debugging) - printf("Timeout is 2^%d nanoseconds\n", - timeout); + if (debugging) + printf("Timeout is 2^%d nanoseconds\n", + timeout); break; case 'T': carp_thresh_seconds = @@ -776,9 +771,6 @@ parseargs(int argc, char *argv[]) } } - if (nap > timeout_sec / 2) - nap = timeout_sec / 2; - if (carp_thresh_seconds == -1) carp_thresh_seconds = nap; @@ -787,7 +779,10 @@ parseargs(int argc, char *argv[]) if (is_daemon && timeout < WD_TO_1SEC) errx(EX_USAGE, "-t argument is less than one second."); if (pretimeout_set) { - if (pretimeout >= timeout_sec) { + struct timespec ts; + + pow2ns_to_ts(timeout, &ts); + if (pretimeout >= (uintmax_t)ts.tv_sec) { errx(EX_USAGE, "pretimeout (%d) >= timeout (%d -> %ld)\n" "see manual section TIMEOUT RESOLUTION", From owner-svn-src-stable-10@freebsd.org Thu Nov 17 15:25:27 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80D67C46219; Thu, 17 Nov 2016 15:25:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35EFE197C; Thu, 17 Nov 2016 15:25:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAHFPQ7K076728; Thu, 17 Nov 2016 15:25:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAHFPQjG076727; Thu, 17 Nov 2016 15:25:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611171525.uAHFPQjG076727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 17 Nov 2016 15:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308766 - stable/10/usr.sbin/watchdogd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 15:25:27 -0000 Author: avg Date: Thu Nov 17 15:25:26 2016 New Revision: 308766 URL: https://svnweb.freebsd.org/changeset/base/308766 Log: MFC r308040,308479: nap time between pats is forced to be at most half of the timeout Note that in this branch the default nap period is 1 second unlike the head where the period is 10 seconds. Modified: stable/10/usr.sbin/watchdogd/watchdogd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- stable/10/usr.sbin/watchdogd/watchdogd.c Thu Nov 17 15:22:55 2016 (r308765) +++ stable/10/usr.sbin/watchdogd/watchdogd.c Thu Nov 17 15:25:26 2016 (r308766) @@ -80,7 +80,8 @@ static u_int timeout = WD_TO_128SEC; static u_int exit_timeout = WD_TO_NEVER; static u_int pretimeout = 0; static u_int timeout_sec; -static u_int passive = 0; +static u_int nap = 1; +static int passive = 0; static int is_daemon = 0; static int is_dry_run = 0; /* do not arm the watchdog, only report on timing of the watch @@ -88,7 +89,6 @@ static int is_dry_run = 0; /* do not ar static int do_timedog = 0; static int do_syslog = 1; static int fd = -1; -static int nap = 1; static int carp_thresh_seconds = -1; static char *test_cmd = NULL; @@ -685,10 +685,15 @@ seconds_to_pow2ns(int seconds) static void parseargs(int argc, char *argv[]) { + struct timespec ts; int longindex; int c; const char *lopt; + /* Get the default value of timeout_sec from the default timeout. */ + pow2ns_to_ts(timeout, &ts); + timeout_sec = ts.tv_sec; + /* * if we end with a 'd' aka 'watchdogd' then we are the daemon program, * otherwise run as a command line utility. @@ -731,9 +736,9 @@ parseargs(int argc, char *argv[]) case 't': timeout_sec = atoi(optarg); timeout = parse_timeout_to_pow2ns(c, NULL, optarg); - if (debugging) - printf("Timeout is 2^%d nanoseconds\n", - timeout); + if (debugging) + printf("Timeout is 2^%d nanoseconds\n", + timeout); break; case 'T': carp_thresh_seconds = @@ -771,6 +776,9 @@ parseargs(int argc, char *argv[]) } } + if (nap > timeout_sec / 2) + nap = timeout_sec / 2; + if (carp_thresh_seconds == -1) carp_thresh_seconds = nap; @@ -779,10 +787,7 @@ parseargs(int argc, char *argv[]) if (is_daemon && timeout < WD_TO_1SEC) errx(EX_USAGE, "-t argument is less than one second."); if (pretimeout_set) { - struct timespec ts; - - pow2ns_to_ts(timeout, &ts); - if (pretimeout >= (uintmax_t)ts.tv_sec) { + if (pretimeout >= timeout_sec) { errx(EX_USAGE, "pretimeout (%d) >= timeout (%d -> %ld)\n" "see manual section TIMEOUT RESOLUTION", From owner-svn-src-stable-10@freebsd.org Fri Nov 18 09:03:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A13FC4624B; Fri, 18 Nov 2016 09:03:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58F61EDF; Fri, 18 Nov 2016 09:03:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAI93Vb5099108; Fri, 18 Nov 2016 09:03:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAI93VTV099107; Fri, 18 Nov 2016 09:03:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201611180903.uAI93VTV099107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 18 Nov 2016 09:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308802 - stable/10/sys/dev/cpuctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2016 09:03:32 -0000 Author: kib Date: Fri Nov 18 09:03:31 2016 New Revision: 308802 URL: https://svnweb.freebsd.org/changeset/base/308802 Log: MFC r308538: Increase the max allowed size of the microcode update blob for x86. Modified: stable/10/sys/dev/cpuctl/cpuctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/10/sys/dev/cpuctl/cpuctl.c Fri Nov 18 09:01:44 2016 (r308801) +++ stable/10/sys/dev/cpuctl/cpuctl.c Fri Nov 18 09:03:31 2016 (r308802) @@ -63,7 +63,7 @@ static d_ioctl_t cpuctl_ioctl; # define DPRINTF(...) #endif -#define UCODE_SIZE_MAX (32 * 1024) +#define UCODE_SIZE_MAX (4 * 1024 * 1024) static int cpuctl_do_msr(int cpu, cpuctl_msr_args_t *data, u_long cmd, struct thread *td); From owner-svn-src-stable-10@freebsd.org Fri Nov 18 16:01:25 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08080C48AB3; Fri, 18 Nov 2016 16:01:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBD481E80; Fri, 18 Nov 2016 16:01:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAIG1NXs061125; Fri, 18 Nov 2016 16:01:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAIG1N3M061124; Fri, 18 Nov 2016 16:01:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611181601.uAIG1N3M061124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 Nov 2016 16:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308804 - stable/10/usr.sbin/crunch/crunchide X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2016 16:01:25 -0000 Author: emaste Date: Fri Nov 18 16:01:23 2016 New Revision: 308804 URL: https://svnweb.freebsd.org/changeset/base/308804 Log: MFC r282824: crunchide: remove EOL whitespace Modified: stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Fri Nov 18 14:06:29 2016 (r308803) +++ stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Fri Nov 18 16:01:23 2016 (r308804) @@ -35,7 +35,7 @@ __RCSID("$NetBSD: exec_elf32.c,v 1.6 199 #endif #endif __FBSDID("$FreeBSD$"); - + #ifndef ELFSIZE #define ELFSIZE 32 #endif @@ -142,7 +142,7 @@ static void * xrealloc(void *ptr, size_t size, const char *fn, const char *use) { void *rv; - + rv = realloc(ptr, size); if (rv == NULL) { free(ptr); @@ -150,7 +150,7 @@ xrealloc(void *ptr, size_t size, const c fn, use); } return (rv); -} +} int ELFNAMEEND(check)(int fd, const char *fn) From owner-svn-src-stable-10@freebsd.org Fri Nov 18 16:05:34 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42820C48CA8; Fri, 18 Nov 2016 16:05:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBAB51B3; Fri, 18 Nov 2016 16:05:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAIG5XR9065159; Fri, 18 Nov 2016 16:05:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAIG5WP2065157; Fri, 18 Nov 2016 16:05:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611181605.uAIG5WP2065157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 Nov 2016 16:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308805 - stable/10/gnu/usr.bin/groff X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2016 16:05:34 -0000 Author: emaste Date: Fri Nov 18 16:05:32 2016 New Revision: 308805 URL: https://svnweb.freebsd.org/changeset/base/308805 Log: MFC r306740, r307150: groff: use changelog date in man pages r306740: groff: use changelog date rather than file modification date in man pages The source checkout date is not particularly relevant, and this makes groff man pages build reproducibly. r307150: Avoid using 'head' in generating groff doc date It may not be available in certain cross build cases. Note that this is a slight change in functionality, in that now only the first line of the source ChangeLog file is processed. This is acceptable as groff will be retired and we won't encounter a possibly-different ChangeLog format. Sponsored by: The FreeBSD Foundation Added: stable/10/gnu/usr.bin/groff/mdate.sh - copied, changed from r306740, head/gnu/usr.bin/groff/mdate.sh Modified: stable/10/gnu/usr.bin/groff/Makefile.inc Modified: stable/10/gnu/usr.bin/groff/Makefile.inc ============================================================================== --- stable/10/gnu/usr.bin/groff/Makefile.inc Fri Nov 18 16:01:23 2016 (r308804) +++ stable/10/gnu/usr.bin/groff/Makefile.inc Fri Nov 18 16:05:32 2016 (r308805) @@ -118,7 +118,7 @@ revision=`sed -e 's/^0$$//' -e 's/^[1-9] -e "s;@TMAC_MDIR@;$(tmacdir)/mm;g" \ -e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);g" \ -e "s;@VERSION@;$(version)$(revision);g" \ - -e "s;@MDATE@;`$(SHELL) ${GROFF_DIST}/mdate.sh $<`;g" \ + -e "s;@MDATE@;$(MDATE);g" \ -e "s;@g@;$(g);g" \ -e "s;@G@;`echo $(g) | LC_ALL=C tr a-z A-Z`;g" \ $< >$@ @@ -140,4 +140,5 @@ TOPREL?= .. GROFF_DIST= ${.CURDIR}/${TOPREL}/../../../contrib/groff DIST_SUBDIR?= ${.CURDIR:T} DIST_DIR= ${GROFF_DIST}/${DIST_SUBDIR} +MDATE!= sh ${.CURDIR}/${TOPREL}/mdate.sh ${GROFF_DIST}/ChangeLog .PATH: ${DIST_DIR} Copied and modified: stable/10/gnu/usr.bin/groff/mdate.sh (from r306740, head/gnu/usr.bin/groff/mdate.sh) ============================================================================== --- head/gnu/usr.bin/groff/mdate.sh Wed Oct 5 23:25:29 2016 (r306740, copy source) +++ stable/10/gnu/usr.bin/groff/mdate.sh Fri Nov 18 16:05:32 2016 (r308805) @@ -4,6 +4,5 @@ set -e test -r "$1" export LC_ALL=C -changelog_date=$(sed -E -n 's/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*$/\1/p' "$1" |\ - head -n 1) +changelog_date=$(sed -E -n '1s/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*$/\1/p' "$1") echo $(date -j -f %Y-%m-%d +"%e %B %Y" $changelog_date) From owner-svn-src-stable-10@freebsd.org Fri Nov 18 22:23:02 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B086BC4877F; Fri, 18 Nov 2016 22:23:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64EC61A1B; Fri, 18 Nov 2016 22:23:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAIMN1jr016681; Fri, 18 Nov 2016 22:23:01 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAIMN1Df016678; Fri, 18 Nov 2016 22:23:01 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201611182223.uAIMN1Df016678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 18 Nov 2016 22:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308814 - stable/10/usr.sbin/pw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2016 22:23:02 -0000 Author: asomers Date: Fri Nov 18 22:23:01 2016 New Revision: 308814 URL: https://svnweb.freebsd.org/changeset/base/308814 Log: MFC r307752 Close some file descriptor leaks in pw Modified: stable/10/usr.sbin/pw/grupd.c stable/10/usr.sbin/pw/pw_nis.c stable/10/usr.sbin/pw/pwupd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/grupd.c ============================================================================== --- stable/10/usr.sbin/pw/grupd.c Fri Nov 18 21:18:51 2016 (r308813) +++ stable/10/usr.sbin/pw/grupd.c Fri Nov 18 22:23:01 2016 (r308814) @@ -34,6 +34,7 @@ static const char rcsid[] = #include #include #include +#include #include "pwupd.h" @@ -73,8 +74,10 @@ gr_update(struct group * grp, char const } if (gr_copy(pfd, tfd, gr, old_gr) == -1) { gr_fini(); + close(tfd); err(1, "gr_copy()"); } + close(tfd); if (gr_mkdb() == -1) { gr_fini(); err(1, "gr_mkdb()"); Modified: stable/10/usr.sbin/pw/pw_nis.c ============================================================================== --- stable/10/usr.sbin/pw/pw_nis.c Fri Nov 18 21:18:51 2016 (r308813) +++ stable/10/usr.sbin/pw/pw_nis.c Fri Nov 18 22:23:01 2016 (r308814) @@ -34,6 +34,7 @@ static const char rcsid[] = #include #include #include +#include #include "pw.h" @@ -63,8 +64,10 @@ pw_nisupdate(const char * path, struct p } if (pw_copy(pfd, tfd, pw, old_pw) == -1) { pw_fini(); + close(tfd); err(1, "pw_copy()"); } + close(tfd); if (chmod(pw_tempname(), 0644) == -1) err(1, "chmod()"); if (rename(pw_tempname(), path) == -1) Modified: stable/10/usr.sbin/pw/pwupd.c ============================================================================== --- stable/10/usr.sbin/pw/pwupd.c Fri Nov 18 21:18:51 2016 (r308813) +++ stable/10/usr.sbin/pw/pwupd.c Fri Nov 18 22:23:01 2016 (r308814) @@ -111,8 +111,10 @@ pw_update(struct passwd * pwd, char cons } if (pw_copy(pfd, tfd, pw, old_pw) == -1) { pw_fini(); + close(tfd); err(1, "pw_copy()"); } + close(tfd); /* * in case of deletion of a user, the whole database * needs to be regenerated From owner-svn-src-stable-10@freebsd.org Sat Nov 19 20:04:01 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47351C4BB7B; Sat, 19 Nov 2016 20:04:01 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14DBDA99; Sat, 19 Nov 2016 20:04:01 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAJK40Lj054530; Sat, 19 Nov 2016 20:04:00 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAJK40he054529; Sat, 19 Nov 2016 20:04:00 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201611192004.uAJK40he054529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 19 Nov 2016 20:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308866 - stable/10/sbin/swapon X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2016 20:04:01 -0000 Author: jilles Date: Sat Nov 19 20:03:59 2016 New Revision: 308866 URL: https://svnweb.freebsd.org/changeset/base/308866 Log: MFC r306585: swapon(8): Update to reality: swapoff ignores -L and the late option in fstab. Modified: stable/10/sbin/swapon/swapon.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/swapon/swapon.8 ============================================================================== --- stable/10/sbin/swapon/swapon.8 Sat Nov 19 20:02:49 2016 (r308865) +++ stable/10/sbin/swapon/swapon.8 Sat Nov 19 20:03:59 2016 (r308866) @@ -28,7 +28,7 @@ .\" @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd November 22, 2013 +.Dd October 2, 2016 .Dt SWAPON 8 .Os .Sh NAME @@ -96,16 +96,8 @@ option is used, all swap devices in .Pa /etc/fstab will be removed, unless their .Dq noauto -or -.Dq late option is also set. If the -.Fl L -option is specified, -swap devices with the -.Dq late -option will be removed as well as ones with no option. -If the .Fl q option is used, informational messages will not be