From owner-svn-src-stable@freebsd.org Sun Jan 17 05:38:05 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33961A6D579; Sun, 17 Jan 2016 05:38:05 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AEFA1587; Sun, 17 Jan 2016 05:38:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0H5c3SK061926; Sun, 17 Jan 2016 05:38:03 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0H5c3l6061924; Sun, 17 Jan 2016 05:38:03 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601170538.u0H5c3l6061924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 17 Jan 2016 05:38:03 +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: r294202 - in stable/10: sbin/ifconfig sys/net 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 05:38:05 -0000 Author: melifaro Date: Sun Jan 17 05:38:03 2016 New Revision: 294202 URL: https://svnweb.freebsd.org/changeset/base/294202 Log: MFC r292831: Add SFF-8024 Extended Specification Compliance. Submitted by: markb_mellanox.com Differential Revision: https://reviews.freebsd.org/D4666 Modified: stable/10/sbin/ifconfig/sfp.c stable/10/sys/net/sff8436.h Modified: stable/10/sbin/ifconfig/sfp.c ============================================================================== --- stable/10/sbin/ifconfig/sfp.c Sun Jan 17 05:12:37 2016 (r294201) +++ stable/10/sbin/ifconfig/sfp.c Sun Jan 17 05:38:03 2016 (r294202) @@ -171,7 +171,7 @@ static struct _nv fc_speed[] = { /* 10/40G Ethernet compliance codes, byte 128 + 3 */ static struct _nv eth_1040g[] = { - { 0x80, "Reserved" }, + { 0x80, "Extended" }, { 0x40, "10GBASE-LRM" }, { 0x20, "10GBASE-LR" }, { 0x10, "10GBASE-SR" }, @@ -181,6 +181,38 @@ static struct _nv eth_1040g[] = { { 0x01, "40G Active Cable" }, { 0, NULL } }; +#define SFF_8636_EXT_COMPLIANCE 0x80 + +/* SFF-8024 Rev. 3.4 table 4.4: Extended Specification Compliance */ +static struct _nv eth_extended_comp[] = { + { 0xFF, "Reserved" }, + { 0x1A, "2 lambda DWDM 100G" }, + { 0x19, "100G ACC or 25GAUI C2M ACC" }, + { 0x18, "100G AOC or 25GAUI C2M AOC" }, + { 0x17, "100G CLR4" }, + { 0x16, "10GBASE-T with SFI electrical interface" }, + { 0x15, "G959.1 profile P1L1-2D2" }, + { 0x14, "G959.1 profile P1S1-2D2" }, + { 0x13, "G959.1 profile P1I1-2D1" }, + { 0x12, "40G PSM4 Parallel SMF" }, + { 0x11, "4 x 10GBASE-SR" }, + { 0x10, "40GBASE-ER4" }, + { 0x0F, "Reserved" }, + { 0x0D, "25GBASE-CR CA-N" }, + { 0x0C, "25GBASE-CR CA-S" }, + { 0x0B, "100GBASE-CR4 or 25GBASE-CR CA-L" }, + { 0x0A, "Reserved" }, + { 0x09, "100G CWDM4 MSA without FEC" }, + { 0x08, "100G ACC (Active Copper Cable)" }, + { 0x07, "100G PSM4 Parallel SMF" }, + { 0x06, "100G CWDM4 MSA with FEC" }, + { 0x05, "100GBASE-SR10" }, + { 0x04, "100GBASE-ER4" }, + { 0x03, "100GBASE-LR4" }, + { 0x02, "100GBASE-SR4" }, + { 0x01, "100G AOC (Active Optical Cable) or 25GAUI C2M ACC" }, + { 0x00, "Unspecified" } +}; /* SFF-8636 Rev. 2.5 table 6.3: Revision compliance */ static struct _nv rev_compl[] = { @@ -371,9 +403,16 @@ get_qsfp_transceiver_class(struct i2c_in const char *tech_class; uint8_t code; - /* Check 10/40G Ethernet class only */ - read_i2c(ii, SFF_8436_BASE, SFF_8436_CODE_E1040G, 1, &code); - tech_class = find_zero_bit(eth_1040g, code, 1); + read_i2c(ii, SFF_8436_BASE, SFF_8436_CODE_E1040100G, 1, &code); + + /* Check for extended specification compliance */ + if (code & SFF_8636_EXT_COMPLIANCE) { + read_i2c(ii, SFF_8436_BASE, SFF_8436_OPTIONS_START, 1, &code); + tech_class = find_value(eth_extended_comp, code); + } else + /* Check 10/40G Ethernet class only */ + tech_class = find_zero_bit(eth_1040g, code, 1); + if (tech_class == NULL) tech_class = "Unknown"; @@ -873,6 +912,7 @@ sfp_status(int s, struct ifreq *ifr, int switch (id_byte) { case SFF_8024_ID_QSFP: case SFF_8024_ID_QSFPPLUS: + case SFF_8024_ID_QSFP28: print_qsfp_status(&ii, verbose); break; default: Modified: stable/10/sys/net/sff8436.h ============================================================================== --- stable/10/sys/net/sff8436.h Sun Jan 17 05:12:37 2016 (r294201) +++ stable/10/sys/net/sff8436.h Sun Jan 17 05:38:03 2016 (r294202) @@ -131,7 +131,7 @@ enum { SFF_8436_CONNECTOR = 130, /* Connector type (Table 32) */ SFF_8436_TRANS_START = 131, /* Electric or Optical Compatibility * (Table 33) */ - SFF_8436_CODE_E1040G = 131, /* 10/40G Ethernet Compliance Code */ + SFF_8436_CODE_E1040100G = 131, /* 10/40/100G Ethernet Compliance Code */ SFF_8436_CODE_SONET = 132, /* SONET Compliance codes */ SFF_8436_CODE_SATA = 133, /* SAS/SATA compliance codes */ SFF_8436_CODE_E1G = 134, /* Gigabit Ethernet Compliant codes */ From owner-svn-src-stable@freebsd.org Sun Jan 17 06:03:00 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C753DA6DD53; Sun, 17 Jan 2016 06:03:00 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 967BF1F7D; Sun, 17 Jan 2016 06:03:00 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0H62x74070229; Sun, 17 Jan 2016 06:02:59 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0H62xth070227; Sun, 17 Jan 2016 06:02:59 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601170602.u0H62xth070227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 17 Jan 2016 06:02: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: r294203 - in stable/10/usr.sbin: arp ndp 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 06:03:00 -0000 Author: melifaro Date: Sun Jan 17 06:02:59 2016 New Revision: 294203 URL: https://svnweb.freebsd.org/changeset/base/294203 Log: MFC r288297 (userland part). If ever MFC is done for the new lltable code, this change will miminise ABI breakage. rtsock requests for deleting interface address lles started to return EPERM instead of old "ignore-and-return 0" in r287789. This broke arp -da / ndp -cn behavior (they exit on rtsock command failure). Fix this by translating LLE_IFADDR to RTM_PINNED flag, passing it to userland and making arp/ndp ignore these entries in batched delete. Modified: stable/10/usr.sbin/arp/arp.c stable/10/usr.sbin/ndp/ndp.c Modified: stable/10/usr.sbin/arp/arp.c ============================================================================== --- stable/10/usr.sbin/arp/arp.c Sun Jan 17 05:38:03 2016 (r294202) +++ stable/10/usr.sbin/arp/arp.c Sun Jan 17 06:02:59 2016 (r294203) @@ -673,10 +673,13 @@ print_entry(struct sockaddr_dl *sdl, */ static void nuke_entry(struct sockaddr_dl *sdl __unused, - struct sockaddr_in *addr, struct rt_msghdr *rtm __unused) + struct sockaddr_in *addr, struct rt_msghdr *rtm) { char ip[20]; + if (rtm->rtm_flags & RTF_PINNED) + return; + snprintf(ip, sizeof(ip), "%s", inet_ntoa(addr->sin_addr)); delete(ip); } Modified: stable/10/usr.sbin/ndp/ndp.c ============================================================================== --- stable/10/usr.sbin/ndp/ndp.c Sun Jan 17 05:38:03 2016 (r294202) +++ stable/10/usr.sbin/ndp/ndp.c Sun Jan 17 06:02:59 2016 (r294203) @@ -655,6 +655,8 @@ again:; if (rtm->rtm_flags & RTF_CLONED) delete(host_buf); #else + if (rtm->rtm_flags & RTF_PINNED) + continue; delete(host_buf); #endif continue; From owner-svn-src-stable@freebsd.org Sun Jan 17 11:59:43 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9BDAA85926; Sun, 17 Jan 2016 11:59:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76D4D173C; Sun, 17 Jan 2016 11:59:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HBxg61074492; Sun, 17 Jan 2016 11:59:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HBxgFZ074491; Sun, 17 Jan 2016 11:59:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171159.u0HBxgFZ074491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 11:59:42 +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: r294206 - stable/10/sys/netinet 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 11:59:43 -0000 Author: tuexen Date: Sun Jan 17 11:59:42 2016 New Revision: 294206 URL: https://svnweb.freebsd.org/changeset/base/294206 Log: MFC r291376: When the sending of an SCTP outgoing stream reset request fails, don't report it to the user since all stream have been marked as pending. Modified: stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Sun Jan 17 08:40:51 2016 (r294205) +++ stable/10/sys/netinet/sctp_usrreq.c Sun Jan 17 11:59:42 2016 (r294206) @@ -4651,11 +4651,20 @@ sctp_setopt(struct socket *so, int optna error = sctp_send_str_reset_req(stcb, strrst->srs_number_streams, strrst->srs_stream_list, send_in, 0, 0, 0, 0, 0); - } else + } else { error = sctp_send_stream_reset_out_if_possible(stcb, SCTP_SO_LOCKED); - if (!error) + } + if (error == 0) { sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED); - + } else { + /* + * For outgoing streams don't report any + * problems in sending the request to the + * application. XXX: Double check resetting + * incoming streams. + */ + error = 0; + } SCTP_TCB_UNLOCK(stcb); break; } From owner-svn-src-stable@freebsd.org Sun Jan 17 12:02:06 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EF89A851AB; Sun, 17 Jan 2016 12:02:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAA231CFD; Sun, 17 Jan 2016 12:02:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HC24KC077121; Sun, 17 Jan 2016 12:02:04 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HC244D077120; Sun, 17 Jan 2016 12:02:04 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171202.u0HC244D077120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 12:02:04 +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: r294207 - stable/10/sys/netinet 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 12:02:06 -0000 Author: tuexen Date: Sun Jan 17 12:02:04 2016 New Revision: 294207 URL: https://svnweb.freebsd.org/changeset/base/294207 Log: MFC r291410: Take also the send queue and sent queue into account when triggering the sending of outgoing stream reset requests. Modified: stable/10/sys/netinet/sctp_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Sun Jan 17 11:59:42 2016 (r294206) +++ stable/10/sys/netinet/sctp_output.c Sun Jan 17 12:02:04 2016 (r294207) @@ -7169,7 +7169,8 @@ one_more_time: } atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&strq->outqueue, sp, next); - if (strq->state == SCTP_STREAM_RESET_PENDING && + if ((strq->state == SCTP_STREAM_RESET_PENDING) && + (strq->chunks_on_queues == 0) && TAILQ_EMPTY(&strq->outqueue)) { stcb->asoc.trigger_reset = 1; } @@ -7571,7 +7572,8 @@ dont_do_it: send_lock_up = 1; } TAILQ_REMOVE(&strq->outqueue, sp, next); - if (strq->state == SCTP_STREAM_RESET_PENDING && + if ((strq->state == SCTP_STREAM_RESET_PENDING) && + (strq->chunks_on_queues == 0) && TAILQ_EMPTY(&strq->outqueue)) { stcb->asoc.trigger_reset = 1; } @@ -11577,7 +11579,8 @@ sctp_add_stream_reset_out(struct sctp_tc /* now how long will this param be? */ for (i = 0; i < stcb->asoc.streamoutcnt; i++) { if ((stcb->asoc.strmout[i].state == SCTP_STREAM_RESET_PENDING) && - (TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue))) { + (stcb->asoc.strmout[i].chunks_on_queues == 0) && + TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { number_entries++; } } @@ -11600,7 +11603,8 @@ sctp_add_stream_reset_out(struct sctp_tc if (number_entries) { for (i = 0; i < stcb->asoc.streamoutcnt; i++) { if ((stcb->asoc.strmout[i].state == SCTP_STREAM_RESET_PENDING) && - (TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue))) { + (stcb->asoc.strmout[i].chunks_on_queues == 0) && + TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { req_out->list_of_streams[at] = htons(i); at++; stcb->asoc.strmout[i].state = SCTP_STREAM_RESET_IN_FLIGHT; From owner-svn-src-stable@freebsd.org Sun Jan 17 12:04:00 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 968D8A852BE; Sun, 17 Jan 2016 12:04:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A18B1031; Sun, 17 Jan 2016 12:04:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HC3xEe077404; Sun, 17 Jan 2016 12:03:59 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HC3xDu077403; Sun, 17 Jan 2016 12:03:59 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171203.u0HC3xDu077403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 12:03: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: r294208 - stable/10/sys/netinet 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 12:04:00 -0000 Author: tuexen Date: Sun Jan 17 12:03:59 2016 New Revision: 294208 URL: https://svnweb.freebsd.org/changeset/base/294208 Log: MFC r291651: Adjust the MTU when accepting an SCTP association using UDP encapsulation. Modified: stable/10/sys/netinet/sctp_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Sun Jan 17 12:02:04 2016 (r294207) +++ stable/10/sys/netinet/sctp_input.c Sun Jan 17 12:03:59 2016 (r294208) @@ -521,7 +521,6 @@ sctp_process_init_ack(struct mbuf *m, in /* calculate the RTO */ net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy, SCTP_RTT_FROM_NON_DATA); - retval = sctp_send_cookie_echo(m, offset, stcb, net); if (retval < 0) { /* @@ -2347,12 +2346,17 @@ sctp_process_cookie_new(struct mbuf *m, sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb, NULL); } (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); - if ((netp) && (*netp)) { + if ((netp != NULL) && (*netp != NULL)) { /* calculate the RTT and set the encaps port */ (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, &cookie->time_entered, sctp_align_unsafe_makecopy, SCTP_RTT_FROM_NON_DATA); +#if defined(INET) || defined(INET6) + if (((*netp)->port == 0) && (port != 0)) { + sctp_pathmtu_adjustment(stcb, (*netp)->mtu - sizeof(struct udphdr)); + } (*netp)->port = port; +#endif } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); @@ -5847,7 +5851,7 @@ sctp_common_input_processing(struct mbuf */ inp = stcb->sctp_ep; #if defined(INET) || defined(INET6) - if ((net) && (port)) { + if ((net != NULL) && (port != 0)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } From owner-svn-src-stable@freebsd.org Sun Jan 17 12:05:45 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87C66A853EC; Sun, 17 Jan 2016 12:05:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54A2F1337; Sun, 17 Jan 2016 12:05:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HC5iHb077665; Sun, 17 Jan 2016 12:05:44 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HC5iGh077664; Sun, 17 Jan 2016 12:05:44 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171205.u0HC5iGh077664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 12:05:44 +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: r294209 - stable/10/sys/netinet 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 12:05:45 -0000 Author: tuexen Date: Sun Jan 17 12:05:44 2016 New Revision: 294209 URL: https://svnweb.freebsd.org/changeset/base/294209 Log: MFC r291659: Minor cleanup. No functional change. Modified: stable/10/sys/netinet/sctp_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Sun Jan 17 12:03:59 2016 (r294208) +++ stable/10/sys/netinet/sctp_output.c Sun Jan 17 12:05:44 2016 (r294209) @@ -12069,7 +12069,7 @@ sctp_send_str_reset_req(struct sctp_tcb oldstream = stcb->asoc.strmout; /* get some more */ SCTP_MALLOC(stcb->asoc.strmout, struct sctp_stream_out *, - ((stcb->asoc.streamoutcnt + adding_o) * sizeof(struct sctp_stream_out)), + (stcb->asoc.streamoutcnt + adding_o) * sizeof(struct sctp_stream_out), SCTP_M_STRMO); if (stcb->asoc.strmout == NULL) { uint8_t x; From owner-svn-src-stable@freebsd.org Sun Jan 17 12:07:49 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31C55A854B0; Sun, 17 Jan 2016 12:07:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7A9F1507; Sun, 17 Jan 2016 12:07:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HC7lRX077789; Sun, 17 Jan 2016 12:07:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HC7lAp077785; Sun, 17 Jan 2016 12:07:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171207.u0HC7lAp077785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 12:07:47 +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: r294210 - stable/10/sys/netinet 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 12:07:49 -0000 Author: tuexen Date: Sun Jan 17 12:07:47 2016 New Revision: 294210 URL: https://svnweb.freebsd.org/changeset/base/294210 Log: MFC r291700: Ensure that outgoing streams get reset when they run dry. Modified: stable/10/sys/netinet/sctp_indata.c stable/10/sys/netinet/sctp_input.c stable/10/sys/netinet/sctp_output.c stable/10/sys/netinet/sctp_timer.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_indata.c ============================================================================== --- stable/10/sys/netinet/sctp_indata.c Sun Jan 17 12:05:44 2016 (r294209) +++ stable/10/sys/netinet/sctp_indata.c Sun Jan 17 12:07:47 2016 (r294210) @@ -2763,6 +2763,11 @@ sctp_process_segment_range(struct sctp_t panic("No chunks on the queues for sid %u.", tp1->rec.data.stream_number); #endif } + if ((stcb->asoc.strmout[tp1->rec.data.stream_number].chunks_on_queues == 0) && + (stcb->asoc.strmout[tp1->rec.data.stream_number].state == SCTP_STREAM_RESET_PENDING) && + TAILQ_EMPTY(&stcb->asoc.strmout[tp1->rec.data.stream_number].outqueue)) { + stcb->asoc.trigger_reset = 1; + } tp1->sent = SCTP_DATAGRAM_NR_ACKED; if (tp1->data) { /* @@ -3736,6 +3741,11 @@ sctp_express_handle_sack(struct sctp_tcb #endif } } + if ((asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues == 0) && + (asoc->strmout[tp1->rec.data.stream_number].state == SCTP_STREAM_RESET_PENDING) && + TAILQ_EMPTY(&asoc->strmout[tp1->rec.data.stream_number].outqueue)) { + asoc->trigger_reset = 1; + } TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next); if (tp1->data) { /* sa_ignore NO_NULL_CHK */ @@ -4461,6 +4471,11 @@ sctp_handle_sack(struct mbuf *m, int off #endif } } + if ((asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues == 0) && + (asoc->strmout[tp1->rec.data.stream_number].state == SCTP_STREAM_RESET_PENDING) && + TAILQ_EMPTY(&asoc->strmout[tp1->rec.data.stream_number].outqueue)) { + asoc->trigger_reset = 1; + } TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next); if (PR_SCTP_ENABLED(tp1->flags)) { if (asoc->pr_sctp_cnt != 0) Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Sun Jan 17 12:05:44 2016 (r294209) +++ stable/10/sys/netinet/sctp_input.c Sun Jan 17 12:07:47 2016 (r294210) @@ -6026,7 +6026,7 @@ trigger_send: if (!TAILQ_EMPTY(&stcb->asoc.control_send_queue)) { cnt_ctrl_ready = stcb->asoc.ctrl_queue_cnt - stcb->asoc.ecn_echo_cnt_onq; } - if (cnt_ctrl_ready || + if (cnt_ctrl_ready || stcb->asoc.trigger_reset || ((un_sent) && (stcb->asoc.peers_rwnd > 0 || (stcb->asoc.peers_rwnd <= 0 && stcb->asoc.total_flight == 0)))) { Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Sun Jan 17 12:05:44 2016 (r294209) +++ stable/10/sys/netinet/sctp_output.c Sun Jan 17 12:07:47 2016 (r294210) @@ -9913,7 +9913,6 @@ sctp_chunk_output(struct sctp_inpcb *inp asoc = &stcb->asoc; do_it_again: /* The Nagle algorithm is only applied when handling a send call. */ - stcb->asoc.trigger_reset = 0; if (from_where == SCTP_OUTPUT_FROM_USR_SEND) { if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NODELAY)) { nagle_on = 0; @@ -9930,7 +9929,8 @@ do_it_again: if ((un_sent <= 0) && (TAILQ_EMPTY(&asoc->control_send_queue)) && (TAILQ_EMPTY(&asoc->asconf_send_queue)) && - (asoc->sent_queue_retran_cnt == 0)) { + (asoc->sent_queue_retran_cnt == 0) && + (asoc->trigger_reset == 0)) { /* Nothing to do unless there is something to be sent left */ return; } @@ -11901,6 +11901,7 @@ sctp_send_stream_reset_out_if_possible(s uint32_t seq; asoc = &stcb->asoc; + asoc->trigger_reset = 0; if (asoc->stream_reset_outstanding) { return (EALREADY); } Modified: stable/10/sys/netinet/sctp_timer.c ============================================================================== --- stable/10/sys/netinet/sctp_timer.c Sun Jan 17 12:05:44 2016 (r294209) +++ stable/10/sys/netinet/sctp_timer.c Sun Jan 17 12:07:47 2016 (r294210) @@ -442,6 +442,11 @@ sctp_recover_sent_list(struct sctp_tcb * asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; } } + if ((asoc->strmout[chk->rec.data.stream_number].chunks_on_queues == 0) && + (asoc->strmout[chk->rec.data.stream_number].state == SCTP_STREAM_RESET_PENDING) && + TAILQ_EMPTY(&asoc->strmout[chk->rec.data.stream_number].outqueue)) { + asoc->trigger_reset = 1; + } TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); if (PR_SCTP_ENABLED(chk->flags)) { if (asoc->pr_sctp_cnt != 0) From owner-svn-src-stable@freebsd.org Sun Jan 17 12:13:22 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC962A8578A; Sun, 17 Jan 2016 12:13:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB32F1D1A; Sun, 17 Jan 2016 12:13:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HCDLAK080582; Sun, 17 Jan 2016 12:13:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HCDLv4080581; Sun, 17 Jan 2016 12:13:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171213.u0HCDLv4080581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 12: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: r294213 - stable/10/sys/netinet 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 12:13:23 -0000 Author: tuexen Date: Sun Jan 17 12:13:21 2016 New Revision: 294213 URL: https://svnweb.freebsd.org/changeset/base/294213 Log: MFC r291752: Fix a bug where a stream reset request wasn't retranmitted when the peer indicated "In progress". Modified: stable/10/sys/netinet/sctp_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Sun Jan 17 12:08:52 2016 (r294212) +++ stable/10/sys/netinet/sctp_input.c Sun Jan 17 12:13:21 2016 (r294213) @@ -3651,6 +3651,7 @@ sctp_handle_stream_reset_response(struct * Set it up so we don't stop * retransmitting */ + asoc->stream_reset_outstanding++; stcb->asoc.str_reset_seq_out--; asoc->stream_reset_out_is_outstanding = 1; no_clear = 1; From owner-svn-src-stable@freebsd.org Sun Jan 17 12:15:43 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95D9DA8586F; Sun, 17 Jan 2016 12:15:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7347C1F76; Sun, 17 Jan 2016 12:15:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HCFgHe080765; Sun, 17 Jan 2016 12:15:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HCFfQM080757; Sun, 17 Jan 2016 12:15:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171215.u0HCFfQM080757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 12:15: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: r294215 - in stable/10/sys: netinet netinet6 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 12:15:43 -0000 Author: tuexen Date: Sun Jan 17 12:15:41 2016 New Revision: 294215 URL: https://svnweb.freebsd.org/changeset/base/294215 Log: MFC r291904: Fix the allocation of outgoing streams: * When processing a cookie, use the number of streams announced in the INIT-ACK. * When sending an INIT-ACK for an existing association, use the value from the association, not from the end-point. Modified: stable/10/sys/netinet/sctp_input.c stable/10/sys/netinet/sctp_output.c stable/10/sys/netinet/sctp_pcb.c stable/10/sys/netinet/sctp_pcb.h stable/10/sys/netinet/sctp_usrreq.c stable/10/sys/netinet/sctputil.c stable/10/sys/netinet/sctputil.h stable/10/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Sun Jan 17 12:13:40 2016 (r294214) +++ stable/10/sys/netinet/sctp_input.c Sun Jan 17 12:15:41 2016 (r294215) @@ -2103,6 +2103,7 @@ sctp_process_cookie_new(struct mbuf *m, */ stcb = sctp_aloc_assoc(inp, init_src, &error, ntohl(initack_cp->init.initiate_tag), vrf_id, + ntohs(initack_cp->init.num_outbound_streams), (struct thread *)NULL ); if (stcb == NULL) { Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Sun Jan 17 12:13:40 2016 (r294214) +++ stable/10/sys/netinet/sctp_output.c Sun Jan 17 12:15:41 2016 (r294215) @@ -3652,6 +3652,7 @@ sctp_process_cmsgs_for_init(struct sctp_ #endif stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; + stcb->asoc.strmout[i].state = SCTP_STREAM_OPENING; stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); } } @@ -5841,10 +5842,10 @@ do_a_abort: his_limit = ntohs(init_chk->init.num_inbound_streams); /* choose what I want */ if (asoc != NULL) { - if (asoc->streamoutcnt > inp->sctp_ep.pre_open_stream_count) { + if (asoc->streamoutcnt > asoc->pre_open_streams) { i_want = asoc->streamoutcnt; } else { - i_want = inp->sctp_ep.pre_open_stream_count; + i_want = asoc->pre_open_streams; } } else { i_want = inp->sctp_ep.pre_open_stream_count; @@ -12617,6 +12618,7 @@ sctp_lower_sosend(struct socket *so, } #endif stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, + inp->sctp_ep.pre_open_stream_count, p ); if (stcb == NULL) { Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Sun Jan 17 12:13:40 2016 (r294214) +++ stable/10/sys/netinet/sctp_pcb.c Sun Jan 17 12:15:41 2016 (r294215) @@ -4164,6 +4164,7 @@ try_again: struct sctp_tcb * sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, int *error, uint32_t override_tag, uint32_t vrf_id, + uint16_t o_streams, struct thread *p ) { @@ -4322,7 +4323,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, /* setup back pointer's */ stcb->sctp_ep = inp; stcb->sctp_socket = inp->sctp_socket; - if ((err = sctp_init_asoc(inp, stcb, override_tag, vrf_id))) { + if ((err = sctp_init_asoc(inp, stcb, override_tag, vrf_id, o_streams))) { /* failed */ SCTP_TCB_LOCK_DESTROY(stcb); SCTP_TCB_SEND_LOCK_DESTROY(stcb); Modified: stable/10/sys/netinet/sctp_pcb.h ============================================================================== --- stable/10/sys/netinet/sctp_pcb.h Sun Jan 17 12:13:40 2016 (r294214) +++ stable/10/sys/netinet/sctp_pcb.h Sun Jan 17 12:15:41 2016 (r294215) @@ -584,7 +584,7 @@ void sctp_inpcb_free(struct sctp_inpcb * struct sctp_tcb * sctp_aloc_assoc(struct sctp_inpcb *, struct sockaddr *, - int *, uint32_t, uint32_t, struct thread *); + int *, uint32_t, uint32_t, uint16_t, struct thread *); int sctp_free_assoc(struct sctp_inpcb *, struct sctp_tcb *, int, int); Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Sun Jan 17 12:13:40 2016 (r294214) +++ stable/10/sys/netinet/sctp_usrreq.c Sun Jan 17 12:15:41 2016 (r294215) @@ -1501,6 +1501,7 @@ sctp_do_connect_x(struct socket *so, str /* We are GOOD to go */ stcb = sctp_aloc_assoc(inp, sa, &error, 0, vrf_id, + inp->sctp_ep.pre_open_stream_count, (struct thread *)p ); if (stcb == NULL) { @@ -6929,7 +6930,7 @@ sctp_connect(struct socket *so, struct s } vrf_id = inp->def_vrf_id; /* We are GOOD to go */ - stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, p); + stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, p); if (stcb == NULL) { /* Gak! no memory */ goto out_now; Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Sun Jan 17 12:13:40 2016 (r294214) +++ stable/10/sys/netinet/sctputil.c Sun Jan 17 12:15:41 2016 (r294215) @@ -938,7 +938,7 @@ sctp_map_assoc_state(int kernel_state) int sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - uint32_t override_tag, uint32_t vrf_id) + uint32_t override_tag, uint32_t vrf_id, uint16_t o_strms) { struct sctp_association *asoc; @@ -1100,7 +1100,7 @@ sctp_init_asoc(struct sctp_inpcb *inp, s * that we request by default. */ asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams = - inp->sctp_ep.pre_open_stream_count; + o_strms; SCTP_MALLOC(asoc->strmout, struct sctp_stream_out *, asoc->streamoutcnt * sizeof(struct sctp_stream_out), SCTP_M_STRMO); Modified: stable/10/sys/netinet/sctputil.h ============================================================================== --- stable/10/sys/netinet/sctputil.h Sun Jan 17 12:13:40 2016 (r294214) +++ stable/10/sys/netinet/sctputil.h Sun Jan 17 12:15:41 2016 (r294215) @@ -83,7 +83,7 @@ uint32_t sctp_select_initial_TSN(struct uint32_t sctp_select_a_tag(struct sctp_inpcb *, uint16_t lport, uint16_t rport, int); -int sctp_init_asoc(struct sctp_inpcb *, struct sctp_tcb *, uint32_t, uint32_t); +int sctp_init_asoc(struct sctp_inpcb *, struct sctp_tcb *, uint32_t, uint32_t, uint16_t); void sctp_fill_random_store(struct sctp_pcb *); Modified: stable/10/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/10/sys/netinet6/sctp6_usrreq.c Sun Jan 17 12:13:40 2016 (r294214) +++ stable/10/sys/netinet6/sctp6_usrreq.c Sun Jan 17 12:15:41 2016 (r294215) @@ -953,7 +953,7 @@ sctp6_connect(struct socket *so, struct return (EALREADY); } /* We are GOOD to go */ - stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, p); + stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, p); SCTP_ASOC_CREATE_UNLOCK(inp); if (stcb == NULL) { /* Gak! no memory */ From owner-svn-src-stable@freebsd.org Sun Jan 17 12:18:03 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D75AA85922; Sun, 17 Jan 2016 12:18:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E63511120; Sun, 17 Jan 2016 12:18:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HCI11e080898; Sun, 17 Jan 2016 12:18:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HCI1GP080895; Sun, 17 Jan 2016 12:18:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171218.u0HCI1GP080895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 12:18: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: r294216 - stable/10/sys/netinet 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 12:18:03 -0000 Author: tuexen Date: Sun Jan 17 12:18:01 2016 New Revision: 294216 URL: https://svnweb.freebsd.org/changeset/base/294216 Log: MFC r292060: Retire sctp_validate_no_locks(). This routine checks that there are no locks held for an inp, without having any lock on the inp. This breaks if the inp goes away when it is called. This happens on stress tests on a RPi B+. Modified: stable/10/sys/netinet/sctp_input.c stable/10/sys/netinet/sctp_output.c stable/10/sys/netinet/sctp_pcb.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Sun Jan 17 12:15:41 2016 (r294215) +++ stable/10/sys/netinet/sctp_input.c Sun Jan 17 12:18:01 2016 (r294216) @@ -5641,30 +5641,6 @@ next_chunk: } -#ifdef INVARIANTS -#ifdef __GNUC__ -__attribute__((noinline)) -#endif - void - sctp_validate_no_locks(struct sctp_inpcb *inp) -{ - struct sctp_tcb *lstcb; - - LIST_FOREACH(lstcb, &inp->sctp_asoc_list, sctp_tcblist) { - if (mtx_owned(&lstcb->tcb_mtx)) { - panic("Own lock on stcb at return from input"); - } - } - if (mtx_owned(&inp->inp_create_mtx)) { - panic("Own create lock on inp"); - } - if (mtx_owned(&inp->inp_mtx)) { - panic("Own inp lock on inp"); - } -} - -#endif - /* * common input chunk processing (v4 and v6) */ @@ -6050,11 +6026,6 @@ out: SCTP_INP_DECR_REF(inp_decr); SCTP_INP_WUNLOCK(inp_decr); } -#ifdef INVARIANTS - if (inp != NULL) { - sctp_validate_no_locks(inp); - } -#endif return; } Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Sun Jan 17 12:15:41 2016 (r294215) +++ stable/10/sys/netinet/sctp_output.c Sun Jan 17 12:18:01 2016 (r294216) @@ -13554,13 +13554,6 @@ out_unlocked: } } #endif -#ifdef INVARIANTS - if (inp) { - sctp_validate_no_locks(inp); - } else { - SCTP_PRINTF("Warning - inp is NULL so cant validate locks\n"); - } -#endif if (top) { sctp_m_freem(top); } Modified: stable/10/sys/netinet/sctp_pcb.h ============================================================================== --- stable/10/sys/netinet/sctp_pcb.h Sun Jan 17 12:15:41 2016 (r294215) +++ stable/10/sys/netinet/sctp_pcb.h Sun Jan 17 12:18:01 2016 (r294216) @@ -654,11 +654,5 @@ void #endif -#ifdef INVARIANTS -void - sctp_validate_no_locks(struct sctp_inpcb *inp); - -#endif - #endif /* _KERNEL */ #endif /* !__sctp_pcb_h__ */ From owner-svn-src-stable@freebsd.org Sun Jan 17 12:39:37 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3503A8626A; Sun, 17 Jan 2016 12:39:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C49B11E2C; Sun, 17 Jan 2016 12:39:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HCdZfG087233; Sun, 17 Jan 2016 12:39:35 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HCdZqx087232; Sun, 17 Jan 2016 12:39:35 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171239.u0HCdZqx087232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 12:39:35 +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: r294219 - stable/10/sys/netinet 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 12:39:37 -0000 Author: tuexen Date: Sun Jan 17 12:39:35 2016 New Revision: 294219 URL: https://svnweb.freebsd.org/changeset/base/294219 Log: MFC r292558: Stop processing of a SACK when the association has been aborted. Modified: stable/10/sys/netinet/sctp_indata.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_indata.c ============================================================================== --- stable/10/sys/netinet/sctp_indata.c Sun Jan 17 12:24:02 2016 (r294218) +++ stable/10/sys/netinet/sctp_indata.c Sun Jan 17 12:39:35 2016 (r294219) @@ -3994,6 +3994,7 @@ again: op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_26; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); + return; } else { struct sctp_nets *netp; From owner-svn-src-stable@freebsd.org Sun Jan 17 12:41:48 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21662A863A4; Sun, 17 Jan 2016 12:41:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFF3312AB; Sun, 17 Jan 2016 12:41:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HCfkRK089997; Sun, 17 Jan 2016 12:41:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HCfkLO089996; Sun, 17 Jan 2016 12:41:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171241.u0HCfkLO089996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 12:41:46 +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: r294220 - stable/10/sys/netinet 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 12:41:48 -0000 Author: tuexen Date: Sun Jan 17 12:41:46 2016 New Revision: 294220 URL: https://svnweb.freebsd.org/changeset/base/294220 Log: MFC r292734: Don't implicitly terminate a user message when moving it to the send_queue and the socket is closed. This results in strange race conditions for the application. While there, remove a stray character. Modified: stable/10/sys/netinet/sctp_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Sun Jan 17 12:39:35 2016 (r294219) +++ stable/10/sys/netinet/sctp_output.c Sun Jan 17 12:41:46 2016 (r294220) @@ -7219,7 +7219,7 @@ one_more_time: } /* Whack down the size */ atomic_subtract_int(&stcb->asoc.total_output_queue_size, sp->length); - if ((stcb->sctp_socket != NULL) && \ + if ((stcb->sctp_socket != NULL) && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc, sp->length); @@ -7238,9 +7238,6 @@ one_more_time: } } some_taken = sp->some_taken; - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - sp->msg_is_complete = 1; - } re_look: length = sp->length; if (sp->msg_is_complete) { From owner-svn-src-stable@freebsd.org Sun Jan 17 14:00:26 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 626BEA85DA4; Sun, 17 Jan 2016 14:00:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 153211A4D; Sun, 17 Jan 2016 14:00:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HE0PdQ034243; Sun, 17 Jan 2016 14:00:25 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HE0PaL034242; Sun, 17 Jan 2016 14:00:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171400.u0HE0PaL034242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 14:00:25 +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: r294221 - stable/10/sys/netinet 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 14:00:26 -0000 Author: tuexen Date: Sun Jan 17 14:00:24 2016 New Revision: 294221 URL: https://svnweb.freebsd.org/changeset/base/294221 Log: MFC r293828: Store the timer type for logging, because the timer can be freed during processing the timerout. Modified: stable/10/sys/netinet/sctputil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Sun Jan 17 12:41:46 2016 (r294220) +++ stable/10/sys/netinet/sctputil.c Sun Jan 17 14:00:24 2016 (r294221) @@ -1495,6 +1495,7 @@ sctp_timeout_handler(void *t) #endif int did_output; + int type; tmr = (struct sctp_timer *)t; inp = (struct sctp_inpcb *)tmr->ep; @@ -1563,8 +1564,9 @@ sctp_timeout_handler(void *t) return; } } + type = tmr->type; tmr->stopped_from = 0xa005; - SCTPDBG(SCTP_DEBUG_TIMER1, "Timer type %d goes off\n", tmr->type); + SCTPDBG(SCTP_DEBUG_TIMER1, "Timer type %d goes off\n", type); if (!SCTP_OS_TIMER_ACTIVE(&tmr->timer)) { if (inp) { SCTP_INP_DECR_REF(inp); @@ -1580,7 +1582,7 @@ sctp_timeout_handler(void *t) if (stcb) { SCTP_TCB_LOCK(stcb); atomic_add_int(&stcb->asoc.refcnt, -1); - if ((tmr->type != SCTP_TIMER_TYPE_ASOCKILL) && + if ((type != SCTP_TIMER_TYPE_ASOCKILL) && ((stcb->asoc.state == 0) || (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED))) { SCTP_TCB_UNLOCK(stcb); @@ -1592,7 +1594,7 @@ sctp_timeout_handler(void *t) } } /* record in stopped what t-o occured */ - tmr->stopped_from = tmr->type; + tmr->stopped_from = type; /* mark as being serviced now */ if (SCTP_OS_TIMER_PENDING(&tmr->timer)) { @@ -1610,7 +1612,7 @@ sctp_timeout_handler(void *t) SCTP_OS_TIMER_DEACTIVATE(&tmr->timer); /* call the handler for the appropriate timer type */ - switch (tmr->type) { + switch (type) { case SCTP_TIMER_TYPE_ZERO_COPY: if (inp == NULL) { break; @@ -1894,11 +1896,11 @@ sctp_timeout_handler(void *t) goto out_no_decr; default: SCTPDBG(SCTP_DEBUG_TIMER1, "sctp_timeout_handler:unknown timer %d\n", - tmr->type); + type); break; } #ifdef SCTP_AUDITING_ENABLED - sctp_audit_log(0xF1, (uint8_t) tmr->type); + sctp_audit_log(0xF1, (uint8_t) type); if (inp) sctp_auditing(5, inp, stcb, net); #endif @@ -1921,8 +1923,7 @@ out_decr: SCTP_INP_DECR_REF(inp); } out_no_decr: - SCTPDBG(SCTP_DEBUG_TIMER1, "Timer now complete (type %d)\n", - tmr->type); + SCTPDBG(SCTP_DEBUG_TIMER1, "Timer now complete (type = %d)\n", type); CURVNET_RESTORE(); } From owner-svn-src-stable@freebsd.org Sun Jan 17 14:10:38 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D692FA862C7; Sun, 17 Jan 2016 14:10:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A376B1ADD; Sun, 17 Jan 2016 14:10:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HEAb0h038908; Sun, 17 Jan 2016 14:10:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HEAbju038907; Sun, 17 Jan 2016 14:10:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171410.u0HEAbju038907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 14:10:37 +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: r294222 - stable/10/sys/netinet 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 14:10:38 -0000 Author: tuexen Date: Sun Jan 17 14:10:37 2016 New Revision: 294222 URL: https://svnweb.freebsd.org/changeset/base/294222 Log: MFC r293913: Fail the SCTP_GET_ASSOC_NUMBER and SCTP_GET_ASSOC_ID_LIST socket options for 1-to-1 style sockets as specified in RFC 6458. Modified: stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Sun Jan 17 14:00:24 2016 (r294221) +++ stable/10/sys/netinet/sctp_usrreq.c Sun Jan 17 14:10:37 2016 (r294222) @@ -1883,8 +1883,15 @@ flags_out: uint32_t *value, cnt; SCTP_CHECK_AND_CAST(value, optval, uint32_t, *optsize); - cnt = 0; SCTP_INP_RLOCK(inp); + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { + /* Can't do this for a 1-1 socket */ + error = EINVAL; + SCTP_INP_RUNLOCK(inp); + break; + } + cnt = 0; LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { cnt++; } @@ -1899,9 +1906,16 @@ flags_out: unsigned int at, limit; SCTP_CHECK_AND_CAST(ids, optval, struct sctp_assoc_ids, *optsize); + SCTP_INP_RLOCK(inp); + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { + /* Can't do this for a 1-1 socket */ + error = EINVAL; + SCTP_INP_RUNLOCK(inp); + break; + } at = 0; limit = (*optsize - sizeof(uint32_t)) / sizeof(sctp_assoc_t); - SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { if (at < limit) { ids->gaids_assoc_id[at++] = sctp_get_associd(stcb); From owner-svn-src-stable@freebsd.org Sun Jan 17 14:14:13 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 909AAA8649A; Sun, 17 Jan 2016 14:14:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41E541E73; Sun, 17 Jan 2016 14:14:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HEEC7X041781; Sun, 17 Jan 2016 14:14:12 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HEECQZ041780; Sun, 17 Jan 2016 14:14:12 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171414.u0HEECQZ041780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 14:14: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: r294223 - stable/10/sys/netinet 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 14:14:13 -0000 Author: tuexen Date: Sun Jan 17 14:14:12 2016 New Revision: 294223 URL: https://svnweb.freebsd.org/changeset/base/294223 Log: MFC r294057: Fix a bug in INIT handling on accepted 1-to-1 style sockets when the listener is closed. This fix allows the following packetdrill test to pass: // Setup a connected, blocking 1-to-1 style socket +0.0 socket(..., SOCK_STREAM, IPPROTO_SCTP) = 3 // Check the handshake with en empty(!) cookie +0.0 bind(3, ..., ...) = 0 +0.0 listen(3, 1) = 0 +0.0 < sctp: INIT[flgs=0, tag=1, a_rwnd=1500, os=1, is=1, tsn=1] +0.0 > sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=..., os=..., is=..., tsn=1, ...] +0.0 < sctp: COOKIE_ECHO[flgs=0, len=..., val=...] +0.0 > sctp: COOKIE_ACK[flgs=0] +0.0 accept(3, ..., ...) = 4 +0.0 close(3) = 0 // Inject an INIT chunk and expect an INIT-ACK +0.0 < sctp: INIT[flgs=0, tag=3, a_rwnd=1500, os=1, is=1, tsn=1] +0.0 > sctp: INIT_ACK[flgs=0, tag=..., a_rwnd=..., os=..., is=..., tsn=..., ...] Modified: stable/10/sys/netinet/sctp_pcb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Sun Jan 17 14:10:37 2016 (r294222) +++ stable/10/sys/netinet/sctp_pcb.c Sun Jan 17 14:14:12 2016 (r294223) @@ -2269,8 +2269,12 @@ sctp_findassociation_addr(struct mbuf *m } } find_tcp_pool = 0; - if ((ch->chunk_type != SCTP_INITIATION) && - (ch->chunk_type != SCTP_INITIATION_ACK) && + /* + * Don't consider INIT chunks since that breaks 1-to-1 sockets: When + * a server closes the listener, incoming INIT chunks are not + * responsed by an INIT-ACK chunk. + */ + if ((ch->chunk_type != SCTP_INITIATION_ACK) && (ch->chunk_type != SCTP_COOKIE_ACK) && (ch->chunk_type != SCTP_COOKIE_ECHO)) { /* Other chunk types go to the tcp pool. */ From owner-svn-src-stable@freebsd.org Sun Jan 17 14:16:27 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D469AA86584; Sun, 17 Jan 2016 14:16:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A16DE1FF0; Sun, 17 Jan 2016 14:16:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HEGQeH041992; Sun, 17 Jan 2016 14:16:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HEGQUC041991; Sun, 17 Jan 2016 14:16:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171416.u0HEGQUC041991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 14:16: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: r294224 - stable/10/sys/dev/e1000 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 14:16:27 -0000 Author: tuexen Date: Sun Jan 17 14:16:26 2016 New Revision: 294224 URL: https://svnweb.freebsd.org/changeset/base/294224 Log: MFC r290641: Add support for SCTP checksum offloading for the 82580 controller similar to the 82576 controller. Tested with Intel i340 cards. Modified: stable/10/sys/dev/e1000/if_igb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/if_igb.c ============================================================================== --- stable/10/sys/dev/e1000/if_igb.c Sun Jan 17 14:14:12 2016 (r294223) +++ stable/10/sys/dev/e1000/if_igb.c Sun Jan 17 14:16:26 2016 (r294224) @@ -1323,7 +1323,8 @@ igb_init_locked(struct adapter *adapter) if (ifp->if_capenable & IFCAP_TXCSUM) { ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); #if __FreeBSD_version >= 800000 - if (adapter->hw.mac.type == e1000_82576) + if ((adapter->hw.mac.type == e1000_82576) || + (adapter->hw.mac.type == e1000_82580)) ifp->if_hwassist |= CSUM_SCTP; #endif } @@ -4609,8 +4610,9 @@ igb_initialize_receive_units(struct adap rxcsum |= E1000_RXCSUM_PCSD; #if __FreeBSD_version >= 800000 /* For SCTP Offload */ - if ((hw->mac.type == e1000_82576) - && (ifp->if_capenable & IFCAP_RXCSUM)) + if (((hw->mac.type == e1000_82576) || + (hw->mac.type == e1000_82580)) && + (ifp->if_capenable & IFCAP_RXCSUM)) rxcsum |= E1000_RXCSUM_CRCOFL; #endif } else { @@ -4618,7 +4620,8 @@ igb_initialize_receive_units(struct adap if (ifp->if_capenable & IFCAP_RXCSUM) { rxcsum |= E1000_RXCSUM_IPPCSE; #if __FreeBSD_version >= 800000 - if (adapter->hw.mac.type == e1000_82576) + if ((adapter->hw.mac.type == e1000_82576) || + (adapter->hw.mac.type == e1000_82580)) rxcsum |= E1000_RXCSUM_CRCOFL; #endif } else From owner-svn-src-stable@freebsd.org Sun Jan 17 14:33:42 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 536F2A86BBA; Sun, 17 Jan 2016 14:33:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1633E1BDE; Sun, 17 Jan 2016 14:33:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HEXfLb048467; Sun, 17 Jan 2016 14:33:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HEXfIP048465; Sun, 17 Jan 2016 14:33:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171433.u0HEXfIP048465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 14:33: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: r294225 - stable/10/usr.bin/sockstat 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 14:33:42 -0000 Author: tuexen Date: Sun Jan 17 14:33:40 2016 New Revision: 294225 URL: https://svnweb.freebsd.org/changeset/base/294225 Log: MFC r285630: Add a -s option which adds a column listing the connection state if applicable (currently only for TCP). This is work from des@ and MFCing was discussed with him. Modified: stable/10/usr.bin/sockstat/sockstat.1 stable/10/usr.bin/sockstat/sockstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sockstat/sockstat.1 ============================================================================== --- stable/10/usr.bin/sockstat/sockstat.1 Sun Jan 17 14:16:26 2016 (r294224) +++ stable/10/usr.bin/sockstat/sockstat.1 Sun Jan 17 14:33:40 2016 (r294225) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 20, 2015 +.Dd July 14, 2015 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -35,7 +35,7 @@ .Nd list open sockets .Sh SYNOPSIS .Nm -.Op Fl 46cLlu +.Op Fl 46cLlsu .Op Fl j Ar jid .Op Fl p Ar ports .Op Fl P Ar protocols @@ -83,6 +83,9 @@ The argument is a comma-separated list of protocol names, as they are defined in .Xr protocols 5 . +.It Fl s +Display the protocol state, if applicable. +This is currently only implemented for TCP. .It Fl u Show .Dv AF_LOCAL Modified: stable/10/usr.bin/sockstat/sockstat.c ============================================================================== --- stable/10/usr.bin/sockstat/sockstat.c Sun Jan 17 14:16:26 2016 (r294224) +++ stable/10/usr.bin/sockstat/sockstat.c Sun Jan 17 14:33:40 2016 (r294225) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define TCPSTATES /* load state names */ +#include #include #include #include @@ -71,6 +73,7 @@ static int opt_c; /* Show connected so static int opt_j; /* Show specified jail */ static int opt_L; /* Don't show IPv4 or IPv6 loopback sockets */ static int opt_l; /* Show listening sockets */ +static int opt_s; /* Show protocol state if applicable */ static int opt_u; /* Show Unix domain sockets */ static int opt_v; /* Verbose mode */ @@ -101,6 +104,7 @@ struct sock { int vflag; int family; int proto; + int state; const char *protoname; struct addr *laddr; struct addr *faddr; @@ -538,9 +542,9 @@ gather_inet(int proto) const char *varname, *protoname; size_t len, bufsize; void *buf; - int hash, retry, vflag; + int hash, retry, state, vflag; - vflag = 0; + state = vflag = 0; if (opt_4) vflag |= INP_IPV4; if (opt_6) @@ -604,6 +608,7 @@ gather_inet(int proto) inp = &xtp->xt_inp; so = &xtp->xt_socket; protoname = xtp->xt_tp.t_flags & TF_TOE ? "toe" : "tcp"; + state = xtp->xt_tp.t_state; break; case IPPROTO_UDP: case IPPROTO_DIVERT: @@ -670,6 +675,8 @@ gather_inet(int proto) sock->laddr = laddr; sock->faddr = faddr; sock->vflag = inp->inp_vflag; + if (proto == IPPROTO_TCP) + sock->state = xtp->xt_tp.t_state; sock->protoname = protoname; hash = (int)((uintptr_t)sock->socket % HASHSIZE); sock->next = sockhash[hash]; @@ -977,7 +984,14 @@ displaysock(struct sock *s, int pos) pos = 0; } } - xprintf("\n"); + if (opt_s && s->proto == IPPROTO_TCP) { + while (pos < 80) + pos += xprintf(" "); + if (s->state >= 0 && s->state < TCP_NSTATES) + pos += xprintf("%s", tcpstates[s->state]); + else + pos += xprintf("?"); + } } static void @@ -988,9 +1002,12 @@ display(void) struct sock *s; int hash, n, pos; - printf("%-8s %-10s %-5s %-2s %-6s %-21s %-21s\n", + printf("%-8s %-10s %-5s %-2s %-6s %-21s %-21s", "USER", "COMMAND", "PID", "FD", "PROTO", "LOCAL ADDRESS", "FOREIGN ADDRESS"); + if (opt_s) + printf(" %-12s", "STATE"); + printf("\n"); setpassent(1); for (xf = xfiles, n = 0; n < nxfiles; ++n, ++xf) { if (xf->xf_data == NULL) @@ -1019,6 +1036,7 @@ display(void) pos += xprintf(" "); pos += xprintf("%d ", xf->xf_fd); displaysock(s, pos); + xprintf("\n"); } } if (opt_j >= 0) @@ -1033,6 +1051,7 @@ display(void) pos += xprintf("%-8s %-10s %-5s %-2s ", "?", "?", "?", "?"); displaysock(s, pos); + xprintf("\n"); } } } @@ -1061,7 +1080,7 @@ static void usage(void) { fprintf(stderr, - "Usage: sockstat [-46cLlu] [-j jid] [-p ports] [-P protocols]\n"); + "usage: sockstat [-46cLlsu] [-j jid] [-p ports] [-P protocols]\n"); exit(1); } @@ -1072,7 +1091,7 @@ main(int argc, char *argv[]) int o, i; opt_j = -1; - while ((o = getopt(argc, argv, "46cj:Llp:P:uv")) != -1) + while ((o = getopt(argc, argv, "46cj:Llp:P:suv")) != -1) switch (o) { case '4': opt_4 = 1; @@ -1098,6 +1117,9 @@ main(int argc, char *argv[]) case 'P': protos_defined = parse_protos(optarg); break; + case 's': + opt_s = 1; + break; case 'u': opt_u = 1; break; From owner-svn-src-stable@freebsd.org Sun Jan 17 14:35:39 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23074A86C43; Sun, 17 Jan 2016 14:35:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3BA91D36; Sun, 17 Jan 2016 14:35:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HEZb9s048662; Sun, 17 Jan 2016 14:35:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HEZbtU048661; Sun, 17 Jan 2016 14:35:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171435.u0HEZbtU048661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 14:35:37 +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: r294226 - stable/10/usr.bin/sockstat 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 14:35:39 -0000 Author: tuexen Date: Sun Jan 17 14:35:37 2016 New Revision: 294226 URL: https://svnweb.freebsd.org/changeset/base/294226 Log: MFC r285651: Move assignments around to avoid a false-positive uninitialized variable warning which broke the sparc64 build. This is work from des@ and MFCing was discussed with him. Modified: stable/10/usr.bin/sockstat/sockstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sockstat/sockstat.c ============================================================================== --- stable/10/usr.bin/sockstat/sockstat.c Sun Jan 17 14:33:40 2016 (r294225) +++ stable/10/usr.bin/sockstat/sockstat.c Sun Jan 17 14:35:37 2016 (r294226) @@ -598,9 +598,10 @@ gather_inet(int proto) xig = (struct xinpgen *)(void *)((char *)xig + xig->xig_len); if (xig >= exig) break; + xip = (struct xinpcb *)xig; + xtp = (struct xtcpcb *)xig; switch (proto) { case IPPROTO_TCP: - xtp = (struct xtcpcb *)xig; if (xtp->xt_len != sizeof(*xtp)) { warnx("struct xtcpcb size mismatch"); goto out; @@ -612,7 +613,6 @@ gather_inet(int proto) break; case IPPROTO_UDP: case IPPROTO_DIVERT: - xip = (struct xinpcb *)xig; if (xip->xi_len != sizeof(*xip)) { warnx("struct xinpcb size mismatch"); goto out; From owner-svn-src-stable@freebsd.org Sun Jan 17 18:07:33 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F26D0A866B1; Sun, 17 Jan 2016 18:07:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A95CE1084; Sun, 17 Jan 2016 18:07:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HI7WOF013750; Sun, 17 Jan 2016 18:07:32 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HI7WjP013749; Sun, 17 Jan 2016 18:07:32 GMT (envelope-from des@FreeBSD.org) Message-Id: <201601171807.u0HI7WjP013749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sun, 17 Jan 2016 18:07: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: r294228 - stable/10/usr.bin/sockstat 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 18:07:34 -0000 Author: des Date: Sun Jan 17 18:07:32 2016 New Revision: 294228 URL: https://svnweb.freebsd.org/changeset/base/294228 Log: MFH (r287178): print status on first line, not last. This revision has previously been (incorrectly) recorded as merged. Modified: stable/10/usr.bin/sockstat/sockstat.c Modified: stable/10/usr.bin/sockstat/sockstat.c ============================================================================== --- stable/10/usr.bin/sockstat/sockstat.c Sun Jan 17 15:21:23 2016 (r294227) +++ stable/10/usr.bin/sockstat/sockstat.c Sun Jan 17 18:07:32 2016 (r294228) @@ -911,7 +911,7 @@ static void displaysock(struct sock *s, int pos) { void *p; - int hash; + int hash, first; struct addr *laddr, *faddr; struct sock *s_tmp; @@ -924,6 +924,7 @@ displaysock(struct sock *s, int pos) pos += xprintf("6 "); laddr = s->laddr; faddr = s->faddr; + first = 1; while (laddr != NULL || faddr != NULL) { while (pos < 36) pos += xprintf(" "); @@ -975,6 +976,14 @@ displaysock(struct sock *s, int pos) default: abort(); } + if (first && opt_s && s->proto == IPPROTO_TCP) { + while (pos < 80) + pos += xprintf(" "); + if (s->state >= 0 && s->state < TCP_NSTATES) + pos += xprintf("%s", tcpstates[s->state]); + else + pos += xprintf("?"); + } if (laddr != NULL) laddr = laddr->next; if (faddr != NULL) @@ -983,15 +992,9 @@ displaysock(struct sock *s, int pos) xprintf("\n"); pos = 0; } + first = 0; } - if (opt_s && s->proto == IPPROTO_TCP) { - while (pos < 80) - pos += xprintf(" "); - if (s->state >= 0 && s->state < TCP_NSTATES) - pos += xprintf("%s", tcpstates[s->state]); - else - pos += xprintf("?"); - } + xprintf("\n"); } static void @@ -1036,7 +1039,6 @@ display(void) pos += xprintf(" "); pos += xprintf("%d ", xf->xf_fd); displaysock(s, pos); - xprintf("\n"); } } if (opt_j >= 0) @@ -1051,7 +1053,6 @@ display(void) pos += xprintf("%-8s %-10s %-5s %-2s ", "?", "?", "?", "?"); displaysock(s, pos); - xprintf("\n"); } } } From owner-svn-src-stable@freebsd.org Sun Jan 17 18:18:03 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 912D3A86B8A; Sun, 17 Jan 2016 18:18:03 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4CA1AB0; Sun, 17 Jan 2016 18:18:03 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HII2jY017260; Sun, 17 Jan 2016 18:18:02 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HII2YQ017255; Sun, 17 Jan 2016 18:18:02 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601171818.u0HII2YQ017255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 17 Jan 2016 18:18:02 +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: r294229 - in stable/10: share/man/man4 sys/dev/uart 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 18:18:03 -0000 Author: ian Date: Sun Jan 17 18:18:01 2016 New Revision: 294229 URL: https://svnweb.freebsd.org/changeset/base/294229 Log: MFC r293781: Restore uart PPS signal capture polarity to its historical norm, and add an option to invert the polarity in software. Also add an option to capture very narrow pulses by using the hardware's MSR delta-bit capability of latching line state changes. Relnotes: yes Added: stable/10/sys/dev/uart/uart_ppstypes.h - copied unchanged from r293781, head/sys/dev/uart/uart_ppstypes.h Modified: stable/10/share/man/man4/uart.4 stable/10/sys/dev/uart/uart_bus.h stable/10/sys/dev/uart/uart_core.c stable/10/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/uart.4 ============================================================================== --- stable/10/share/man/man4/uart.4 Sun Jan 17 18:07:32 2016 (r294228) +++ stable/10/share/man/man4/uart.4 Sun Jan 17 18:18:01 2016 (r294229) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2015 +.Dd December 9, 2015 .Dt UART 4 .Os .Sh NAME @@ -160,7 +160,9 @@ The API, accessed via is available on the tty device. To use the PPS capture feature with .Xr ntpd 8 , -symlink the tty device to +symlink the tty callout device +.Va /dev/cuau? +to .Va /dev/pps0. .Pp The @@ -175,15 +177,54 @@ it can be set in .Xr loader.conf 5 or .Xr sysctl.conf 5 . +.Pp The following capture modes are available: .Bl -tag -compact -offset "mmmm" -width "mmmm" -.It 0 +.It 0x00 Capture disabled. -.It 1 +.It 0x01 Capture pulses on the CTS line. -.It 2 -Capture pulses on the DCD line (default). +.It 0x02 +Capture pulses on the DCD line. .El +.Pp +The following values may be ORed with the capture mode to configure +capture processing options: +.Bl -tag -compact -offset "mmmm" -width "mmmm" +.It 0x10 +Invert the pulse (RS-232 logic low = ASSERT, high = CLEAR). +.It 0x20 +Attempt to capture narrow pulses. +.El +.Pp +Add the narrow pulse option when the incoming PPS pulse width is small +enough to prevent reliable capture in normal mode. +In narrow mode the driver uses the hardware's ability to latch a line +state change; not all hardware has this capability. +The hardware latch provides a reliable indication that a pulse occurred, +but prevents distinguishing between the CLEAR and ASSERT edges of the pulse. +For each detected pulse, the driver synthesizes both an ASSERT and a CLEAR +event, using the same timestamp for each. +To prevent spurious events when the hardware is intermittently able to +see both edges of a pulse, the driver will not generate a new pair of +events within a half second of the prior pair. +Both normal and narrow pulse modes work with +.Xr ntpd 8 . +.Pp +Add the invert option when the connection to the uart device uses TTL +level signals, or when the PPS source emits inverted pulses. +RFC 2783 defines an ASSERT event as a higher-voltage line level, and a CLEAR +event as a lower-voltage line level, in the context of the RS-232 protocol. +The modem control signals on a TTL-level connection are typically +inverted from the RS-232 levels. +For example, carrier presence is indicated by a high signal on an RS-232 +DCD line, and by a low signal on a TTL DCD line. +This is due to the use of inverting line driver buffers to convert between +TTL and RS-232 line levels in most hardware designs. +Generally speaking, a connection to a DB-9 style connector is an RS-232 +level signal at up to 12 volts. +A connection to header pins or an edge-connector on an embedded board +is typically a TTL signal at 3.3 or 5 volts. .Sh FILES .Bl -tag -width ".Pa /dev/ttyu?.init" -compact .It Pa /dev/ttyu? Modified: stable/10/sys/dev/uart/uart_bus.h ============================================================================== --- stable/10/sys/dev/uart/uart_bus.h Sun Jan 17 18:07:32 2016 (r294228) +++ stable/10/sys/dev/uart/uart_bus.h Sun Jan 17 18:18:01 2016 (r294229) @@ -112,6 +112,7 @@ struct uart_softc { /* Pulse capturing support (PPS). */ struct pps_state sc_pps; int sc_pps_mode; + sbintime_t sc_pps_captime; /* Upper layer data. */ void *sc_softih; Modified: stable/10/sys/dev/uart/uart_core.c ============================================================================== --- stable/10/sys/dev/uart/uart_core.c Sun Jan 17 18:07:32 2016 (r294228) +++ stable/10/sys/dev/uart/uart_core.c Sun Jan 17 18:18:01 2016 (r294229) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "uart_if.h" @@ -65,47 +66,47 @@ static MALLOC_DEFINE(M_UART, "UART", "UA static int uart_poll_freq = UART_POLL_FREQ; TUNABLE_INT("debug.uart_poll_freq", &uart_poll_freq); -#define PPS_MODE_DISABLED 0 -#define PPS_MODE_CTS 1 -#define PPS_MODE_DCD 2 - static inline int -uart_pps_signal(int pps_mode) +uart_pps_mode_valid(int pps_mode) { + int opt; - switch(pps_mode) { - case PPS_MODE_CTS: - return (SER_CTS); - case PPS_MODE_DCD: - return (SER_DCD); - } - return (0); + switch(pps_mode & UART_PPS_SIGNAL_MASK) { + case UART_PPS_DISABLED: + case UART_PPS_CTS: + case UART_PPS_DCD: + break; + default: + return (false); + } + + opt = pps_mode & UART_PPS_OPTION_MASK; + if ((opt & ~(UART_PPS_INVERT_PULSE | UART_PPS_NARROW_PULSE)) != 0) + return (false); + + return (true); } -static inline int -uart_pps_mode_valid(int pps_mode) + +static void +uart_pps_print_mode(struct uart_softc *sc) { - switch(pps_mode) { - case PPS_MODE_DISABLED: - case PPS_MODE_CTS: - case PPS_MODE_DCD: - return (true); - } - return (false); -} - -static const char * -uart_pps_mode_name(int pps_mode) -{ - switch(pps_mode) { - case PPS_MODE_DISABLED: - return ("disabled"); - case PPS_MODE_CTS: - return ("CTS"); - case PPS_MODE_DCD: - return ("DCD"); - } - return ("invalid"); + device_printf(sc->sc_dev, "PPS capture mode: "); + switch(sc->sc_pps_mode) { + case UART_PPS_DISABLED: + printf("disabled"); + case UART_PPS_CTS: + printf("CTS"); + case UART_PPS_DCD: + printf("DCD"); + default: + printf("invalid"); + } + if (sc->sc_pps_mode & UART_PPS_INVERT_PULSE) + printf("-Inverted"); + if (sc->sc_pps_mode & UART_PPS_NARROW_PULSE) + printf("-NarrowPulse"); + printf("\n"); } static int @@ -126,6 +127,55 @@ uart_pps_mode_sysctl(SYSCTL_HANDLER_ARGS } static void +uart_pps_process(struct uart_softc *sc, int ser_sig) +{ + sbintime_t now; + int is_assert, pps_sig; + + /* Which signal is configured as PPS? Early out if none. */ + switch(sc->sc_pps_mode & UART_PPS_SIGNAL_MASK) { + case UART_PPS_CTS: + pps_sig = SER_CTS; + break; + case UART_PPS_DCD: + pps_sig = SER_DCD; + break; + default: + return; + } + + /* Early out if there is no change in the signal configured as PPS. */ + if ((ser_sig & SER_DELTA(pps_sig)) == 0) + return; + + /* + * In narrow-pulse mode we need to synthesize both capture and clear + * events from a single "delta occurred" indication from the uart + * hardware because the pulse width is too narrow to reliably detect + * both edges. However, when the pulse width is close to our interrupt + * processing latency we might intermittantly catch both edges. To + * guard against generating spurious events when that happens, we use a + * separate timer to ensure at least half a second elapses before we + * generate another event. + */ + pps_capture(&sc->sc_pps); + if (sc->sc_pps_mode & UART_PPS_NARROW_PULSE) { + now = getsbinuptime(); + if (now > sc->sc_pps_captime + 500 * SBT_1MS) { + sc->sc_pps_captime = now; + pps_event(&sc->sc_pps, PPS_CAPTUREASSERT); + pps_event(&sc->sc_pps, PPS_CAPTURECLEAR); + } + } else { + is_assert = ser_sig & pps_sig; + if (sc->sc_pps_mode & UART_PPS_INVERT_PULSE) + is_assert = !is_assert; + pps_event(&sc->sc_pps, is_assert ? PPS_CAPTUREASSERT : + PPS_CAPTURECLEAR); + } +} + +static void uart_pps_init(struct uart_softc *sc) { struct sysctl_ctx_list *ctx; @@ -142,23 +192,23 @@ uart_pps_init(struct uart_softc *sc) * for one specific device. */ #ifdef UART_PPS_ON_CTS - sc->sc_pps_mode = PPS_MODE_CTS; + sc->sc_pps_mode = UART_PPS_CTS; #else - sc->sc_pps_mode = PPS_MODE_DCD; + sc->sc_pps_mode = UART_PPS_DCD; #endif TUNABLE_INT_FETCH("hw.uart.pps_mode", &sc->sc_pps_mode); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "pps_mode", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, uart_pps_mode_sysctl, "I", - "pulse capturing mode - 0/1/2 - disabled/CTS/DCD"); + "pulse mode: 0/1/2=disabled/CTS/DCD; " + "add 0x10 to invert, 0x20 for narrow pulse"); if (!uart_pps_mode_valid(sc->sc_pps_mode)) { device_printf(sc->sc_dev, - "Invalid pps_mode %d configured; disabling PPS capture\n", + "Invalid pps_mode 0x%02x configured; disabling PPS capture\n", sc->sc_pps_mode); - sc->sc_pps_mode = PPS_MODE_DISABLED; + sc->sc_pps_mode = UART_PPS_DISABLED; } else if (bootverbose) { - device_printf(sc->sc_dev, "PPS capture mode %d (%s)\n", - sc->sc_pps_mode, uart_pps_mode_name(sc->sc_pps_mode)); + uart_pps_print_mode(sc); } sc->sc_pps.ppscap = PPS_CAPTUREBOTH; @@ -302,23 +352,16 @@ static __inline int uart_intr_sigchg(void *arg) { struct uart_softc *sc = arg; - int new, old, pps_sig, sig; + int new, old, sig; sig = UART_GETSIG(sc); /* - * Time pulse counting support. Note that both CTS and DCD are - * active-low signals. The status bit is high to indicate that - * the signal on the line is low, which corresponds to a PPS - * clear event. + * Time pulse counting support, invoked whenever the PPS parameters are + * currently set to capture either edge of the signal. */ if (sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) { - pps_sig = uart_pps_signal(sc->sc_pps_mode); - if (sig & SER_DELTA(pps_sig)) { - pps_capture(&sc->sc_pps); - pps_event(&sc->sc_pps, (sig & pps_sig) ? - PPS_CAPTURECLEAR : PPS_CAPTUREASSERT); - } + uart_pps_process(sc, sig); } /* Modified: stable/10/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_ns8250.c Sun Jan 17 18:07:32 2016 (r294228) +++ stable/10/sys/dev/uart/uart_dev_ns8250.c Sun Jan 17 18:18:01 2016 (r294229) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #include @@ -390,11 +391,40 @@ static struct ofw_compat_data compat_dat UART_FDT_CLASS_AND_DEVICE(compat_data); #endif -#define SIGCHG(c, i, s, d) \ - if (c) { \ - i |= (i & s) ? s : s | d; \ - } else { \ - i = (i & s) ? (i & ~s) | d : i; \ +/* Use token-pasting to form SER_ and MSR_ named constants. */ +#define SER(sig) SER_##sig +#define SERD(sig) SER_D##sig +#define MSR(sig) MSR_##sig +#define MSRD(sig) MSR_D##sig + +/* + * Detect signal changes using software delta detection. The previous state of + * the signals is in 'var' the new hardware state is in 'msr', and 'sig' is the + * short name (DCD, CTS, etc) of the signal bit being processed; 'var' gets the + * new state of both the signal and the delta bits. + */ +#define SIGCHGSW(var, msr, sig) \ + if ((msr) & MSR(sig)) { \ + if ((var & SER(sig)) == 0) \ + var |= SERD(sig) | SER(sig); \ + } else { \ + if ((var & SER(sig)) != 0) \ + var = SERD(sig) | (var & ~SER(sig)); \ + } + +/* + * Detect signal changes using the hardware msr delta bits. This is currently + * used only when PPS timing information is being captured using the "narrow + * pulse" option. With a narrow PPS pulse the signal may not still be asserted + * by time the interrupt handler is invoked. The hardware will latch the fact + * that it changed in the delta bits. + */ +#define SIGCHGHW(var, msr, sig) \ + if ((msr) & MSRD(sig)) { \ + if (((msr) & MSR(sig)) != 0) \ + var |= SERD(sig) | SER(sig); \ + else \ + var = SERD(sig) | (var & ~SER(sig)); \ } int @@ -521,21 +551,37 @@ ns8250_bus_flush(struct uart_softc *sc, int ns8250_bus_getsig(struct uart_softc *sc) { - uint32_t new, old, sig; + uint32_t old, sig; uint8_t msr; + /* + * The delta bits are reputed to be broken on some hardware, so use + * software delta detection by default. Use the hardware delta bits + * when capturing PPS pulses which are too narrow for software detection + * to see the edges. Hardware delta for RI doesn't work like the + * others, so always use software for it. Other threads may be changing + * other (non-MSR) bits in sc_hwsig, so loop until it can succesfully + * update without other changes happening. Note that the SIGCHGxx() + * macros carefully preserve the delta bits when we have to loop several + * times and a signal transitions between iterations. + */ do { old = sc->sc_hwsig; sig = old; uart_lock(sc->sc_hwmtx); msr = uart_getreg(&sc->sc_bas, REG_MSR); uart_unlock(sc->sc_hwmtx); - SIGCHG(msr & MSR_DSR, sig, SER_DSR, SER_DDSR); - SIGCHG(msr & MSR_CTS, sig, SER_CTS, SER_DCTS); - SIGCHG(msr & MSR_DCD, sig, SER_DCD, SER_DDCD); - SIGCHG(msr & MSR_RI, sig, SER_RI, SER_DRI); - new = sig & ~SER_MASK_DELTA; - } while (!atomic_cmpset_32(&sc->sc_hwsig, old, new)); + if (sc->sc_pps_mode & UART_PPS_NARROW_PULSE) { + SIGCHGHW(sig, msr, DSR); + SIGCHGHW(sig, msr, CTS); + SIGCHGHW(sig, msr, DCD); + } else { + SIGCHGSW(sig, msr, DSR); + SIGCHGSW(sig, msr, CTS); + SIGCHGSW(sig, msr, DCD); + } + SIGCHGSW(sig, msr, RI); + } while (!atomic_cmpset_32(&sc->sc_hwsig, old, sig & ~SER_MASK_DELTA)); return (sig); } @@ -889,12 +935,10 @@ ns8250_bus_setsig(struct uart_softc *sc, old = sc->sc_hwsig; new = old; if (sig & SER_DDTR) { - SIGCHG(sig & SER_DTR, new, SER_DTR, - SER_DDTR); + new = (new & ~SER_DTR) | (sig & (SER_DTR | SER_DDTR)); } if (sig & SER_DRTS) { - SIGCHG(sig & SER_RTS, new, SER_RTS, - SER_DRTS); + new = (new & ~SER_RTS) | (sig & (SER_RTS | SER_DRTS)); } } while (!atomic_cmpset_32(&sc->sc_hwsig, old, new)); uart_lock(sc->sc_hwmtx); Copied: stable/10/sys/dev/uart/uart_ppstypes.h (from r293781, head/sys/dev/uart/uart_ppstypes.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/uart/uart_ppstypes.h Sun Jan 17 18:18:01 2016 (r294229, copy of r293781, head/sys/dev/uart/uart_ppstypes.h) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2015 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_UART_PPSTYPES_H_ +#define _DEV_UART_PPSTYPES_H_ + +/* + * These constants are shared by several drivers including uart and usb_serial. + */ + +#define UART_PPS_SIGNAL_MASK 0x0f +#define UART_PPS_OPTION_MASK 0xf0 + +#define UART_PPS_DISABLED 0x00 +#define UART_PPS_CTS 0x01 +#define UART_PPS_DCD 0x02 + +#define UART_PPS_INVERT_PULSE 0x10 +#define UART_PPS_NARROW_PULSE 0x20 + +#endif /* _DEV_UART_PPSTYPES_H_ */ From owner-svn-src-stable@freebsd.org Sun Jan 17 18:35:47 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9E92A851AA; Sun, 17 Jan 2016 18:35:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76E0B11D2; Sun, 17 Jan 2016 18:35:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HIZkGb023467; Sun, 17 Jan 2016 18:35:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HIZkxu023466; Sun, 17 Jan 2016 18:35:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171835.u0HIZkxu023466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 18:35:46 +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: r294230 - stable/10/usr.bin/sockstat 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 18:35:47 -0000 Author: tuexen Date: Sun Jan 17 18:35:46 2016 New Revision: 294230 URL: https://svnweb.freebsd.org/changeset/base/294230 Log: MFC r287179: Remove a variable which is set but never used. Modified: stable/10/usr.bin/sockstat/sockstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sockstat/sockstat.c ============================================================================== --- stable/10/usr.bin/sockstat/sockstat.c Sun Jan 17 18:18:01 2016 (r294229) +++ stable/10/usr.bin/sockstat/sockstat.c Sun Jan 17 18:35:46 2016 (r294230) @@ -542,9 +542,9 @@ gather_inet(int proto) const char *varname, *protoname; size_t len, bufsize; void *buf; - int hash, retry, state, vflag; + int hash, retry, vflag; - state = vflag = 0; + vflag = 0; if (opt_4) vflag |= INP_IPV4; if (opt_6) @@ -609,7 +609,6 @@ gather_inet(int proto) inp = &xtp->xt_inp; so = &xtp->xt_socket; protoname = xtp->xt_tp.t_flags & TF_TOE ? "toe" : "tcp"; - state = xtp->xt_tp.t_state; break; case IPPROTO_UDP: case IPPROTO_DIVERT: From owner-svn-src-stable@freebsd.org Sun Jan 17 18:37:38 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5884DA8524B; Sun, 17 Jan 2016 18:37:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34C351372; Sun, 17 Jan 2016 18:37:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HIbbPA023630; Sun, 17 Jan 2016 18:37:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HIbbAD023628; Sun, 17 Jan 2016 18:37:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171837.u0HIbbAD023628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 18:37:37 +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: r294231 - stable/10/usr.bin/sockstat 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 18:37:38 -0000 Author: tuexen Date: Sun Jan 17 18:37:36 2016 New Revision: 294231 URL: https://svnweb.freebsd.org/changeset/base/294231 Log: MFC r287182: Add SCTP support. Modified: stable/10/usr.bin/sockstat/sockstat.1 stable/10/usr.bin/sockstat/sockstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sockstat/sockstat.1 ============================================================================== --- stable/10/usr.bin/sockstat/sockstat.1 Sun Jan 17 18:35:46 2016 (r294230) +++ stable/10/usr.bin/sockstat/sockstat.1 Sun Jan 17 18:37:36 2016 (r294231) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2015 +.Dd August 27, 2015 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -85,7 +85,7 @@ as they are defined in .Xr protocols 5 . .It Fl s Display the protocol state, if applicable. -This is currently only implemented for TCP. +This is currently only implemented for SCTP and TCP. .It Fl u Show .Dv AF_LOCAL Modified: stable/10/usr.bin/sockstat/sockstat.c ============================================================================== --- stable/10/usr.bin/sockstat/sockstat.c Sun Jan 17 18:35:46 2016 (r294230) +++ stable/10/usr.bin/sockstat/sockstat.c Sun Jan 17 18:37:36 2016 (r294231) @@ -332,6 +332,12 @@ gather_sctp(void) sock->socket = xinpcb->socket; sock->proto = IPPROTO_SCTP; sock->protoname = "sctp"; + if (xinpcb->flags & SCTP_PCB_FLAGS_UNBOUND) + sock->state = SCTP_CLOSED; + else if (xinpcb->maxqlen == 0) + sock->state = SCTP_BOUND; + else + sock->state = SCTP_LISTEN; if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) { sock->family = AF_INET6; sock->vflag = INP_IPV6; @@ -421,6 +427,7 @@ gather_sctp(void) sock->socket = xinpcb->socket; sock->proto = IPPROTO_SCTP; sock->protoname = "sctp"; + sock->state = (int)xstcb->state; if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) { sock->family = AF_INET6; sock->vflag = INP_IPV6; @@ -906,6 +913,46 @@ check_ports(struct sock *s) return (0); } +static const char * +sctp_state(int state) +{ + switch (state) { + case SCTP_CLOSED: + return "CLOSED"; + break; + case SCTP_BOUND: + return "BOUND"; + break; + case SCTP_LISTEN: + return "LISTEN"; + break; + case SCTP_COOKIE_WAIT: + return "COOKIE_WAIT"; + break; + case SCTP_COOKIE_ECHOED: + return "COOKIE_ECHOED"; + break; + case SCTP_ESTABLISHED: + return "ESTABLISHED"; + break; + case SCTP_SHUTDOWN_SENT: + return "SHUTDOWN_SENT"; + break; + case SCTP_SHUTDOWN_RECEIVED: + return "SHUTDOWN_RECEIVED"; + break; + case SCTP_SHUTDOWN_ACK_SENT: + return "SHUTDOWN_ACK_SENT"; + break; + case SCTP_SHUTDOWN_PENDING: + return "SHUTDOWN_PENDING"; + break; + default: + return "UNKNOWN"; + break; + } +} + static void displaysock(struct sock *s, int pos) { @@ -975,13 +1022,22 @@ displaysock(struct sock *s, int pos) default: abort(); } - if (first && opt_s && s->proto == IPPROTO_TCP) { + if (first && opt_s && + (s->proto == IPPROTO_SCTP || s->proto == IPPROTO_TCP)) { while (pos < 80) pos += xprintf(" "); - if (s->state >= 0 && s->state < TCP_NSTATES) - pos += xprintf("%s", tcpstates[s->state]); - else - pos += xprintf("?"); + switch (s->proto) { + case IPPROTO_SCTP: + pos += xprintf("%s", sctp_state(s->state)); + break; + case IPPROTO_TCP: + if (s->state >= 0 && s->state < TCP_NSTATES) + pos += + xprintf("%s", tcpstates[s->state]); + else + pos += xprintf("?"); + break; + } } if (laddr != NULL) laddr = laddr->next; From owner-svn-src-stable@freebsd.org Sun Jan 17 18:39:02 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71E6BA8530A; Sun, 17 Jan 2016 18:39:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 451AA152A; Sun, 17 Jan 2016 18:39:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HId1G9023767; Sun, 17 Jan 2016 18:39:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0HId1nB023766; Sun, 17 Jan 2016 18:39:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601171839.u0HId1nB023766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Jan 2016 18:39: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: r294232 - stable/10/usr.bin/sockstat 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 18:39:02 -0000 Author: tuexen Date: Sun Jan 17 18:39:01 2016 New Revision: 294232 URL: https://svnweb.freebsd.org/changeset/base/294232 Log: MFC r287281: Report CLOSED as state for bound sockets for consistency with netstat and the way TCP is handled. Modified: stable/10/usr.bin/sockstat/sockstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sockstat/sockstat.c ============================================================================== --- stable/10/usr.bin/sockstat/sockstat.c Sun Jan 17 18:37:36 2016 (r294231) +++ stable/10/usr.bin/sockstat/sockstat.c Sun Jan 17 18:39:01 2016 (r294232) @@ -332,10 +332,8 @@ gather_sctp(void) sock->socket = xinpcb->socket; sock->proto = IPPROTO_SCTP; sock->protoname = "sctp"; - if (xinpcb->flags & SCTP_PCB_FLAGS_UNBOUND) + if (xinpcb->maxqlen == 0) sock->state = SCTP_CLOSED; - else if (xinpcb->maxqlen == 0) - sock->state = SCTP_BOUND; else sock->state = SCTP_LISTEN; if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) { From owner-svn-src-stable@freebsd.org Mon Jan 18 03:47:47 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE4F6A86611; Mon, 18 Jan 2016 03:47:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADBFD1B39; Mon, 18 Jan 2016 03:47:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0I3lkX8093809; Mon, 18 Jan 2016 03:47:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0I3lksD093808; Mon, 18 Jan 2016 03:47:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601180347.u0I3lksD093808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 18 Jan 2016 03:47:46 +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: r294239 - stable/10/lib/libc/rpc 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 03:47:48 -0000 Author: ngie Date: Mon Jan 18 03:47:46 2016 New Revision: 294239 URL: https://svnweb.freebsd.org/changeset/base/294239 Log: MFC r293704: Fix theoretical leak of netconfig(3) resources in svcunix_create(..) In the event that the getconfig(3) call in svcunix_create is partly successful, some of the netconfig(3) resources allocated might be leaked if the call returns NULL as endnetconfig(3) wasn't called explicitly in that case. Ensure that the resources are fully cleaned up by going to the `done` label, which will call endnetconfig(3) for us. Submitted by: Miles Ohlrich Modified: stable/10/lib/libc/rpc/rpc_soc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/rpc_soc.c ============================================================================== --- stable/10/lib/libc/rpc/rpc_soc.c Mon Jan 18 00:07:04 2016 (r294238) +++ stable/10/lib/libc/rpc/rpc_soc.c Mon Jan 18 03:47:46 2016 (r294239) @@ -525,7 +525,7 @@ svcunix_create(sock, sendsize, recvsize, break; } if (nconf == NULL) - return(xprt); + goto done; if ((sock = __rpc_nconf2fd(nconf)) < 0) goto done; From owner-svn-src-stable@freebsd.org Mon Jan 18 03:49:58 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7D9DA866EB; Mon, 18 Jan 2016 03:49:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 895801CDF; Mon, 18 Jan 2016 03:49:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0I3nvB1093961; Mon, 18 Jan 2016 03:49:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0I3nvbF093960; Mon, 18 Jan 2016 03:49:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601180349.u0I3nvbF093960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 18 Jan 2016 03:49:57 +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: r294240 - stable/10/lib/libc/rpc 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 03:49:58 -0000 Author: ngie Date: Mon Jan 18 03:49:57 2016 New Revision: 294240 URL: https://svnweb.freebsd.org/changeset/base/294240 Log: MFC r293705: Similar to r293704, fix theoretical leak of netconfig(3) resources in __rpcbind_is_up(..) if getnetconfig(3) is partly successful in allocating resources, but not completely successful by moving the endnetconfig(3) call up before we return from the function if nconf == NULL. Submitted by: Miles Ohlrich Modified: stable/10/lib/libc/rpc/rpcb_clnt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- stable/10/lib/libc/rpc/rpcb_clnt.c Mon Jan 18 03:47:46 2016 (r294239) +++ stable/10/lib/libc/rpc/rpcb_clnt.c Mon Jan 18 03:49:57 2016 (r294240) @@ -675,11 +675,11 @@ __rpcbind_is_up() strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0) break; } + endnetconfig(localhandle); + if (nconf == NULL) return (FALSE); - endnetconfig(localhandle); - memset(&sun, 0, sizeof sun); sock = _socket(AF_LOCAL, SOCK_STREAM, 0); if (sock < 0) From owner-svn-src-stable@freebsd.org Mon Jan 18 03:51:39 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D686AA86863; Mon, 18 Jan 2016 03:51:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3B9E1EEB; Mon, 18 Jan 2016 03:51:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0I3pciP096619; Mon, 18 Jan 2016 03:51:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0I3pcKn096618; Mon, 18 Jan 2016 03:51:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601180351.u0I3pcKn096618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 18 Jan 2016 03:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294241 - stable/9/lib/libc/rpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 03:51:39 -0000 Author: ngie Date: Mon Jan 18 03:51:38 2016 New Revision: 294241 URL: https://svnweb.freebsd.org/changeset/base/294241 Log: MFstable/10 r294239: MFC r293704: Fix theoretical leak of netconfig(3) resources in svcunix_create(..) In the event that the getconfig(3) call in svcunix_create is partly successful, some of the netconfig(3) resources allocated might be leaked if the call returns NULL as endnetconfig(3) wasn't called explicitly in that case. Ensure that the resources are fully cleaned up by going to the `done` label, which will call endnetconfig(3) for us. Submitted by: Miles Ohlrich Modified: stable/9/lib/libc/rpc/rpc_soc.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/rpc/rpc_soc.c ============================================================================== --- stable/9/lib/libc/rpc/rpc_soc.c Mon Jan 18 03:49:57 2016 (r294240) +++ stable/9/lib/libc/rpc/rpc_soc.c Mon Jan 18 03:51:38 2016 (r294241) @@ -525,7 +525,7 @@ svcunix_create(sock, sendsize, recvsize, break; } if (nconf == NULL) - return(xprt); + goto done; if ((sock = __rpc_nconf2fd(nconf)) < 0) goto done; From owner-svn-src-stable@freebsd.org Mon Jan 18 03:52:45 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B75EA868E9; Mon, 18 Jan 2016 03:52:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48D4711BF; Mon, 18 Jan 2016 03:52:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0I3qisZ096717; Mon, 18 Jan 2016 03:52:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0I3qieW096716; Mon, 18 Jan 2016 03:52:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601180352.u0I3qieW096716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 18 Jan 2016 03:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294242 - stable/9/lib/libc/rpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 03:52:45 -0000 Author: ngie Date: Mon Jan 18 03:52:44 2016 New Revision: 294242 URL: https://svnweb.freebsd.org/changeset/base/294242 Log: MFstable/10 r294240: MFC r293705: Similar to r293704, fix theoretical leak of netconfig(3) resources in __rpcbind_is_up(..) if getnetconfig(3) is partly successful in allocating resources, but not completely successful by moving the endnetconfig(3) call up before we return from the function if nconf == NULL. Submitted by: Miles Ohlrich Modified: stable/9/lib/libc/rpc/rpcb_clnt.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- stable/9/lib/libc/rpc/rpcb_clnt.c Mon Jan 18 03:51:38 2016 (r294241) +++ stable/9/lib/libc/rpc/rpcb_clnt.c Mon Jan 18 03:52:44 2016 (r294242) @@ -675,11 +675,11 @@ __rpcbind_is_up() strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0) break; } + endnetconfig(localhandle); + if (nconf == NULL) return (FALSE); - endnetconfig(localhandle); - memset(&sun, 0, sizeof sun); sock = _socket(AF_LOCAL, SOCK_STREAM, 0); if (sock < 0) From owner-svn-src-stable@freebsd.org Mon Jan 18 03:55:41 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9984AA86A06; Mon, 18 Jan 2016 03:55:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63E9713DF; Mon, 18 Jan 2016 03:55:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0I3teA8096896; Mon, 18 Jan 2016 03:55:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0I3teA2096891; Mon, 18 Jan 2016 03:55:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601180355.u0I3teA2096891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 18 Jan 2016 03:55:40 +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: r294243 - stable/10/lib/msun/tests 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 03:55:41 -0000 Author: ngie Date: Mon Jan 18 03:55:40 2016 New Revision: 294243 URL: https://svnweb.freebsd.org/changeset/base/294243 Log: MFC r292497: Integrate the remaining tools/regression/lib/msun testcases into the FreeBSD test suite under lib/msun/tests Added: stable/10/lib/msun/tests/ctrig_test.c - copied unchanged from r292497, head/lib/msun/tests/ctrig_test.c stable/10/lib/msun/tests/exponential_test.c - copied unchanged from r292497, head/lib/msun/tests/exponential_test.c stable/10/lib/msun/tests/fma_test.c - copied unchanged from r292497, head/lib/msun/tests/fma_test.c stable/10/lib/msun/tests/invtrig_test.c - copied unchanged from r292497, head/lib/msun/tests/invtrig_test.c stable/10/lib/msun/tests/lround_test.c - copied unchanged from r292497, head/lib/msun/tests/lround_test.c stable/10/lib/msun/tests/lround_test.t - copied unchanged from r292497, head/lib/msun/tests/lround_test.t stable/10/lib/msun/tests/test-utils.h - copied unchanged from r292497, head/lib/msun/tests/test-utils.h Modified: stable/10/lib/msun/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/msun/tests/Makefile ============================================================================== --- stable/10/lib/msun/tests/Makefile Mon Jan 18 03:52:44 2016 (r294242) +++ stable/10/lib/msun/tests/Makefile Mon Jan 18 03:55:40 2016 (r294243) @@ -39,12 +39,19 @@ NETBSD_ATF_TESTS_C+= tanh_test TAP_TESTS_C+= cexp_test TAP_TESTS_C+= conj_test TAP_TESTS_C+= csqrt_test +TAP_TESTS_C+= ctrig_test +TAP_TESTS_C+= exponential_test TAP_TESTS_C+= fenv_test +TAP_TESTS_C+= fma_test TAP_TESTS_C+= fmaxmin_test TAP_TESTS_C+= ilogb_test +TAP_TESTS_C+= invtrig_test TAP_TESTS_C+= invctrig_test TAP_TESTS_C+= logarithm_test TAP_TESTS_C+= lrint_test +# XXX: the testcase crashes on all platforms, but only on head +# (bug 205451) +#TAP_TESTS_C+= lround_test TAP_TESTS_C+= nan_test TAP_TESTS_C+= nearbyint_test TAP_TESTS_C+= next_test @@ -53,7 +60,6 @@ TAP_TESTS_C+= trig_test .for t in ${TAP_TESTS_C} CFLAGS.$t+= -O0 -CFLAGS.$t+= -I${SRCTOP}/tools/regression/lib/msun .endfor CSTD= c99 Copied: stable/10/lib/msun/tests/ctrig_test.c (from r292497, head/lib/msun/tests/ctrig_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/tests/ctrig_test.c Mon Jan 18 03:55:40 2016 (r294243, copy of r292497, head/lib/msun/tests/ctrig_test.c) @@ -0,0 +1,482 @@ +/*- + * Copyright (c) 2008-2011 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Tests for csin[h](), ccos[h](), and ctan[h](). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include "test-utils.h" + +#pragma STDC FENV_ACCESS ON +#pragma STDC CX_LIMITED_RANGE OFF + +/* + * Test that a function returns the correct value and sets the + * exception flags correctly. The exceptmask specifies which + * exceptions we should check. We need to be lenient for several + * reasons, but mainly because on some architectures it's impossible + * to raise FE_OVERFLOW without raising FE_INEXACT. + * + * These are macros instead of functions so that assert provides more + * meaningful error messages. + * + * XXX The volatile here is to avoid gcc's bogus constant folding and work + * around the lack of support for the FENV_ACCESS pragma. + */ +#define test_p(func, z, result, exceptmask, excepts, checksign) do { \ + volatile long double complex _d = z; \ + debug(" testing %s(%Lg + %Lg I) == %Lg + %Lg I\n", #func, \ + creall(_d), cimagl(_d), creall(result), cimagl(result)); \ + assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ + assert(cfpequal_cs((func)(_d), (result), (checksign))); \ + assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ +} while (0) + +/* + * Test within a given tolerance. The tolerance indicates relative error + * in ulps. If result is 0, however, it measures absolute error in units + * of _EPSILON. + */ +#define test_p_tol(func, z, result, tol) do { \ + volatile long double complex _d = z; \ + debug(" testing %s(%Lg + %Lg I) ~= %Lg + %Lg I\n", #func, \ + creall(_d), cimagl(_d), creall(result), cimagl(result)); \ + assert(cfpequal_tol((func)(_d), (result), (tol), FPE_ABS_ZERO)); \ +} while (0) + +/* These wrappers apply the identities f(conj(z)) = conj(f(z)). */ +#define test(func, z, result, exceptmask, excepts, checksign) do { \ + test_p(func, z, result, exceptmask, excepts, checksign); \ + test_p(func, conjl(z), conjl(result), exceptmask, excepts, checksign); \ +} while (0) +#define test_tol(func, z, result, tol) do { \ + test_p_tol(func, z, result, tol); \ + test_p_tol(func, conjl(z), conjl(result), tol); \ +} while (0) +#define test_odd_tol(func, z, result, tol) do { \ + test_tol(func, z, result, tol); \ + test_tol(func, -(z), -(result), tol); \ +} while (0) +#define test_even_tol(func, z, result, tol) do { \ + test_tol(func, z, result, tol); \ + test_tol(func, -(z), result, tol); \ +} while (0) + +/* Test the given function in all precisions. */ +#define testall(func, x, result, exceptmask, excepts, checksign) do { \ + test(func, x, result, exceptmask, excepts, checksign); \ + test(func##f, x, result, exceptmask, excepts, checksign); \ +} while (0) +#define testall_odd(func, x, result, exceptmask, excepts, checksign) do { \ + testall(func, x, result, exceptmask, excepts, checksign); \ + testall(func, -x, -result, exceptmask, excepts, checksign); \ +} while (0) +#define testall_even(func, x, result, exceptmask, excepts, checksign) do { \ + testall(func, x, result, exceptmask, excepts, checksign); \ + testall(func, -x, result, exceptmask, excepts, checksign); \ +} while (0) + +/* + * Test the given function in all precisions, within a given tolerance. + * The tolerance is specified in ulps. + */ +#define testall_tol(func, x, result, tol) do { \ + test_tol(func, x, result, tol * DBL_ULP()); \ + test_tol(func##f, x, result, tol * FLT_ULP()); \ +} while (0) +#define testall_odd_tol(func, x, result, tol) do { \ + test_odd_tol(func, x, result, tol * DBL_ULP()); \ + test_odd_tol(func##f, x, result, tol * FLT_ULP()); \ +} while (0) +#define testall_even_tol(func, x, result, tol) do { \ + test_even_tol(func, x, result, tol * DBL_ULP()); \ + test_even_tol(func##f, x, result, tol * FLT_ULP()); \ +} while (0) + + +/* Tests for 0 */ +void +test_zero(void) +{ + long double complex zero = CMPLXL(0.0, 0.0); + + /* csinh(0) = ctanh(0) = 0; ccosh(0) = 1 (no exceptions raised) */ + testall_odd(csinh, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); + testall_odd(csin, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); + testall_even(ccosh, zero, 1.0, ALL_STD_EXCEPT, 0, CS_BOTH); + testall_even(ccos, zero, CMPLXL(1.0, -0.0), ALL_STD_EXCEPT, 0, CS_BOTH); + testall_odd(ctanh, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); + testall_odd(ctan, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); +} + +/* + * Tests for NaN inputs. + */ +void +test_nan() +{ + long double complex nan_nan = CMPLXL(NAN, NAN); + long double complex z; + + /* + * IN CSINH CCOSH CTANH + * NaN,NaN NaN,NaN NaN,NaN NaN,NaN + * finite,NaN NaN,NaN [inval] NaN,NaN [inval] NaN,NaN [inval] + * NaN,finite NaN,NaN [inval] NaN,NaN [inval] NaN,NaN [inval] + * NaN,Inf NaN,NaN [inval] NaN,NaN [inval] NaN,NaN [inval] + * Inf,NaN +-Inf,NaN Inf,NaN 1,+-0 + * 0,NaN +-0,NaN NaN,+-0 NaN,NaN [inval] + * NaN,0 NaN,0 NaN,+-0 NaN,0 + */ + z = nan_nan; + testall_odd(csinh, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall_even(ccosh, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall_odd(ctanh, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall_odd(csin, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall_even(ccos, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall_odd(ctan, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + + z = CMPLXL(42, NAN); + testall_odd(csinh, z, nan_nan, OPT_INVALID, 0, 0); + testall_even(ccosh, z, nan_nan, OPT_INVALID, 0, 0); + /* XXX We allow a spurious inexact exception here. */ + testall_odd(ctanh, z, nan_nan, OPT_INVALID & ~FE_INEXACT, 0, 0); + testall_odd(csin, z, nan_nan, OPT_INVALID, 0, 0); + testall_even(ccos, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(ctan, z, nan_nan, OPT_INVALID, 0, 0); + + z = CMPLXL(NAN, 42); + testall_odd(csinh, z, nan_nan, OPT_INVALID, 0, 0); + testall_even(ccosh, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(ctanh, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(csin, z, nan_nan, OPT_INVALID, 0, 0); + testall_even(ccos, z, nan_nan, OPT_INVALID, 0, 0); + /* XXX We allow a spurious inexact exception here. */ + testall_odd(ctan, z, nan_nan, OPT_INVALID & ~FE_INEXACT, 0, 0); + + z = CMPLXL(NAN, INFINITY); + testall_odd(csinh, z, nan_nan, OPT_INVALID, 0, 0); + testall_even(ccosh, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(ctanh, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(csin, z, CMPLXL(NAN, INFINITY), ALL_STD_EXCEPT, 0, 0); + testall_even(ccos, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, + CS_IMAG); + testall_odd(ctan, z, CMPLXL(0, 1), ALL_STD_EXCEPT, 0, CS_IMAG); + + z = CMPLXL(INFINITY, NAN); + testall_odd(csinh, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, 0); + testall_even(ccosh, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, + CS_REAL); + testall_odd(ctanh, z, CMPLXL(1, 0), ALL_STD_EXCEPT, 0, CS_REAL); + testall_odd(csin, z, nan_nan, OPT_INVALID, 0, 0); + testall_even(ccos, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(ctan, z, nan_nan, OPT_INVALID, 0, 0); + + z = CMPLXL(0, NAN); + testall_odd(csinh, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, 0, 0); + testall_even(ccosh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0); + testall_odd(ctanh, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(csin, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, 0, CS_REAL); + testall_even(ccos, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0); + testall_odd(ctan, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, 0, CS_REAL); + + z = CMPLXL(NAN, 0); + testall_odd(csinh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, CS_IMAG); + testall_even(ccosh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0); + testall_odd(ctanh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, CS_IMAG); + testall_odd(csin, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0); + testall_even(ccos, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0); + testall_odd(ctan, z, nan_nan, OPT_INVALID, 0, 0); +} + +void +test_inf(void) +{ + static const long double finites[] = { + 0, M_PI / 4, 3 * M_PI / 4, 5 * M_PI / 4, + }; + long double complex z, c, s; + int i; + + /* + * IN CSINH CCOSH CTANH + * Inf,Inf +-Inf,NaN inval +-Inf,NaN inval 1,+-0 + * Inf,finite Inf cis(finite) Inf cis(finite) 1,0 sin(2 finite) + * 0,Inf +-0,NaN inval NaN,+-0 inval NaN,NaN inval + * finite,Inf NaN,NaN inval NaN,NaN inval NaN,NaN inval + */ + z = CMPLXL(INFINITY, INFINITY); + testall_odd(csinh, z, CMPLXL(INFINITY, NAN), + ALL_STD_EXCEPT, FE_INVALID, 0); + testall_even(ccosh, z, CMPLXL(INFINITY, NAN), + ALL_STD_EXCEPT, FE_INVALID, 0); + testall_odd(ctanh, z, CMPLXL(1, 0), ALL_STD_EXCEPT, 0, CS_REAL); + testall_odd(csin, z, CMPLXL(NAN, INFINITY), + ALL_STD_EXCEPT, FE_INVALID, 0); + testall_even(ccos, z, CMPLXL(INFINITY, NAN), + ALL_STD_EXCEPT, FE_INVALID, 0); + testall_odd(ctan, z, CMPLXL(0, 1), ALL_STD_EXCEPT, 0, CS_REAL); + + /* XXX We allow spurious inexact exceptions here (hard to avoid). */ + for (i = 0; i < sizeof(finites) / sizeof(finites[0]); i++) { + z = CMPLXL(INFINITY, finites[i]); + c = INFINITY * cosl(finites[i]); + s = finites[i] == 0 ? finites[i] : INFINITY * sinl(finites[i]); + testall_odd(csinh, z, CMPLXL(c, s), OPT_INEXACT, 0, CS_BOTH); + testall_even(ccosh, z, CMPLXL(c, s), OPT_INEXACT, 0, CS_BOTH); + testall_odd(ctanh, z, CMPLXL(1, 0 * sin(finites[i] * 2)), + OPT_INEXACT, 0, CS_BOTH); + z = CMPLXL(finites[i], INFINITY); + testall_odd(csin, z, CMPLXL(s, c), OPT_INEXACT, 0, CS_BOTH); + testall_even(ccos, z, CMPLXL(c, -s), OPT_INEXACT, 0, CS_BOTH); + testall_odd(ctan, z, CMPLXL(0 * sin(finites[i] * 2), 1), + OPT_INEXACT, 0, CS_BOTH); + } + + z = CMPLXL(0, INFINITY); + testall_odd(csinh, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + testall_even(ccosh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, FE_INVALID, 0); + testall_odd(ctanh, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + z = CMPLXL(INFINITY, 0); + testall_odd(csin, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, FE_INVALID, 0); + testall_even(ccos, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, FE_INVALID, 0); + testall_odd(ctan, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + + z = CMPLXL(42, INFINITY); + testall_odd(csinh, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + testall_even(ccosh, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + /* XXX We allow a spurious inexact exception here. */ + testall_odd(ctanh, z, CMPLXL(NAN, NAN), OPT_INEXACT, FE_INVALID, 0); + z = CMPLXL(INFINITY, 42); + testall_odd(csin, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + testall_even(ccos, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + /* XXX We allow a spurious inexact exception here. */ + testall_odd(ctan, z, CMPLXL(NAN, NAN), OPT_INEXACT, FE_INVALID, 0); +} + +/* Tests along the real and imaginary axes. */ +void +test_axes(void) +{ + static const long double nums[] = { + M_PI / 4, M_PI / 2, 3 * M_PI / 4, + 5 * M_PI / 4, 3 * M_PI / 2, 7 * M_PI / 4, + }; + long double complex z; + int i; + + for (i = 0; i < sizeof(nums) / sizeof(nums[0]); i++) { + /* Real axis */ + z = CMPLXL(nums[i], 0.0); + test_odd_tol(csinh, z, CMPLXL(sinh(nums[i]), 0), DBL_ULP()); + test_even_tol(ccosh, z, CMPLXL(cosh(nums[i]), 0), DBL_ULP()); + test_odd_tol(ctanh, z, CMPLXL(tanh(nums[i]), 0), DBL_ULP()); + test_odd_tol(csin, z, CMPLXL(sin(nums[i]), + copysign(0, cos(nums[i]))), DBL_ULP()); + test_even_tol(ccos, z, CMPLXL(cos(nums[i]), + -copysign(0, sin(nums[i]))), DBL_ULP()); + test_odd_tol(ctan, z, CMPLXL(tan(nums[i]), 0), DBL_ULP()); + + test_odd_tol(csinhf, z, CMPLXL(sinhf(nums[i]), 0), FLT_ULP()); + test_even_tol(ccoshf, z, CMPLXL(coshf(nums[i]), 0), FLT_ULP()); + printf("%a %a\n", creal(z), cimag(z)); + printf("%a %a\n", creal(ctanhf(z)), cimag(ctanhf(z))); + printf("%a\n", nextafterf(tanhf(nums[i]), INFINITY)); + test_odd_tol(ctanhf, z, CMPLXL(tanhf(nums[i]), 0), + 1.3 * FLT_ULP()); + test_odd_tol(csinf, z, CMPLXL(sinf(nums[i]), + copysign(0, cosf(nums[i]))), FLT_ULP()); + test_even_tol(ccosf, z, CMPLXL(cosf(nums[i]), + -copysign(0, sinf(nums[i]))), 2 * FLT_ULP()); + test_odd_tol(ctanf, z, CMPLXL(tanf(nums[i]), 0), FLT_ULP()); + + /* Imaginary axis */ + z = CMPLXL(0.0, nums[i]); + test_odd_tol(csinh, z, CMPLXL(copysign(0, cos(nums[i])), + sin(nums[i])), DBL_ULP()); + test_even_tol(ccosh, z, CMPLXL(cos(nums[i]), + copysign(0, sin(nums[i]))), DBL_ULP()); + test_odd_tol(ctanh, z, CMPLXL(0, tan(nums[i])), DBL_ULP()); + test_odd_tol(csin, z, CMPLXL(0, sinh(nums[i])), DBL_ULP()); + test_even_tol(ccos, z, CMPLXL(cosh(nums[i]), -0.0), DBL_ULP()); + test_odd_tol(ctan, z, CMPLXL(0, tanh(nums[i])), DBL_ULP()); + + test_odd_tol(csinhf, z, CMPLXL(copysign(0, cosf(nums[i])), + sinf(nums[i])), FLT_ULP()); + test_even_tol(ccoshf, z, CMPLXL(cosf(nums[i]), + copysign(0, sinf(nums[i]))), FLT_ULP()); + test_odd_tol(ctanhf, z, CMPLXL(0, tanf(nums[i])), FLT_ULP()); + test_odd_tol(csinf, z, CMPLXL(0, sinhf(nums[i])), FLT_ULP()); + test_even_tol(ccosf, z, CMPLXL(coshf(nums[i]), -0.0), + FLT_ULP()); + test_odd_tol(ctanf, z, CMPLXL(0, tanhf(nums[i])), + 1.3 * FLT_ULP()); + } +} + +void +test_small(void) +{ + /* + * z = 0.5 + i Pi/4 + * sinh(z) = (sinh(0.5) + i cosh(0.5)) * sqrt(2)/2 + * cosh(z) = (cosh(0.5) + i sinh(0.5)) * sqrt(2)/2 + * tanh(z) = (2cosh(0.5)sinh(0.5) + i) / (2 cosh(0.5)**2 - 1) + * z = -0.5 + i Pi/2 + * sinh(z) = cosh(0.5) + * cosh(z) = -i sinh(0.5) + * tanh(z) = -coth(0.5) + * z = 1.0 + i 3Pi/4 + * sinh(z) = (-sinh(1) + i cosh(1)) * sqrt(2)/2 + * cosh(z) = (-cosh(1) + i sinh(1)) * sqrt(2)/2 + * tanh(z) = (2cosh(1)sinh(1) - i) / (2cosh(1)**2 - 1) + */ + static const struct { + long double a, b; + long double sinh_a, sinh_b; + long double cosh_a, cosh_b; + long double tanh_a, tanh_b; + } tests[] = { + { 0.5L, + 0.78539816339744830961566084581987572L, + 0.36847002415910435172083660522240710L, + 0.79735196663945774996093142586179334L, + 0.79735196663945774996093142586179334L, + 0.36847002415910435172083660522240710L, + 0.76159415595576488811945828260479359L, + 0.64805427366388539957497735322615032L }, + { -0.5L, + 1.57079632679489661923132169163975144L, + 0.0L, + 1.12762596520638078522622516140267201L, + 0.0L, + -0.52109530549374736162242562641149156L, + -2.16395341373865284877000401021802312L, + 0.0L }, + { 1.0L, + 2.35619449019234492884698253745962716L, + -0.83099273328405698212637979852748608L, + 1.09112278079550143030545602018565236L, + -1.09112278079550143030545602018565236L, + 0.83099273328405698212637979852748609L, + 0.96402758007581688394641372410092315L, + -0.26580222883407969212086273981988897L } + }; + long double complex z; + int i; + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { + z = CMPLXL(tests[i].a, tests[i].b); + testall_odd_tol(csinh, z, + CMPLXL(tests[i].sinh_a, tests[i].sinh_b), 1.1); + testall_even_tol(ccosh, z, + CMPLXL(tests[i].cosh_a, tests[i].cosh_b), 1.1); + testall_odd_tol(ctanh, z, + CMPLXL(tests[i].tanh_a, tests[i].tanh_b), 1.4); + } +} + +/* Test inputs that might cause overflow in a sloppy implementation. */ +void +test_large(void) +{ + long double complex z; + + /* tanh() uses a threshold around x=22, so check both sides. */ + z = CMPLXL(21, 0.78539816339744830961566084581987572L); + testall_odd_tol(ctanh, z, + CMPLXL(1.0, 1.14990445285871196133287617611468468e-18L), 1.2); + z++; + testall_odd_tol(ctanh, z, + CMPLXL(1.0, 1.55622644822675930314266334585597964e-19L), 1); + + z = CMPLXL(355, 0.78539816339744830961566084581987572L); + test_odd_tol(ctanh, z, + CMPLXL(1.0, 8.95257245135025991216632140458264468e-309L), + DBL_ULP()); +#if !defined(__i386__) + z = CMPLXL(30, 0x1p1023L); + test_odd_tol(ctanh, z, + CMPLXL(1.0, -1.62994325413993477997492170229268382e-26L), + DBL_ULP()); + z = CMPLXL(1, 0x1p1023L); + test_odd_tol(ctanh, z, + CMPLXL(0.878606311888306869546254022621986509L, + -0.225462792499754505792678258169527424L), + DBL_ULP()); +#endif + + z = CMPLXL(710.6, 0.78539816339744830961566084581987572L); + test_odd_tol(csinh, z, + CMPLXL(1.43917579766621073533185387499658944e308L, + 1.43917579766621073533185387499658944e308L), DBL_ULP()); + test_even_tol(ccosh, z, + CMPLXL(1.43917579766621073533185387499658944e308L, + 1.43917579766621073533185387499658944e308L), DBL_ULP()); + + z = CMPLXL(1500, 0.78539816339744830961566084581987572L); + testall_odd(csinh, z, CMPLXL(INFINITY, INFINITY), OPT_INEXACT, + FE_OVERFLOW, CS_BOTH); + testall_even(ccosh, z, CMPLXL(INFINITY, INFINITY), OPT_INEXACT, + FE_OVERFLOW, CS_BOTH); +} + +int +main(int argc, char *argv[]) +{ + + printf("1..6\n"); + + test_zero(); + printf("ok 1 - ctrig zero\n"); + + test_nan(); + printf("ok 2 - ctrig nan\n"); + + test_inf(); + printf("ok 3 - ctrig inf\n"); + + test_axes(); + printf("ok 4 - ctrig axes\n"); + + test_small(); + printf("ok 5 - ctrig small\n"); + + test_large(); + printf("ok 6 - ctrig large\n"); + + return (0); +} Copied: stable/10/lib/msun/tests/exponential_test.c (from r292497, head/lib/msun/tests/exponential_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/tests/exponential_test.c Mon Jan 18 03:55:40 2016 (r294243, copy of r292497, head/lib/msun/tests/exponential_test.c) @@ -0,0 +1,169 @@ +/*- + * Copyright (c) 2008 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Tests for corner cases in exp*(). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#ifdef __i386__ +#include +#endif + +#include "test-utils.h" + +#pragma STDC FENV_ACCESS ON + +/* + * Test that a function returns the correct value and sets the + * exception flags correctly. The exceptmask specifies which + * exceptions we should check. We need to be lenient for several + * reasoons, but mainly because on some architectures it's impossible + * to raise FE_OVERFLOW without raising FE_INEXACT. + * + * These are macros instead of functions so that assert provides more + * meaningful error messages. + * + * XXX The volatile here is to avoid gcc's bogus constant folding and work + * around the lack of support for the FENV_ACCESS pragma. + */ +#define test(func, x, result, exceptmask, excepts) do { \ + volatile long double _d = x; \ + assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ + assert(fpequal((func)(_d), (result))); \ + assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ +} while (0) + +/* Test all the functions that compute b^x. */ +#define _testall0(x, result, exceptmask, excepts) do { \ + test(exp, x, result, exceptmask, excepts); \ + test(expf, x, result, exceptmask, excepts); \ + test(exp2, x, result, exceptmask, excepts); \ + test(exp2f, x, result, exceptmask, excepts); \ +} while (0) + +/* Skip over exp2l on platforms that don't support it. */ +#if LDBL_PREC == 53 +#define testall0 _testall0 +#else +#define testall0(x, result, exceptmask, excepts) do { \ + _testall0(x, result, exceptmask, excepts); \ + test(exp2l, x, result, exceptmask, excepts); \ +} while (0) +#endif + +/* Test all the functions that compute b^x - 1. */ +#define testall1(x, result, exceptmask, excepts) do { \ + test(expm1, x, result, exceptmask, excepts); \ + test(expm1f, x, result, exceptmask, excepts); \ +} while (0) + +void +run_generic_tests(void) +{ + + /* exp(0) == 1, no exceptions raised */ + testall0(0.0, 1.0, ALL_STD_EXCEPT, 0); + testall1(0.0, 0.0, ALL_STD_EXCEPT, 0); + testall0(-0.0, 1.0, ALL_STD_EXCEPT, 0); + testall1(-0.0, -0.0, ALL_STD_EXCEPT, 0); + + /* exp(NaN) == NaN, no exceptions raised */ + testall0(NAN, NAN, ALL_STD_EXCEPT, 0); + testall1(NAN, NAN, ALL_STD_EXCEPT, 0); + + /* exp(Inf) == Inf, no exceptions raised */ + testall0(INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + testall1(INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + + /* exp(-Inf) == 0, no exceptions raised */ + testall0(-INFINITY, 0.0, ALL_STD_EXCEPT, 0); + testall1(-INFINITY, -1.0, ALL_STD_EXCEPT, 0); + +#if !defined(__i386__) + /* exp(big) == Inf, overflow exception */ + testall0(50000.0, INFINITY, ALL_STD_EXCEPT & ~FE_INEXACT, FE_OVERFLOW); + testall1(50000.0, INFINITY, ALL_STD_EXCEPT & ~FE_INEXACT, FE_OVERFLOW); + + /* exp(small) == 0, underflow and inexact exceptions */ + testall0(-50000.0, 0.0, ALL_STD_EXCEPT, FE_UNDERFLOW | FE_INEXACT); +#endif + testall1(-50000.0, -1.0, ALL_STD_EXCEPT, FE_INEXACT); +} + +void +run_exp2_tests(void) +{ + int i; + + /* + * We should insist that exp2() return exactly the correct + * result and not raise an inexact exception for integer + * arguments. + */ + feclearexcept(FE_ALL_EXCEPT); + for (i = FLT_MIN_EXP - FLT_MANT_DIG; i < FLT_MAX_EXP; i++) { + assert(exp2f(i) == ldexpf(1.0, i)); + assert(fetestexcept(ALL_STD_EXCEPT) == 0); + } + for (i = DBL_MIN_EXP - DBL_MANT_DIG; i < DBL_MAX_EXP; i++) { + assert(exp2(i) == ldexp(1.0, i)); + assert(fetestexcept(ALL_STD_EXCEPT) == 0); + } + for (i = LDBL_MIN_EXP - LDBL_MANT_DIG; i < LDBL_MAX_EXP; i++) { + assert(exp2l(i) == ldexpl(1.0, i)); + assert(fetestexcept(ALL_STD_EXCEPT) == 0); + } +} + +int +main(int argc, char *argv[]) +{ + + printf("1..3\n"); + + run_generic_tests(); + printf("ok 1 - exponential\n"); + +#ifdef __i386__ + fpsetprec(FP_PE); + run_generic_tests(); +#endif + printf("ok 2 - exponential\n"); + + run_exp2_tests(); + printf("ok 3 - exponential\n"); + + return (0); +} Copied: stable/10/lib/msun/tests/fma_test.c (from r292497, head/lib/msun/tests/fma_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/tests/fma_test.c Mon Jan 18 03:55:40 2016 (r294243, copy of r292497, head/lib/msun/tests/fma_test.c) @@ -0,0 +1,542 @@ +/*- + * Copyright (c) 2008 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Tests for fma{,f,l}(). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include "test-utils.h" + +#pragma STDC FENV_ACCESS ON + +/* + * Test that a function returns the correct value and sets the + * exception flags correctly. The exceptmask specifies which + * exceptions we should check. We need to be lenient for several + * reasons, but mainly because on some architectures it's impossible + * to raise FE_OVERFLOW without raising FE_INEXACT. + * + * These are macros instead of functions so that assert provides more + * meaningful error messages. + */ +#define test(func, x, y, z, result, exceptmask, excepts) do { \ + volatile long double _vx = (x), _vy = (y), _vz = (z); \ + assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ + assert(fpequal((func)(_vx, _vy, _vz), (result))); \ + assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ +} while (0) + +#define testall(x, y, z, result, exceptmask, excepts) do { \ + test(fma, (double)(x), (double)(y), (double)(z), \ + (double)(result), (exceptmask), (excepts)); \ + test(fmaf, (float)(x), (float)(y), (float)(z), \ + (float)(result), (exceptmask), (excepts)); \ + test(fmal, (x), (y), (z), (result), (exceptmask), (excepts)); \ +} while (0) + +/* Test in all rounding modes. */ +#define testrnd(func, x, y, z, rn, ru, rd, rz, exceptmask, excepts) do { \ + fesetround(FE_TONEAREST); \ + test((func), (x), (y), (z), (rn), (exceptmask), (excepts)); \ + fesetround(FE_UPWARD); \ + test((func), (x), (y), (z), (ru), (exceptmask), (excepts)); \ + fesetround(FE_DOWNWARD); \ + test((func), (x), (y), (z), (rd), (exceptmask), (excepts)); \ + fesetround(FE_TOWARDZERO); \ + test((func), (x), (y), (z), (rz), (exceptmask), (excepts)); \ +} while (0) + +/* + * This is needed because clang constant-folds fma in ways that are incorrect + * in rounding modes other than FE_TONEAREST. + */ +volatile double one = 1.0; + +static void +test_zeroes(void) +{ + const int rd = (fegetround() == FE_DOWNWARD); + + testall(0.0, 0.0, 0.0, 0.0, ALL_STD_EXCEPT, 0); + testall(1.0, 0.0, 0.0, 0.0, ALL_STD_EXCEPT, 0); + testall(0.0, 1.0, 0.0, 0.0, ALL_STD_EXCEPT, 0); + testall(0.0, 0.0, 1.0, 1.0, ALL_STD_EXCEPT, 0); + + testall(-0.0, 0.0, 0.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(0.0, -0.0, 0.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(-0.0, -0.0, 0.0, 0.0, ALL_STD_EXCEPT, 0); + testall(0.0, 0.0, -0.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(-0.0, -0.0, -0.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + + testall(-0.0, 0.0, -0.0, -0.0, ALL_STD_EXCEPT, 0); + testall(0.0, -0.0, -0.0, -0.0, ALL_STD_EXCEPT, 0); + + testall(-one, one, one, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(one, -one, one, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(-one, -one, -one, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + + switch (fegetround()) { + case FE_TONEAREST: + case FE_TOWARDZERO: + test(fmaf, -FLT_MIN, FLT_MIN, 0.0, -0.0, + ALL_STD_EXCEPT, FE_INEXACT | FE_UNDERFLOW); + test(fma, -DBL_MIN, DBL_MIN, 0.0, -0.0, + ALL_STD_EXCEPT, FE_INEXACT | FE_UNDERFLOW); + test(fmal, -LDBL_MIN, LDBL_MIN, 0.0, -0.0, + ALL_STD_EXCEPT, FE_INEXACT | FE_UNDERFLOW); + } +} + +static void +test_infinities(void) +{ + + testall(INFINITY, 1.0, -1.0, INFINITY, ALL_STD_EXCEPT, 0); + testall(-1.0, INFINITY, 0.0, -INFINITY, ALL_STD_EXCEPT, 0); + testall(0.0, 0.0, INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + testall(1.0, 1.0, INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + testall(1.0, 1.0, -INFINITY, -INFINITY, ALL_STD_EXCEPT, 0); + + testall(INFINITY, -INFINITY, 1.0, -INFINITY, ALL_STD_EXCEPT, 0); + testall(INFINITY, INFINITY, 1.0, INFINITY, ALL_STD_EXCEPT, 0); + testall(-INFINITY, -INFINITY, INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + + testall(0.0, INFINITY, 1.0, NAN, ALL_STD_EXCEPT, FE_INVALID); + testall(INFINITY, 0.0, -0.0, NAN, ALL_STD_EXCEPT, FE_INVALID); + + /* The invalid exception is optional in this case. */ + testall(INFINITY, 0.0, NAN, NAN, ALL_STD_EXCEPT & ~FE_INVALID, 0); + + testall(INFINITY, INFINITY, -INFINITY, NAN, + ALL_STD_EXCEPT, FE_INVALID); + testall(-INFINITY, INFINITY, INFINITY, NAN, + ALL_STD_EXCEPT, FE_INVALID); + testall(INFINITY, -1.0, INFINITY, NAN, + ALL_STD_EXCEPT, FE_INVALID); + + test(fmaf, FLT_MAX, FLT_MAX, -INFINITY, -INFINITY, ALL_STD_EXCEPT, 0); + test(fma, DBL_MAX, DBL_MAX, -INFINITY, -INFINITY, ALL_STD_EXCEPT, 0); + test(fmal, LDBL_MAX, LDBL_MAX, -INFINITY, -INFINITY, + ALL_STD_EXCEPT, 0); + test(fmaf, FLT_MAX, -FLT_MAX, INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + test(fma, DBL_MAX, -DBL_MAX, INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + test(fmal, LDBL_MAX, -LDBL_MAX, INFINITY, INFINITY, + ALL_STD_EXCEPT, 0); +} + +static void +test_nans(void) +{ + + testall(NAN, 0.0, 0.0, NAN, ALL_STD_EXCEPT, 0); + testall(1.0, NAN, 1.0, NAN, ALL_STD_EXCEPT, 0); + testall(1.0, -1.0, NAN, NAN, ALL_STD_EXCEPT, 0); + testall(0.0, 0.0, NAN, NAN, ALL_STD_EXCEPT, 0); + testall(NAN, NAN, NAN, NAN, ALL_STD_EXCEPT, 0); + + /* x*y should not raise an inexact/overflow/underflow if z is NaN. */ + testall(M_PI, M_PI, NAN, NAN, ALL_STD_EXCEPT, 0); + test(fmaf, FLT_MIN, FLT_MIN, NAN, NAN, ALL_STD_EXCEPT, 0); + test(fma, DBL_MIN, DBL_MIN, NAN, NAN, ALL_STD_EXCEPT, 0); + test(fmal, LDBL_MIN, LDBL_MIN, NAN, NAN, ALL_STD_EXCEPT, 0); + test(fmaf, FLT_MAX, FLT_MAX, NAN, NAN, ALL_STD_EXCEPT, 0); + test(fma, DBL_MAX, DBL_MAX, NAN, NAN, ALL_STD_EXCEPT, 0); + test(fmal, LDBL_MAX, LDBL_MAX, NAN, NAN, ALL_STD_EXCEPT, 0); +} + +/* + * Tests for cases where z is very small compared to x*y. + */ +static void +test_small_z(void) +{ + + /* x*y positive, z positive */ + if (fegetround() == FE_UPWARD) { + test(fmaf, one, one, 0x1.0p-100, 1.0 + FLT_EPSILON, + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, one, one, 0x1.0p-200, 1.0 + DBL_EPSILON, + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, one, one, 0x1.0p-200, 1.0 + LDBL_EPSILON, + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(0x1.0p100, one, 0x1.0p-100, 0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } + + /* x*y negative, z negative */ + if (fegetround() == FE_DOWNWARD) { + test(fmaf, -one, one, -0x1.0p-100, -(1.0 + FLT_EPSILON), + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, -one, one, -0x1.0p-200, -(1.0 + DBL_EPSILON), + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, -one, one, -0x1.0p-200, -(1.0 + LDBL_EPSILON), + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(0x1.0p100, -one, -0x1.0p-100, -0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } + + /* x*y positive, z negative */ + if (fegetround() == FE_DOWNWARD || fegetround() == FE_TOWARDZERO) { + test(fmaf, one, one, -0x1.0p-100, 1.0 - FLT_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, one, one, -0x1.0p-200, 1.0 - DBL_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, one, one, -0x1.0p-200, 1.0 - LDBL_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(0x1.0p100, one, -0x1.0p-100, 0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } + + /* x*y negative, z positive */ + if (fegetround() == FE_UPWARD || fegetround() == FE_TOWARDZERO) { + test(fmaf, -one, one, 0x1.0p-100, -1.0 + FLT_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, -one, one, 0x1.0p-200, -1.0 + DBL_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, -one, one, 0x1.0p-200, -1.0 + LDBL_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(-0x1.0p100, one, 0x1.0p-100, -0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } +} + +/* + * Tests for cases where z is very large compared to x*y. + */ +static void +test_big_z(void) +{ + + /* z positive, x*y positive */ + if (fegetround() == FE_UPWARD) { + test(fmaf, 0x1.0p-50, 0x1.0p-50, 1.0, 1.0 + FLT_EPSILON, + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, 0x1.0p-100, 0x1.0p-100, 1.0, 1.0 + DBL_EPSILON, + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, 0x1.0p-100, 0x1.0p-100, 1.0, 1.0 + LDBL_EPSILON, + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(-0x1.0p-50, -0x1.0p-50, 0x1.0p100, 0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } + + /* z negative, x*y negative */ + if (fegetround() == FE_DOWNWARD) { + test(fmaf, -0x1.0p-50, 0x1.0p-50, -1.0, -(1.0 + FLT_EPSILON), + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, -0x1.0p-100, 0x1.0p-100, -1.0, -(1.0 + DBL_EPSILON), + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, -0x1.0p-100, 0x1.0p-100, -1.0, -(1.0 + LDBL_EPSILON), + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(0x1.0p-50, -0x1.0p-50, -0x1.0p100, -0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } + + /* z negative, x*y positive */ + if (fegetround() == FE_UPWARD || fegetround() == FE_TOWARDZERO) { + test(fmaf, -0x1.0p-50, -0x1.0p-50, -1.0, + -1.0 + FLT_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); + test(fma, -0x1.0p-100, -0x1.0p-100, -1.0, + -1.0 + DBL_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, -0x1.0p-100, -0x1.0p-100, -1.0, + -1.0 + LDBL_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(0x1.0p-50, 0x1.0p-50, -0x1.0p100, -0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } + + /* z positive, x*y negative */ + if (fegetround() == FE_DOWNWARD || fegetround() == FE_TOWARDZERO) { + test(fmaf, 0x1.0p-50, -0x1.0p-50, 1.0, 1.0 - FLT_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, 0x1.0p-100, -0x1.0p-100, 1.0, 1.0 - DBL_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, 0x1.0p-100, -0x1.0p-100, 1.0, 1.0 - LDBL_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(-0x1.0p-50, 0x1.0p-50, 0x1.0p100, 0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } +} + +static void +test_accuracy(void) +{ + + /* ilogb(x*y) - ilogb(z) = 20 */ + testrnd(fmaf, -0x1.c139d8p-51, -0x1.600e7ap32, 0x1.26558cp-38, + 0x1.34e48ap-18, 0x1.34e48cp-18, 0x1.34e48ap-18, 0x1.34e48ap-18, + ALL_STD_EXCEPT, FE_INEXACT); + testrnd(fma, -0x1.c139d7b84f1a3p-51, -0x1.600e7a2a16484p32, + 0x1.26558cac31580p-38, 0x1.34e48a78aae97p-18, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Jan 18 03:56:51 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68C75A86AA0; Mon, 18 Jan 2016 03:56:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DC7B15F5; Mon, 18 Jan 2016 03:56:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0I3uoIM096973; Mon, 18 Jan 2016 03:56:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0I3uoo8096972; Mon, 18 Jan 2016 03:56:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601180356.u0I3uoo8096972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 18 Jan 2016 03:56:50 +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: r294244 - stable/10/tools/regression/lib/msun 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 03:56:51 -0000 Author: ngie Date: Mon Jan 18 03:56:49 2016 New Revision: 294244 URL: https://svnweb.freebsd.org/changeset/base/294244 Log: Remove tools/regression/lib/msun (follow up to r292497) Sponsored by: EMC / Isilon Storage Division Deleted: stable/10/tools/regression/lib/msun/ From owner-svn-src-stable@freebsd.org Mon Jan 18 11:47:05 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EE15A86544; Mon, 18 Jan 2016 11:47:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 471DF1FAF; Mon, 18 Jan 2016 11:47:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IBl4Q3035324; Mon, 18 Jan 2016 11:47:04 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IBl47o035321; Mon, 18 Jan 2016 11:47:04 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201601181147.u0IBl47o035321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 18 Jan 2016 11:47:04 +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: r294263 - stable/10/sys/fs/smbfs 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 11:47:05 -0000 Author: ae Date: Mon Jan 18 11:47:03 2016 New Revision: 294263 URL: https://svnweb.freebsd.org/changeset/base/294263 Log: MFC r293679: Change the type of newsize argument in the smbfs_smb_setfsize() function from int to int64. MSDN says that SMB_SET_FILE_END_OF_FILE_INFO uses signed 64-bit integer to specify offset, but since smbfs_smb_setfsize() has used plain int, a value was truncated in case when offset was larger than 2G. https://msdn.microsoft.com/en-us/library/ff469975.aspx In particular, now `truncate -s 10G` will work correctly on the mounted SMB share. Modified: stable/10/sys/fs/smbfs/smbfs_smb.c stable/10/sys/fs/smbfs/smbfs_subr.h stable/10/sys/fs/smbfs/smbfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/smbfs/smbfs_smb.c ============================================================================== --- stable/10/sys/fs/smbfs/smbfs_smb.c Mon Jan 18 09:36:10 2016 (r294262) +++ stable/10/sys/fs/smbfs/smbfs_smb.c Mon Jan 18 11:47:03 2016 (r294263) @@ -333,18 +333,18 @@ smbfs_smb_flush(struct smbnode *np, stru } int -smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred) +smbfs_smb_setfsize(struct smbnode *np, int64_t newsize, struct smb_cred *scred) { struct smb_share *ssp = np->n_mount->sm_share; struct smb_rq *rqp; struct mbchain *mbp; int error; - if (!smbfs_smb_seteof(np, (int64_t) newsize, scred)) { + if (!smbfs_smb_seteof(np, newsize, scred)) { np->n_flag |= NFLUSHWIRE; return (0); } - + /* XXX: We should use SMB_COM_WRITE_ANDX to support large offsets */ error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_WRITE, scred, &rqp); if (error) return (error); @@ -352,7 +352,7 @@ smbfs_smb_setfsize(struct smbnode *np, i smb_rq_wstart(rqp); mb_put_mem(mbp, (caddr_t)&np->n_fid, 2, MB_MSYSTEM); mb_put_uint16le(mbp, 0); - mb_put_uint32le(mbp, newsize); + mb_put_uint32le(mbp, (uint32_t)newsize); mb_put_uint16le(mbp, 0); smb_rq_wend(rqp); smb_rq_bstart(rqp); Modified: stable/10/sys/fs/smbfs/smbfs_subr.h ============================================================================== --- stable/10/sys/fs/smbfs/smbfs_subr.h Mon Jan 18 09:36:10 2016 (r294262) +++ stable/10/sys/fs/smbfs/smbfs_subr.h Mon Jan 18 11:47:03 2016 (r294263) @@ -128,7 +128,8 @@ int smbfs_smb_lock(struct smbnode *np, off_t start, off_t end, struct smb_cred *scred); int smbfs_smb_statfs(struct smb_share *ssp, struct statfs *sbp, struct smb_cred *scred); -int smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred); +int smbfs_smb_setfsize(struct smbnode *np, int64_t newsize, + struct smb_cred *scred); int smbfs_smb_query_info(struct smbnode *np, const char *name, int len, struct smbfattr *fap, struct smb_cred *scred); Modified: stable/10/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- stable/10/sys/fs/smbfs/smbfs_vnops.c Mon Jan 18 09:36:10 2016 (r294262) +++ stable/10/sys/fs/smbfs/smbfs_vnops.c Mon Jan 18 11:47:03 2016 (r294263) @@ -358,7 +358,8 @@ smbfs_setattr(ap) doclose = 1; } if (error == 0) - error = smbfs_smb_setfsize(np, vap->va_size, scred); + error = smbfs_smb_setfsize(np, + (int64_t)vap->va_size, scred); if (doclose) smbfs_smb_close(ssp, np->n_fid, NULL, scred); if (error) { From owner-svn-src-stable@freebsd.org Mon Jan 18 11:51:42 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8BB5A86689; Mon, 18 Jan 2016 11:51:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9624F1271; Mon, 18 Jan 2016 11:51:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IBpfWc036143; Mon, 18 Jan 2016 11:51:41 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IBpfYp036140; Mon, 18 Jan 2016 11:51:41 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201601181151.u0IBpfYp036140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 18 Jan 2016 11:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294264 - stable/9/sys/fs/smbfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 11:51:42 -0000 Author: ae Date: Mon Jan 18 11:51:41 2016 New Revision: 294264 URL: https://svnweb.freebsd.org/changeset/base/294264 Log: MFC r293679: Change the type of newsize argument in the smbfs_smb_setfsize() function from int to int64. MSDN says that SMB_SET_FILE_END_OF_FILE_INFO uses signed 64-bit integer to specify offset, but since smbfs_smb_setfsize() has used plain int, a value was truncated in case when offset was larger than 2G. https://msdn.microsoft.com/en-us/library/ff469975.aspx In particular, now `truncate -s 10G` will work correctly on the mounted SMB share. Modified: stable/9/sys/fs/smbfs/smbfs_smb.c stable/9/sys/fs/smbfs/smbfs_subr.h stable/9/sys/fs/smbfs/smbfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/smbfs/smbfs_smb.c ============================================================================== --- stable/9/sys/fs/smbfs/smbfs_smb.c Mon Jan 18 11:47:03 2016 (r294263) +++ stable/9/sys/fs/smbfs/smbfs_smb.c Mon Jan 18 11:51:41 2016 (r294264) @@ -331,18 +331,18 @@ smbfs_smb_flush(struct smbnode *np, stru } int -smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred) +smbfs_smb_setfsize(struct smbnode *np, int64_t newsize, struct smb_cred *scred) { struct smb_share *ssp = np->n_mount->sm_share; struct smb_rq rq, *rqp = &rq; struct mbchain *mbp; int error; - if (!smbfs_smb_seteof(np, (int64_t) newsize, scred)) { + if (!smbfs_smb_seteof(np, newsize, scred)) { np->n_flag |= NFLUSHWIRE; return (0); } - + /* XXX: We should use SMB_COM_WRITE_ANDX to support large offsets */ error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_WRITE, scred); if (error) return error; @@ -350,7 +350,7 @@ smbfs_smb_setfsize(struct smbnode *np, i smb_rq_wstart(rqp); mb_put_mem(mbp, (caddr_t)&np->n_fid, 2, MB_MSYSTEM); mb_put_uint16le(mbp, 0); - mb_put_uint32le(mbp, newsize); + mb_put_uint32le(mbp, (uint32_t)newsize); mb_put_uint16le(mbp, 0); smb_rq_wend(rqp); smb_rq_bstart(rqp); Modified: stable/9/sys/fs/smbfs/smbfs_subr.h ============================================================================== --- stable/9/sys/fs/smbfs/smbfs_subr.h Mon Jan 18 11:47:03 2016 (r294263) +++ stable/9/sys/fs/smbfs/smbfs_subr.h Mon Jan 18 11:51:41 2016 (r294264) @@ -127,7 +127,8 @@ int smbfs_smb_lock(struct smbnode *np, off_t start, off_t end, struct smb_cred *scred); int smbfs_smb_statfs(struct smb_share *ssp, struct statfs *sbp, struct smb_cred *scred); -int smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred); +int smbfs_smb_setfsize(struct smbnode *np, int64_t newsize, + struct smb_cred *scred); int smbfs_smb_query_info(struct smbnode *np, const char *name, int len, struct smbfattr *fap, struct smb_cred *scred); Modified: stable/9/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- stable/9/sys/fs/smbfs/smbfs_vnops.c Mon Jan 18 11:47:03 2016 (r294263) +++ stable/9/sys/fs/smbfs/smbfs_vnops.c Mon Jan 18 11:51:41 2016 (r294264) @@ -332,7 +332,8 @@ smbfs_setattr(ap) doclose = 1; } if (error == 0) - error = smbfs_smb_setfsize(np, vap->va_size, &scred); + error = smbfs_smb_setfsize(np, + (int64_t)vap->va_size, &scred); if (doclose) smbfs_smb_close(ssp, np->n_fid, NULL, &scred); if (error) { From owner-svn-src-stable@freebsd.org Mon Jan 18 15:30:17 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E991A8755C; Mon, 18 Jan 2016 15:30:17 +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 072481588; Mon, 18 Jan 2016 15:30:16 +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 u0IFUGPP000670; Mon, 18 Jan 2016 15:30:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IFUFqC000668; Mon, 18 Jan 2016 15:30:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601181530.u0IFUFqC000668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Jan 2016 15:30: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: r294268 - in stable/10/sys/boot/efi: boot1 loader 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 15:30:17 -0000 Author: emaste Date: Mon Jan 18 15:30:15 2016 New Revision: 294268 URL: https://svnweb.freebsd.org/changeset/base/294268 Log: MFC r287930: Various small cleanups to EFI loader Makefiles. Modified: stable/10/sys/boot/efi/boot1/Makefile stable/10/sys/boot/efi/loader/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/10/sys/boot/efi/boot1/Makefile Mon Jan 18 14:11:34 2016 (r294267) +++ stable/10/sys/boot/efi/boot1/Makefile Mon Jan 18 15:30:15 2016 (r294268) @@ -9,7 +9,7 @@ MAN= MK_SSP= no -PROG= loader.sym +PROG= boot1.sym INTERNALPROG= # architecture-specific loader code @@ -38,7 +38,7 @@ LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymboli LDFLAGS+= -Wl,-znocombreloc .endif -${PROG}: ${LDSCRIPT} +DPADD+= ${LDSCRIPT} OBJCOPY?= objcopy OBJDUMP?= objdump @@ -49,19 +49,19 @@ EFI_TARGET= efi-app-x86_64 EFI_TARGET= efi-app-ia32 .endif -boot1.efi: loader.sym +boot1.efi: ${PROG} if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \ ${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \ exit 1; \ fi ${OBJCOPY} -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ - -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ + -j .rela.dyn -j .reloc -j .eh_frame \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} boot1.o: ${.CURDIR}/../../common/ufsread.c -# The following inserts out objects into a template FAT file system +# The following inserts our objects into a template FAT file system # created by generate-fat.sh .include "${.CURDIR}/Makefile.fat" Modified: stable/10/sys/boot/efi/loader/Makefile ============================================================================== --- stable/10/sys/boot/efi/loader/Makefile Mon Jan 18 14:11:34 2016 (r294267) +++ stable/10/sys/boot/efi/loader/Makefile Mon Jan 18 15:30:15 2016 (r294268) @@ -12,7 +12,6 @@ MK_SSP= no PROG= loader.sym INTERNALPROG= -.PATH: ${.CURDIR}/../../efi/loader # architecture-specific loader code SRCS= autoload.c \ bootinfo.c \ @@ -80,7 +79,7 @@ EFI_TARGET= efi-app-x86_64 EFI_TARGET= efi-app-ia32 .endif -loader.efi: loader.sym +loader.efi: ${PROG} if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \ ${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \ exit 1; \ From owner-svn-src-stable@freebsd.org Mon Jan 18 15:34:11 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A1C4A8774C; Mon, 18 Jan 2016 15:34:11 +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 66FA81A6E; Mon, 18 Jan 2016 15:34:11 +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 u0IFYAu1003431; Mon, 18 Jan 2016 15:34:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IFYAdS003430; Mon, 18 Jan 2016 15:34:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601181534.u0IFYAdS003430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Jan 2016 15:34:10 +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: r294269 - stable/10/sys/boot/efi/boot1 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 15:34:11 -0000 Author: emaste Date: Mon Jan 18 15:34:10 2016 New Revision: 294269 URL: https://svnweb.freebsd.org/changeset/base/294269 Log: MFC r281117: Move boot1.efi to the global CLEANFILES list It's not x86 specific. Modified: stable/10/sys/boot/efi/boot1/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/10/sys/boot/efi/boot1/Makefile Mon Jan 18 15:30:15 2016 (r294268) +++ stable/10/sys/boot/efi/boot1/Makefile Mon Jan 18 15:34:10 2016 (r294269) @@ -73,7 +73,7 @@ boot1.efifat: boot1.efi bzip2 -f -d ${.TARGET}.bz2 dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc -CLEANFILES= boot1.efifat +CLEANFILES= boot1.efi boot1.efifat .endif # ${COMPILER_TYPE} != "gcc" @@ -82,7 +82,7 @@ CLEANFILES= boot1.efifat .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" beforedepend ${OBJS}: machine x86 -CLEANFILES+= machine x86 boot1.efi +CLEANFILES+= machine x86 machine: ln -sf ${.CURDIR}/../../../amd64/include machine From owner-svn-src-stable@freebsd.org Mon Jan 18 15:37:42 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83E65A87898; Mon, 18 Jan 2016 15:37:42 +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 537721C8C; Mon, 18 Jan 2016 15:37:42 +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 u0IFbfJC003597; Mon, 18 Jan 2016 15:37:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IFbf1k003596; Mon, 18 Jan 2016 15:37:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601181537.u0IFbf1k003596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Jan 2016 15:37: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: r294270 - stable/10/sys/boot/efi/loader 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 15:37:42 -0000 Author: emaste Date: Mon Jan 18 15:37:41 2016 New Revision: 294270 URL: https://svnweb.freebsd.org/changeset/base/294270 Log: MFC r293165: loader.efi: support non-contiguous console modes Modified: stable/10/sys/boot/efi/loader/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/loader/main.c ============================================================================== --- stable/10/sys/boot/efi/loader/main.c Mon Jan 18 15:34:10 2016 (r294269) +++ stable/10/sys/boot/efi/loader/main.c Mon Jan 18 15:37:41 2016 (r294270) @@ -333,10 +333,11 @@ command_mode(int argc, char *argv[]) return (CMD_OK); } - for (i = 0; ; i++) { + printf("Current mode: %d\n", conout->Mode->Mode); + for (i = 0; i <= conout->Mode->MaxMode; i++) { status = conout->QueryMode(conout, i, &cols, &rows); if (EFI_ERROR(status)) - break; + continue; printf("Mode %d: %u columns, %u rows\n", i, (unsigned)cols, (unsigned)rows); } From owner-svn-src-stable@freebsd.org Mon Jan 18 15:39:34 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86659A8792A; Mon, 18 Jan 2016 15:39:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D9711DF3; Mon, 18 Jan 2016 15:39:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IFdXd7003731; Mon, 18 Jan 2016 15:39:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IFdWjU003727; Mon, 18 Jan 2016 15:39:32 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601181539.u0IFdWjU003727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 18 Jan 2016 15:39: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: r294271 - stable/10/sys/fs/ext2fs 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 15:39:34 -0000 Author: pfg Date: Mon Jan 18 15:39:32 2016 New Revision: 294271 URL: https://svnweb.freebsd.org/changeset/base/294271 Log: MFC r293680 ext4: add support for reading sparse files Add support for sparse files in ext4. Also implement read-ahead, which greatly increases the performance when transferring files from ext4. The sparse file support has become very common in ext4. Both features implemented by Damjan Jovanovic. PR: 205816 Modified: stable/10/sys/fs/ext2fs/ext2_bmap.c stable/10/sys/fs/ext2fs/ext2_extents.c stable/10/sys/fs/ext2fs/ext2_extents.h stable/10/sys/fs/ext2fs/ext2_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_bmap.c Mon Jan 18 15:37:41 2016 (r294270) +++ stable/10/sys/fs/ext2fs/ext2_bmap.c Mon Jan 18 15:39:32 2016 (r294271) @@ -102,9 +102,6 @@ ext4_bmapext(struct vnode *vp, int32_t b fs = ip->i_e2fs; lbn = bn; - /* - * TODO: need to implement read ahead to improve the performance. - */ if (runp != NULL) *runp = 0; @@ -112,15 +109,25 @@ ext4_bmapext(struct vnode *vp, int32_t b *runb = 0; ext4_ext_find_extent(fs, ip, lbn, &path); - ep = path.ep_ext; - if (ep == NULL) - ret = EIO; - else { - *bnp = fsbtodb(fs, lbn - ep->e_blk + - (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); + if (path.ep_is_sparse) { + *bnp = -1; + if (runp != NULL) + *runp = path.ep_sparse_ext.e_len - + (lbn - path.ep_sparse_ext.e_blk) - 1; + } else { + ep = path.ep_ext; + if (ep == NULL) + ret = EIO; + else { + *bnp = fsbtodb(fs, lbn - ep->e_blk + + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); - if (*bnp == 0) - *bnp = -1; + if (*bnp == 0) + *bnp = -1; + + if (runp != NULL) + *runp = ep->e_len - (lbn - ep->e_blk) - 1; + } } if (path.ep_bp != NULL) { Modified: stable/10/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_extents.c Mon Jan 18 15:37:41 2016 (r294270) +++ stable/10/sys/fs/ext2fs/ext2_extents.c Mon Jan 18 15:39:32 2016 (r294271) @@ -66,13 +66,14 @@ static void ext4_ext_binsearch(struct inode *ip, struct ext4_extent_path *path, daddr_t lbn) { struct ext4_extent_header *ehp = path->ep_header; - struct ext4_extent *l, *r, *m; + struct ext4_extent *first, *l, *r, *m; if (ehp->eh_ecount == 0) return; - l = (struct ext4_extent *)(char *)(ehp + 1); - r = (struct ext4_extent *)(char *)(ehp + 1) + ehp->eh_ecount - 1; + first = (struct ext4_extent *)(char *)(ehp + 1); + l = first; + r = first + ehp->eh_ecount - 1; while (l <= r) { m = l + (r - l) / 2; if (lbn < m->e_blk) @@ -81,7 +82,25 @@ ext4_ext_binsearch(struct inode *ip, str l = m + 1; } + if (l == first) { + path->ep_sparse_ext.e_blk = lbn; + path->ep_sparse_ext.e_len = first->e_blk - lbn; + path->ep_sparse_ext.e_start_hi = 0; + path->ep_sparse_ext.e_start_lo = 0; + path->ep_is_sparse = 1; + return; + } path->ep_ext = l - 1; + if (path->ep_ext->e_blk + path->ep_ext->e_len <= lbn) { + path->ep_sparse_ext.e_blk = lbn; + if (l <= (first + ehp->eh_ecount - 1)) + path->ep_sparse_ext.e_len = l->e_blk - lbn; + else // XXX: where does it end? + path->ep_sparse_ext.e_len = 1; + path->ep_sparse_ext.e_start_hi = 0; + path->ep_sparse_ext.e_start_lo = 0; + path->ep_is_sparse = 1; + } } /* @@ -169,6 +188,7 @@ ext4_ext_find_extent(struct m_ext2fs *fs path->ep_depth = i; path->ep_ext = NULL; path->ep_index = NULL; + path->ep_is_sparse = 0; ext4_ext_binsearch(ip, path, lbn); return (path); Modified: stable/10/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_extents.h Mon Jan 18 15:37:41 2016 (r294270) +++ stable/10/sys/fs/ext2fs/ext2_extents.h Mon Jan 18 15:39:32 2016 (r294271) @@ -84,7 +84,11 @@ struct ext4_extent_cache { struct ext4_extent_path { uint16_t ep_depth; struct buf *ep_bp; - struct ext4_extent *ep_ext; + int ep_is_sparse; + union { + struct ext4_extent ep_sparse_ext; + struct ext4_extent *ep_ext; + }; struct ext4_extent_index *ep_index; struct ext4_extent_header *ep_header; }; Modified: stable/10/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vnops.c Mon Jan 18 15:37:41 2016 (r294270) +++ stable/10/sys/fs/ext2fs/ext2_vnops.c Mon Jan 18 15:39:32 2016 (r294271) @@ -1787,6 +1787,7 @@ ext2_ioctl(struct vop_ioctl_args *ap) static int ext4_ext_read(struct vop_read_args *ap) { + static unsigned char zeroes[EXT2_MAX_BLOCK_SIZE]; struct vnode *vp; struct inode *ip; struct uio *uio; @@ -1831,11 +1832,15 @@ ext4_ext_read(struct vop_read_args *ap) switch (cache_type) { case EXT4_EXT_CACHE_NO: ext4_ext_find_extent(fs, ip, lbn, &path); - ep = path.ep_ext; + if (path.ep_is_sparse) + ep = &path.ep_sparse_ext; + else + ep = path.ep_ext; if (ep == NULL) return (EIO); - ext4_ext_put_cache(ip, ep, EXT4_EXT_CACHE_IN); + ext4_ext_put_cache(ip, ep, + path.ep_is_sparse ? EXT4_EXT_CACHE_GAP : EXT4_EXT_CACHE_IN); newblk = lbn - ep->e_blk + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32); @@ -1848,7 +1853,7 @@ ext4_ext_read(struct vop_read_args *ap) case EXT4_EXT_CACHE_GAP: /* block has not been allocated yet */ - return (0); + break; case EXT4_EXT_CACHE_IN: newblk = lbn - nex.e_blk + (nex.e_start_lo | @@ -1859,24 +1864,34 @@ ext4_ext_read(struct vop_read_args *ap) panic("%s: invalid cache type", __func__); } - error = bread(ip->i_devvp, fsbtodb(fs, newblk), size, NOCRED, &bp); - if (error) { - brelse(bp); - return (error); - } + if (cache_type == EXT4_EXT_CACHE_GAP || + (cache_type == EXT4_EXT_CACHE_NO && path.ep_is_sparse)) { + if (xfersize > sizeof(zeroes)) + xfersize = sizeof(zeroes); + error = uiomove(zeroes, xfersize, uio); + if (error) + return (error); + } else { + error = bread(ip->i_devvp, fsbtodb(fs, newblk), size, + NOCRED, &bp); + if (error) { + brelse(bp); + return (error); + } - size -= bp->b_resid; - if (size < xfersize) { - if (size == 0) { - bqrelse(bp); - break; + size -= bp->b_resid; + if (size < xfersize) { + if (size == 0) { + bqrelse(bp); + break; + } + xfersize = size; } - xfersize = size; + error = uiomove(bp->b_data + blkoffset, xfersize, uio); + bqrelse(bp); + if (error) + return (error); } - error = uiomove(bp->b_data + blkoffset, (int)xfersize, uio); - bqrelse(bp); - if (error) - return (error); } return (0); From owner-svn-src-stable@freebsd.org Mon Jan 18 15:43:02 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 299B5A87B0F; Mon, 18 Jan 2016 15:43:02 +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 EA88912FF; Mon, 18 Jan 2016 15:43:01 +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 u0IFh0XF006486; Mon, 18 Jan 2016 15:43:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IFh0O7006485; Mon, 18 Jan 2016 15:43:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601181543.u0IFh0O7006485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Jan 2016 15:43: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: r294272 - stable/10/sys/amd64/include 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 15:43:02 -0000 Author: emaste Date: Mon Jan 18 15:43:00 2016 New Revision: 294272 URL: https://svnweb.freebsd.org/changeset/base/294272 Log: MFC r281381: Use explicitly sized types in EFI module metadata This will allow the same metadata struct to be used on all platforms. Modified: stable/10/sys/amd64/include/metadata.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/metadata.h ============================================================================== --- stable/10/sys/amd64/include/metadata.h Mon Jan 18 15:39:32 2016 (r294271) +++ stable/10/sys/amd64/include/metadata.h Mon Jan 18 15:43:00 2016 (r294272) @@ -36,17 +36,17 @@ #define MODINFOMD_EFI_FB 0x1005 struct efi_map_header { - size_t memory_size; - size_t descriptor_size; + uint64_t memory_size; + uint64_t descriptor_size; uint32_t descriptor_version; }; struct efi_fb { uint64_t fb_addr; uint64_t fb_size; - int fb_height; - int fb_width; - int fb_stride; + uint32_t fb_height; + uint32_t fb_width; + uint32_t fb_stride; uint32_t fb_mask_red; uint32_t fb_mask_green; uint32_t fb_mask_blue; From owner-svn-src-stable@freebsd.org Mon Jan 18 15:43:38 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1A85A87B99; Mon, 18 Jan 2016 15:43:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DBAA15A8; Mon, 18 Jan 2016 15:43:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IFhbx5006773; Mon, 18 Jan 2016 15:43:37 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IFhbSC006757; Mon, 18 Jan 2016 15:43:37 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601181543.u0IFhbSC006757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 18 Jan 2016 15:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294273 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 15:43:38 -0000 Author: pfg Date: Mon Jan 18 15:43:37 2016 New Revision: 294273 URL: https://svnweb.freebsd.org/changeset/base/294273 Log: MFC r293680 ext4: add support for reading sparse files Add support for sparse files in ext4. Also implement read-ahead, which greatly increases the performance when transferring files from ext4. The sparse file support has become very common in ext4. Both features implemented by Damjan Jovanovic. PR: 205816 Modified: stable/9/sys/fs/ext2fs/ext2_bmap.c stable/9/sys/fs/ext2fs/ext2_extents.c stable/9/sys/fs/ext2fs/ext2_extents.h stable/9/sys/fs/ext2fs/ext2_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_bmap.c Mon Jan 18 15:43:00 2016 (r294272) +++ stable/9/sys/fs/ext2fs/ext2_bmap.c Mon Jan 18 15:43:37 2016 (r294273) @@ -102,9 +102,6 @@ ext4_bmapext(struct vnode *vp, int32_t b fs = ip->i_e2fs; lbn = bn; - /* - * TODO: need to implement read ahead to improve the performance. - */ if (runp != NULL) *runp = 0; @@ -112,15 +109,25 @@ ext4_bmapext(struct vnode *vp, int32_t b *runb = 0; ext4_ext_find_extent(fs, ip, lbn, &path); - ep = path.ep_ext; - if (ep == NULL) - ret = EIO; - else { - *bnp = fsbtodb(fs, lbn - ep->e_blk + - (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); + if (path.ep_is_sparse) { + *bnp = -1; + if (runp != NULL) + *runp = path.ep_sparse_ext.e_len - + (lbn - path.ep_sparse_ext.e_blk) - 1; + } else { + ep = path.ep_ext; + if (ep == NULL) + ret = EIO; + else { + *bnp = fsbtodb(fs, lbn - ep->e_blk + + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); - if (*bnp == 0) - *bnp = -1; + if (*bnp == 0) + *bnp = -1; + + if (runp != NULL) + *runp = ep->e_len - (lbn - ep->e_blk) - 1; + } } if (path.ep_bp != NULL) { Modified: stable/9/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_extents.c Mon Jan 18 15:43:00 2016 (r294272) +++ stable/9/sys/fs/ext2fs/ext2_extents.c Mon Jan 18 15:43:37 2016 (r294273) @@ -66,13 +66,14 @@ static void ext4_ext_binsearch(struct inode *ip, struct ext4_extent_path *path, daddr_t lbn) { struct ext4_extent_header *ehp = path->ep_header; - struct ext4_extent *l, *r, *m; + struct ext4_extent *first, *l, *r, *m; if (ehp->eh_ecount == 0) return; - l = (struct ext4_extent *)(char *)(ehp + 1); - r = (struct ext4_extent *)(char *)(ehp + 1) + ehp->eh_ecount - 1; + first = (struct ext4_extent *)(char *)(ehp + 1); + l = first; + r = first + ehp->eh_ecount - 1; while (l <= r) { m = l + (r - l) / 2; if (lbn < m->e_blk) @@ -81,7 +82,25 @@ ext4_ext_binsearch(struct inode *ip, str l = m + 1; } + if (l == first) { + path->ep_sparse_ext.e_blk = lbn; + path->ep_sparse_ext.e_len = first->e_blk - lbn; + path->ep_sparse_ext.e_start_hi = 0; + path->ep_sparse_ext.e_start_lo = 0; + path->ep_is_sparse = 1; + return; + } path->ep_ext = l - 1; + if (path->ep_ext->e_blk + path->ep_ext->e_len <= lbn) { + path->ep_sparse_ext.e_blk = lbn; + if (l <= (first + ehp->eh_ecount - 1)) + path->ep_sparse_ext.e_len = l->e_blk - lbn; + else // XXX: where does it end? + path->ep_sparse_ext.e_len = 1; + path->ep_sparse_ext.e_start_hi = 0; + path->ep_sparse_ext.e_start_lo = 0; + path->ep_is_sparse = 1; + } } /* @@ -169,6 +188,7 @@ ext4_ext_find_extent(struct m_ext2fs *fs path->ep_depth = i; path->ep_ext = NULL; path->ep_index = NULL; + path->ep_is_sparse = 0; ext4_ext_binsearch(ip, path, lbn); return (path); Modified: stable/9/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_extents.h Mon Jan 18 15:43:00 2016 (r294272) +++ stable/9/sys/fs/ext2fs/ext2_extents.h Mon Jan 18 15:43:37 2016 (r294273) @@ -84,7 +84,11 @@ struct ext4_extent_cache { struct ext4_extent_path { uint16_t ep_depth; struct buf *ep_bp; - struct ext4_extent *ep_ext; + int ep_is_sparse; + union { + struct ext4_extent ep_sparse_ext; + struct ext4_extent *ep_ext; + }; struct ext4_extent_index *ep_index; struct ext4_extent_header *ep_header; }; Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_vnops.c Mon Jan 18 15:43:00 2016 (r294272) +++ stable/9/sys/fs/ext2fs/ext2_vnops.c Mon Jan 18 15:43:37 2016 (r294273) @@ -1789,6 +1789,7 @@ ext2_ioctl(struct vop_ioctl_args *ap) static int ext4_ext_read(struct vop_read_args *ap) { + static unsigned char zeroes[EXT2_MAX_BLOCK_SIZE]; struct vnode *vp; struct inode *ip; struct uio *uio; @@ -1833,11 +1834,15 @@ ext4_ext_read(struct vop_read_args *ap) switch (cache_type) { case EXT4_EXT_CACHE_NO: ext4_ext_find_extent(fs, ip, lbn, &path); - ep = path.ep_ext; + if (path.ep_is_sparse) + ep = &path.ep_sparse_ext; + else + ep = path.ep_ext; if (ep == NULL) return (EIO); - ext4_ext_put_cache(ip, ep, EXT4_EXT_CACHE_IN); + ext4_ext_put_cache(ip, ep, + path.ep_is_sparse ? EXT4_EXT_CACHE_GAP : EXT4_EXT_CACHE_IN); newblk = lbn - ep->e_blk + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32); @@ -1850,7 +1855,7 @@ ext4_ext_read(struct vop_read_args *ap) case EXT4_EXT_CACHE_GAP: /* block has not been allocated yet */ - return (0); + break; case EXT4_EXT_CACHE_IN: newblk = lbn - nex.e_blk + (nex.e_start_lo | @@ -1861,24 +1866,34 @@ ext4_ext_read(struct vop_read_args *ap) panic("%s: invalid cache type", __func__); } - error = bread(ip->i_devvp, fsbtodb(fs, newblk), size, NOCRED, &bp); - if (error) { - brelse(bp); - return (error); - } + if (cache_type == EXT4_EXT_CACHE_GAP || + (cache_type == EXT4_EXT_CACHE_NO && path.ep_is_sparse)) { + if (xfersize > sizeof(zeroes)) + xfersize = sizeof(zeroes); + error = uiomove(zeroes, xfersize, uio); + if (error) + return (error); + } else { + error = bread(ip->i_devvp, fsbtodb(fs, newblk), size, + NOCRED, &bp); + if (error) { + brelse(bp); + return (error); + } - size -= bp->b_resid; - if (size < xfersize) { - if (size == 0) { - bqrelse(bp); - break; + size -= bp->b_resid; + if (size < xfersize) { + if (size == 0) { + bqrelse(bp); + break; + } + xfersize = size; } - xfersize = size; + error = uiomove(bp->b_data + blkoffset, xfersize, uio); + bqrelse(bp); + if (error) + return (error); } - error = uiomove(bp->b_data + blkoffset, (int)xfersize, uio); - bqrelse(bp); - if (error) - return (error); } return (0); From owner-svn-src-stable@freebsd.org Mon Jan 18 15:52:09 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02711A86108; Mon, 18 Jan 2016 15:52:09 +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 CF7BB114A; Mon, 18 Jan 2016 15:52:08 +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 u0IFq7pn010055; Mon, 18 Jan 2016 15:52:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IFq7ij010052; Mon, 18 Jan 2016 15:52:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601181552.u0IFq7ij010052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Jan 2016 15:52:07 +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: r294274 - in stable/10/sys: amd64/include i386/include x86/include 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 15:52:09 -0000 Author: emaste Date: Mon Jan 18 15:52:07 2016 New Revision: 294274 URL: https://svnweb.freebsd.org/changeset/base/294274 Log: MFC r293343: Move amd64 metadata.h to x86 and share with i386 Added: stable/10/sys/x86/include/metadata.h - copied unchanged from r293343, head/sys/x86/include/metadata.h Modified: stable/10/sys/amd64/include/metadata.h stable/10/sys/i386/include/metadata.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/metadata.h ============================================================================== --- stable/10/sys/amd64/include/metadata.h Mon Jan 18 15:43:37 2016 (r294273) +++ stable/10/sys/amd64/include/metadata.h Mon Jan 18 15:52:07 2016 (r294274) @@ -1,56 +1,6 @@ /*- - * Copyright (c) 2003 Peter Wemm - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_METADATA_H_ -#define _MACHINE_METADATA_H_ - -#define MODINFOMD_SMAP 0x1001 -#define MODINFOMD_SMAP_XATTR 0x1002 -#define MODINFOMD_DTBP 0x1003 -#define MODINFOMD_EFI_MAP 0x1004 -#define MODINFOMD_EFI_FB 0x1005 - -struct efi_map_header { - uint64_t memory_size; - uint64_t descriptor_size; - uint32_t descriptor_version; -}; - -struct efi_fb { - uint64_t fb_addr; - uint64_t fb_size; - uint32_t fb_height; - uint32_t fb_width; - uint32_t fb_stride; - uint32_t fb_mask_red; - uint32_t fb_mask_green; - uint32_t fb_mask_blue; - uint32_t fb_mask_reserved; -}; - -#endif /* !_MACHINE_METADATA_H_ */ +#include Modified: stable/10/sys/i386/include/metadata.h ============================================================================== --- stable/10/sys/i386/include/metadata.h Mon Jan 18 15:43:37 2016 (r294273) +++ stable/10/sys/i386/include/metadata.h Mon Jan 18 15:52:07 2016 (r294274) @@ -1,36 +1,6 @@ /*- - * Copyright (c) 2003 Peter Wemm - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_METADATA_H_ -#define _MACHINE_METADATA_H_ - -#define MODINFOMD_SMAP 0x1001 -#define MODINFOMD_SMAP_XATTR 0x1002 -#define MODINFOMD_DTBP 0x1003 - -#endif /* !_MACHINE_METADATA_H_ */ +#include Copied: stable/10/sys/x86/include/metadata.h (from r293343, head/sys/x86/include/metadata.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/x86/include/metadata.h Mon Jan 18 15:52:07 2016 (r294274, copy of r293343, head/sys/x86/include/metadata.h) @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2003 Peter Wemm + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_METADATA_H_ +#define _MACHINE_METADATA_H_ + +#define MODINFOMD_SMAP 0x1001 +#define MODINFOMD_SMAP_XATTR 0x1002 +#define MODINFOMD_DTBP 0x1003 +#define MODINFOMD_EFI_MAP 0x1004 +#define MODINFOMD_EFI_FB 0x1005 +#define MODINFOMD_MODULEP 0x1006 + +struct efi_map_header { + uint64_t memory_size; + uint64_t descriptor_size; + uint32_t descriptor_version; +}; + +struct efi_fb { + uint64_t fb_addr; + uint64_t fb_size; + uint32_t fb_height; + uint32_t fb_width; + uint32_t fb_stride; + uint32_t fb_mask_red; + uint32_t fb_mask_green; + uint32_t fb_mask_blue; + uint32_t fb_mask_reserved; +}; + +#endif /* !_MACHINE_METADATA_H_ */ From owner-svn-src-stable@freebsd.org Mon Jan 18 15:55:26 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5195A861D9; Mon, 18 Jan 2016 15:55:26 +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 A1F3D1357; Mon, 18 Jan 2016 15:55:26 +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 u0IFtPdF010242; Mon, 18 Jan 2016 15:55:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IFtPqg010238; Mon, 18 Jan 2016 15:55:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601181555.u0IFtPqg010238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Jan 2016 15:55:25 +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: r294275 - in stable/10/sys/boot/efi: boot1 include loader 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 15:55:27 -0000 Author: emaste Date: Mon Jan 18 15:55:25 2016 New Revision: 294275 URL: https://svnweb.freebsd.org/changeset/base/294275 Log: MFC r293244: Introduce and use new EFI_ERROR_CODE macro for EFI errors Modified: stable/10/sys/boot/efi/boot1/boot1.c stable/10/sys/boot/efi/include/efierr.h stable/10/sys/boot/efi/loader/bootinfo.c stable/10/sys/boot/efi/loader/copy.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 18 15:52:07 2016 (r294274) +++ stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 18 15:55:25 2016 (r294275) @@ -309,20 +309,20 @@ load(const char *fname) buffer, bufsize, &loaderhandle); if (EFI_ERROR(status)) printf("LoadImage failed with error %lu\n", - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); status = systab->BootServices->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image); if (EFI_ERROR(status)) printf("HandleProtocol failed with error %lu\n", - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); loaded_image->DeviceHandle = bootdevhandle; status = systab->BootServices->StartImage(loaderhandle, NULL, NULL); if (EFI_ERROR(status)) printf("StartImage failed with error %lu\n", - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); } static void Modified: stable/10/sys/boot/efi/include/efierr.h ============================================================================== --- stable/10/sys/boot/efi/include/efierr.h Mon Jan 18 15:52:07 2016 (r294274) +++ stable/10/sys/boot/efi/include/efierr.h Mon Jan 18 15:55:25 2016 (r294275) @@ -30,7 +30,8 @@ Revision History #define EFIWARN(a) (a) -#define EFI_ERROR(a) (((INTN) a) < 0) +#define EFI_ERROR(a) (((INTN) a) < 0) +#define EFI_ERROR_CODE(a) (a & ~EFI_ERROR_MASK) #define EFI_SUCCESS 0 Modified: stable/10/sys/boot/efi/loader/bootinfo.c ============================================================================== --- stable/10/sys/boot/efi/loader/bootinfo.c Mon Jan 18 15:52:07 2016 (r294274) +++ stable/10/sys/boot/efi/loader/bootinfo.c Mon Jan 18 15:55:25 2016 (r294275) @@ -275,7 +275,7 @@ bi_load_efi_data(struct preloaded_file * pages, &addr); if (EFI_ERROR(status)) { printf("%s: AllocatePages error %lu\n", __func__, - (unsigned long)(status & ~EFI_ERROR_MASK)); + EFI_ERROR_CODE(status)); return (ENOMEM); } @@ -291,7 +291,7 @@ bi_load_efi_data(struct preloaded_file * status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver); if (EFI_ERROR(status)) { printf("%s: GetMemoryMap error %lu\n", __func__, - (unsigned long)(status & ~EFI_ERROR_MASK)); + EFI_ERROR_CODE(status)); return (EINVAL); } status = BS->ExitBootServices(IH, efi_mapkey); @@ -305,8 +305,7 @@ bi_load_efi_data(struct preloaded_file * } BS->FreePages(addr, pages); } - printf("ExitBootServices error %lu\n", - (unsigned long)(status & ~EFI_ERROR_MASK)); + printf("ExitBootServices error %lu\n", EFI_ERROR_CODE(status)); return (EINVAL); } Modified: stable/10/sys/boot/efi/loader/copy.c ============================================================================== --- stable/10/sys/boot/efi/loader/copy.c Mon Jan 18 15:52:07 2016 (r294274) +++ stable/10/sys/boot/efi/loader/copy.c Mon Jan 18 15:55:25 2016 (r294275) @@ -56,7 +56,7 @@ efi_copy_init(void) STAGE_PAGES, &staging); if (EFI_ERROR(status)) { printf("failed to allocate staging area: %lu\n", - (unsigned long)(status & EFI_ERROR_MASK)); + EFI_ERROR_CODE(status)); return (status); } staging_end = staging + STAGE_PAGES * EFI_PAGE_SIZE; From owner-svn-src-stable@freebsd.org Mon Jan 18 16:10:00 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 214FCA867BD; Mon, 18 Jan 2016 16:10:00 +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 D30D01039; Mon, 18 Jan 2016 16:09:59 +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 u0IG9wW0014064; Mon, 18 Jan 2016 16:09:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IG9wJ3014063; Mon, 18 Jan 2016 16:09:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601181609.u0IG9wJ3014063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Jan 2016 16:09:58 +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: r294276 - stable/10/sys/boot/efi/boot1 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 16:10:00 -0000 Author: emaste Date: Mon Jan 18 16:09:58 2016 New Revision: 294276 URL: https://svnweb.freebsd.org/changeset/base/294276 Log: MFC r281058: Remove whitespace. Modified: stable/10/sys/boot/efi/boot1/boot1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 18 15:55:25 2016 (r294275) +++ stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 18 16:09:58 2016 (r294276) @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); #define _PATH_LOADER "/boot/loader.efi" #define _PATH_KERNEL "/boot/kernel/kernel" - + #define BSIZEMAX 16384 typedef int putc_func_t(char c, void *arg); @@ -40,7 +40,7 @@ struct sp_data { u_int sp_len; u_int sp_size; }; - + static const char digits[] = "0123456789abcdef"; static void panic(const char *fmt, ...) __dead2; @@ -62,7 +62,7 @@ static void load(const char *fname); EFI_SYSTEM_TABLE *systab; EFI_HANDLE *image; -static void +static void bcopy(const void *src, void *dst, size_t len) { const char *s = src; @@ -71,12 +71,12 @@ bcopy(const void *src, void *dst, size_t while (len-- != 0) *d++ = *s++; } - + static void memcpy(void *dst, const void *src, size_t len) { bcopy(src, dst, len); -} +} static void bzero(void *b, size_t len) @@ -86,7 +86,7 @@ bzero(void *b, size_t len) while (len-- != 0) *p++ = 0; } - + static int strcmp(const char *s1, const char *s2) { @@ -134,7 +134,7 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E for (i = 0; i < nparts; i++) { status = systab->BootServices->HandleProtocol(handles[i], - &DevicePathGUID, (void **)&devpath); + &DevicePathGUID, (void **)&devpath); if (EFI_ERROR(status)) continue; @@ -142,7 +142,7 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E devpath = NextDevicePathNode(devpath); status = systab->BootServices->HandleProtocol(handles[i], - &BlockIoProtocolGUID, (void **)&blkio); + &BlockIoProtocolGUID, (void **)&blkio); if (EFI_ERROR(status)) continue; @@ -158,7 +158,7 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E bootdevhandle = handles[i]; load(path); - + panic("Load failed"); return EFI_SUCCESS; @@ -266,7 +266,7 @@ fsstat(ufs_ino_t inode) } static struct dmadat __dmadat; - + static int domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet) { @@ -278,7 +278,7 @@ domount(EFI_DEVICE_PATH *device, EFI_BLO if (!quiet) printf("domount: can't read superblock\n"); return (-1); - } + } if (!quiet) printf("Succesfully mounted UFS filesystem\n"); return (0); @@ -303,7 +303,7 @@ load(const char *fname) status = systab->BootServices->AllocatePool(EfiLoaderData, bufsize, &buffer); fsread(ino, buffer, bufsize); - + /* XXX: For secure boot, we need our own loader here */ status = systab->BootServices->LoadImage(TRUE, image, bootdevpath, buffer, bufsize, &loaderhandle); @@ -552,4 +552,3 @@ __ultoa(char *buf, u_long ul, int base) while ((ul /= base) != 0); return (p); } - From owner-svn-src-stable@freebsd.org Mon Jan 18 16:41:27 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA87BA87471; Mon, 18 Jan 2016 16:41:27 +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 990D3147C; Mon, 18 Jan 2016 16:41:27 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IGfQLU025156; Mon, 18 Jan 2016 16:41:26 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IGfQrc025155; Mon, 18 Jan 2016 16:41:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201601181641.u0IGfQrc025155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 18 Jan 2016 16:41: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: r294278 - stable/10/sbin/mount 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 16:41:27 -0000 Author: asomers Date: Mon Jan 18 16:41:26 2016 New Revision: 294278 URL: https://svnweb.freebsd.org/changeset/base/294278 Log: MFC r292573 Fix "mount -a" for NFS and ZFS filesystems with shared mountpoints sbin/mount.c Check whether an fstab entry has the same fstype as a mounted filesystem before declaring it to be mounted. This will allow NFS filesystems that share a mountpoint with a local filesystem to be automatically mounted at boot. This is not such an unusual situation. For example, if somebody uses the standard installer with a ZFS root, he'll get a /usr/home filesystem, even though he may choose to mount /usr/home over NFS. Modified: stable/10/sbin/mount/mount.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/mount/mount.c ============================================================================== --- stable/10/sbin/mount/mount.c Mon Jan 18 16:33:03 2016 (r294277) +++ stable/10/sbin/mount/mount.c Mon Jan 18 16:41:26 2016 (r294278) @@ -485,10 +485,18 @@ ismounted(struct fstab *fs, struct statf strlcpy(realfsfile, fs->fs_file, sizeof(realfsfile)); } + /* + * Consider the filesystem to be mounted if: + * It has the same mountpoint as a mounted filesytem, and + * It has the same type as that same mounted filesystem, and + * It has the same device name as that same mounted filesystem, OR + * It is a nonremountable filesystem + */ for (i = mntsize - 1; i >= 0; --i) if (strcmp(realfsfile, mntbuf[i].f_mntonname) == 0 && + strcmp(fs->fs_vfstype, mntbuf[i].f_fstypename) == 0 && (!isremountable(fs->fs_vfstype) || - strcmp(fs->fs_spec, mntbuf[i].f_mntfromname) == 0)) + (strcmp(fs->fs_spec, mntbuf[i].f_mntfromname) == 0))) return (1); return (0); } From owner-svn-src-stable@freebsd.org Mon Jan 18 18:27:23 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45F3AA83C46; Mon, 18 Jan 2016 18:27:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D30A1306; Mon, 18 Jan 2016 18:27:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IIRMuV055942; Mon, 18 Jan 2016 18:27:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IIRLGQ055936; Mon, 18 Jan 2016 18:27:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601181827.u0IIRLGQ055936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 18 Jan 2016 18:27: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: r294283 - in stable/10/sys: amd64/include i386/include kern vm 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 18:27:23 -0000 Author: jhb Date: Mon Jan 18 18:27:21 2016 New Revision: 294283 URL: https://svnweb.freebsd.org/changeset/base/294283 Log: MFC 290728: Export various helper variables describing the layout and size of certain kernel structures for use by debuggers. This mostly aids in examining cores from a kernel without debug symbols as a debugger can infer these values if debug symbols are available. One set of variables describes the layout of 'struct linker_file' to walk the list of loaded kernel modules. A second set of variables describes the layout of 'struct proc' and 'struct thread' to walk the list of processes in the kernel and the threads in each process. The 'pcb_size' variable is used to index into the stoppcbs[] array. The 'vm_maxuser_address' is used to distinguish kernel virtual addresses from user addresses. This doesn't have to be perfect, and 'vm_maxuser_address' is a cheap and simple way to differentiate kernel pointers from simple values like TIDs and PIDs. While here, annotate the fields in struct pcb used by kgdb on amd64 and i386 to note that their ABI should be preserved. Annotations for other platforms will be added in the future. Modified: stable/10/sys/amd64/include/pcb.h stable/10/sys/i386/include/pcb.h stable/10/sys/kern/kern_linker.c stable/10/sys/kern/kern_mib.c stable/10/sys/kern/kern_proc.c stable/10/sys/vm/vm_kern.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/pcb.h ============================================================================== --- stable/10/sys/amd64/include/pcb.h Mon Jan 18 17:49:32 2016 (r294282) +++ stable/10/sys/amd64/include/pcb.h Mon Jan 18 18:27:21 2016 (r294283) @@ -44,15 +44,19 @@ #include #ifdef __amd64__ +/* + * NB: The fields marked with (*) are used by kernel debuggers. Their + * ABI should be preserved. + */ struct pcb { - register_t pcb_r15; - register_t pcb_r14; - register_t pcb_r13; - register_t pcb_r12; - register_t pcb_rbp; - register_t pcb_rsp; - register_t pcb_rbx; - register_t pcb_rip; + register_t pcb_r15; /* (*) */ + register_t pcb_r14; /* (*) */ + register_t pcb_r13; /* (*) */ + register_t pcb_r12; /* (*) */ + register_t pcb_rbp; /* (*) */ + register_t pcb_rsp; /* (*) */ + register_t pcb_rbx; /* (*) */ + register_t pcb_rip; /* (*) */ register_t pcb_fsbase; register_t pcb_gsbase; register_t pcb_kgsbase; Modified: stable/10/sys/i386/include/pcb.h ============================================================================== --- stable/10/sys/i386/include/pcb.h Mon Jan 18 17:49:32 2016 (r294282) +++ stable/10/sys/i386/include/pcb.h Mon Jan 18 18:27:21 2016 (r294283) @@ -44,13 +44,17 @@ #endif #include +/* + * NB: The fields marked with (*) are used by kernel debuggers. Their + * ABI should be preserved. + */ struct pcb { - int pcb_edi; - int pcb_esi; - int pcb_ebp; - int pcb_esp; - int pcb_ebx; - int pcb_eip; + int pcb_edi; /* (*) */ + int pcb_esi; /* (*) */ + int pcb_ebp; /* (*) */ + int pcb_esp; /* (*) */ + int pcb_ebx; /* (*) */ + int pcb_eip; /* (*) */ struct segment_descriptor pcb_fsd; struct segment_descriptor pcb_gsd; int pcb_ds; Modified: stable/10/sys/kern/kern_linker.c ============================================================================== --- stable/10/sys/kern/kern_linker.c Mon Jan 18 17:49:32 2016 (r294282) +++ stable/10/sys/kern/kern_linker.c Mon Jan 18 18:27:21 2016 (r294283) @@ -71,6 +71,12 @@ SYSCTL_INT(_debug, OID_AUTO, kld_debug, TUNABLE_INT("debug.kld_debug", &kld_debug); #endif +/* These variables are used by kernel debuggers to enumerate loaded files. */ +const int kld_off_address = offsetof(struct linker_file, address); +const int kld_off_filename = offsetof(struct linker_file, filename); +const int kld_off_pathname = offsetof(struct linker_file, pathname); +const int kld_off_next = offsetof(struct linker_file, link.tqe_next); + /* * static char *linker_search_path(const char *name, struct mod_depend * *verinfo); Modified: stable/10/sys/kern/kern_mib.c ============================================================================== --- stable/10/sys/kern/kern_mib.c Mon Jan 18 17:49:32 2016 (r294282) +++ stable/10/sys/kern/kern_mib.c Mon Jan 18 18:27:21 2016 (r294283) @@ -574,6 +574,11 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, buf, SYSCTL_INT(_debug_sizeof, OID_AUTO, kinfo_proc, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, sizeof(struct kinfo_proc), "sizeof(struct kinfo_proc)"); +/* Used by kernel debuggers. */ +const int pcb_size = sizeof(struct pcb); +SYSCTL_INT(_debug_sizeof, OID_AUTO, pcb, CTLFLAG_RD, + SYSCTL_NULL_INT_PTR, sizeof(struct pcb), "sizeof(struct pcb)"); + /* XXX compatibility, remove for 6.0 */ #include #include Modified: stable/10/sys/kern/kern_proc.c ============================================================================== --- stable/10/sys/kern/kern_proc.c Mon Jan 18 17:49:32 2016 (r294282) +++ stable/10/sys/kern/kern_proc.c Mon Jan 18 18:27:21 2016 (r294283) @@ -139,6 +139,21 @@ struct sx proctree_lock; struct mtx ppeers_lock; uma_zone_t proc_zone; +/* + * The offset of various fields in struct proc and struct thread. + * These are used by kernel debuggers to enumerate kernel threads and + * processes. + */ +const int proc_off_p_pid = offsetof(struct proc, p_pid); +const int proc_off_p_comm = offsetof(struct proc, p_comm); +const int proc_off_p_list = offsetof(struct proc, p_list); +const int proc_off_p_threads = offsetof(struct proc, p_threads); +const int thread_off_td_tid = offsetof(struct thread, td_tid); +const int thread_off_td_name = offsetof(struct thread, td_name); +const int thread_off_td_oncpu = offsetof(struct thread, td_oncpu); +const int thread_off_td_pcb = offsetof(struct thread, td_pcb); +const int thread_off_td_plist = offsetof(struct thread, td_plist); + int kstack_pages = KSTACK_PAGES; SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0, "Kernel stack size in pages"); Modified: stable/10/sys/vm/vm_kern.c ============================================================================== --- stable/10/sys/vm/vm_kern.c Mon Jan 18 17:49:32 2016 (r294282) +++ stable/10/sys/vm/vm_kern.c Mon Jan 18 18:27:21 2016 (r294283) @@ -94,6 +94,9 @@ vm_map_t pipe_map; const void *zero_region; CTASSERT((ZERO_REGION_SIZE & PAGE_MASK) == 0); +/* NB: Used by kernel debuggers. */ +const u_long vm_maxuser_address = VM_MAXUSER_ADDRESS; + SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, SYSCTL_NULL_ULONG_PTR, VM_MIN_KERNEL_ADDRESS, "Min kernel address"); From owner-svn-src-stable@freebsd.org Mon Jan 18 18:50:28 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CACAA864D7; Mon, 18 Jan 2016 18:50:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5C610A1; Mon, 18 Jan 2016 18:50:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IIoRrs061986; Mon, 18 Jan 2016 18:50:27 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IIoQoq061979; Mon, 18 Jan 2016 18:50:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601181850.u0IIoQoq061979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 Jan 2016 18:50: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: r294285 - stable/10/usr.bin/systat 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 18:50:28 -0000 Author: tuexen Date: Mon Jan 18 18:50:26 2016 New Revision: 294285 URL: https://svnweb.freebsd.org/changeset/base/294285 Log: MFC r289873: Add support to systat to display SCTP statistics. MFC r289874: Bump date in man page. Added: stable/10/usr.bin/systat/sctp.c - copied unchanged from r289873, head/usr.bin/systat/sctp.c Modified: stable/10/usr.bin/systat/Makefile stable/10/usr.bin/systat/cmdtab.c stable/10/usr.bin/systat/extern.h stable/10/usr.bin/systat/systat.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/systat/Makefile ============================================================================== --- stable/10/usr.bin/systat/Makefile Mon Jan 18 18:41:09 2016 (r294284) +++ stable/10/usr.bin/systat/Makefile Mon Jan 18 18:50:26 2016 (r294285) @@ -6,7 +6,7 @@ PROG= systat SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c \ netcmds.c netstat.c pigs.c swap.c icmp.c \ - mode.c ip.c tcp.c \ + mode.c ip.c sctp.c tcp.c \ vmstat.c convtbl.c ifcmds.c ifstat.c .if ${MK_INET6_SUPPORT} != "no" Modified: stable/10/usr.bin/systat/cmdtab.c ============================================================================== --- stable/10/usr.bin/systat/cmdtab.c Mon Jan 18 18:41:09 2016 (r294284) +++ stable/10/usr.bin/systat/cmdtab.c Mon Jan 18 18:50:26 2016 (r294285) @@ -69,6 +69,9 @@ struct cmdtab cmdtab[] = { initip6, openip6, closeip6, cmdmode, resetip6, CF_LOADAV }, #endif + { "sctp", showsctp, fetchsctp, labelsctp, + initsctp, opensctp, closesctp, cmdmode, + resetsctp, CF_LOADAV }, { "tcp", showtcp, fetchtcp, labeltcp, inittcp, opentcp, closetcp, cmdmode, resettcp, CF_LOADAV }, Modified: stable/10/usr.bin/systat/extern.h ============================================================================== --- stable/10/usr.bin/systat/extern.h Mon Jan 18 18:41:09 2016 (r294284) +++ stable/10/usr.bin/systat/extern.h Mon Jan 18 18:50:26 2016 (r294285) @@ -163,3 +163,14 @@ void showtcp(void); void status(void); void suspend(int); char *sysctl_dynread(const char *, size_t *); + +#define SYSTAT_CMD(name) \ + void close ## name(WINDOW *); \ + void fetch ## name(void); \ + int init ## name(void); \ + void label ## name(void); \ + WINDOW *open ## name(void); \ + void reset ## name(void); \ + void show ## name(void) + +SYSTAT_CMD ( sctp ); Copied: stable/10/usr.bin/systat/sctp.c (from r289873, head/usr.bin/systat/sctp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/systat/sctp.c Mon Jan 18 18:50:26 2016 (r294285, copy of r289873, head/usr.bin/systat/sctp.c) @@ -0,0 +1,362 @@ +/*- + * Copyright (c) 2015 + * The Regents of the University of California. All rights reserved. + * Michael Tuexen. 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#include +#include + +#include "systat.h" +#include "extern.h" +#include "mode.h" + +static struct sctpstat curstat, initstat, oldstat; + +/*- +--0 1 2 3 4 5 6 7 +--0123456789012345678901234567890123456789012345678901234567890123456789012345 +00 SCTP Associations SCTP Packets +01999999999999 associations initiated 999999999999 packets sent +02999999999999 associations accepted 999999999999 packets received +03999999999999 associations established 999999999999 - out of the blue +04999999999999 associations restarted 999999999999 - bad vtag +05999999999999 associations terminated 999999999999 - bad crc32c +06999999999999 associations aborted +07 +08 SCTP Timers SCTP Chunks +09999999999999 init timeouts 999999999999 control chunks sent +10999999999999 cookie timeouts 999999999999 data chunks sent +11999999999999 data timeouts 999999999999 - ordered +12999999999999 delayed sack timeouts 999999999999 - unordered +13999999999999 shutdown timeouts 999999999999 control chunks received +14999999999999 shutdown-ack timeouts 999999999999 data chunks received +15999999999999 shutdown guard timeouts 999999999999 - ordered +16999999999999 heartbeat timeouts 999999999999 - unordered +17999999999999 path MTU timeouts +18999999999999 autoclose timeouts SCTP user messages +19999999999999 asconf timeouts 999999999999 fragmented +20999999999999 stream reset timeouts 999999999999 reassembled +--0123456789012345678901234567890123456789012345678901234567890123456789012345 +--0 1 2 3 4 5 6 7 +*/ + +WINDOW * +opensctp(void) +{ + return (subwin(stdscr, LINES-3-1, 0, MAINWIN_ROW, 0)); +} + +void +closesctp(WINDOW *w) +{ + if (w != NULL) { + wclear(w); + wrefresh(w); + delwin(w); + } +} + +void +labelsctp(void) +{ + wmove(wnd, 0, 0); wclrtoeol(wnd); +#define L(row, str) mvwprintw(wnd, row, 13, str) +#define R(row, str) mvwprintw(wnd, row, 51, str); + L(0, "SCTP Associations"); R(0, "SCTP Packets"); + L(1, "associations initiated"); R(1, "packets sent"); + L(2, "associations accepted"); R(2, "packets received"); + L(3, "associations established"); R(3, "- out of the blue"); + L(4, "associations restarted"); R(4, "- bad vtag"); + L(5, "associations terminated"); R(5, "- bad crc32c"); + L(6, "associations aborted"); + + L(8, "SCTP Timers"); R(8, "SCTP Chunks"); + L(9, "init timeouts"); R(9, "control chunks sent"); + L(10, "cookie timeouts"); R(10, "data chunks sent"); + L(11, "data timeouts"); R(11, "- ordered"); + L(12, "delayed sack timeouts"); R(12, "- unordered"); + L(13, "shutdown timeouts"); R(13, "control chunks received"); + L(14, "shutdown-ack timeouts"); R(14, "data chunks received"); + L(15, "shutdown guard timeouts"); R(15, "- ordered"); + L(16, "heartbeat timeouts"); R(16, "- unordered"); + L(17, "path MTU timeouts"); + L(18, "autoclose timeouts"); R(18, "SCTP User Messages"); + L(19, "asconf timeouts"); R(19, "fragmented"); + L(20, "stream reset timeouts"); R(20, "reassembled"); +#undef L +#undef R +} + +static void +domode(struct sctpstat *ret) +{ + const struct sctpstat *sub; + int divisor = 1; + + switch(currentmode) { + case display_RATE: + sub = &oldstat; + divisor = (delay > 1000000) ? delay / 1000000 : 1; + break; + case display_DELTA: + sub = &oldstat; + break; + case display_SINCE: + sub = &initstat; + break; + default: + *ret = curstat; + return; + } +#define DO(stat) ret->stat = (curstat.stat - sub->stat) / divisor + DO(sctps_currestab); + DO(sctps_activeestab); + DO(sctps_restartestab); + DO(sctps_collisionestab); + DO(sctps_passiveestab); + DO(sctps_aborted); + DO(sctps_shutdown); + DO(sctps_outoftheblue); + DO(sctps_checksumerrors); + DO(sctps_outcontrolchunks); + DO(sctps_outorderchunks); + DO(sctps_outunorderchunks); + DO(sctps_incontrolchunks); + DO(sctps_inorderchunks); + DO(sctps_inunorderchunks); + DO(sctps_fragusrmsgs); + DO(sctps_reasmusrmsgs); + DO(sctps_outpackets); + DO(sctps_inpackets); + + DO(sctps_recvpackets); + DO(sctps_recvdatagrams); + DO(sctps_recvpktwithdata); + DO(sctps_recvsacks); + DO(sctps_recvdata); + DO(sctps_recvdupdata); + DO(sctps_recvheartbeat); + DO(sctps_recvheartbeatack); + DO(sctps_recvecne); + DO(sctps_recvauth); + DO(sctps_recvauthmissing); + DO(sctps_recvivalhmacid); + DO(sctps_recvivalkeyid); + DO(sctps_recvauthfailed); + DO(sctps_recvexpress); + DO(sctps_recvexpressm); + DO(sctps_recvnocrc); + DO(sctps_recvswcrc); + DO(sctps_recvhwcrc); + + DO(sctps_sendpackets); + DO(sctps_sendsacks); + DO(sctps_senddata); + DO(sctps_sendretransdata); + DO(sctps_sendfastretrans); + DO(sctps_sendmultfastretrans); + DO(sctps_sendheartbeat); + DO(sctps_sendecne); + DO(sctps_sendauth); + DO(sctps_senderrors); + DO(sctps_sendnocrc); + DO(sctps_sendswcrc); + DO(sctps_sendhwcrc); + + DO(sctps_pdrpfmbox); + DO(sctps_pdrpfehos); + DO(sctps_pdrpmbda); + DO(sctps_pdrpmbct); + DO(sctps_pdrpbwrpt); + DO(sctps_pdrpcrupt); + DO(sctps_pdrpnedat); + DO(sctps_pdrppdbrk); + DO(sctps_pdrptsnnf); + DO(sctps_pdrpdnfnd); + DO(sctps_pdrpdiwnp); + DO(sctps_pdrpdizrw); + DO(sctps_pdrpbadd); + DO(sctps_pdrpmark); + + DO(sctps_timoiterator); + DO(sctps_timodata); + DO(sctps_timowindowprobe); + DO(sctps_timoinit); + DO(sctps_timosack); + DO(sctps_timoshutdown); + DO(sctps_timoheartbeat); + DO(sctps_timocookie); + DO(sctps_timosecret); + DO(sctps_timopathmtu); + DO(sctps_timoshutdownack); + DO(sctps_timoshutdownguard); + DO(sctps_timostrmrst); + DO(sctps_timoearlyfr); + DO(sctps_timoasconf); + DO(sctps_timodelprim); + DO(sctps_timoautoclose); + DO(sctps_timoassockill); + DO(sctps_timoinpkill); + + DO(sctps_hdrops); + DO(sctps_badsum); + DO(sctps_noport); + DO(sctps_badvtag); + DO(sctps_badsid); + DO(sctps_nomem); + DO(sctps_fastretransinrtt); + DO(sctps_markedretrans); + DO(sctps_naglesent); + DO(sctps_naglequeued); + DO(sctps_maxburstqueued); + DO(sctps_ifnomemqueued); + DO(sctps_windowprobed); + DO(sctps_lowlevelerr); + DO(sctps_lowlevelerrusr); + DO(sctps_datadropchklmt); + DO(sctps_datadroprwnd); + DO(sctps_ecnereducedcwnd); + DO(sctps_vtagexpress); + DO(sctps_vtagbogus); + DO(sctps_primary_randry); + DO(sctps_cmt_randry); + DO(sctps_slowpath_sack); + DO(sctps_wu_sacks_sent); + DO(sctps_sends_with_flags); + DO(sctps_sends_with_unord); + DO(sctps_sends_with_eof); + DO(sctps_sends_with_abort); + DO(sctps_protocol_drain_calls); + DO(sctps_protocol_drains_done); + DO(sctps_read_peeks); + DO(sctps_cached_chk); + DO(sctps_cached_strmoq); + DO(sctps_left_abandon); + DO(sctps_send_burst_avoid); + DO(sctps_send_cwnd_avoid); + DO(sctps_fwdtsn_map_over); + DO(sctps_queue_upd_ecne); +#undef DO +} + +void +showsctp(void) +{ + struct sctpstat stats; + + memset(&stats, 0, sizeof stats); + domode(&stats); + +#define DO(stat, row, col) \ + mvwprintw(wnd, row, col, "%12lu", stats.stat) +#define L(row, stat) DO(stat, row, 0) +#define R(row, stat) DO(stat, row, 38) + L(1, sctps_activeestab); R(1, sctps_outpackets); + L(2, sctps_passiveestab); R(2, sctps_inpackets); + L(3, sctps_currestab); R(3, sctps_outoftheblue); + L(4, sctps_restartestab); R(4, sctps_badvtag); + L(5, sctps_shutdown); R(5, sctps_checksumerrors); + L(6, sctps_aborted); + + + L(9, sctps_timoinit); R(9, sctps_outcontrolchunks); + L(10, sctps_timocookie); R(10, sctps_senddata); + L(11, sctps_timodata); R(11, sctps_outorderchunks); + L(12, sctps_timosack); R(12, sctps_outunorderchunks); + L(13, sctps_timoshutdown); R(13, sctps_incontrolchunks); + L(14, sctps_timoshutdownack); R(14, sctps_recvdata); + L(15, sctps_timoshutdownguard); R(15, sctps_inorderchunks); + L(16, sctps_timoheartbeat); R(16, sctps_inunorderchunks); + L(17, sctps_timopathmtu); + L(18, sctps_timoautoclose); + L(19, sctps_timoasconf); R(19, sctps_fragusrmsgs); + L(20, sctps_timostrmrst); R(20, sctps_reasmusrmsgs); +#undef DO +#undef L +#undef R +} + +int +initsctp(void) +{ + size_t len; + const char *name = "net.inet.sctp.stats"; + + len = 0; + if (sysctlbyname(name, NULL, &len, NULL, 0) < 0) { + error("sysctl getting sctpstat size failed"); + return 0; + } + if (len > sizeof curstat) { + error("sctpstat structure has grown--recompile systat!"); + return 0; + } + if (sysctlbyname(name, &initstat, &len, NULL, 0) < 0) { + error("sysctl getting sctpstat failed"); + return 0; + } + oldstat = initstat; + return 1; +} + +void +resetsctp(void) +{ + size_t len; + const char *name = "net.inet.sctp.stats"; + + len = sizeof initstat; + if (sysctlbyname(name, &initstat, &len, NULL, 0) < 0) { + error("sysctl getting sctpstat failed"); + } + oldstat = initstat; +} + +void +fetchsctp(void) +{ + size_t len; + const char *name = "net.inet.sctp.stats"; + + oldstat = curstat; + len = sizeof curstat; + if (sysctlbyname(name, &curstat, &len, NULL, 0) < 0) { + error("sysctl getting sctpstat failed"); + } + return; +} Modified: stable/10/usr.bin/systat/systat.1 ============================================================================== --- stable/10/usr.bin/systat/systat.1 Mon Jan 18 18:41:09 2016 (r294284) +++ stable/10/usr.bin/systat/systat.1 Mon Jan 18 18:50:26 2016 (r294285) @@ -28,7 +28,7 @@ .\" @(#)systat.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd July 15, 2013 +.Dd October 24, 2015 .Dt SYSTAT 1 .Os .Sh NAME @@ -95,6 +95,7 @@ to be one of: .Ic ip6 , .Ic netstat , .Ic pigs , +.Ic sctp , .Ic swap , .Ic tcp , or @@ -223,6 +224,12 @@ except that it displays statistics. It does not display .Tn UDP statistics. +.It Ic sctp +Like +.Ic icmp , +but with +.Tn SCTP +statistics. .It Ic tcp Like .Ic icmp , From owner-svn-src-stable@freebsd.org Mon Jan 18 19:13:56 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB9B1A86E87; Mon, 18 Jan 2016 19:13:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44A621E87; Mon, 18 Jan 2016 19:13:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IJDtgf071353; Mon, 18 Jan 2016 19:13:55 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IJDsjf071343; Mon, 18 Jan 2016 19:13:54 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601181913.u0IJDsjf071343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 18 Jan 2016 19:13:54 +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: r294286 - in stable/10: contrib/less usr.bin/less 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 19:13:56 -0000 Author: delphij Date: Mon Jan 18 19:13:54 2016 New Revision: 294286 URL: https://svnweb.freebsd.org/changeset/base/294286 Log: MFC r293190: MFV r293125: less v481. Relnotes: yes Added: stable/10/contrib/less/compose.uni - copied unchanged from r293190, head/contrib/less/compose.uni stable/10/contrib/less/mkutable - copied unchanged from r293190, head/contrib/less/mkutable stable/10/contrib/less/ubin.uni - copied unchanged from r293190, head/contrib/less/ubin.uni stable/10/contrib/less/wide.uni - copied unchanged from r293190, head/contrib/less/wide.uni Modified: stable/10/contrib/less/LICENSE stable/10/contrib/less/NEWS stable/10/contrib/less/README stable/10/contrib/less/brac.c stable/10/contrib/less/ch.c stable/10/contrib/less/charset.c stable/10/contrib/less/charset.h stable/10/contrib/less/cmd.h stable/10/contrib/less/cmdbuf.c stable/10/contrib/less/command.c stable/10/contrib/less/cvt.c stable/10/contrib/less/decode.c stable/10/contrib/less/edit.c stable/10/contrib/less/filename.c stable/10/contrib/less/forwback.c stable/10/contrib/less/funcs.h stable/10/contrib/less/help.c stable/10/contrib/less/ifile.c stable/10/contrib/less/input.c stable/10/contrib/less/jump.c stable/10/contrib/less/less.h stable/10/contrib/less/less.hlp stable/10/contrib/less/less.nro stable/10/contrib/less/lessecho.c stable/10/contrib/less/lessecho.nro stable/10/contrib/less/lesskey.c stable/10/contrib/less/lesskey.h stable/10/contrib/less/lesskey.nro stable/10/contrib/less/lglob.h stable/10/contrib/less/line.c stable/10/contrib/less/linenum.c stable/10/contrib/less/lsystem.c stable/10/contrib/less/main.c stable/10/contrib/less/mark.c stable/10/contrib/less/mkhelp.c stable/10/contrib/less/optfunc.c stable/10/contrib/less/option.c stable/10/contrib/less/option.h stable/10/contrib/less/opttbl.c stable/10/contrib/less/os.c stable/10/contrib/less/output.c stable/10/contrib/less/pattern.c stable/10/contrib/less/pattern.h stable/10/contrib/less/pckeys.h stable/10/contrib/less/position.c stable/10/contrib/less/position.h stable/10/contrib/less/prompt.c stable/10/contrib/less/regexp.c stable/10/contrib/less/screen.c stable/10/contrib/less/scrsize.c stable/10/contrib/less/search.c stable/10/contrib/less/signal.c stable/10/contrib/less/tags.c stable/10/contrib/less/ttyin.c stable/10/contrib/less/version.c stable/10/usr.bin/less/defines.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/less/LICENSE ============================================================================== --- stable/10/contrib/less/LICENSE Mon Jan 18 18:50:26 2016 (r294285) +++ stable/10/contrib/less/LICENSE Mon Jan 18 19:13:54 2016 (r294286) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2012 Mark Nudelman +Copyright (C) 1984-2015 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/10/contrib/less/NEWS ============================================================================== --- stable/10/contrib/less/NEWS Mon Jan 18 18:50:26 2016 (r294285) +++ stable/10/contrib/less/NEWS Mon Jan 18 19:13:54 2016 (r294286) @@ -7,7 +7,44 @@ http://www.greenwoodsoftware.com/less You can also download the latest version of less from there. - To report bugs, suggestions or comments, send email to bug-less@gnu.org. + To report bugs, suggestions or comments, send email to bug-less@gnu.org + +====================================================================== + + Major changes between "less" versions 458 and 481 + +* Don't overwrite history file; just append to it. + +* New command ESC-G goes to end of currently buffered data in a pipe. + +* Disable history feature when compiled with LESSHISTFILE set to "-". + +* In more-compatible mode, make the -p option apply to every file opened, + not just the first one. + +* In more-compatible mode, change the -e option to work like -E, not -EF. + +* Treat multiple CRs before LF are like one CR (all the CRs are hidden). + +* Allow "extra" string in lesskey file to append to a multi-char command + (like a search pattern), without executing the command. + +* Ignore -u/-U setting while viewing help file, so that + underline and bold chars are displayed correctly. + +* Improve detection of "binary" files in UTF-8 mode. + +* Fix bug with ++ commands. + +* Fix bug where prompt was sometimes not displayed with +G. + +* Fix possible memory corruption + +* Fix bugs and improve performance in ampersand filtering. + +* Automate construction of Unicode tables from Unicode database. + +* Allow %% escape sequence in LESSOPEN variable. ====================================================================== Modified: stable/10/contrib/less/README ============================================================================== --- stable/10/contrib/less/README Mon Jan 18 18:50:26 2016 (r294285) +++ stable/10/contrib/less/README Mon Jan 18 19:13:54 2016 (r294286) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 458 + Less, version 481 - This is the distribution of less, version 458, released 04 Apr 2013. + This is the distribution of less, version 481, released 31 Aug 2015. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -53,8 +53,9 @@ INSTALLATION (Unix systems only): Specifies the regular expression library used by less for pattern matching. The default is "auto", which means the configure program finds a regular expression library automatically. Other values are: - posix Use the POSIX-compatible regcomp. + gnu Use the GNU regex library. pcre Use the PCRE library. + posix Use the POSIX-compatible regcomp. regcmp Use the regcmp library. re_comp Use the re_comp library. regcomp Use the V8-compatible regcomp. Modified: stable/10/contrib/less/brac.c ============================================================================== --- stable/10/contrib/less/brac.c Mon Jan 18 18:50:26 2016 (r294285) +++ stable/10/contrib/less/brac.c Mon Jan 18 19:13:54 2016 (r294286) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/10/contrib/less/ch.c ============================================================================== --- stable/10/contrib/less/ch.c Mon Jan 18 18:50:26 2016 (r294285) +++ stable/10/contrib/less/ch.c Mon Jan 18 19:13:54 2016 (r294286) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -54,7 +54,7 @@ struct buf { * The file state is maintained in a filestate structure. * A pointer to the filestate is kept in the ifile structure. */ -#define BUFHASH_SIZE 64 +#define BUFHASH_SIZE 1024 struct filestate { struct bufnode buflist; struct bufnode hashtbl[BUFHASH_SIZE]; @@ -323,13 +323,16 @@ ch_get() #if HAVE_STAT_INO if (follow_mode == FOLLOW_NAME) { - /* See whether the file's i-number has changed. + /* See whether the file's i-number has changed, + * or the file has shrunk. * If so, force the file to be closed and * reopened. */ struct stat st; + POSITION curr_pos = ch_tell(); int r = stat(get_filename(curr_ifile), &st); if (r == 0 && (st.st_ino != curr_ino || - st.st_dev != curr_dev)) + st.st_dev != curr_dev || + (curr_pos != NULL_POSITION && st.st_size < curr_pos))) { /* screen_trashed=2 causes * make_display to reopen the file. */ @@ -536,6 +539,32 @@ ch_end_seek() } /* + * Seek to the last position in the file that is currently buffered. + */ + public int +ch_end_buffer_seek() +{ + register struct buf *bp; + register struct bufnode *bn; + POSITION buf_pos; + POSITION end_pos; + + if (thisfile == NULL || (ch_flags & CH_CANSEEK)) + return (ch_end_seek()); + + end_pos = 0; + FOR_BUFS(bn) + { + bp = bufnode_buf(bn); + buf_pos = (bp->block * LBUFSIZE) + bp->datasize; + if (buf_pos > end_pos) + end_pos = buf_pos; + } + + return (ch_seek(end_pos)); +} + +/* * Seek to the beginning of the file, or as close to it as we can get. * We may not be able to seek there if input is a pipe and the * beginning of the pipe is no longer buffered. Modified: stable/10/contrib/less/charset.c ============================================================================== --- stable/10/contrib/less/charset.c Mon Jan 18 18:50:26 2016 (r294285) +++ stable/10/contrib/less/charset.c Mon Jan 18 19:13:54 2016 (r294286) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -466,36 +466,15 @@ prutfchar(ch) else SNPRINTF1(buf, sizeof(buf), binfmt, (char) ch); } else if (is_ubin_char(ch)) + { SNPRINTF1(buf, sizeof(buf), utfbinfmt, ch); - else + } else { - int len; + char *p = buf; if (ch >= 0x80000000) - { - len = 3; - ch = 0xFFFD; - } else - { - len = (ch < 0x80) ? 1 - : (ch < 0x800) ? 2 - : (ch < 0x10000) ? 3 - : (ch < 0x200000) ? 4 - : (ch < 0x4000000) ? 5 - : 6; - } - buf[len] = '\0'; - if (len == 1) - *buf = (char) ch; - else - { - *buf = ((1 << len) - 1) << (8 - len); - while (--len > 0) - { - buf[len] = (char) (0x80 | (ch & 0x3F)); - ch >>= 6; - } - *buf |= ch; - } + ch = 0xFFFD; /* REPLACEMENT CHARACTER */ + put_wchar(&p, ch); + *p = '\0'; } return (buf); } @@ -524,11 +503,12 @@ utf_len(ch) } /* - * Is a UTF-8 character well-formed? + * Does the parameter point to the lead byte of a well-formed UTF-8 character? */ public int -is_utf8_well_formed(s) +is_utf8_well_formed(s, slen) unsigned char *s; + int slen; { int i; int len; @@ -537,6 +517,8 @@ is_utf8_well_formed(s) return (0); len = utf_len((char) s[0]); + if (len > slen) + return (0); if (len == 1) return (1); if (len == 2) @@ -558,6 +540,35 @@ is_utf8_well_formed(s) } /* + * Return number of invalid UTF-8 sequences found in a buffer. + */ + public int +utf_bin_count(data, len) + unsigned char *data; + int len; +{ + int bin_count = 0; + while (len > 0) + { + if (is_utf8_well_formed(data, len)) + { + int clen = utf_len(*data); + data += clen; + len -= clen; + } else + { + /* Skip to next lead byte. */ + bin_count++; + do { + ++data; + --len; + } while (len > 0 && !IS_UTF8_LEAD(*data)); + } + } + return (bin_count); +} + +/* * Get the value of a UTF-8 character. */ public LWCHAR @@ -706,411 +717,51 @@ step_char(pp, dir, limit) /* * Unicode characters data + * Actual data is in the generated *.uni files. */ -struct wchar_range { LWCHAR first, last; }; -/* - * Characters with general category values - * Mn: Mark, Nonspacing - * Me: Mark, Enclosing - * Last synched with - * - * dated 2005-11-30T00:58:48Z - */ -static struct wchar_range comp_table[] = { - { 0x0300, 0x036F} /* Mn */, { 0x0483, 0x0486} /* Mn */, - { 0x0488, 0x0489} /* Me */, - { 0x0591, 0x05BD} /* Mn */, { 0x05BF, 0x05BF} /* Mn */, - { 0x05C1, 0x05C2} /* Mn */, { 0x05C4, 0x05C5} /* Mn */, - { 0x05C7, 0x05C7} /* Mn */, { 0x0610, 0x0615} /* Mn */, - { 0x064B, 0x065E} /* Mn */, { 0x0670, 0x0670} /* Mn */, - { 0x06D6, 0x06DC} /* Mn */, - { 0x06DE, 0x06DE} /* Me */, - { 0x06DF, 0x06E4} /* Mn */, { 0x06E7, 0x06E8} /* Mn */, - { 0x06EA, 0x06ED} /* Mn */, { 0x0711, 0x0711} /* Mn */, - { 0x0730, 0x074A} /* Mn */, { 0x07A6, 0x07B0} /* Mn */, - { 0x07EB, 0x07F3} /* Mn */, { 0x0901, 0x0902} /* Mn */, - { 0x093C, 0x093C} /* Mn */, { 0x0941, 0x0948} /* Mn */, - { 0x094D, 0x094D} /* Mn */, { 0x0951, 0x0954} /* Mn */, - { 0x0962, 0x0963} /* Mn */, { 0x0981, 0x0981} /* Mn */, - { 0x09BC, 0x09BC} /* Mn */, { 0x09C1, 0x09C4} /* Mn */, - { 0x09CD, 0x09CD} /* Mn */, { 0x09E2, 0x09E3} /* Mn */, - { 0x0A01, 0x0A02} /* Mn */, { 0x0A3C, 0x0A3C} /* Mn */, - { 0x0A41, 0x0A42} /* Mn */, { 0x0A47, 0x0A48} /* Mn */, - { 0x0A4B, 0x0A4D} /* Mn */, { 0x0A70, 0x0A71} /* Mn */, - { 0x0A81, 0x0A82} /* Mn */, { 0x0ABC, 0x0ABC} /* Mn */, - { 0x0AC1, 0x0AC5} /* Mn */, { 0x0AC7, 0x0AC8} /* Mn */, - { 0x0ACD, 0x0ACD} /* Mn */, { 0x0AE2, 0x0AE3} /* Mn */, - { 0x0B01, 0x0B01} /* Mn */, { 0x0B3C, 0x0B3C} /* Mn */, - { 0x0B3F, 0x0B3F} /* Mn */, { 0x0B41, 0x0B43} /* Mn */, - { 0x0B4D, 0x0B4D} /* Mn */, { 0x0B56, 0x0B56} /* Mn */, - { 0x0B82, 0x0B82} /* Mn */, { 0x0BC0, 0x0BC0} /* Mn */, - { 0x0BCD, 0x0BCD} /* Mn */, { 0x0C3E, 0x0C40} /* Mn */, - { 0x0C46, 0x0C48} /* Mn */, { 0x0C4A, 0x0C4D} /* Mn */, - { 0x0C55, 0x0C56} /* Mn */, { 0x0CBC, 0x0CBC} /* Mn */, - { 0x0CBF, 0x0CBF} /* Mn */, { 0x0CC6, 0x0CC6} /* Mn */, - { 0x0CCC, 0x0CCD} /* Mn */, { 0x0CE2, 0x0CE3} /* Mn */, - { 0x0D41, 0x0D43} /* Mn */, { 0x0D4D, 0x0D4D} /* Mn */, - { 0x0DCA, 0x0DCA} /* Mn */, { 0x0DD2, 0x0DD4} /* Mn */, - { 0x0DD6, 0x0DD6} /* Mn */, { 0x0E31, 0x0E31} /* Mn */, - { 0x0E34, 0x0E3A} /* Mn */, { 0x0E47, 0x0E4E} /* Mn */, - { 0x0EB1, 0x0EB1} /* Mn */, { 0x0EB4, 0x0EB9} /* Mn */, - { 0x0EBB, 0x0EBC} /* Mn */, { 0x0EC8, 0x0ECD} /* Mn */, - { 0x0F18, 0x0F19} /* Mn */, { 0x0F35, 0x0F35} /* Mn */, - { 0x0F37, 0x0F37} /* Mn */, { 0x0F39, 0x0F39} /* Mn */, - { 0x0F71, 0x0F7E} /* Mn */, { 0x0F80, 0x0F84} /* Mn */, - { 0x0F86, 0x0F87} /* Mn */, { 0x0F90, 0x0F97} /* Mn */, - { 0x0F99, 0x0FBC} /* Mn */, { 0x0FC6, 0x0FC6} /* Mn */, - { 0x102D, 0x1030} /* Mn */, { 0x1032, 0x1032} /* Mn */, - { 0x1036, 0x1037} /* Mn */, { 0x1039, 0x1039} /* Mn */, - { 0x1058, 0x1059} /* Mn */, { 0x135F, 0x135F} /* Mn */, - { 0x1712, 0x1714} /* Mn */, { 0x1732, 0x1734} /* Mn */, - { 0x1752, 0x1753} /* Mn */, { 0x1772, 0x1773} /* Mn */, - { 0x17B7, 0x17BD} /* Mn */, { 0x17C6, 0x17C6} /* Mn */, - { 0x17C9, 0x17D3} /* Mn */, { 0x17DD, 0x17DD} /* Mn */, - { 0x180B, 0x180D} /* Mn */, { 0x18A9, 0x18A9} /* Mn */, - { 0x1920, 0x1922} /* Mn */, { 0x1927, 0x1928} /* Mn */, - { 0x1932, 0x1932} /* Mn */, { 0x1939, 0x193B} /* Mn */, - { 0x1A17, 0x1A18} /* Mn */, { 0x1B00, 0x1B03} /* Mn */, - { 0x1B34, 0x1B34} /* Mn */, { 0x1B36, 0x1B3A} /* Mn */, - { 0x1B3C, 0x1B3C} /* Mn */, { 0x1B42, 0x1B42} /* Mn */, - { 0x1B6B, 0x1B73} /* Mn */, { 0x1DC0, 0x1DCA} /* Mn */, - { 0x1DFE, 0x1DFF} /* Mn */, { 0x20D0, 0x20DC} /* Mn */, - { 0x20DD, 0x20E0} /* Me */, - { 0x20E1, 0x20E1} /* Mn */, - { 0x20E2, 0x20E4} /* Me */, - { 0x20E5, 0x20EF} /* Mn */, { 0x302A, 0x302F} /* Mn */, - { 0x3099, 0x309A} /* Mn */, { 0xA806, 0xA806} /* Mn */, - { 0xA80B, 0xA80B} /* Mn */, { 0xA825, 0xA826} /* Mn */, - { 0xFB1E, 0xFB1E} /* Mn */, { 0xFE00, 0xFE0F} /* Mn */, - { 0xFE20, 0xFE23} /* Mn */, { 0x10A01, 0x10A03} /* Mn */, - { 0x10A05, 0x10A06} /* Mn */, { 0x10A0C, 0x10A0F} /* Mn */, - { 0x10A38, 0x10A3A} /* Mn */, { 0x10A3F, 0x10A3F} /* Mn */, - { 0x1D167, 0x1D169} /* Mn */, { 0x1D17B, 0x1D182} /* Mn */, - { 0x1D185, 0x1D18B} /* Mn */, { 0x1D1AA, 0x1D1AD} /* Mn */, - { 0x1D242, 0x1D244} /* Mn */, { 0xE0100, 0xE01EF} /* Mn */, -}; +#define DECLARE_RANGE_TABLE_START(name) \ + static struct wchar_range name##_array[] = { +#define DECLARE_RANGE_TABLE_END(name) \ + }; struct wchar_range_table name##_table = { name##_array, sizeof(name##_array)/sizeof(*name##_array) }; -/* - * Special pairs, not ranges. - */ +DECLARE_RANGE_TABLE_START(compose) +#include "compose.uni" +DECLARE_RANGE_TABLE_END(compose) + +DECLARE_RANGE_TABLE_START(ubin) +#include "ubin.uni" +DECLARE_RANGE_TABLE_END(ubin) + +DECLARE_RANGE_TABLE_START(wide) +#include "wide.uni" +DECLARE_RANGE_TABLE_END(wide) + +/* comb_table is special pairs, not ranges. */ static struct wchar_range comb_table[] = { {0x0644,0x0622}, {0x0644,0x0623}, {0x0644,0x0625}, {0x0644,0x0627}, }; -/* - * Characters with general category values - * Cc: Other, Control - * Cf: Other, Format - * Cs: Other, Surrogate - * Co: Other, Private Use - * Cn: Other, Not Assigned - * Zl: Separator, Line - * Zp: Separator, Paragraph - * Last synched with - * - * dated 2005-11-30T00:58:48Z - */ -static struct wchar_range ubin_table[] = { - { 0x0000, 0x0007} /* Cc */, - { 0x000B, 0x000C} /* Cc */, - { 0x000E, 0x001A} /* Cc */, - { 0x001C, 0x001F} /* Cc */, - { 0x007F, 0x009F} /* Cc */, -#if 0 - { 0x00AD, 0x00AD} /* Cf */, -#endif - { 0x0370, 0x0373} /* Cn */, { 0x0376, 0x0379} /* Cn */, - { 0x037F, 0x0383} /* Cn */, { 0x038B, 0x038B} /* Cn */, - { 0x038D, 0x038D} /* Cn */, { 0x03A2, 0x03A2} /* Cn */, - { 0x03CF, 0x03CF} /* Cn */, { 0x0487, 0x0487} /* Cn */, - { 0x0514, 0x0530} /* Cn */, { 0x0557, 0x0558} /* Cn */, - { 0x0560, 0x0560} /* Cn */, { 0x0588, 0x0588} /* Cn */, - { 0x058B, 0x0590} /* Cn */, { 0x05C8, 0x05CF} /* Cn */, - { 0x05EB, 0x05EF} /* Cn */, { 0x05F5, 0x05FF} /* Cn */, -#if 0 - { 0x0600, 0x0603} /* Cf */, -#endif - { 0x0604, 0x060A} /* Cn */, { 0x0616, 0x061A} /* Cn */, - { 0x061C, 0x061D} /* Cn */, { 0x0620, 0x0620} /* Cn */, - { 0x063B, 0x063F} /* Cn */, { 0x065F, 0x065F} /* Cn */, -#if 0 - { 0x06DD, 0x06DD} /* Cf */, -#endif - { 0x070E, 0x070E} /* Cn */, -#if 0 - { 0x070F, 0x070F} /* Cf */, -#endif - { 0x074B, 0x074C} /* Cn */, { 0x076E, 0x077F} /* Cn */, - { 0x07B2, 0x07BF} /* Cn */, { 0x07FB, 0x0900} /* Cn */, - { 0x093A, 0x093B} /* Cn */, { 0x094E, 0x094F} /* Cn */, - { 0x0955, 0x0957} /* Cn */, { 0x0971, 0x097A} /* Cn */, - { 0x0980, 0x0980} /* Cn */, { 0x0984, 0x0984} /* Cn */, - { 0x098D, 0x098E} /* Cn */, { 0x0991, 0x0992} /* Cn */, - { 0x09A9, 0x09A9} /* Cn */, { 0x09B1, 0x09B1} /* Cn */, - { 0x09B3, 0x09B5} /* Cn */, { 0x09BA, 0x09BB} /* Cn */, - { 0x09C5, 0x09C6} /* Cn */, { 0x09C9, 0x09CA} /* Cn */, - { 0x09CF, 0x09D6} /* Cn */, { 0x09D8, 0x09DB} /* Cn */, - { 0x09DE, 0x09DE} /* Cn */, { 0x09E4, 0x09E5} /* Cn */, - { 0x09FB, 0x0A00} /* Cn */, { 0x0A04, 0x0A04} /* Cn */, - { 0x0A0B, 0x0A0E} /* Cn */, { 0x0A11, 0x0A12} /* Cn */, - { 0x0A29, 0x0A29} /* Cn */, { 0x0A31, 0x0A31} /* Cn */, - { 0x0A34, 0x0A34} /* Cn */, { 0x0A37, 0x0A37} /* Cn */, - { 0x0A3A, 0x0A3B} /* Cn */, { 0x0A3D, 0x0A3D} /* Cn */, - { 0x0A43, 0x0A46} /* Cn */, { 0x0A49, 0x0A4A} /* Cn */, - { 0x0A4E, 0x0A58} /* Cn */, { 0x0A5D, 0x0A5D} /* Cn */, - { 0x0A5F, 0x0A65} /* Cn */, { 0x0A75, 0x0A80} /* Cn */, - { 0x0A84, 0x0A84} /* Cn */, { 0x0A8E, 0x0A8E} /* Cn */, - { 0x0A92, 0x0A92} /* Cn */, { 0x0AA9, 0x0AA9} /* Cn */, - { 0x0AB1, 0x0AB1} /* Cn */, { 0x0AB4, 0x0AB4} /* Cn */, - { 0x0ABA, 0x0ABB} /* Cn */, { 0x0AC6, 0x0AC6} /* Cn */, - { 0x0ACA, 0x0ACA} /* Cn */, { 0x0ACE, 0x0ACF} /* Cn */, - { 0x0AD1, 0x0ADF} /* Cn */, { 0x0AE4, 0x0AE5} /* Cn */, - { 0x0AF0, 0x0AF0} /* Cn */, { 0x0AF2, 0x0B00} /* Cn */, - { 0x0B04, 0x0B04} /* Cn */, { 0x0B0D, 0x0B0E} /* Cn */, - { 0x0B11, 0x0B12} /* Cn */, { 0x0B29, 0x0B29} /* Cn */, - { 0x0B31, 0x0B31} /* Cn */, { 0x0B34, 0x0B34} /* Cn */, - { 0x0B3A, 0x0B3B} /* Cn */, { 0x0B44, 0x0B46} /* Cn */, - { 0x0B49, 0x0B4A} /* Cn */, { 0x0B4E, 0x0B55} /* Cn */, - { 0x0B58, 0x0B5B} /* Cn */, { 0x0B5E, 0x0B5E} /* Cn */, - { 0x0B62, 0x0B65} /* Cn */, { 0x0B72, 0x0B81} /* Cn */, - { 0x0B84, 0x0B84} /* Cn */, { 0x0B8B, 0x0B8D} /* Cn */, - { 0x0B91, 0x0B91} /* Cn */, { 0x0B96, 0x0B98} /* Cn */, - { 0x0B9B, 0x0B9B} /* Cn */, { 0x0B9D, 0x0B9D} /* Cn */, - { 0x0BA0, 0x0BA2} /* Cn */, { 0x0BA5, 0x0BA7} /* Cn */, - { 0x0BAB, 0x0BAD} /* Cn */, { 0x0BBA, 0x0BBD} /* Cn */, - { 0x0BC3, 0x0BC5} /* Cn */, { 0x0BC9, 0x0BC9} /* Cn */, - { 0x0BCE, 0x0BD6} /* Cn */, { 0x0BD8, 0x0BE5} /* Cn */, - { 0x0BFB, 0x0C00} /* Cn */, { 0x0C04, 0x0C04} /* Cn */, - { 0x0C0D, 0x0C0D} /* Cn */, { 0x0C11, 0x0C11} /* Cn */, - { 0x0C29, 0x0C29} /* Cn */, { 0x0C34, 0x0C34} /* Cn */, - { 0x0C3A, 0x0C3D} /* Cn */, { 0x0C45, 0x0C45} /* Cn */, - { 0x0C49, 0x0C49} /* Cn */, { 0x0C4E, 0x0C54} /* Cn */, - { 0x0C57, 0x0C5F} /* Cn */, { 0x0C62, 0x0C65} /* Cn */, - { 0x0C70, 0x0C81} /* Cn */, { 0x0C84, 0x0C84} /* Cn */, - { 0x0C8D, 0x0C8D} /* Cn */, { 0x0C91, 0x0C91} /* Cn */, - { 0x0CA9, 0x0CA9} /* Cn */, { 0x0CB4, 0x0CB4} /* Cn */, - { 0x0CBA, 0x0CBB} /* Cn */, { 0x0CC5, 0x0CC5} /* Cn */, - { 0x0CC9, 0x0CC9} /* Cn */, { 0x0CCE, 0x0CD4} /* Cn */, - { 0x0CD7, 0x0CDD} /* Cn */, { 0x0CDF, 0x0CDF} /* Cn */, - { 0x0CE4, 0x0CE5} /* Cn */, { 0x0CF0, 0x0CF0} /* Cn */, - { 0x0CF3, 0x0D01} /* Cn */, { 0x0D04, 0x0D04} /* Cn */, - { 0x0D0D, 0x0D0D} /* Cn */, { 0x0D11, 0x0D11} /* Cn */, - { 0x0D29, 0x0D29} /* Cn */, { 0x0D3A, 0x0D3D} /* Cn */, - { 0x0D44, 0x0D45} /* Cn */, { 0x0D49, 0x0D49} /* Cn */, - { 0x0D4E, 0x0D56} /* Cn */, { 0x0D58, 0x0D5F} /* Cn */, - { 0x0D62, 0x0D65} /* Cn */, { 0x0D70, 0x0D81} /* Cn */, - { 0x0D84, 0x0D84} /* Cn */, { 0x0D97, 0x0D99} /* Cn */, - { 0x0DB2, 0x0DB2} /* Cn */, { 0x0DBC, 0x0DBC} /* Cn */, - { 0x0DBE, 0x0DBF} /* Cn */, { 0x0DC7, 0x0DC9} /* Cn */, - { 0x0DCB, 0x0DCE} /* Cn */, { 0x0DD5, 0x0DD5} /* Cn */, - { 0x0DD7, 0x0DD7} /* Cn */, { 0x0DE0, 0x0DF1} /* Cn */, - { 0x0DF5, 0x0E00} /* Cn */, { 0x0E3B, 0x0E3E} /* Cn */, - { 0x0E5C, 0x0E80} /* Cn */, { 0x0E83, 0x0E83} /* Cn */, - { 0x0E85, 0x0E86} /* Cn */, { 0x0E89, 0x0E89} /* Cn */, - { 0x0E8B, 0x0E8C} /* Cn */, { 0x0E8E, 0x0E93} /* Cn */, - { 0x0E98, 0x0E98} /* Cn */, { 0x0EA0, 0x0EA0} /* Cn */, - { 0x0EA4, 0x0EA4} /* Cn */, { 0x0EA6, 0x0EA6} /* Cn */, - { 0x0EA8, 0x0EA9} /* Cn */, { 0x0EAC, 0x0EAC} /* Cn */, - { 0x0EBA, 0x0EBA} /* Cn */, { 0x0EBE, 0x0EBF} /* Cn */, - { 0x0EC5, 0x0EC5} /* Cn */, { 0x0EC7, 0x0EC7} /* Cn */, - { 0x0ECE, 0x0ECF} /* Cn */, { 0x0EDA, 0x0EDB} /* Cn */, - { 0x0EDE, 0x0EFF} /* Cn */, { 0x0F48, 0x0F48} /* Cn */, - { 0x0F6B, 0x0F70} /* Cn */, { 0x0F8C, 0x0F8F} /* Cn */, - { 0x0F98, 0x0F98} /* Cn */, { 0x0FBD, 0x0FBD} /* Cn */, - { 0x0FCD, 0x0FCE} /* Cn */, { 0x0FD2, 0x0FFF} /* Cn */, - { 0x1022, 0x1022} /* Cn */, { 0x1028, 0x1028} /* Cn */, - { 0x102B, 0x102B} /* Cn */, { 0x1033, 0x1035} /* Cn */, - { 0x103A, 0x103F} /* Cn */, { 0x105A, 0x109F} /* Cn */, - { 0x10C6, 0x10CF} /* Cn */, { 0x10FD, 0x10FF} /* Cn */, - { 0x115A, 0x115E} /* Cn */, { 0x11A3, 0x11A7} /* Cn */, - { 0x11FA, 0x11FF} /* Cn */, { 0x1249, 0x1249} /* Cn */, - { 0x124E, 0x124F} /* Cn */, { 0x1257, 0x1257} /* Cn */, - { 0x1259, 0x1259} /* Cn */, { 0x125E, 0x125F} /* Cn */, - { 0x1289, 0x1289} /* Cn */, { 0x128E, 0x128F} /* Cn */, - { 0x12B1, 0x12B1} /* Cn */, { 0x12B6, 0x12B7} /* Cn */, - { 0x12BF, 0x12BF} /* Cn */, { 0x12C1, 0x12C1} /* Cn */, - { 0x12C6, 0x12C7} /* Cn */, { 0x12D7, 0x12D7} /* Cn */, - { 0x1311, 0x1311} /* Cn */, { 0x1316, 0x1317} /* Cn */, - { 0x135B, 0x135E} /* Cn */, { 0x137D, 0x137F} /* Cn */, - { 0x139A, 0x139F} /* Cn */, { 0x13F5, 0x1400} /* Cn */, - { 0x1677, 0x167F} /* Cn */, { 0x169D, 0x169F} /* Cn */, - { 0x16F1, 0x16FF} /* Cn */, { 0x170D, 0x170D} /* Cn */, - { 0x1715, 0x171F} /* Cn */, { 0x1737, 0x173F} /* Cn */, - { 0x1754, 0x175F} /* Cn */, { 0x176D, 0x176D} /* Cn */, - { 0x1771, 0x1771} /* Cn */, { 0x1774, 0x177F} /* Cn */, -#if 0 - { 0x17B4, 0x17B5} /* Cf */, -#endif - { 0x17DE, 0x17DF} /* Cn */, { 0x17EA, 0x17EF} /* Cn */, - { 0x17FA, 0x17FF} /* Cn */, { 0x180F, 0x180F} /* Cn */, - { 0x181A, 0x181F} /* Cn */, { 0x1878, 0x187F} /* Cn */, - { 0x18AA, 0x18FF} /* Cn */, { 0x191D, 0x191F} /* Cn */, - { 0x192C, 0x192F} /* Cn */, { 0x193C, 0x193F} /* Cn */, - { 0x1941, 0x1943} /* Cn */, { 0x196E, 0x196F} /* Cn */, - { 0x1975, 0x197F} /* Cn */, { 0x19AA, 0x19AF} /* Cn */, - { 0x19CA, 0x19CF} /* Cn */, { 0x19DA, 0x19DD} /* Cn */, - { 0x1A1C, 0x1A1D} /* Cn */, { 0x1A20, 0x1AFF} /* Cn */, - { 0x1B4C, 0x1B4F} /* Cn */, { 0x1B7D, 0x1CFF} /* Cn */, - { 0x1DCB, 0x1DFD} /* Cn */, { 0x1E9C, 0x1E9F} /* Cn */, - { 0x1EFA, 0x1EFF} /* Cn */, { 0x1F16, 0x1F17} /* Cn */, - { 0x1F1E, 0x1F1F} /* Cn */, { 0x1F46, 0x1F47} /* Cn */, - { 0x1F4E, 0x1F4F} /* Cn */, { 0x1F58, 0x1F58} /* Cn */, - { 0x1F5A, 0x1F5A} /* Cn */, { 0x1F5C, 0x1F5C} /* Cn */, - { 0x1F5E, 0x1F5E} /* Cn */, { 0x1F7E, 0x1F7F} /* Cn */, - { 0x1FB5, 0x1FB5} /* Cn */, { 0x1FC5, 0x1FC5} /* Cn */, - { 0x1FD4, 0x1FD5} /* Cn */, { 0x1FDC, 0x1FDC} /* Cn */, - { 0x1FF0, 0x1FF1} /* Cn */, { 0x1FF5, 0x1FF5} /* Cn */, - { 0x1FFF, 0x1FFF} /* Cn */, - { 0x200B, 0x200F} /* Cf */, - { 0x2028, 0x2028} /* Zl */, - { 0x2029, 0x2029} /* Zp */, - { 0x202A, 0x202E} /* Cf */, - { 0x2060, 0x2063} /* Cf */, - { 0x2064, 0x2069} /* Cn */, - { 0x206A, 0x206F} /* Cf */, - { 0x2072, 0x2073} /* Cn */, { 0x208F, 0x208F} /* Cn */, - { 0x2095, 0x209F} /* Cn */, { 0x20B6, 0x20CF} /* Cn */, - { 0x20F0, 0x20FF} /* Cn */, { 0x214F, 0x2152} /* Cn */, - { 0x2185, 0x218F} /* Cn */, { 0x23E8, 0x23FF} /* Cn */, - { 0x2427, 0x243F} /* Cn */, { 0x244B, 0x245F} /* Cn */, - { 0x269D, 0x269F} /* Cn */, { 0x26B3, 0x2700} /* Cn */, - { 0x2705, 0x2705} /* Cn */, { 0x270A, 0x270B} /* Cn */, - { 0x2728, 0x2728} /* Cn */, { 0x274C, 0x274C} /* Cn */, - { 0x274E, 0x274E} /* Cn */, { 0x2753, 0x2755} /* Cn */, - { 0x2757, 0x2757} /* Cn */, { 0x275F, 0x2760} /* Cn */, - { 0x2795, 0x2797} /* Cn */, { 0x27B0, 0x27B0} /* Cn */, - { 0x27BF, 0x27BF} /* Cn */, { 0x27CB, 0x27CF} /* Cn */, - { 0x27EC, 0x27EF} /* Cn */, { 0x2B1B, 0x2B1F} /* Cn */, - { 0x2B24, 0x2BFF} /* Cn */, { 0x2C2F, 0x2C2F} /* Cn */, - { 0x2C5F, 0x2C5F} /* Cn */, { 0x2C6D, 0x2C73} /* Cn */, - { 0x2C78, 0x2C7F} /* Cn */, { 0x2CEB, 0x2CF8} /* Cn */, - { 0x2D26, 0x2D2F} /* Cn */, { 0x2D66, 0x2D6E} /* Cn */, - { 0x2D70, 0x2D7F} /* Cn */, { 0x2D97, 0x2D9F} /* Cn */, - { 0x2DA7, 0x2DA7} /* Cn */, { 0x2DAF, 0x2DAF} /* Cn */, - { 0x2DB7, 0x2DB7} /* Cn */, { 0x2DBF, 0x2DBF} /* Cn */, - { 0x2DC7, 0x2DC7} /* Cn */, { 0x2DCF, 0x2DCF} /* Cn */, - { 0x2DD7, 0x2DD7} /* Cn */, { 0x2DDF, 0x2DFF} /* Cn */, - { 0x2E18, 0x2E1B} /* Cn */, { 0x2E1E, 0x2E7F} /* Cn */, - { 0x2E9A, 0x2E9A} /* Cn */, { 0x2EF4, 0x2EFF} /* Cn */, - { 0x2FD6, 0x2FEF} /* Cn */, { 0x2FFC, 0x2FFF} /* Cn */, - { 0x3040, 0x3040} /* Cn */, { 0x3097, 0x3098} /* Cn */, - { 0x3100, 0x3104} /* Cn */, { 0x312D, 0x3130} /* Cn */, - { 0x318F, 0x318F} /* Cn */, { 0x31B8, 0x31BF} /* Cn */, - { 0x31D0, 0x31EF} /* Cn */, { 0x321F, 0x321F} /* Cn */, - { 0x3244, 0x324F} /* Cn */, { 0x32FF, 0x32FF} /* Cn */, - { 0x4DB6, 0x4DBF} /* Cn */, { 0x9FBC, 0x9FFF} /* Cn */, - { 0xA48D, 0xA48F} /* Cn */, { 0xA4C7, 0xA6FF} /* Cn */, - { 0xA71B, 0xA71F} /* Cn */, { 0xA722, 0xA7FF} /* Cn */, - { 0xA82C, 0xA83F} /* Cn */, { 0xA878, 0xABFF} /* Cn */, - { 0xD7A4, 0xD7FF} /* Cn */, - { 0xD800, 0xDFFF} /* Cs */, - { 0xE000, 0xF8FF} /* Co */, - { 0xFA2E, 0xFA2F} /* Cn */, { 0xFA6B, 0xFA6F} /* Cn */, - { 0xFADA, 0xFAFF} /* Cn */, { 0xFB07, 0xFB12} /* Cn */, - { 0xFB18, 0xFB1C} /* Cn */, { 0xFB37, 0xFB37} /* Cn */, - { 0xFB3D, 0xFB3D} /* Cn */, { 0xFB3F, 0xFB3F} /* Cn */, - { 0xFB42, 0xFB42} /* Cn */, { 0xFB45, 0xFB45} /* Cn */, - { 0xFBB2, 0xFBD2} /* Cn */, { 0xFD40, 0xFD4F} /* Cn */, - { 0xFD90, 0xFD91} /* Cn */, { 0xFDC8, 0xFDEF} /* Cn */, - { 0xFDFE, 0xFDFF} /* Cn */, { 0xFE1A, 0xFE1F} /* Cn */, - { 0xFE24, 0xFE2F} /* Cn */, { 0xFE53, 0xFE53} /* Cn */, - { 0xFE67, 0xFE67} /* Cn */, { 0xFE6C, 0xFE6F} /* Cn */, - { 0xFE75, 0xFE75} /* Cn */, { 0xFEFD, 0xFEFE} /* Cn */, - { 0xFEFF, 0xFEFF} /* Cf */, - { 0xFF00, 0xFF00} /* Cn */, { 0xFFBF, 0xFFC1} /* Cn */, - { 0xFFC8, 0xFFC9} /* Cn */, { 0xFFD0, 0xFFD1} /* Cn */, - { 0xFFD8, 0xFFD9} /* Cn */, { 0xFFDD, 0xFFDF} /* Cn */, - { 0xFFE7, 0xFFE7} /* Cn */, { 0xFFEF, 0xFFF8} /* Cn */, - { 0xFFF9, 0xFFFB} /* Cf */, - { 0xFFFE, 0xFFFF} /* Cn */, { 0x1000C, 0x1000C} /* Cn */, - { 0x10027, 0x10027} /* Cn */, { 0x1003B, 0x1003B} /* Cn */, - { 0x1003E, 0x1003E} /* Cn */, { 0x1004E, 0x1004F} /* Cn */, - { 0x1005E, 0x1007F} /* Cn */, { 0x100FB, 0x100FF} /* Cn */, - { 0x10103, 0x10106} /* Cn */, { 0x10134, 0x10136} /* Cn */, - { 0x1018B, 0x102FF} /* Cn */, { 0x1031F, 0x1031F} /* Cn */, - { 0x10324, 0x1032F} /* Cn */, { 0x1034B, 0x1037F} /* Cn */, - { 0x1039E, 0x1039E} /* Cn */, { 0x103C4, 0x103C7} /* Cn */, - { 0x103D6, 0x103FF} /* Cn */, - { 0x1049E, 0x1049F} /* Cn */, { 0x104AA, 0x107FF} /* Cn */, - { 0x10806, 0x10807} /* Cn */, { 0x10809, 0x10809} /* Cn */, - { 0x10836, 0x10836} /* Cn */, { 0x10839, 0x1083B} /* Cn */, - { 0x1083D, 0x1083E} /* Cn */, { 0x10840, 0x108FF} /* Cn */, - { 0x1091A, 0x1091E} /* Cn */, { 0x10920, 0x109FF} /* Cn */, - { 0x10A04, 0x10A04} /* Cn */, { 0x10A07, 0x10A0B} /* Cn */, - { 0x10A14, 0x10A14} /* Cn */, { 0x10A18, 0x10A18} /* Cn */, - { 0x10A34, 0x10A37} /* Cn */, { 0x10A3B, 0x10A3E} /* Cn */, - { 0x10A48, 0x10A4F} /* Cn */, { 0x10A59, 0x11FFF} /* Cn */, - { 0x1236F, 0x123FF} /* Cn */, { 0x12463, 0x1246F} /* Cn */, - { 0x12474, 0x1CFFF} /* Cn */, { 0x1D0F6, 0x1D0FF} /* Cn */, - { 0x1D127, 0x1D129} /* Cn */, - { 0x1D173, 0x1D17A} /* Cf */, - { 0x1D1DE, 0x1D1FF} /* Cn */, { 0x1D246, 0x1D2FF} /* Cn */, - { 0x1D357, 0x1D35F} /* Cn */, { 0x1D372, 0x1D3FF} /* Cn */, - { 0x1D455, 0x1D455} /* Cn */, { 0x1D49D, 0x1D49D} /* Cn */, - { 0x1D4A0, 0x1D4A1} /* Cn */, { 0x1D4A3, 0x1D4A4} /* Cn */, - { 0x1D4A7, 0x1D4A8} /* Cn */, { 0x1D4AD, 0x1D4AD} /* Cn */, - { 0x1D4BA, 0x1D4BA} /* Cn */, { 0x1D4BC, 0x1D4BC} /* Cn */, - { 0x1D4C4, 0x1D4C4} /* Cn */, { 0x1D506, 0x1D506} /* Cn */, - { 0x1D50B, 0x1D50C} /* Cn */, { 0x1D515, 0x1D515} /* Cn */, - { 0x1D51D, 0x1D51D} /* Cn */, { 0x1D53A, 0x1D53A} /* Cn */, - { 0x1D53F, 0x1D53F} /* Cn */, { 0x1D545, 0x1D545} /* Cn */, - { 0x1D547, 0x1D549} /* Cn */, { 0x1D551, 0x1D551} /* Cn */, - { 0x1D6A6, 0x1D6A7} /* Cn */, { 0x1D7CC, 0x1D7CD} /* Cn */, - { 0x1D800, 0x1FFFF} /* Cn */, { 0x2A6D7, 0x2F7FF} /* Cn */, - { 0x2FA1E, 0xE0000} /* Cn */, - { 0xE0001, 0xE0001} /* Cf */, - { 0xE0002, 0xE001F} /* Cn */, - { 0xE0020, 0xE007F} /* Cf */, - { 0xE0080, 0xE00FF} /* Cn */, { 0xE01F0, 0xEFFFF} /* Cn */, - { 0xF0000, 0xFFFFD} /* Co */, - { 0xFFFFE, 0xFFFFF} /* Cn */, - {0x100000,0x10FFFD} /* Co */, - {0x10FFFE,0x10FFFF} /* Cn */, - {0x110000,0x7FFFFFFF} /* ISO 10646?? */ -}; - -/* - * Double width characters - * W: East Asian Wide - * F: East Asian Full-width - * Unassigned code points may be included when they allow ranges to be merged. - * Last synched with - * - * dated 2005-11-08T01:32:56Z - */ -static struct wchar_range wide_table[] = { - { 0x1100, 0x115F} /* W */, { 0x2329, 0x232A} /* W */, - { 0x2E80, 0x2FFB} /* W */, - { 0x3000, 0x3000} /* F */, - { 0x3001, 0x303E} /* W */, { 0x3041, 0x4DB5} /* W */, - { 0x4E00, 0x9FBB} /* W */, { 0xA000, 0xA4C6} /* W */, - { 0xAC00, 0xD7A3} /* W */, { 0xF900, 0xFAD9} /* W */, - { 0xFE10, 0xFE19} /* W */, { 0xFE30, 0xFE6B} /* W */, - { 0xFF01, 0xFF60} /* F */, { 0xFFE0, 0xFFE6} /* F */, - { 0x20000, 0x2FFFD} /* W */, { 0x30000, 0x3FFFD} /* W */, -}; static int -is_in_table(ch, table, tsize) +is_in_table(ch, table) LWCHAR ch; - struct wchar_range table[]; - int tsize; + struct wchar_range_table *table; { int hi; int lo; /* Binary search in the table. */ - if (ch < table[0].first) + if (ch < table->table[0].first) return 0; lo = 0; - hi = tsize - 1; + hi = table->count - 1; while (lo <= hi) { int mid = (lo + hi) / 2; - if (ch > table[mid].last) + if (ch > table->table[mid].last) lo = mid + 1; - else if (ch < table[mid].first) + else if (ch < table->table[mid].first) hi = mid - 1; else return 1; @@ -1126,7 +777,7 @@ is_in_table(ch, table, tsize) is_composing_char(ch) LWCHAR ch; { - return is_in_table(ch, comp_table, (sizeof(comp_table) / sizeof(*comp_table))); + return is_in_table(ch, &compose_table); } /* @@ -1136,7 +787,7 @@ is_composing_char(ch) is_ubin_char(ch) LWCHAR ch; { - return is_in_table(ch, ubin_table, (sizeof(ubin_table) / sizeof(*ubin_table))); + return is_in_table(ch, &ubin_table); } /* @@ -1146,7 +797,7 @@ is_ubin_char(ch) is_wide_char(ch) LWCHAR ch; { - return is_in_table(ch, wide_table, (sizeof(wide_table) / sizeof(*wide_table))); + return is_in_table(ch, &wide_table); } /* Modified: stable/10/contrib/less/charset.h ============================================================================== --- stable/10/contrib/less/charset.h Mon Jan 18 18:50:26 2016 (r294285) +++ stable/10/contrib/less/charset.h Mon Jan 18 19:13:54 2016 (r294286) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/10/contrib/less/cmd.h ============================================================================== --- stable/10/contrib/less/cmd.h Mon Jan 18 18:50:26 2016 (r294285) +++ stable/10/contrib/less/cmd.h Mon Jan 18 19:13:54 2016 (r294286) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -66,6 +66,7 @@ #define A_PREV_TAG 54 #define A_FILTER 55 #define A_F_UNTIL_HILITE 56 +#define A_GOEND_BUF 57 #define A_INVALID 100 #define A_NOACTION 101 Modified: stable/10/contrib/less/cmdbuf.c ============================================================================== --- stable/10/contrib/less/cmdbuf.c Mon Jan 18 18:50:26 2016 (r294285) +++ stable/10/contrib/less/cmdbuf.c Mon Jan 18 19:13:54 2016 (r294286) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -203,7 +203,7 @@ cmd_step_common(p, ch, len, pwidth, bswi pr = prchar((int) ch); if (pwidth != NULL || bswidth != NULL) { - int len = strlen(pr); + int len = (int) strlen(pr); if (pwidth != NULL) *pwidth = len; if (bswidth != NULL) @@ -222,7 +222,7 @@ cmd_step_common(p, ch, len, pwidth, bswi *bswidth = 0; } else if (is_ubin_char(ch)) { - int len = strlen(pr); + int len = (int) strlen(pr); if (pwidth != NULL) *pwidth = len; if (bswidth != NULL) @@ -375,7 +375,7 @@ cmd_lshift() s = ns; } - cmd_offset = s - cmdbuf; + cmd_offset = (int) (s - cmdbuf); save_cp = cp; cmd_home(); cmd_repaint(save_cp); @@ -405,7 +405,7 @@ cmd_rshift() cols += width; } - cmd_offset = s - cmdbuf; + cmd_offset = (int) (s - cmdbuf); save_cp = cp; cmd_home(); cmd_repaint(save_cp); @@ -535,7 +535,7 @@ cmd_erase() */ s = cp; cmd_left(); - clen = s - cp; + clen = (int) (s - cp); /* * Remove the char from the buffer (shift the buffer left). @@ -701,7 +701,7 @@ cmd_updown(action) if (updown_match < 0) { - updown_match = cp - cmdbuf; + updown_match = (int) (cp - cmdbuf); } /* @@ -744,12 +744,13 @@ cmd_updown(action) #endif /* - * Add a string to a history list. + * Add a string to an mlist. */ public void -cmd_addhist(mlist, cmd) +cmd_addhist(mlist, cmd, modified) struct mlist *mlist; char *cmd; + int modified; { #if CMD_HISTORY struct mlist *ml; @@ -773,6 +774,7 @@ cmd_addhist(mlist, cmd) */ ml = (struct mlist *) ecalloc(1, sizeof(struct mlist)); ml->string = save(cmd); + ml->modified = modified; ml->next = mlist; ml->prev = mlist->prev; mlist->prev->next = ml; @@ -799,7 +801,7 @@ cmd_accept() */ if (curr_mlist == NULL) return; - cmd_addhist(curr_mlist, cmdbuf); + cmd_addhist(curr_mlist, cmdbuf, 1); curr_mlist->modified = 1; #endif } @@ -965,7 +967,7 @@ delimit_word() int delim_quoted = 0; int meta_quoted = 0; char *esc = get_meta_escape(); - int esclen = strlen(esc); + int esclen = (int) strlen(esc); #endif /* @@ -1262,7 +1264,7 @@ cmd_char(c) cmd_mbc_buf[cmd_mbc_buf_index++] = c; if (cmd_mbc_buf_index < cmd_mbc_buf_len) return (CC_OK); - if (!is_utf8_well_formed(cmd_mbc_buf)) + if (!is_utf8_well_formed(cmd_mbc_buf, cmd_mbc_buf_index)) { /* complete, but not well formed (non-shortest form), sequence */ cmd_mbc_buf_len = 0; @@ -1359,6 +1361,18 @@ cmd_lastpattern() #if CMD_HISTORY /* + */ + static int +mlist_size(ml) + struct mlist *ml; +{ + int size = 0; + for (ml = ml->next; ml->string != NULL; ml = ml->next) + ++size; + return size; +} + +/* * Get the name of the history file. */ static char * @@ -1378,6 +1392,10 @@ histfile_name() return (save(name)); } + /* See if history file is disabled in the build. */ + if (strcmp(LESSHISTFILE, "") == 0 || strcmp(LESSHISTFILE, "-") == 0) + return (NULL); + /* Otherwise, file is in $HOME. */ home = lgetenv("HOME"); if (home == NULL || *home == '\0') @@ -1388,25 +1406,28 @@ histfile_name() #endif return (NULL); } - len = strlen(home) + strlen(LESSHISTFILE) + 2; + len = (int) (strlen(home) + strlen(LESSHISTFILE) + 2); name = (char *) ecalloc(len, sizeof(char)); SNPRINTF2(name, len, "%s/%s", home, LESSHISTFILE); return (name); } -#endif /* CMD_HISTORY */ /* - * Initialize history from a .lesshist file. + * Read a .lesshst file and call a callback for each line in the file. */ - public void -init_cmdhist() + static void +read_cmdhist2(action, uparam, skip_search, skip_shell) + void (*action)(void*,struct mlist*,char*); + void *uparam; + int skip_search; + int skip_shell; { -#if CMD_HISTORY struct mlist *ml = NULL; char line[CMDBUF_SIZE]; char *filename; FILE *f; char *p; + int *skip = NULL; filename = histfile_name(); if (filename == NULL) @@ -1432,84 +1453,170 @@ init_cmdhist() } } if (strcmp(line, HISTFILE_SEARCH_SECTION) == 0) + { ml = &mlist_search; - else if (strcmp(line, HISTFILE_SHELL_SECTION) == 0) + skip = &skip_search; + } else if (strcmp(line, HISTFILE_SHELL_SECTION) == 0) { #if SHELL_ESCAPE || PIPEC ml = &mlist_shell; + skip = &skip_shell; #else ml = NULL; + skip = NULL; #endif } else if (*line == '"') { if (ml != NULL) - cmd_addhist(ml, line+1); + { + if (skip != NULL && *skip > 0) + --(*skip); + else + (*action)(uparam, ml, line+1); + } } } fclose(f); +} + + static void +read_cmdhist(action, uparam, skip_search, skip_shell) + void (*action)(void*,struct mlist*,char*); + void *uparam; + int skip_search; + int skip_shell; +{ + read_cmdhist2(action, uparam, skip_search, skip_shell); + (*action)(uparam, NULL, NULL); /* signal end of file */ +} + + static void +addhist_init(void *uparam, struct mlist *ml, char *string) +{ + if (ml == NULL || string == NULL) + return; + cmd_addhist(ml, string, 0); +} +#endif /* CMD_HISTORY */ + +/* + * Initialize history from a .lesshist file. + */ + public void +init_cmdhist() *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Jan 18 19:27:27 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19F4AA87334; Mon, 18 Jan 2016 19:27:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7F1013C1; Mon, 18 Jan 2016 19:27:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IJRP9a074318; Mon, 18 Jan 2016 19:27:25 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IJROfx074307; Mon, 18 Jan 2016 19:27:24 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601181927.u0IJROfx074307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 18 Jan 2016 19:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294287 - in stable/9: contrib/less usr.bin/less X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 19:27:27 -0000 Author: delphij Date: Mon Jan 18 19:27:24 2016 New Revision: 294287 URL: https://svnweb.freebsd.org/changeset/base/294287 Log: MFC r293190: MFV r293125: less v481. Relnotes: yes Added: stable/9/contrib/less/compose.uni - copied unchanged from r293190, head/contrib/less/compose.uni stable/9/contrib/less/mkutable - copied unchanged from r293190, head/contrib/less/mkutable stable/9/contrib/less/ubin.uni - copied unchanged from r293190, head/contrib/less/ubin.uni stable/9/contrib/less/wide.uni - copied unchanged from r293190, head/contrib/less/wide.uni Modified: stable/9/contrib/less/LICENSE stable/9/contrib/less/NEWS stable/9/contrib/less/README stable/9/contrib/less/brac.c stable/9/contrib/less/ch.c stable/9/contrib/less/charset.c stable/9/contrib/less/charset.h stable/9/contrib/less/cmd.h stable/9/contrib/less/cmdbuf.c stable/9/contrib/less/command.c stable/9/contrib/less/cvt.c stable/9/contrib/less/decode.c stable/9/contrib/less/edit.c stable/9/contrib/less/filename.c stable/9/contrib/less/forwback.c stable/9/contrib/less/funcs.h stable/9/contrib/less/help.c stable/9/contrib/less/ifile.c stable/9/contrib/less/input.c stable/9/contrib/less/jump.c stable/9/contrib/less/less.h stable/9/contrib/less/less.hlp stable/9/contrib/less/less.nro stable/9/contrib/less/lessecho.c stable/9/contrib/less/lessecho.nro stable/9/contrib/less/lesskey.c stable/9/contrib/less/lesskey.h stable/9/contrib/less/lesskey.nro stable/9/contrib/less/lglob.h stable/9/contrib/less/line.c stable/9/contrib/less/linenum.c stable/9/contrib/less/lsystem.c stable/9/contrib/less/main.c stable/9/contrib/less/mark.c stable/9/contrib/less/mkhelp.c stable/9/contrib/less/optfunc.c stable/9/contrib/less/option.c stable/9/contrib/less/option.h stable/9/contrib/less/opttbl.c stable/9/contrib/less/os.c stable/9/contrib/less/output.c stable/9/contrib/less/pattern.c stable/9/contrib/less/pattern.h stable/9/contrib/less/pckeys.h stable/9/contrib/less/position.c stable/9/contrib/less/position.h stable/9/contrib/less/prompt.c stable/9/contrib/less/regexp.c stable/9/contrib/less/screen.c stable/9/contrib/less/scrsize.c stable/9/contrib/less/search.c stable/9/contrib/less/signal.c stable/9/contrib/less/tags.c stable/9/contrib/less/ttyin.c stable/9/contrib/less/version.c stable/9/usr.bin/less/defines.h Directory Properties: stable/9/contrib/less/ (props changed) stable/9/usr.bin/less/ (props changed) Modified: stable/9/contrib/less/LICENSE ============================================================================== --- stable/9/contrib/less/LICENSE Mon Jan 18 19:13:54 2016 (r294286) +++ stable/9/contrib/less/LICENSE Mon Jan 18 19:27:24 2016 (r294287) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2012 Mark Nudelman +Copyright (C) 1984-2015 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/9/contrib/less/NEWS ============================================================================== --- stable/9/contrib/less/NEWS Mon Jan 18 19:13:54 2016 (r294286) +++ stable/9/contrib/less/NEWS Mon Jan 18 19:27:24 2016 (r294287) @@ -7,7 +7,44 @@ http://www.greenwoodsoftware.com/less You can also download the latest version of less from there. - To report bugs, suggestions or comments, send email to bug-less@gnu.org. + To report bugs, suggestions or comments, send email to bug-less@gnu.org + +====================================================================== + + Major changes between "less" versions 458 and 481 + +* Don't overwrite history file; just append to it. + +* New command ESC-G goes to end of currently buffered data in a pipe. + +* Disable history feature when compiled with LESSHISTFILE set to "-". + +* In more-compatible mode, make the -p option apply to every file opened, + not just the first one. + +* In more-compatible mode, change the -e option to work like -E, not -EF. + +* Treat multiple CRs before LF are like one CR (all the CRs are hidden). + +* Allow "extra" string in lesskey file to append to a multi-char command + (like a search pattern), without executing the command. + +* Ignore -u/-U setting while viewing help file, so that + underline and bold chars are displayed correctly. + +* Improve detection of "binary" files in UTF-8 mode. + +* Fix bug with ++ commands. + +* Fix bug where prompt was sometimes not displayed with +G. + +* Fix possible memory corruption + +* Fix bugs and improve performance in ampersand filtering. + +* Automate construction of Unicode tables from Unicode database. + +* Allow %% escape sequence in LESSOPEN variable. ====================================================================== Modified: stable/9/contrib/less/README ============================================================================== --- stable/9/contrib/less/README Mon Jan 18 19:13:54 2016 (r294286) +++ stable/9/contrib/less/README Mon Jan 18 19:27:24 2016 (r294287) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 458 + Less, version 481 - This is the distribution of less, version 458, released 04 Apr 2013. + This is the distribution of less, version 481, released 31 Aug 2015. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -53,8 +53,9 @@ INSTALLATION (Unix systems only): Specifies the regular expression library used by less for pattern matching. The default is "auto", which means the configure program finds a regular expression library automatically. Other values are: - posix Use the POSIX-compatible regcomp. + gnu Use the GNU regex library. pcre Use the PCRE library. + posix Use the POSIX-compatible regcomp. regcmp Use the regcmp library. re_comp Use the re_comp library. regcomp Use the V8-compatible regcomp. Modified: stable/9/contrib/less/brac.c ============================================================================== --- stable/9/contrib/less/brac.c Mon Jan 18 19:13:54 2016 (r294286) +++ stable/9/contrib/less/brac.c Mon Jan 18 19:27:24 2016 (r294287) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/9/contrib/less/ch.c ============================================================================== --- stable/9/contrib/less/ch.c Mon Jan 18 19:13:54 2016 (r294286) +++ stable/9/contrib/less/ch.c Mon Jan 18 19:27:24 2016 (r294287) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -54,7 +54,7 @@ struct buf { * The file state is maintained in a filestate structure. * A pointer to the filestate is kept in the ifile structure. */ -#define BUFHASH_SIZE 64 +#define BUFHASH_SIZE 1024 struct filestate { struct bufnode buflist; struct bufnode hashtbl[BUFHASH_SIZE]; @@ -323,13 +323,16 @@ ch_get() #if HAVE_STAT_INO if (follow_mode == FOLLOW_NAME) { - /* See whether the file's i-number has changed. + /* See whether the file's i-number has changed, + * or the file has shrunk. * If so, force the file to be closed and * reopened. */ struct stat st; + POSITION curr_pos = ch_tell(); int r = stat(get_filename(curr_ifile), &st); if (r == 0 && (st.st_ino != curr_ino || - st.st_dev != curr_dev)) + st.st_dev != curr_dev || + (curr_pos != NULL_POSITION && st.st_size < curr_pos))) { /* screen_trashed=2 causes * make_display to reopen the file. */ @@ -536,6 +539,32 @@ ch_end_seek() } /* + * Seek to the last position in the file that is currently buffered. + */ + public int +ch_end_buffer_seek() +{ + register struct buf *bp; + register struct bufnode *bn; + POSITION buf_pos; + POSITION end_pos; + + if (thisfile == NULL || (ch_flags & CH_CANSEEK)) + return (ch_end_seek()); + + end_pos = 0; + FOR_BUFS(bn) + { + bp = bufnode_buf(bn); + buf_pos = (bp->block * LBUFSIZE) + bp->datasize; + if (buf_pos > end_pos) + end_pos = buf_pos; + } + + return (ch_seek(end_pos)); +} + +/* * Seek to the beginning of the file, or as close to it as we can get. * We may not be able to seek there if input is a pipe and the * beginning of the pipe is no longer buffered. Modified: stable/9/contrib/less/charset.c ============================================================================== --- stable/9/contrib/less/charset.c Mon Jan 18 19:13:54 2016 (r294286) +++ stable/9/contrib/less/charset.c Mon Jan 18 19:27:24 2016 (r294287) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -466,36 +466,15 @@ prutfchar(ch) else SNPRINTF1(buf, sizeof(buf), binfmt, (char) ch); } else if (is_ubin_char(ch)) + { SNPRINTF1(buf, sizeof(buf), utfbinfmt, ch); - else + } else { - int len; + char *p = buf; if (ch >= 0x80000000) - { - len = 3; - ch = 0xFFFD; - } else - { - len = (ch < 0x80) ? 1 - : (ch < 0x800) ? 2 - : (ch < 0x10000) ? 3 - : (ch < 0x200000) ? 4 - : (ch < 0x4000000) ? 5 - : 6; - } - buf[len] = '\0'; - if (len == 1) - *buf = (char) ch; - else - { - *buf = ((1 << len) - 1) << (8 - len); - while (--len > 0) - { - buf[len] = (char) (0x80 | (ch & 0x3F)); - ch >>= 6; - } - *buf |= ch; - } + ch = 0xFFFD; /* REPLACEMENT CHARACTER */ + put_wchar(&p, ch); + *p = '\0'; } return (buf); } @@ -524,11 +503,12 @@ utf_len(ch) } /* - * Is a UTF-8 character well-formed? + * Does the parameter point to the lead byte of a well-formed UTF-8 character? */ public int -is_utf8_well_formed(s) +is_utf8_well_formed(s, slen) unsigned char *s; + int slen; { int i; int len; @@ -537,6 +517,8 @@ is_utf8_well_formed(s) return (0); len = utf_len((char) s[0]); + if (len > slen) + return (0); if (len == 1) return (1); if (len == 2) @@ -558,6 +540,35 @@ is_utf8_well_formed(s) } /* + * Return number of invalid UTF-8 sequences found in a buffer. + */ + public int +utf_bin_count(data, len) + unsigned char *data; + int len; +{ + int bin_count = 0; + while (len > 0) + { + if (is_utf8_well_formed(data, len)) + { + int clen = utf_len(*data); + data += clen; + len -= clen; + } else + { + /* Skip to next lead byte. */ + bin_count++; + do { + ++data; + --len; + } while (len > 0 && !IS_UTF8_LEAD(*data)); + } + } + return (bin_count); +} + +/* * Get the value of a UTF-8 character. */ public LWCHAR @@ -706,411 +717,51 @@ step_char(pp, dir, limit) /* * Unicode characters data + * Actual data is in the generated *.uni files. */ -struct wchar_range { LWCHAR first, last; }; -/* - * Characters with general category values - * Mn: Mark, Nonspacing - * Me: Mark, Enclosing - * Last synched with - * - * dated 2005-11-30T00:58:48Z - */ -static struct wchar_range comp_table[] = { - { 0x0300, 0x036F} /* Mn */, { 0x0483, 0x0486} /* Mn */, - { 0x0488, 0x0489} /* Me */, - { 0x0591, 0x05BD} /* Mn */, { 0x05BF, 0x05BF} /* Mn */, - { 0x05C1, 0x05C2} /* Mn */, { 0x05C4, 0x05C5} /* Mn */, - { 0x05C7, 0x05C7} /* Mn */, { 0x0610, 0x0615} /* Mn */, - { 0x064B, 0x065E} /* Mn */, { 0x0670, 0x0670} /* Mn */, - { 0x06D6, 0x06DC} /* Mn */, - { 0x06DE, 0x06DE} /* Me */, - { 0x06DF, 0x06E4} /* Mn */, { 0x06E7, 0x06E8} /* Mn */, - { 0x06EA, 0x06ED} /* Mn */, { 0x0711, 0x0711} /* Mn */, - { 0x0730, 0x074A} /* Mn */, { 0x07A6, 0x07B0} /* Mn */, - { 0x07EB, 0x07F3} /* Mn */, { 0x0901, 0x0902} /* Mn */, - { 0x093C, 0x093C} /* Mn */, { 0x0941, 0x0948} /* Mn */, - { 0x094D, 0x094D} /* Mn */, { 0x0951, 0x0954} /* Mn */, - { 0x0962, 0x0963} /* Mn */, { 0x0981, 0x0981} /* Mn */, - { 0x09BC, 0x09BC} /* Mn */, { 0x09C1, 0x09C4} /* Mn */, - { 0x09CD, 0x09CD} /* Mn */, { 0x09E2, 0x09E3} /* Mn */, - { 0x0A01, 0x0A02} /* Mn */, { 0x0A3C, 0x0A3C} /* Mn */, - { 0x0A41, 0x0A42} /* Mn */, { 0x0A47, 0x0A48} /* Mn */, - { 0x0A4B, 0x0A4D} /* Mn */, { 0x0A70, 0x0A71} /* Mn */, - { 0x0A81, 0x0A82} /* Mn */, { 0x0ABC, 0x0ABC} /* Mn */, - { 0x0AC1, 0x0AC5} /* Mn */, { 0x0AC7, 0x0AC8} /* Mn */, - { 0x0ACD, 0x0ACD} /* Mn */, { 0x0AE2, 0x0AE3} /* Mn */, - { 0x0B01, 0x0B01} /* Mn */, { 0x0B3C, 0x0B3C} /* Mn */, - { 0x0B3F, 0x0B3F} /* Mn */, { 0x0B41, 0x0B43} /* Mn */, - { 0x0B4D, 0x0B4D} /* Mn */, { 0x0B56, 0x0B56} /* Mn */, - { 0x0B82, 0x0B82} /* Mn */, { 0x0BC0, 0x0BC0} /* Mn */, - { 0x0BCD, 0x0BCD} /* Mn */, { 0x0C3E, 0x0C40} /* Mn */, - { 0x0C46, 0x0C48} /* Mn */, { 0x0C4A, 0x0C4D} /* Mn */, - { 0x0C55, 0x0C56} /* Mn */, { 0x0CBC, 0x0CBC} /* Mn */, - { 0x0CBF, 0x0CBF} /* Mn */, { 0x0CC6, 0x0CC6} /* Mn */, - { 0x0CCC, 0x0CCD} /* Mn */, { 0x0CE2, 0x0CE3} /* Mn */, - { 0x0D41, 0x0D43} /* Mn */, { 0x0D4D, 0x0D4D} /* Mn */, - { 0x0DCA, 0x0DCA} /* Mn */, { 0x0DD2, 0x0DD4} /* Mn */, - { 0x0DD6, 0x0DD6} /* Mn */, { 0x0E31, 0x0E31} /* Mn */, - { 0x0E34, 0x0E3A} /* Mn */, { 0x0E47, 0x0E4E} /* Mn */, - { 0x0EB1, 0x0EB1} /* Mn */, { 0x0EB4, 0x0EB9} /* Mn */, - { 0x0EBB, 0x0EBC} /* Mn */, { 0x0EC8, 0x0ECD} /* Mn */, - { 0x0F18, 0x0F19} /* Mn */, { 0x0F35, 0x0F35} /* Mn */, - { 0x0F37, 0x0F37} /* Mn */, { 0x0F39, 0x0F39} /* Mn */, - { 0x0F71, 0x0F7E} /* Mn */, { 0x0F80, 0x0F84} /* Mn */, - { 0x0F86, 0x0F87} /* Mn */, { 0x0F90, 0x0F97} /* Mn */, - { 0x0F99, 0x0FBC} /* Mn */, { 0x0FC6, 0x0FC6} /* Mn */, - { 0x102D, 0x1030} /* Mn */, { 0x1032, 0x1032} /* Mn */, - { 0x1036, 0x1037} /* Mn */, { 0x1039, 0x1039} /* Mn */, - { 0x1058, 0x1059} /* Mn */, { 0x135F, 0x135F} /* Mn */, - { 0x1712, 0x1714} /* Mn */, { 0x1732, 0x1734} /* Mn */, - { 0x1752, 0x1753} /* Mn */, { 0x1772, 0x1773} /* Mn */, - { 0x17B7, 0x17BD} /* Mn */, { 0x17C6, 0x17C6} /* Mn */, - { 0x17C9, 0x17D3} /* Mn */, { 0x17DD, 0x17DD} /* Mn */, - { 0x180B, 0x180D} /* Mn */, { 0x18A9, 0x18A9} /* Mn */, - { 0x1920, 0x1922} /* Mn */, { 0x1927, 0x1928} /* Mn */, - { 0x1932, 0x1932} /* Mn */, { 0x1939, 0x193B} /* Mn */, - { 0x1A17, 0x1A18} /* Mn */, { 0x1B00, 0x1B03} /* Mn */, - { 0x1B34, 0x1B34} /* Mn */, { 0x1B36, 0x1B3A} /* Mn */, - { 0x1B3C, 0x1B3C} /* Mn */, { 0x1B42, 0x1B42} /* Mn */, - { 0x1B6B, 0x1B73} /* Mn */, { 0x1DC0, 0x1DCA} /* Mn */, - { 0x1DFE, 0x1DFF} /* Mn */, { 0x20D0, 0x20DC} /* Mn */, - { 0x20DD, 0x20E0} /* Me */, - { 0x20E1, 0x20E1} /* Mn */, - { 0x20E2, 0x20E4} /* Me */, - { 0x20E5, 0x20EF} /* Mn */, { 0x302A, 0x302F} /* Mn */, - { 0x3099, 0x309A} /* Mn */, { 0xA806, 0xA806} /* Mn */, - { 0xA80B, 0xA80B} /* Mn */, { 0xA825, 0xA826} /* Mn */, - { 0xFB1E, 0xFB1E} /* Mn */, { 0xFE00, 0xFE0F} /* Mn */, - { 0xFE20, 0xFE23} /* Mn */, { 0x10A01, 0x10A03} /* Mn */, - { 0x10A05, 0x10A06} /* Mn */, { 0x10A0C, 0x10A0F} /* Mn */, - { 0x10A38, 0x10A3A} /* Mn */, { 0x10A3F, 0x10A3F} /* Mn */, - { 0x1D167, 0x1D169} /* Mn */, { 0x1D17B, 0x1D182} /* Mn */, - { 0x1D185, 0x1D18B} /* Mn */, { 0x1D1AA, 0x1D1AD} /* Mn */, - { 0x1D242, 0x1D244} /* Mn */, { 0xE0100, 0xE01EF} /* Mn */, -}; +#define DECLARE_RANGE_TABLE_START(name) \ + static struct wchar_range name##_array[] = { +#define DECLARE_RANGE_TABLE_END(name) \ + }; struct wchar_range_table name##_table = { name##_array, sizeof(name##_array)/sizeof(*name##_array) }; -/* - * Special pairs, not ranges. - */ +DECLARE_RANGE_TABLE_START(compose) +#include "compose.uni" +DECLARE_RANGE_TABLE_END(compose) + +DECLARE_RANGE_TABLE_START(ubin) +#include "ubin.uni" +DECLARE_RANGE_TABLE_END(ubin) + +DECLARE_RANGE_TABLE_START(wide) +#include "wide.uni" +DECLARE_RANGE_TABLE_END(wide) + +/* comb_table is special pairs, not ranges. */ static struct wchar_range comb_table[] = { {0x0644,0x0622}, {0x0644,0x0623}, {0x0644,0x0625}, {0x0644,0x0627}, }; -/* - * Characters with general category values - * Cc: Other, Control - * Cf: Other, Format - * Cs: Other, Surrogate - * Co: Other, Private Use - * Cn: Other, Not Assigned - * Zl: Separator, Line - * Zp: Separator, Paragraph - * Last synched with - * - * dated 2005-11-30T00:58:48Z - */ -static struct wchar_range ubin_table[] = { - { 0x0000, 0x0007} /* Cc */, - { 0x000B, 0x000C} /* Cc */, - { 0x000E, 0x001A} /* Cc */, - { 0x001C, 0x001F} /* Cc */, - { 0x007F, 0x009F} /* Cc */, -#if 0 - { 0x00AD, 0x00AD} /* Cf */, -#endif - { 0x0370, 0x0373} /* Cn */, { 0x0376, 0x0379} /* Cn */, - { 0x037F, 0x0383} /* Cn */, { 0x038B, 0x038B} /* Cn */, - { 0x038D, 0x038D} /* Cn */, { 0x03A2, 0x03A2} /* Cn */, - { 0x03CF, 0x03CF} /* Cn */, { 0x0487, 0x0487} /* Cn */, - { 0x0514, 0x0530} /* Cn */, { 0x0557, 0x0558} /* Cn */, - { 0x0560, 0x0560} /* Cn */, { 0x0588, 0x0588} /* Cn */, - { 0x058B, 0x0590} /* Cn */, { 0x05C8, 0x05CF} /* Cn */, - { 0x05EB, 0x05EF} /* Cn */, { 0x05F5, 0x05FF} /* Cn */, -#if 0 - { 0x0600, 0x0603} /* Cf */, -#endif - { 0x0604, 0x060A} /* Cn */, { 0x0616, 0x061A} /* Cn */, - { 0x061C, 0x061D} /* Cn */, { 0x0620, 0x0620} /* Cn */, - { 0x063B, 0x063F} /* Cn */, { 0x065F, 0x065F} /* Cn */, -#if 0 - { 0x06DD, 0x06DD} /* Cf */, -#endif - { 0x070E, 0x070E} /* Cn */, -#if 0 - { 0x070F, 0x070F} /* Cf */, -#endif - { 0x074B, 0x074C} /* Cn */, { 0x076E, 0x077F} /* Cn */, - { 0x07B2, 0x07BF} /* Cn */, { 0x07FB, 0x0900} /* Cn */, - { 0x093A, 0x093B} /* Cn */, { 0x094E, 0x094F} /* Cn */, - { 0x0955, 0x0957} /* Cn */, { 0x0971, 0x097A} /* Cn */, - { 0x0980, 0x0980} /* Cn */, { 0x0984, 0x0984} /* Cn */, - { 0x098D, 0x098E} /* Cn */, { 0x0991, 0x0992} /* Cn */, - { 0x09A9, 0x09A9} /* Cn */, { 0x09B1, 0x09B1} /* Cn */, - { 0x09B3, 0x09B5} /* Cn */, { 0x09BA, 0x09BB} /* Cn */, - { 0x09C5, 0x09C6} /* Cn */, { 0x09C9, 0x09CA} /* Cn */, - { 0x09CF, 0x09D6} /* Cn */, { 0x09D8, 0x09DB} /* Cn */, - { 0x09DE, 0x09DE} /* Cn */, { 0x09E4, 0x09E5} /* Cn */, - { 0x09FB, 0x0A00} /* Cn */, { 0x0A04, 0x0A04} /* Cn */, - { 0x0A0B, 0x0A0E} /* Cn */, { 0x0A11, 0x0A12} /* Cn */, - { 0x0A29, 0x0A29} /* Cn */, { 0x0A31, 0x0A31} /* Cn */, - { 0x0A34, 0x0A34} /* Cn */, { 0x0A37, 0x0A37} /* Cn */, - { 0x0A3A, 0x0A3B} /* Cn */, { 0x0A3D, 0x0A3D} /* Cn */, - { 0x0A43, 0x0A46} /* Cn */, { 0x0A49, 0x0A4A} /* Cn */, - { 0x0A4E, 0x0A58} /* Cn */, { 0x0A5D, 0x0A5D} /* Cn */, - { 0x0A5F, 0x0A65} /* Cn */, { 0x0A75, 0x0A80} /* Cn */, - { 0x0A84, 0x0A84} /* Cn */, { 0x0A8E, 0x0A8E} /* Cn */, - { 0x0A92, 0x0A92} /* Cn */, { 0x0AA9, 0x0AA9} /* Cn */, - { 0x0AB1, 0x0AB1} /* Cn */, { 0x0AB4, 0x0AB4} /* Cn */, - { 0x0ABA, 0x0ABB} /* Cn */, { 0x0AC6, 0x0AC6} /* Cn */, - { 0x0ACA, 0x0ACA} /* Cn */, { 0x0ACE, 0x0ACF} /* Cn */, - { 0x0AD1, 0x0ADF} /* Cn */, { 0x0AE4, 0x0AE5} /* Cn */, - { 0x0AF0, 0x0AF0} /* Cn */, { 0x0AF2, 0x0B00} /* Cn */, - { 0x0B04, 0x0B04} /* Cn */, { 0x0B0D, 0x0B0E} /* Cn */, - { 0x0B11, 0x0B12} /* Cn */, { 0x0B29, 0x0B29} /* Cn */, - { 0x0B31, 0x0B31} /* Cn */, { 0x0B34, 0x0B34} /* Cn */, - { 0x0B3A, 0x0B3B} /* Cn */, { 0x0B44, 0x0B46} /* Cn */, - { 0x0B49, 0x0B4A} /* Cn */, { 0x0B4E, 0x0B55} /* Cn */, - { 0x0B58, 0x0B5B} /* Cn */, { 0x0B5E, 0x0B5E} /* Cn */, - { 0x0B62, 0x0B65} /* Cn */, { 0x0B72, 0x0B81} /* Cn */, - { 0x0B84, 0x0B84} /* Cn */, { 0x0B8B, 0x0B8D} /* Cn */, - { 0x0B91, 0x0B91} /* Cn */, { 0x0B96, 0x0B98} /* Cn */, - { 0x0B9B, 0x0B9B} /* Cn */, { 0x0B9D, 0x0B9D} /* Cn */, - { 0x0BA0, 0x0BA2} /* Cn */, { 0x0BA5, 0x0BA7} /* Cn */, - { 0x0BAB, 0x0BAD} /* Cn */, { 0x0BBA, 0x0BBD} /* Cn */, - { 0x0BC3, 0x0BC5} /* Cn */, { 0x0BC9, 0x0BC9} /* Cn */, - { 0x0BCE, 0x0BD6} /* Cn */, { 0x0BD8, 0x0BE5} /* Cn */, - { 0x0BFB, 0x0C00} /* Cn */, { 0x0C04, 0x0C04} /* Cn */, - { 0x0C0D, 0x0C0D} /* Cn */, { 0x0C11, 0x0C11} /* Cn */, - { 0x0C29, 0x0C29} /* Cn */, { 0x0C34, 0x0C34} /* Cn */, - { 0x0C3A, 0x0C3D} /* Cn */, { 0x0C45, 0x0C45} /* Cn */, - { 0x0C49, 0x0C49} /* Cn */, { 0x0C4E, 0x0C54} /* Cn */, - { 0x0C57, 0x0C5F} /* Cn */, { 0x0C62, 0x0C65} /* Cn */, - { 0x0C70, 0x0C81} /* Cn */, { 0x0C84, 0x0C84} /* Cn */, - { 0x0C8D, 0x0C8D} /* Cn */, { 0x0C91, 0x0C91} /* Cn */, - { 0x0CA9, 0x0CA9} /* Cn */, { 0x0CB4, 0x0CB4} /* Cn */, - { 0x0CBA, 0x0CBB} /* Cn */, { 0x0CC5, 0x0CC5} /* Cn */, - { 0x0CC9, 0x0CC9} /* Cn */, { 0x0CCE, 0x0CD4} /* Cn */, - { 0x0CD7, 0x0CDD} /* Cn */, { 0x0CDF, 0x0CDF} /* Cn */, - { 0x0CE4, 0x0CE5} /* Cn */, { 0x0CF0, 0x0CF0} /* Cn */, - { 0x0CF3, 0x0D01} /* Cn */, { 0x0D04, 0x0D04} /* Cn */, - { 0x0D0D, 0x0D0D} /* Cn */, { 0x0D11, 0x0D11} /* Cn */, - { 0x0D29, 0x0D29} /* Cn */, { 0x0D3A, 0x0D3D} /* Cn */, - { 0x0D44, 0x0D45} /* Cn */, { 0x0D49, 0x0D49} /* Cn */, - { 0x0D4E, 0x0D56} /* Cn */, { 0x0D58, 0x0D5F} /* Cn */, - { 0x0D62, 0x0D65} /* Cn */, { 0x0D70, 0x0D81} /* Cn */, - { 0x0D84, 0x0D84} /* Cn */, { 0x0D97, 0x0D99} /* Cn */, - { 0x0DB2, 0x0DB2} /* Cn */, { 0x0DBC, 0x0DBC} /* Cn */, - { 0x0DBE, 0x0DBF} /* Cn */, { 0x0DC7, 0x0DC9} /* Cn */, - { 0x0DCB, 0x0DCE} /* Cn */, { 0x0DD5, 0x0DD5} /* Cn */, - { 0x0DD7, 0x0DD7} /* Cn */, { 0x0DE0, 0x0DF1} /* Cn */, - { 0x0DF5, 0x0E00} /* Cn */, { 0x0E3B, 0x0E3E} /* Cn */, - { 0x0E5C, 0x0E80} /* Cn */, { 0x0E83, 0x0E83} /* Cn */, - { 0x0E85, 0x0E86} /* Cn */, { 0x0E89, 0x0E89} /* Cn */, - { 0x0E8B, 0x0E8C} /* Cn */, { 0x0E8E, 0x0E93} /* Cn */, - { 0x0E98, 0x0E98} /* Cn */, { 0x0EA0, 0x0EA0} /* Cn */, - { 0x0EA4, 0x0EA4} /* Cn */, { 0x0EA6, 0x0EA6} /* Cn */, - { 0x0EA8, 0x0EA9} /* Cn */, { 0x0EAC, 0x0EAC} /* Cn */, - { 0x0EBA, 0x0EBA} /* Cn */, { 0x0EBE, 0x0EBF} /* Cn */, - { 0x0EC5, 0x0EC5} /* Cn */, { 0x0EC7, 0x0EC7} /* Cn */, - { 0x0ECE, 0x0ECF} /* Cn */, { 0x0EDA, 0x0EDB} /* Cn */, - { 0x0EDE, 0x0EFF} /* Cn */, { 0x0F48, 0x0F48} /* Cn */, - { 0x0F6B, 0x0F70} /* Cn */, { 0x0F8C, 0x0F8F} /* Cn */, - { 0x0F98, 0x0F98} /* Cn */, { 0x0FBD, 0x0FBD} /* Cn */, - { 0x0FCD, 0x0FCE} /* Cn */, { 0x0FD2, 0x0FFF} /* Cn */, - { 0x1022, 0x1022} /* Cn */, { 0x1028, 0x1028} /* Cn */, - { 0x102B, 0x102B} /* Cn */, { 0x1033, 0x1035} /* Cn */, - { 0x103A, 0x103F} /* Cn */, { 0x105A, 0x109F} /* Cn */, - { 0x10C6, 0x10CF} /* Cn */, { 0x10FD, 0x10FF} /* Cn */, - { 0x115A, 0x115E} /* Cn */, { 0x11A3, 0x11A7} /* Cn */, - { 0x11FA, 0x11FF} /* Cn */, { 0x1249, 0x1249} /* Cn */, - { 0x124E, 0x124F} /* Cn */, { 0x1257, 0x1257} /* Cn */, - { 0x1259, 0x1259} /* Cn */, { 0x125E, 0x125F} /* Cn */, - { 0x1289, 0x1289} /* Cn */, { 0x128E, 0x128F} /* Cn */, - { 0x12B1, 0x12B1} /* Cn */, { 0x12B6, 0x12B7} /* Cn */, - { 0x12BF, 0x12BF} /* Cn */, { 0x12C1, 0x12C1} /* Cn */, - { 0x12C6, 0x12C7} /* Cn */, { 0x12D7, 0x12D7} /* Cn */, - { 0x1311, 0x1311} /* Cn */, { 0x1316, 0x1317} /* Cn */, - { 0x135B, 0x135E} /* Cn */, { 0x137D, 0x137F} /* Cn */, - { 0x139A, 0x139F} /* Cn */, { 0x13F5, 0x1400} /* Cn */, - { 0x1677, 0x167F} /* Cn */, { 0x169D, 0x169F} /* Cn */, - { 0x16F1, 0x16FF} /* Cn */, { 0x170D, 0x170D} /* Cn */, - { 0x1715, 0x171F} /* Cn */, { 0x1737, 0x173F} /* Cn */, - { 0x1754, 0x175F} /* Cn */, { 0x176D, 0x176D} /* Cn */, - { 0x1771, 0x1771} /* Cn */, { 0x1774, 0x177F} /* Cn */, -#if 0 - { 0x17B4, 0x17B5} /* Cf */, -#endif - { 0x17DE, 0x17DF} /* Cn */, { 0x17EA, 0x17EF} /* Cn */, - { 0x17FA, 0x17FF} /* Cn */, { 0x180F, 0x180F} /* Cn */, - { 0x181A, 0x181F} /* Cn */, { 0x1878, 0x187F} /* Cn */, - { 0x18AA, 0x18FF} /* Cn */, { 0x191D, 0x191F} /* Cn */, - { 0x192C, 0x192F} /* Cn */, { 0x193C, 0x193F} /* Cn */, - { 0x1941, 0x1943} /* Cn */, { 0x196E, 0x196F} /* Cn */, - { 0x1975, 0x197F} /* Cn */, { 0x19AA, 0x19AF} /* Cn */, - { 0x19CA, 0x19CF} /* Cn */, { 0x19DA, 0x19DD} /* Cn */, - { 0x1A1C, 0x1A1D} /* Cn */, { 0x1A20, 0x1AFF} /* Cn */, - { 0x1B4C, 0x1B4F} /* Cn */, { 0x1B7D, 0x1CFF} /* Cn */, - { 0x1DCB, 0x1DFD} /* Cn */, { 0x1E9C, 0x1E9F} /* Cn */, - { 0x1EFA, 0x1EFF} /* Cn */, { 0x1F16, 0x1F17} /* Cn */, - { 0x1F1E, 0x1F1F} /* Cn */, { 0x1F46, 0x1F47} /* Cn */, - { 0x1F4E, 0x1F4F} /* Cn */, { 0x1F58, 0x1F58} /* Cn */, - { 0x1F5A, 0x1F5A} /* Cn */, { 0x1F5C, 0x1F5C} /* Cn */, - { 0x1F5E, 0x1F5E} /* Cn */, { 0x1F7E, 0x1F7F} /* Cn */, - { 0x1FB5, 0x1FB5} /* Cn */, { 0x1FC5, 0x1FC5} /* Cn */, - { 0x1FD4, 0x1FD5} /* Cn */, { 0x1FDC, 0x1FDC} /* Cn */, - { 0x1FF0, 0x1FF1} /* Cn */, { 0x1FF5, 0x1FF5} /* Cn */, - { 0x1FFF, 0x1FFF} /* Cn */, - { 0x200B, 0x200F} /* Cf */, - { 0x2028, 0x2028} /* Zl */, - { 0x2029, 0x2029} /* Zp */, - { 0x202A, 0x202E} /* Cf */, - { 0x2060, 0x2063} /* Cf */, - { 0x2064, 0x2069} /* Cn */, - { 0x206A, 0x206F} /* Cf */, - { 0x2072, 0x2073} /* Cn */, { 0x208F, 0x208F} /* Cn */, - { 0x2095, 0x209F} /* Cn */, { 0x20B6, 0x20CF} /* Cn */, - { 0x20F0, 0x20FF} /* Cn */, { 0x214F, 0x2152} /* Cn */, - { 0x2185, 0x218F} /* Cn */, { 0x23E8, 0x23FF} /* Cn */, - { 0x2427, 0x243F} /* Cn */, { 0x244B, 0x245F} /* Cn */, - { 0x269D, 0x269F} /* Cn */, { 0x26B3, 0x2700} /* Cn */, - { 0x2705, 0x2705} /* Cn */, { 0x270A, 0x270B} /* Cn */, - { 0x2728, 0x2728} /* Cn */, { 0x274C, 0x274C} /* Cn */, - { 0x274E, 0x274E} /* Cn */, { 0x2753, 0x2755} /* Cn */, - { 0x2757, 0x2757} /* Cn */, { 0x275F, 0x2760} /* Cn */, - { 0x2795, 0x2797} /* Cn */, { 0x27B0, 0x27B0} /* Cn */, - { 0x27BF, 0x27BF} /* Cn */, { 0x27CB, 0x27CF} /* Cn */, - { 0x27EC, 0x27EF} /* Cn */, { 0x2B1B, 0x2B1F} /* Cn */, - { 0x2B24, 0x2BFF} /* Cn */, { 0x2C2F, 0x2C2F} /* Cn */, - { 0x2C5F, 0x2C5F} /* Cn */, { 0x2C6D, 0x2C73} /* Cn */, - { 0x2C78, 0x2C7F} /* Cn */, { 0x2CEB, 0x2CF8} /* Cn */, - { 0x2D26, 0x2D2F} /* Cn */, { 0x2D66, 0x2D6E} /* Cn */, - { 0x2D70, 0x2D7F} /* Cn */, { 0x2D97, 0x2D9F} /* Cn */, - { 0x2DA7, 0x2DA7} /* Cn */, { 0x2DAF, 0x2DAF} /* Cn */, - { 0x2DB7, 0x2DB7} /* Cn */, { 0x2DBF, 0x2DBF} /* Cn */, - { 0x2DC7, 0x2DC7} /* Cn */, { 0x2DCF, 0x2DCF} /* Cn */, - { 0x2DD7, 0x2DD7} /* Cn */, { 0x2DDF, 0x2DFF} /* Cn */, - { 0x2E18, 0x2E1B} /* Cn */, { 0x2E1E, 0x2E7F} /* Cn */, - { 0x2E9A, 0x2E9A} /* Cn */, { 0x2EF4, 0x2EFF} /* Cn */, - { 0x2FD6, 0x2FEF} /* Cn */, { 0x2FFC, 0x2FFF} /* Cn */, - { 0x3040, 0x3040} /* Cn */, { 0x3097, 0x3098} /* Cn */, - { 0x3100, 0x3104} /* Cn */, { 0x312D, 0x3130} /* Cn */, - { 0x318F, 0x318F} /* Cn */, { 0x31B8, 0x31BF} /* Cn */, - { 0x31D0, 0x31EF} /* Cn */, { 0x321F, 0x321F} /* Cn */, - { 0x3244, 0x324F} /* Cn */, { 0x32FF, 0x32FF} /* Cn */, - { 0x4DB6, 0x4DBF} /* Cn */, { 0x9FBC, 0x9FFF} /* Cn */, - { 0xA48D, 0xA48F} /* Cn */, { 0xA4C7, 0xA6FF} /* Cn */, - { 0xA71B, 0xA71F} /* Cn */, { 0xA722, 0xA7FF} /* Cn */, - { 0xA82C, 0xA83F} /* Cn */, { 0xA878, 0xABFF} /* Cn */, - { 0xD7A4, 0xD7FF} /* Cn */, - { 0xD800, 0xDFFF} /* Cs */, - { 0xE000, 0xF8FF} /* Co */, - { 0xFA2E, 0xFA2F} /* Cn */, { 0xFA6B, 0xFA6F} /* Cn */, - { 0xFADA, 0xFAFF} /* Cn */, { 0xFB07, 0xFB12} /* Cn */, - { 0xFB18, 0xFB1C} /* Cn */, { 0xFB37, 0xFB37} /* Cn */, - { 0xFB3D, 0xFB3D} /* Cn */, { 0xFB3F, 0xFB3F} /* Cn */, - { 0xFB42, 0xFB42} /* Cn */, { 0xFB45, 0xFB45} /* Cn */, - { 0xFBB2, 0xFBD2} /* Cn */, { 0xFD40, 0xFD4F} /* Cn */, - { 0xFD90, 0xFD91} /* Cn */, { 0xFDC8, 0xFDEF} /* Cn */, - { 0xFDFE, 0xFDFF} /* Cn */, { 0xFE1A, 0xFE1F} /* Cn */, - { 0xFE24, 0xFE2F} /* Cn */, { 0xFE53, 0xFE53} /* Cn */, - { 0xFE67, 0xFE67} /* Cn */, { 0xFE6C, 0xFE6F} /* Cn */, - { 0xFE75, 0xFE75} /* Cn */, { 0xFEFD, 0xFEFE} /* Cn */, - { 0xFEFF, 0xFEFF} /* Cf */, - { 0xFF00, 0xFF00} /* Cn */, { 0xFFBF, 0xFFC1} /* Cn */, - { 0xFFC8, 0xFFC9} /* Cn */, { 0xFFD0, 0xFFD1} /* Cn */, - { 0xFFD8, 0xFFD9} /* Cn */, { 0xFFDD, 0xFFDF} /* Cn */, - { 0xFFE7, 0xFFE7} /* Cn */, { 0xFFEF, 0xFFF8} /* Cn */, - { 0xFFF9, 0xFFFB} /* Cf */, - { 0xFFFE, 0xFFFF} /* Cn */, { 0x1000C, 0x1000C} /* Cn */, - { 0x10027, 0x10027} /* Cn */, { 0x1003B, 0x1003B} /* Cn */, - { 0x1003E, 0x1003E} /* Cn */, { 0x1004E, 0x1004F} /* Cn */, - { 0x1005E, 0x1007F} /* Cn */, { 0x100FB, 0x100FF} /* Cn */, - { 0x10103, 0x10106} /* Cn */, { 0x10134, 0x10136} /* Cn */, - { 0x1018B, 0x102FF} /* Cn */, { 0x1031F, 0x1031F} /* Cn */, - { 0x10324, 0x1032F} /* Cn */, { 0x1034B, 0x1037F} /* Cn */, - { 0x1039E, 0x1039E} /* Cn */, { 0x103C4, 0x103C7} /* Cn */, - { 0x103D6, 0x103FF} /* Cn */, - { 0x1049E, 0x1049F} /* Cn */, { 0x104AA, 0x107FF} /* Cn */, - { 0x10806, 0x10807} /* Cn */, { 0x10809, 0x10809} /* Cn */, - { 0x10836, 0x10836} /* Cn */, { 0x10839, 0x1083B} /* Cn */, - { 0x1083D, 0x1083E} /* Cn */, { 0x10840, 0x108FF} /* Cn */, - { 0x1091A, 0x1091E} /* Cn */, { 0x10920, 0x109FF} /* Cn */, - { 0x10A04, 0x10A04} /* Cn */, { 0x10A07, 0x10A0B} /* Cn */, - { 0x10A14, 0x10A14} /* Cn */, { 0x10A18, 0x10A18} /* Cn */, - { 0x10A34, 0x10A37} /* Cn */, { 0x10A3B, 0x10A3E} /* Cn */, - { 0x10A48, 0x10A4F} /* Cn */, { 0x10A59, 0x11FFF} /* Cn */, - { 0x1236F, 0x123FF} /* Cn */, { 0x12463, 0x1246F} /* Cn */, - { 0x12474, 0x1CFFF} /* Cn */, { 0x1D0F6, 0x1D0FF} /* Cn */, - { 0x1D127, 0x1D129} /* Cn */, - { 0x1D173, 0x1D17A} /* Cf */, - { 0x1D1DE, 0x1D1FF} /* Cn */, { 0x1D246, 0x1D2FF} /* Cn */, - { 0x1D357, 0x1D35F} /* Cn */, { 0x1D372, 0x1D3FF} /* Cn */, - { 0x1D455, 0x1D455} /* Cn */, { 0x1D49D, 0x1D49D} /* Cn */, - { 0x1D4A0, 0x1D4A1} /* Cn */, { 0x1D4A3, 0x1D4A4} /* Cn */, - { 0x1D4A7, 0x1D4A8} /* Cn */, { 0x1D4AD, 0x1D4AD} /* Cn */, - { 0x1D4BA, 0x1D4BA} /* Cn */, { 0x1D4BC, 0x1D4BC} /* Cn */, - { 0x1D4C4, 0x1D4C4} /* Cn */, { 0x1D506, 0x1D506} /* Cn */, - { 0x1D50B, 0x1D50C} /* Cn */, { 0x1D515, 0x1D515} /* Cn */, - { 0x1D51D, 0x1D51D} /* Cn */, { 0x1D53A, 0x1D53A} /* Cn */, - { 0x1D53F, 0x1D53F} /* Cn */, { 0x1D545, 0x1D545} /* Cn */, - { 0x1D547, 0x1D549} /* Cn */, { 0x1D551, 0x1D551} /* Cn */, - { 0x1D6A6, 0x1D6A7} /* Cn */, { 0x1D7CC, 0x1D7CD} /* Cn */, - { 0x1D800, 0x1FFFF} /* Cn */, { 0x2A6D7, 0x2F7FF} /* Cn */, - { 0x2FA1E, 0xE0000} /* Cn */, - { 0xE0001, 0xE0001} /* Cf */, - { 0xE0002, 0xE001F} /* Cn */, - { 0xE0020, 0xE007F} /* Cf */, - { 0xE0080, 0xE00FF} /* Cn */, { 0xE01F0, 0xEFFFF} /* Cn */, - { 0xF0000, 0xFFFFD} /* Co */, - { 0xFFFFE, 0xFFFFF} /* Cn */, - {0x100000,0x10FFFD} /* Co */, - {0x10FFFE,0x10FFFF} /* Cn */, - {0x110000,0x7FFFFFFF} /* ISO 10646?? */ -}; - -/* - * Double width characters - * W: East Asian Wide - * F: East Asian Full-width - * Unassigned code points may be included when they allow ranges to be merged. - * Last synched with - * - * dated 2005-11-08T01:32:56Z - */ -static struct wchar_range wide_table[] = { - { 0x1100, 0x115F} /* W */, { 0x2329, 0x232A} /* W */, - { 0x2E80, 0x2FFB} /* W */, - { 0x3000, 0x3000} /* F */, - { 0x3001, 0x303E} /* W */, { 0x3041, 0x4DB5} /* W */, - { 0x4E00, 0x9FBB} /* W */, { 0xA000, 0xA4C6} /* W */, - { 0xAC00, 0xD7A3} /* W */, { 0xF900, 0xFAD9} /* W */, - { 0xFE10, 0xFE19} /* W */, { 0xFE30, 0xFE6B} /* W */, - { 0xFF01, 0xFF60} /* F */, { 0xFFE0, 0xFFE6} /* F */, - { 0x20000, 0x2FFFD} /* W */, { 0x30000, 0x3FFFD} /* W */, -}; static int -is_in_table(ch, table, tsize) +is_in_table(ch, table) LWCHAR ch; - struct wchar_range table[]; - int tsize; + struct wchar_range_table *table; { int hi; int lo; /* Binary search in the table. */ - if (ch < table[0].first) + if (ch < table->table[0].first) return 0; lo = 0; - hi = tsize - 1; + hi = table->count - 1; while (lo <= hi) { int mid = (lo + hi) / 2; - if (ch > table[mid].last) + if (ch > table->table[mid].last) lo = mid + 1; - else if (ch < table[mid].first) + else if (ch < table->table[mid].first) hi = mid - 1; else return 1; @@ -1126,7 +777,7 @@ is_in_table(ch, table, tsize) is_composing_char(ch) LWCHAR ch; { - return is_in_table(ch, comp_table, (sizeof(comp_table) / sizeof(*comp_table))); + return is_in_table(ch, &compose_table); } /* @@ -1136,7 +787,7 @@ is_composing_char(ch) is_ubin_char(ch) LWCHAR ch; { - return is_in_table(ch, ubin_table, (sizeof(ubin_table) / sizeof(*ubin_table))); + return is_in_table(ch, &ubin_table); } /* @@ -1146,7 +797,7 @@ is_ubin_char(ch) is_wide_char(ch) LWCHAR ch; { - return is_in_table(ch, wide_table, (sizeof(wide_table) / sizeof(*wide_table))); + return is_in_table(ch, &wide_table); } /* Modified: stable/9/contrib/less/charset.h ============================================================================== --- stable/9/contrib/less/charset.h Mon Jan 18 19:13:54 2016 (r294286) +++ stable/9/contrib/less/charset.h Mon Jan 18 19:27:24 2016 (r294287) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/9/contrib/less/cmd.h ============================================================================== --- stable/9/contrib/less/cmd.h Mon Jan 18 19:13:54 2016 (r294286) +++ stable/9/contrib/less/cmd.h Mon Jan 18 19:27:24 2016 (r294287) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -66,6 +66,7 @@ #define A_PREV_TAG 54 #define A_FILTER 55 #define A_F_UNTIL_HILITE 56 +#define A_GOEND_BUF 57 #define A_INVALID 100 #define A_NOACTION 101 Modified: stable/9/contrib/less/cmdbuf.c ============================================================================== --- stable/9/contrib/less/cmdbuf.c Mon Jan 18 19:13:54 2016 (r294286) +++ stable/9/contrib/less/cmdbuf.c Mon Jan 18 19:27:24 2016 (r294287) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -203,7 +203,7 @@ cmd_step_common(p, ch, len, pwidth, bswi pr = prchar((int) ch); if (pwidth != NULL || bswidth != NULL) { - int len = strlen(pr); + int len = (int) strlen(pr); if (pwidth != NULL) *pwidth = len; if (bswidth != NULL) @@ -222,7 +222,7 @@ cmd_step_common(p, ch, len, pwidth, bswi *bswidth = 0; } else if (is_ubin_char(ch)) { - int len = strlen(pr); + int len = (int) strlen(pr); if (pwidth != NULL) *pwidth = len; if (bswidth != NULL) @@ -375,7 +375,7 @@ cmd_lshift() s = ns; } - cmd_offset = s - cmdbuf; + cmd_offset = (int) (s - cmdbuf); save_cp = cp; cmd_home(); cmd_repaint(save_cp); @@ -405,7 +405,7 @@ cmd_rshift() cols += width; } - cmd_offset = s - cmdbuf; + cmd_offset = (int) (s - cmdbuf); save_cp = cp; cmd_home(); cmd_repaint(save_cp); @@ -535,7 +535,7 @@ cmd_erase() */ s = cp; cmd_left(); - clen = s - cp; + clen = (int) (s - cp); /* * Remove the char from the buffer (shift the buffer left). @@ -701,7 +701,7 @@ cmd_updown(action) if (updown_match < 0) { - updown_match = cp - cmdbuf; + updown_match = (int) (cp - cmdbuf); } /* @@ -744,12 +744,13 @@ cmd_updown(action) #endif /* - * Add a string to a history list. + * Add a string to an mlist. */ public void -cmd_addhist(mlist, cmd) +cmd_addhist(mlist, cmd, modified) struct mlist *mlist; char *cmd; + int modified; { #if CMD_HISTORY struct mlist *ml; @@ -773,6 +774,7 @@ cmd_addhist(mlist, cmd) */ ml = (struct mlist *) ecalloc(1, sizeof(struct mlist)); ml->string = save(cmd); + ml->modified = modified; ml->next = mlist; ml->prev = mlist->prev; mlist->prev->next = ml; @@ -799,7 +801,7 @@ cmd_accept() */ if (curr_mlist == NULL) return; - cmd_addhist(curr_mlist, cmdbuf); + cmd_addhist(curr_mlist, cmdbuf, 1); curr_mlist->modified = 1; #endif } @@ -965,7 +967,7 @@ delimit_word() int delim_quoted = 0; int meta_quoted = 0; char *esc = get_meta_escape(); - int esclen = strlen(esc); + int esclen = (int) strlen(esc); #endif /* @@ -1262,7 +1264,7 @@ cmd_char(c) cmd_mbc_buf[cmd_mbc_buf_index++] = c; if (cmd_mbc_buf_index < cmd_mbc_buf_len) return (CC_OK); - if (!is_utf8_well_formed(cmd_mbc_buf)) + if (!is_utf8_well_formed(cmd_mbc_buf, cmd_mbc_buf_index)) { /* complete, but not well formed (non-shortest form), sequence */ cmd_mbc_buf_len = 0; @@ -1359,6 +1361,18 @@ cmd_lastpattern() #if CMD_HISTORY /* + */ + static int +mlist_size(ml) + struct mlist *ml; +{ + int size = 0; + for (ml = ml->next; ml->string != NULL; ml = ml->next) + ++size; + return size; +} + +/* * Get the name of the history file. */ static char * @@ -1378,6 +1392,10 @@ histfile_name() return (save(name)); } + /* See if history file is disabled in the build. */ + if (strcmp(LESSHISTFILE, "") == 0 || strcmp(LESSHISTFILE, "-") == 0) + return (NULL); + /* Otherwise, file is in $HOME. */ home = lgetenv("HOME"); if (home == NULL || *home == '\0') @@ -1388,25 +1406,28 @@ histfile_name() #endif return (NULL); } - len = strlen(home) + strlen(LESSHISTFILE) + 2; + len = (int) (strlen(home) + strlen(LESSHISTFILE) + 2); name = (char *) ecalloc(len, sizeof(char)); SNPRINTF2(name, len, "%s/%s", home, LESSHISTFILE); return (name); } -#endif /* CMD_HISTORY */ /* - * Initialize history from a .lesshist file. + * Read a .lesshst file and call a callback for each line in the file. */ - public void -init_cmdhist() + static void +read_cmdhist2(action, uparam, skip_search, skip_shell) + void (*action)(void*,struct mlist*,char*); + void *uparam; + int skip_search; + int skip_shell; { -#if CMD_HISTORY struct mlist *ml = NULL; char line[CMDBUF_SIZE]; char *filename; FILE *f; char *p; + int *skip = NULL; filename = histfile_name(); if (filename == NULL) @@ -1432,84 +1453,170 @@ init_cmdhist() } } if (strcmp(line, HISTFILE_SEARCH_SECTION) == 0) + { ml = &mlist_search; - else if (strcmp(line, HISTFILE_SHELL_SECTION) == 0) + skip = &skip_search; + } else if (strcmp(line, HISTFILE_SHELL_SECTION) == 0) { #if SHELL_ESCAPE || PIPEC ml = &mlist_shell; + skip = &skip_shell; #else ml = NULL; + skip = NULL; #endif } else if (*line == '"') { if (ml != NULL) - cmd_addhist(ml, line+1); + { + if (skip != NULL && *skip > 0) + --(*skip); + else + (*action)(uparam, ml, line+1); + } } } fclose(f); +} + + static void +read_cmdhist(action, uparam, skip_search, skip_shell) + void (*action)(void*,struct mlist*,char*); + void *uparam; + int skip_search; + int skip_shell; +{ + read_cmdhist2(action, uparam, skip_search, skip_shell); + (*action)(uparam, NULL, NULL); /* signal end of file */ +} + + static void +addhist_init(void *uparam, struct mlist *ml, char *string) +{ + if (ml == NULL || string == NULL) + return; + cmd_addhist(ml, string, 0); +} +#endif /* CMD_HISTORY */ + +/* + * Initialize history from a .lesshist file. + */ + public void +init_cmdhist() *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Jan 18 19:42:06 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9682EA87875; Mon, 18 Jan 2016 19:42:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 722141FCC; Mon, 18 Jan 2016 19:42:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IJg56C077781; Mon, 18 Jan 2016 19:42:05 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IJg5gJ077778; Mon, 18 Jan 2016 19:42:05 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601181942.u0IJg5gJ077778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 18 Jan 2016 19:42:05 +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: r294288 - stable/10/contrib/netcat 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 19:42:06 -0000 Author: delphij Date: Mon Jan 18 19:42:05 2016 New Revision: 294288 URL: https://svnweb.freebsd.org/changeset/base/294288 Log: MFC r288303: MFV r288243: nc from OpenBSD 5.8. Modified: stable/10/contrib/netcat/nc.1 stable/10/contrib/netcat/netcat.c stable/10/contrib/netcat/socks.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netcat/nc.1 ============================================================================== --- stable/10/contrib/netcat/nc.1 Mon Jan 18 19:27:24 2016 (r294287) +++ stable/10/contrib/netcat/nc.1 Mon Jan 18 19:42:05 2016 (r294288) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.67 2014/02/26 20:56:11 claudio Exp $ +.\" $OpenBSD: nc.1,v 1.68 2015/03/26 10:35:04 tobias Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 11, 2014 +.Dd September 26, 2015 .Dt NC 1 .Os .Sh NAME @@ -133,7 +133,7 @@ connection to another program (e.g.\& .Xr ssh 1 using the .Xr ssh_config 5 -.Cm ProxyUseFdPass +.Cm ProxyUseFdpass option). .It Fl h Prints out Modified: stable/10/contrib/netcat/netcat.c ============================================================================== --- stable/10/contrib/netcat/netcat.c Mon Jan 18 19:27:24 2016 (r294287) +++ stable/10/contrib/netcat/netcat.c Mon Jan 18 19:42:05 2016 (r294288) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.127 2015/02/14 22:40:22 jca Exp $ */ +/* $OpenBSD: netcat.c,v 1.130 2015/07/26 19:12:28 chl Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -52,15 +52,16 @@ #include #include #include +#include +#include #include #include +#include #include #include #include #include #include -#include -#include #include "atomicio.h" #ifndef SUN_LEN @@ -163,6 +164,8 @@ main(int argc, char *argv[]) uport = NULL; sv = NULL; + signal(SIGPIPE, SIG_IGN); + while ((ch = getopt_long(argc, argv, "46DdEe:FhI:i:klNnoO:P:p:rSs:tT:UuV:vw:X:x:z", longopts, NULL)) != -1) { @@ -1042,7 +1045,6 @@ fdpass(int nfd) bzero(&mh, sizeof(mh)); bzero(&cmsgbuf, sizeof(cmsgbuf)); bzero(&iov, sizeof(iov)); - bzero(&pfd, sizeof(pfd)); mh.msg_control = (caddr_t)&cmsgbuf.buf; mh.msg_controllen = sizeof(cmsgbuf.buf); @@ -1059,17 +1061,17 @@ fdpass(int nfd) bzero(&pfd, sizeof(pfd)); pfd.fd = STDOUT_FILENO; + pfd.events = POLLOUT; for (;;) { r = sendmsg(STDOUT_FILENO, &mh, 0); if (r == -1) { if (errno == EAGAIN || errno == EINTR) { - pfd.events = POLLOUT; if (poll(&pfd, 1, -1) == -1) err(1, "poll"); continue; } err(1, "sendmsg"); - } else if (r == -1) + } else if (r != 1) errx(1, "sendmsg: unexpected return value %zd", r); else break; Modified: stable/10/contrib/netcat/socks.c ============================================================================== --- stable/10/contrib/netcat/socks.c Mon Jan 18 19:27:24 2016 (r294287) +++ stable/10/contrib/netcat/socks.c Mon Jan 18 19:42:05 2016 (r294288) @@ -1,4 +1,4 @@ -/* $OpenBSD: socks.c,v 1.20 2012/03/08 09:56:28 espie Exp $ */ +/* $OpenBSD: socks.c,v 1.21 2015/03/26 21:19:51 tobias Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -308,8 +308,8 @@ socks_connect(const char *host, const ch } /* Terminate headers */ - if ((r = atomicio(vwrite, proxyfd, "\r\n", 2)) != 2) - err(1, "write failed (2/%d)", r); + if ((cnt = atomicio(vwrite, proxyfd, "\r\n", 2)) != 2) + err(1, "write failed (%zu/2)", cnt); /* Read status reply */ proxy_read_line(proxyfd, buf, sizeof(buf)); From owner-svn-src-stable@freebsd.org Mon Jan 18 19:52:22 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24510A87C33; Mon, 18 Jan 2016 19:52:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2E2B1892; Mon, 18 Jan 2016 19:52:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IJqKk9083588; Mon, 18 Jan 2016 19:52:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IJqKGF083583; Mon, 18 Jan 2016 19:52:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601181952.u0IJqKGF083583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 18 Jan 2016 19:52:20 +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: r294289 - in stable/10: sys/dev/pci usr.sbin/pciconf 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 19:52:22 -0000 Author: jhb Date: Mon Jan 18 19:52:20 2016 New Revision: 294289 URL: https://svnweb.freebsd.org/changeset/base/294289 Log: MFC 291225: Add a new -B flag for use with list mode (-l) that lists details about bridges. Currently this includes information about what resources a bridge decodes on the upstream side for use by downstream devices including bus numbers, I/O port resources, and memory resources. Windows and bus ranges are enumerated for both PCI-PCI bridges and PCI-CardBus bridges. To simplify the implementation, all enumeration is done by reading the appropriate config space registers directly rather than querying the bridge driver in the kernel via new ioctls. This does result in a few limitations. First, an unimplemented window in a PCI-PCI bridge cannot be accurately detected as accurate detection requires writing to the window base register. That is not safe for pciconf(8). Instead, this assumes that any window where both the base and limit read as all zeroes is unimplemented. Second, the PCI-PCI bridge driver in a tree has a few quirks for PCI-PCI bridges that use subtractive decoding but do not indicate that via the progif config register. The list of quirks is duplicated in pciconf's source. Modified: stable/10/sys/dev/pci/pcireg.h stable/10/sys/dev/pci/pcivar.h stable/10/usr.sbin/pciconf/pciconf.8 stable/10/usr.sbin/pciconf/pciconf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/pci/pcireg.h ============================================================================== --- stable/10/sys/dev/pci/pcireg.h Mon Jan 18 19:42:05 2016 (r294288) +++ stable/10/sys/dev/pci/pcireg.h Mon Jan 18 19:52:20 2016 (r294289) @@ -260,6 +260,11 @@ #define PCIR_BIOS_1 0x38 #define PCIR_BRIDGECTL_1 0x3e +#define PCI_PPBMEMBASE(h,l) ((((uint64_t)(h) << 32) + ((l)<<16)) & ~0xfffff) +#define PCI_PPBMEMLIMIT(h,l) ((((uint64_t)(h) << 32) + ((l)<<16)) | 0xfffff) +#define PCI_PPBIOBASE(h,l) ((((h)<<16) + ((l)<<8)) & ~0xfff) +#define PCI_PPBIOLIMIT(h,l) ((((h)<<16) + ((l)<<8)) | 0xfff) + /* config registers for header type 2 (CardBus) devices */ #define PCIR_MAX_BAR_2 0 @@ -279,6 +284,9 @@ #define PCIR_IOLIMIT0_2 0x30 #define PCIR_IOBASE1_2 0x34 #define PCIR_IOLIMIT1_2 0x38 +#define PCIM_CBBIO_16 0x0 +#define PCIM_CBBIO_32 0x1 +#define PCIM_CBBIO_MASK 0x3 #define PCIR_BRIDGECTL_2 0x3e @@ -287,6 +295,11 @@ #define PCIR_PCCARDIF_2 0x44 +#define PCI_CBBMEMBASE(l) ((l) & ~0xfffff) +#define PCI_CBBMEMLIMIT(l) ((l) | 0xfffff) +#define PCI_CBBIOBASE(l) ((l) & ~0x3) +#define PCI_CBBIOLIMIT(l) ((l) | 0x3) + /* PCI device class, subclass and programming interface definitions */ #define PCIC_OLD 0x00 @@ -474,6 +487,17 @@ #define PCIB_BCR_DISCARD_TIMER_STATUS 0x0400 #define PCIB_BCR_DISCARD_TIMER_SERREN 0x0800 +#define CBB_BCR_PERR_ENABLE 0x0001 +#define CBB_BCR_SERR_ENABLE 0x0002 +#define CBB_BCR_ISA_ENABLE 0x0004 +#define CBB_BCR_VGA_ENABLE 0x0008 +#define CBB_BCR_MASTER_ABORT_MODE 0x0020 +#define CBB_BCR_CARDBUS_RESET 0x0040 +#define CBB_BCR_IREQ_INT_ENABLE 0x0080 +#define CBB_BCR_PREFETCH_0_ENABLE 0x0100 +#define CBB_BCR_PREFETCH_1_ENABLE 0x0200 +#define CBB_BCR_WRITE_POSTING_ENABLE 0x0400 + /* PCI power manangement */ #define PCIR_POWER_CAP 0x2 #define PCIM_PCAP_SPEC 0x0007 Modified: stable/10/sys/dev/pci/pcivar.h ============================================================================== --- stable/10/sys/dev/pci/pcivar.h Mon Jan 18 19:42:05 2016 (r294288) +++ stable/10/sys/dev/pci/pcivar.h Mon Jan 18 19:52:20 2016 (r294289) @@ -190,11 +190,6 @@ typedef struct pcicfg { /* additional type 1 device config header information (PCI to PCI bridge) */ -#define PCI_PPBMEMBASE(h,l) ((((pci_addr_t)(h) << 32) + ((l)<<16)) & ~0xfffff) -#define PCI_PPBMEMLIMIT(h,l) ((((pci_addr_t)(h) << 32) + ((l)<<16)) | 0xfffff) -#define PCI_PPBIOBASE(h,l) ((((h)<<16) + ((l)<<8)) & ~0xfff) -#define PCI_PPBIOLIMIT(h,l) ((((h)<<16) + ((l)<<8)) | 0xfff) - typedef struct { pci_addr_t pmembase; /* base address of prefetchable memory */ pci_addr_t pmemlimit; /* topmost address of prefetchable memory */ Modified: stable/10/usr.sbin/pciconf/pciconf.8 ============================================================================== --- stable/10/usr.sbin/pciconf/pciconf.8 Mon Jan 18 19:42:05 2016 (r294288) +++ stable/10/usr.sbin/pciconf/pciconf.8 Mon Jan 18 19:52:20 2016 (r294289) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 06, 2015 +.Dd November 23, 2015 .Dt PCICONF 8 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd diagnostic utility for the PCI bus .Sh SYNOPSIS .Nm -.Fl l Oo Fl bcevV Oc Op Ar device +.Fl l Oo Fl BbceVv Oc Op Ar device .Nm .Fl a Ar device .Nm @@ -112,6 +112,42 @@ device, which contains several (similar one chip. .Pp If the +.Fl B +option is supplied, +.Nm +will list additional information for +.Tn PCI +to +.Tn PCI +and +.Tn PCI +to +.Tn CardBus +bridges, +specifically the resource ranges decoded by the bridge for use by devices +behind the bridge. +Each bridge lists a range of bus numbers handled by the bridge and its +downstream devices. +Memory and I/O port decoding windows are enumerated via a line in the +following format: +.Bd -literal + window[1c] = type I/O Port, range 16, addr 0x5000-0x8fff, enabled +.Ed +.Pp +The first value after the +.Dq Li window +prefix in the square brackets is the offset of the decoding window in +config space in hexadecimal. +The type of a window is one of +.Dq Memory , +.Dq Prefetchable Memory , +or +.Dq I/O Port . +The range indicates the binary log of the maximum address the window decodes. +The address field indicates the start and end addresses of the decoded range. +Finally, the last flag indicates if the window is enabled or disabled. +.Pp +If the .Fl b option is supplied, .Nm @@ -132,7 +168,7 @@ The type of a BAR is one of .Dq Prefetchable Memory , or .Dq I/O Port . -The range indicates the maximum address the BAR decodes. +The range indicates the binary log of the maximum address the BAR decodes. The base and size indicate the start and length of the BAR's address window, respectively. Finally, the last flag indicates if the BAR is enabled or disabled. Modified: stable/10/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/10/usr.sbin/pciconf/pciconf.c Mon Jan 18 19:42:05 2016 (r294288) +++ stable/10/usr.sbin/pciconf/pciconf.c Mon Jan 18 19:52:20 2016 (r294289) @@ -39,6 +39,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -69,9 +70,10 @@ struct pci_vendor_info TAILQ_HEAD(,pci_vendor_info) pci_vendors; static struct pcisel getsel(const char *str); +static void list_bridge(int fd, struct pci_conf *p); static void list_bars(int fd, struct pci_conf *p); -static void list_devs(const char *name, int verbose, int bars, int caps, - int errors, int vpd); +static void list_devs(const char *name, int verbose, int bars, int bridge, + int caps, int errors, int vpd); static void list_verbose(struct pci_conf *p); static void list_vpd(int fd, struct pci_conf *p); static const char *guess_class(struct pci_conf *p); @@ -87,7 +89,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: pciconf -l [-bcevV] [device]", + "usage: pciconf -l [-BbcevV] [device]", " pciconf -a device", " pciconf -r [-b | -h] device addr[:addr2]", " pciconf -w [-b | -h] device addr value"); @@ -99,18 +101,22 @@ main(int argc, char **argv) { int c; int listmode, readmode, writemode, attachedmode; - int bars, caps, errors, verbose, vpd; + int bars, bridge, caps, errors, verbose, vpd; int byte, isshort; listmode = readmode = writemode = attachedmode = 0; - bars = caps = errors = verbose = vpd = byte = isshort = 0; + bars = bridge = caps = errors = verbose = vpd = byte = isshort = 0; - while ((c = getopt(argc, argv, "abcehlrwvV")) != -1) { + while ((c = getopt(argc, argv, "aBbcehlrwVv")) != -1) { switch(c) { case 'a': attachedmode = 1; break; + case 'B': + bridge = 1; + break; + case 'b': bars = 1; byte = 1; @@ -161,7 +167,7 @@ main(int argc, char **argv) if (listmode) { list_devs(optind + 1 == argc ? argv[optind] : NULL, verbose, - bars, caps, errors, vpd); + bars, bridge, caps, errors, vpd); } else if (attachedmode) { chkattached(argv[optind]); } else if (readmode) { @@ -178,8 +184,8 @@ main(int argc, char **argv) } static void -list_devs(const char *name, int verbose, int bars, int caps, int errors, - int vpd) +list_devs(const char *name, int verbose, int bars, int bridge, int caps, + int errors, int vpd) { int fd; struct pci_conf_io pc; @@ -190,7 +196,8 @@ list_devs(const char *name, int verbose, if (verbose) load_vendors(); - fd = open(_PATH_DEVPCI, (caps || errors) ? O_RDWR : O_RDONLY, 0); + fd = open(_PATH_DEVPCI, (bridge || caps || errors) ? O_RDWR : O_RDONLY, + 0); if (fd < 0) err(1, "%s", _PATH_DEVPCI); @@ -248,6 +255,8 @@ list_devs(const char *name, int verbose, list_verbose(p); if (bars) list_bars(fd, p); + if (bridge) + list_bridge(fd, p); if (caps) list_caps(fd, p); if (errors) @@ -261,6 +270,189 @@ list_devs(const char *name, int verbose, } static void +print_bus_range(int fd, struct pci_conf *p, int secreg, int subreg) +{ + uint8_t secbus, subbus; + + secbus = read_config(fd, &p->pc_sel, secreg, 1); + subbus = read_config(fd, &p->pc_sel, subreg, 1); + printf(" bus range = %u-%u\n", secbus, subbus); +} + +static void +print_window(int reg, const char *type, int range, uint64_t base, + uint64_t limit) +{ + + printf(" window[%02x] = type %s, range %2d, addr %#jx-%#jx, %s\n", + reg, type, range, (uintmax_t)base, (uintmax_t)limit, + base < limit ? "enabled" : "disabled"); +} + +static void +print_special_decode(bool isa, bool vga, bool subtractive) +{ + bool comma; + + if (isa || vga || subtractive) { + comma = false; + printf(" decode = "); + if (isa) { + printf("ISA"); + comma = true; + } + if (vga) { + printf("%sVGA", comma ? ", " : ""); + comma = true; + } + if (subtractive) + printf("%ssubtractive", comma ? ", " : ""); + printf("\n"); + } +} + +static void +print_bridge_windows(int fd, struct pci_conf *p) +{ + uint64_t base, limit; + uint32_t val; + uint16_t bctl; + bool subtractive; + int range; + + /* + * XXX: This assumes that a window with a base and limit of 0 + * is not implemented. In theory a window might be programmed + * at the smallest size with a base of 0, but those do not seem + * common in practice. + */ + val = read_config(fd, &p->pc_sel, PCIR_IOBASEL_1, 1); + if (val != 0 || read_config(fd, &p->pc_sel, PCIR_IOLIMITL_1, 1) != 0) { + if ((val & PCIM_BRIO_MASK) == PCIM_BRIO_32) { + base = PCI_PPBIOBASE( + read_config(fd, &p->pc_sel, PCIR_IOBASEH_1, 2), + val); + limit = PCI_PPBIOLIMIT( + read_config(fd, &p->pc_sel, PCIR_IOLIMITH_1, 2), + read_config(fd, &p->pc_sel, PCIR_IOLIMITL_1, 1)); + range = 32; + } else { + base = PCI_PPBIOBASE(0, val); + limit = PCI_PPBIOLIMIT(0, + read_config(fd, &p->pc_sel, PCIR_IOLIMITL_1, 1)); + range = 16; + } + print_window(PCIR_IOBASEL_1, "I/O Port", range, base, limit); + } + + base = PCI_PPBMEMBASE(0, + read_config(fd, &p->pc_sel, PCIR_MEMBASE_1, 2)); + limit = PCI_PPBMEMLIMIT(0, + read_config(fd, &p->pc_sel, PCIR_MEMLIMIT_1, 2)); + print_window(PCIR_MEMBASE_1, "Memory", 32, base, limit); + + val = read_config(fd, &p->pc_sel, PCIR_PMBASEL_1, 2); + if (val != 0 || read_config(fd, &p->pc_sel, PCIR_PMLIMITL_1, 2) != 0) { + if ((val & PCIM_BRPM_MASK) == PCIM_BRPM_64) { + base = PCI_PPBMEMBASE( + read_config(fd, &p->pc_sel, PCIR_PMBASEH_1, 4), + val); + limit = PCI_PPBMEMLIMIT( + read_config(fd, &p->pc_sel, PCIR_PMLIMITH_1, 4), + read_config(fd, &p->pc_sel, PCIR_PMLIMITL_1, 2)); + range = 64; + } else { + base = PCI_PPBMEMBASE(0, val); + limit = PCI_PPBMEMLIMIT(0, + read_config(fd, &p->pc_sel, PCIR_PMLIMITL_1, 2)); + range = 32; + } + print_window(PCIR_PMBASEL_1, "Prefetchable Memory", range, base, + limit); + } + + /* + * XXX: This list of bridges that are subtractive but do not set + * progif to indicate it is copied from pci_pci.c. + */ + subtractive = p->pc_progif == PCIP_BRIDGE_PCI_SUBTRACTIVE; + switch (p->pc_device << 16 | p->pc_vendor) { + case 0xa002177d: /* Cavium ThunderX */ + case 0x124b8086: /* Intel 82380FB Mobile */ + case 0x060513d7: /* Toshiba ???? */ + subtractive = true; + } + if (p->pc_vendor == 0x8086 && (p->pc_device & 0xff00) == 0x2400) + subtractive = true; + + bctl = read_config(fd, &p->pc_sel, PCIR_BRIDGECTL_1, 2); + print_special_decode(bctl & PCIB_BCR_ISA_ENABLE, + bctl & PCIB_BCR_VGA_ENABLE, subtractive); +} + +static void +print_cardbus_mem_window(int fd, struct pci_conf *p, int basereg, int limitreg, + bool prefetch) +{ + + print_window(basereg, prefetch ? "Prefetchable Memory" : "Memory", 32, + PCI_CBBMEMBASE(read_config(fd, &p->pc_sel, basereg, 4)), + PCI_CBBMEMLIMIT(read_config(fd, &p->pc_sel, limitreg, 4))); +} + +static void +print_cardbus_io_window(int fd, struct pci_conf *p, int basereg, int limitreg) +{ + uint32_t base, limit; + uint32_t val; + int range; + + val = read_config(fd, &p->pc_sel, basereg, 2); + if ((val & PCIM_CBBIO_MASK) == PCIM_CBBIO_32) { + base = PCI_CBBIOBASE(read_config(fd, &p->pc_sel, basereg, 4)); + limit = PCI_CBBIOBASE(read_config(fd, &p->pc_sel, limitreg, 4)); + range = 32; + } else { + base = PCI_CBBIOBASE(val); + limit = PCI_CBBIOBASE(read_config(fd, &p->pc_sel, limitreg, 2)); + range = 16; + } + print_window(basereg, "I/O Port", range, base, limit); +} + +static void +print_cardbus_windows(int fd, struct pci_conf *p) +{ + uint16_t bctl; + + bctl = read_config(fd, &p->pc_sel, PCIR_BRIDGECTL_2, 2); + print_cardbus_mem_window(fd, p, PCIR_MEMBASE0_2, PCIR_MEMLIMIT0_2, + bctl & CBB_BCR_PREFETCH_0_ENABLE); + print_cardbus_mem_window(fd, p, PCIR_MEMBASE1_2, PCIR_MEMLIMIT1_2, + bctl & CBB_BCR_PREFETCH_1_ENABLE); + print_cardbus_io_window(fd, p, PCIR_IOBASE0_2, PCIR_IOLIMIT0_2); + print_cardbus_io_window(fd, p, PCIR_IOBASE1_2, PCIR_IOLIMIT1_2); + print_special_decode(bctl & CBB_BCR_ISA_ENABLE, + bctl & CBB_BCR_VGA_ENABLE, false); +} + +static void +list_bridge(int fd, struct pci_conf *p) +{ + + switch (p->pc_hdr & PCIM_HDRTYPE) { + case PCIM_HDRTYPE_BRIDGE: + print_bus_range(fd, p, PCIR_SECBUS_1, PCIR_SUBBUS_1); + print_bridge_windows(fd, p); + break; + case PCIM_HDRTYPE_CARDBUS: + print_bus_range(fd, p, PCIR_SECBUS_2, PCIR_SUBBUS_2); + print_cardbus_windows(fd, p); + break; + } +} + +static void list_bars(int fd, struct pci_conf *p) { struct pci_bar_io bar; From owner-svn-src-stable@freebsd.org Mon Jan 18 20:44:30 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABEAAA86F38; Mon, 18 Jan 2016 20:44:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DDF01504; Mon, 18 Jan 2016 20:44:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IKiTdc098387; Mon, 18 Jan 2016 20:44:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IKiTTr098386; Mon, 18 Jan 2016 20:44:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601182044.u0IKiTTr098386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 18 Jan 2016 20:44:29 +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: r294292 - stable/10/sys/dev/drm2/i915 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 20:44:30 -0000 Author: jhb Date: Mon Jan 18 20:44:29 2016 New Revision: 294292 URL: https://svnweb.freebsd.org/changeset/base/294292 Log: MFC 292409: It seems certain Intel GPUs use GPIO bitbanging over a child device instead of GMBUS access for I2C transfers. The GMBUS driver falls back to this mode when a transfer times out. However, the first transfer to timeout was sending the request back to itself resulting in an panic due to recursing on a lock. Fix it to forward the request on to the proper device. This appears to have been accidentally changed in r277487. Modified: stable/10/sys/dev/drm2/i915/intel_iic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/i915/intel_iic.c ============================================================================== --- stable/10/sys/dev/drm2/i915/intel_iic.c Mon Jan 18 20:22:51 2016 (r294291) +++ stable/10/sys/dev/drm2/i915/intel_iic.c Mon Jan 18 20:44:29 2016 (r294292) @@ -467,8 +467,7 @@ timeout: * Try GPIO bitbanging instead. */ sc->force_bit_dev = true; - error = -IICBUS_TRANSFER(idev, msgs, nmsgs); - goto out; + error = -IICBUS_TRANSFER(dev_priv->bbbus[unit], msgs, nmsgs); out: sx_xunlock(&dev_priv->gmbus_sx); From owner-svn-src-stable@freebsd.org Mon Jan 18 21:24:30 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A03CA87F38; Mon, 18 Jan 2016 21:24:30 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D69F410E8; Mon, 18 Jan 2016 21:24:29 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ILOSjL010326; Mon, 18 Jan 2016 21:24:28 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ILOSIN010325; Mon, 18 Jan 2016 21:24:28 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201601182124.u0ILOSIN010325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Mon, 18 Jan 2016 21:24:28 +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: r294294 - stable/10/usr.sbin/bhyve 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 21:24:30 -0000 Author: gnn Date: Mon Jan 18 21:24:28 2016 New Revision: 294294 URL: https://svnweb.freebsd.org/changeset/base/294294 Log: MFC: 293459,293643 Add netmap support for bhyve Modified: stable/10/usr.sbin/bhyve/pci_virtio_net.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_net.c Mon Jan 18 20:47:04 2016 (r294293) +++ stable/10/usr.sbin/bhyve/pci_virtio_net.c Mon Jan 18 21:24:28 2016 (r294294) @@ -36,6 +36,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifndef NETMAP_WITH_LIBS +#define NETMAP_WITH_LIBS +#endif +#include #include #include @@ -133,6 +137,8 @@ struct pci_vtnet_softc { struct mevent *vsc_mevp; int vsc_tapfd; + struct nm_desc *vsc_nmd; + int vsc_rx_ready; volatile int resetting; /* set and checked outside lock */ @@ -149,6 +155,10 @@ struct pci_vtnet_softc { pthread_mutex_t tx_mtx; pthread_cond_t tx_cond; int tx_in_progress; + + void (*pci_vtnet_rx)(struct pci_vtnet_softc *sc); + void (*pci_vtnet_tx)(struct pci_vtnet_softc *sc, struct iovec *iov, + int iovcnt, int len); }; static void pci_vtnet_reset(void *); @@ -371,14 +381,208 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc vq_endchains(vq, 1); } +static int +pci_vtnet_netmap_writev(struct nm_desc *nmd, struct iovec *iov, int iovcnt) +{ + int r, i; + int len = 0; + + for (r = nmd->cur_tx_ring; ; ) { + struct netmap_ring *ring = NETMAP_TXRING(nmd->nifp, r); + uint32_t cur, idx; + char *buf; + + if (nm_ring_empty(ring)) { + r++; + if (r > nmd->last_tx_ring) + r = nmd->first_tx_ring; + if (r == nmd->cur_rx_ring) + break; + continue; + } + cur = ring->cur; + idx = ring->slot[cur].buf_idx; + buf = NETMAP_BUF(ring, idx); + + for (i = 0; i < iovcnt; i++) { + memcpy(&buf[len], iov[i].iov_base, iov[i].iov_len); + len += iov[i].iov_len; + } + ring->slot[cur].len = len; + ring->head = ring->cur = nm_ring_next(ring, cur); + nmd->cur_tx_ring = r; + ioctl(nmd->fd, NIOCTXSYNC, NULL); + break; + } + + return (len); +} + +static inline int +pci_vtnet_netmap_readv(struct nm_desc *nmd, struct iovec *iov, int iovcnt) +{ + int len = 0; + int i = 0; + int r; + + for (r = nmd->cur_rx_ring; ; ) { + struct netmap_ring *ring = NETMAP_RXRING(nmd->nifp, r); + uint32_t cur, idx; + char *buf; + size_t left; + + if (nm_ring_empty(ring)) { + r++; + if (r > nmd->last_rx_ring) + r = nmd->first_rx_ring; + if (r == nmd->cur_rx_ring) + break; + continue; + } + cur = ring->cur; + idx = ring->slot[cur].buf_idx; + buf = NETMAP_BUF(ring, idx); + left = ring->slot[cur].len; + + for (i = 0; i < iovcnt && left > 0; i++) { + if (iov[i].iov_len > left) + iov[i].iov_len = left; + memcpy(iov[i].iov_base, &buf[len], iov[i].iov_len); + len += iov[i].iov_len; + left -= iov[i].iov_len; + } + ring->head = ring->cur = nm_ring_next(ring, cur); + nmd->cur_rx_ring = r; + ioctl(nmd->fd, NIOCRXSYNC, NULL); + break; + } + for (; i < iovcnt; i++) + iov[i].iov_len = 0; + + return (len); +} + +/* + * Called to send a buffer chain out to the vale port + */ +static void +pci_vtnet_netmap_tx(struct pci_vtnet_softc *sc, struct iovec *iov, int iovcnt, + int len) +{ + static char pad[60]; /* all zero bytes */ + + if (sc->vsc_nmd == NULL) + return; + + /* + * If the length is < 60, pad out to that and add the + * extra zero'd segment to the iov. It is guaranteed that + * there is always an extra iov available by the caller. + */ + if (len < 60) { + iov[iovcnt].iov_base = pad; + iov[iovcnt].iov_len = 60 - len; + iovcnt++; + } + (void) pci_vtnet_netmap_writev(sc->vsc_nmd, iov, iovcnt); +} + +static void +pci_vtnet_netmap_rx(struct pci_vtnet_softc *sc) +{ + struct iovec iov[VTNET_MAXSEGS], *riov; + struct vqueue_info *vq; + void *vrx; + int len, n; + uint16_t idx; + + /* + * Should never be called without a valid netmap descriptor + */ + assert(sc->vsc_nmd != NULL); + + /* + * But, will be called when the rx ring hasn't yet + * been set up or the guest is resetting the device. + */ + if (!sc->vsc_rx_ready || sc->resetting) { + /* + * Drop the packet and try later. + */ + (void) nm_nextpkt(sc->vsc_nmd, (void *)dummybuf); + return; + } + + /* + * Check for available rx buffers + */ + vq = &sc->vsc_queues[VTNET_RXQ]; + if (!vq_has_descs(vq)) { + /* + * Drop the packet and try later. Interrupt on + * empty, if that's negotiated. + */ + (void) nm_nextpkt(sc->vsc_nmd, (void *)dummybuf); + vq_endchains(vq, 1); + return; + } + + do { + /* + * Get descriptor chain. + */ + n = vq_getchain(vq, &idx, iov, VTNET_MAXSEGS, NULL); + assert(n >= 1 && n <= VTNET_MAXSEGS); + + /* + * Get a pointer to the rx header, and use the + * data immediately following it for the packet buffer. + */ + vrx = iov[0].iov_base; + riov = rx_iov_trim(iov, &n, sc->rx_vhdrlen); + + len = pci_vtnet_netmap_readv(sc->vsc_nmd, riov, n); + + if (len == 0) { + /* + * No more packets, but still some avail ring + * entries. Interrupt if needed/appropriate. + */ + vq_endchains(vq, 0); + return; + } + + /* + * The only valid field in the rx packet header is the + * number of buffers if merged rx bufs were negotiated. + */ + memset(vrx, 0, sc->rx_vhdrlen); + + if (sc->rx_merge) { + struct virtio_net_rxhdr *vrxh; + + vrxh = vrx; + vrxh->vrh_bufs = 1; + } + + /* + * Release this chain and handle more chains. + */ + vq_relchain(vq, idx, len + sc->rx_vhdrlen); + } while (vq_has_descs(vq)); + + /* Interrupt if needed, including for NOTIFY_ON_EMPTY. */ + vq_endchains(vq, 1); +} + static void -pci_vtnet_tap_callback(int fd, enum ev_type type, void *param) +pci_vtnet_rx_callback(int fd, enum ev_type type, void *param) { struct pci_vtnet_softc *sc = param; pthread_mutex_lock(&sc->rx_mtx); sc->rx_in_progress = 1; - pci_vtnet_tap_rx(sc); + sc->pci_vtnet_rx(sc); sc->rx_in_progress = 0; pthread_mutex_unlock(&sc->rx_mtx); @@ -421,7 +625,7 @@ pci_vtnet_proctx(struct pci_vtnet_softc } DPRINTF(("virtio: packet send, %d bytes, %d segs\n\r", plen, n)); - pci_vtnet_tap_tx(sc, &iov[1], n - 1, plen); + sc->pci_vtnet_tx(sc, &iov[1], n - 1, plen); /* chain is processed, release it and set tlen */ vq_relchain(vq, idx, tlen); @@ -532,6 +736,67 @@ pci_vtnet_parsemac(char *mac_str, uint8_ return (0); } +static void +pci_vtnet_tap_setup(struct pci_vtnet_softc *sc, char *devname) +{ + char tbuf[80]; + + strcpy(tbuf, "/dev/"); + strlcat(tbuf, devname, sizeof(tbuf)); + + sc->pci_vtnet_rx = pci_vtnet_tap_rx; + sc->pci_vtnet_tx = pci_vtnet_tap_tx; + + sc->vsc_tapfd = open(tbuf, O_RDWR); + if (sc->vsc_tapfd == -1) { + WPRINTF(("open of tap device %s failed\n", tbuf)); + return; + } + + /* + * Set non-blocking and register for read + * notifications with the event loop + */ + int opt = 1; + if (ioctl(sc->vsc_tapfd, FIONBIO, &opt) < 0) { + WPRINTF(("tap device O_NONBLOCK failed\n")); + close(sc->vsc_tapfd); + sc->vsc_tapfd = -1; + } + + sc->vsc_mevp = mevent_add(sc->vsc_tapfd, + EVF_READ, + pci_vtnet_rx_callback, + sc); + if (sc->vsc_mevp == NULL) { + WPRINTF(("Could not register event\n")); + close(sc->vsc_tapfd); + sc->vsc_tapfd = -1; + } +} + +static void +pci_vtnet_netmap_setup(struct pci_vtnet_softc *sc, char *ifname) +{ + sc->pci_vtnet_rx = pci_vtnet_netmap_rx; + sc->pci_vtnet_tx = pci_vtnet_netmap_tx; + + sc->vsc_nmd = nm_open(ifname, NULL, 0, 0); + if (sc->vsc_nmd == NULL) { + WPRINTF(("open of netmap device %s failed\n", ifname)); + return; + } + + sc->vsc_mevp = mevent_add(sc->vsc_nmd->fd, + EVF_READ, + pci_vtnet_rx_callback, + sc); + if (sc->vsc_mevp == NULL) { + WPRINTF(("Could not register event\n")); + nm_close(sc->vsc_nmd); + sc->vsc_nmd = NULL; + } +} static int pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) @@ -567,8 +832,8 @@ pci_vtnet_init(struct vmctx *ctx, struct */ mac_provided = 0; sc->vsc_tapfd = -1; + sc->vsc_nmd = NULL; if (opts != NULL) { - char tbuf[80]; int err; devname = vtopts = strdup(opts); @@ -583,36 +848,13 @@ pci_vtnet_init(struct vmctx *ctx, struct mac_provided = 1; } - strcpy(tbuf, "/dev/"); - strlcat(tbuf, devname, sizeof(tbuf)); + if (strncmp(devname, "vale", 4) == 0) + pci_vtnet_netmap_setup(sc, devname); + if ((strncmp(devname, "tap", 3) == 0) || + (strncmp(devname, "vmmnet", 5) == 0)) + pci_vtnet_tap_setup(sc, devname); free(devname); - - sc->vsc_tapfd = open(tbuf, O_RDWR); - if (sc->vsc_tapfd == -1) { - WPRINTF(("open of tap device %s failed\n", tbuf)); - } else { - /* - * Set non-blocking and register for read - * notifications with the event loop - */ - int opt = 1; - if (ioctl(sc->vsc_tapfd, FIONBIO, &opt) < 0) { - WPRINTF(("tap device O_NONBLOCK failed\n")); - close(sc->vsc_tapfd); - sc->vsc_tapfd = -1; - } - - sc->vsc_mevp = mevent_add(sc->vsc_tapfd, - EVF_READ, - pci_vtnet_tap_callback, - sc); - if (sc->vsc_mevp == NULL) { - WPRINTF(("Could not register event\n")); - close(sc->vsc_tapfd); - sc->vsc_tapfd = -1; - } - } } /* From owner-svn-src-stable@freebsd.org Tue Jan 19 01:30:23 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE631A87ABA; Tue, 19 Jan 2016 01:30:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E1611094; Tue, 19 Jan 2016 01:30:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0J1UMY8081662; Tue, 19 Jan 2016 01:30:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0J1UMWg081661; Tue, 19 Jan 2016 01:30:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601190130.u0J1UMWg081661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 19 Jan 2016 01:30:22 +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: r294300 - stable/10/lib/libc/rpc 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 01:30:23 -0000 Author: ngie Date: Tue Jan 19 01:30:22 2016 New Revision: 294300 URL: https://svnweb.freebsd.org/changeset/base/294300 Log: MFC r293715: Fix a mismerge from NetBSD in r162194 with `xdr_rpcb_entry_list_ptr(..)` This fixes the potential NULL pointer dereference properly, and also fixes memory leaks encountered in the process of iterating through `*rp`. Found by: Valgrind Submitted by: Miles Ohlrich Modified: stable/10/lib/libc/rpc/rpcb_prot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/rpcb_prot.c ============================================================================== --- stable/10/lib/libc/rpc/rpcb_prot.c Mon Jan 18 22:21:46 2016 (r294299) +++ stable/10/lib/libc/rpc/rpcb_prot.c Tue Jan 19 01:30:22 2016 (r294300) @@ -217,14 +217,14 @@ xdr_rpcb_entry_list_ptr(xdrs, rp) * the case of freeing we must remember the next object * before we free the current object ... */ - if (freeing) + if (freeing && *rp) next = (*rp)->rpcb_entry_next; if (! xdr_reference(xdrs, (caddr_t *)rp, (u_int)sizeof (rpcb_entry_list), (xdrproc_t)xdr_rpcb_entry)) { return (FALSE); } - if (freeing && *rp) { + if (freeing) { next_copy = next; rp = &next_copy; /* From owner-svn-src-stable@freebsd.org Tue Jan 19 01:33:29 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49CA3A87CBB; Tue, 19 Jan 2016 01:33:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17AA214EB; Tue, 19 Jan 2016 01:33:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0J1XSW5084386; Tue, 19 Jan 2016 01:33:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0J1XSlY084385; Tue, 19 Jan 2016 01:33:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601190133.u0J1XSlY084385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 19 Jan 2016 01:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294301 - stable/9/lib/libc/rpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 01:33:29 -0000 Author: ngie Date: Tue Jan 19 01:33:27 2016 New Revision: 294301 URL: https://svnweb.freebsd.org/changeset/base/294301 Log: MFstable/10 r294300: MFC r293715: Fix a mismerge from NetBSD in r162194 with `xdr_rpcb_entry_list_ptr(..)` This fixes the potential NULL pointer dereference properly, and also fixes memory leaks encountered in the process of iterating through `*rp`. Found by: Valgrind Submitted by: Miles Ohlrich Modified: stable/9/lib/libc/rpc/rpcb_prot.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/rpc/rpcb_prot.c ============================================================================== --- stable/9/lib/libc/rpc/rpcb_prot.c Tue Jan 19 01:30:22 2016 (r294300) +++ stable/9/lib/libc/rpc/rpcb_prot.c Tue Jan 19 01:33:27 2016 (r294301) @@ -217,14 +217,14 @@ xdr_rpcb_entry_list_ptr(xdrs, rp) * the case of freeing we must remember the next object * before we free the current object ... */ - if (freeing) + if (freeing && *rp) next = (*rp)->rpcb_entry_next; if (! xdr_reference(xdrs, (caddr_t *)rp, (u_int)sizeof (rpcb_entry_list), (xdrproc_t)xdr_rpcb_entry)) { return (FALSE); } - if (freeing && *rp) { + if (freeing) { next_copy = next; rp = &next_copy; /* From owner-svn-src-stable@freebsd.org Tue Jan 19 01:35:18 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17508A87E05; Tue, 19 Jan 2016 01:35:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7E911779; Tue, 19 Jan 2016 01:35:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0J1ZG2I084519; Tue, 19 Jan 2016 01:35:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0J1ZGiv084518; Tue, 19 Jan 2016 01:35:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601190135.u0J1ZGiv084518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 19 Jan 2016 01:35:16 +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: r294302 - stable/10/tools/regression/sockets/so_setfib 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 01:35:18 -0000 Author: ngie Date: Tue Jan 19 01:35:16 2016 New Revision: 294302 URL: https://svnweb.freebsd.org/changeset/base/294302 Log: MFC r294123: Add missing newline to message about requiring root privileges This will help ensure that scripts/parsers don't get confused when the message is printed out Modified: stable/10/tools/regression/sockets/so_setfib/so_setfib.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/sockets/so_setfib/so_setfib.c ============================================================================== --- stable/10/tools/regression/sockets/so_setfib/so_setfib.c Tue Jan 19 01:33:27 2016 (r294301) +++ stable/10/tools/regression/sockets/so_setfib/so_setfib.c Tue Jan 19 01:35:16 2016 (r294302) @@ -171,7 +171,7 @@ main(int argc __unused, char *argv[] __u size_t s; if (geteuid() != 0) { - printf("1..0 # SKIP: must be root"); + printf("1..0 # SKIP: must be root\n"); return (0); } From owner-svn-src-stable@freebsd.org Tue Jan 19 01:38:08 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 284A8A87EF5; Tue, 19 Jan 2016 01:38:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D29E119BE; Tue, 19 Jan 2016 01:38:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0J1c6uH084710; Tue, 19 Jan 2016 01:38:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0J1c6fm084709; Tue, 19 Jan 2016 01:38:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601190138.u0J1c6fm084709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 19 Jan 2016 01:38:06 +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: r294303 - stable/10/tools/regression/sockets/accf_data_attach 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 01:38:08 -0000 Author: ngie Date: Tue Jan 19 01:38:06 2016 New Revision: 294303 URL: https://svnweb.freebsd.org/changeset/base/294303 Log: MFC r294103: - Check for accf_filter before running the tests, otherwise it will always fail at subtest 9/11 - Use strncpy instead of strcpy with afa.af_name Modified: stable/10/tools/regression/sockets/accf_data_attach/accf_data_attach.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/sockets/accf_data_attach/accf_data_attach.c ============================================================================== --- stable/10/tools/regression/sockets/accf_data_attach/accf_data_attach.c Tue Jan 19 01:35:16 2016 (r294302) +++ stable/10/tools/regression/sockets/accf_data_attach/accf_data_attach.c Tue Jan 19 01:38:06 2016 (r294303) @@ -27,6 +27,7 @@ */ #include +#include #include #include @@ -65,6 +66,16 @@ main(void) socklen_t len; int lso, ret; + /* XXX: PLAIN_TEST_REQUIRE_MODULE "backport" for stable/9 */ + const char *_mod_name = "accf_data"; + + if (modfind(_mod_name) == -1) { + printf("1..0 # SKIP - module %s could not be resolved: %s\n", + _mod_name, strerror(errno)); + _exit(0); + } + /* XXX: PLAIN_TEST_REQUIRE_MODULE for stable/9 */ + printf("1..11\n"); /* @@ -119,7 +130,7 @@ main(void) * yet a listen() socket. */ bzero(&afa, sizeof(afa)); - strcpy(afa.af_name, ACCF_NAME); + strncpy(afa.af_name, ACCF_NAME, sizeof(afa.af_name)); ret = setsockopt(lso, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa)); if (ret == 0) errx(-1, "not ok 5 - setsockopt() before listen() succeeded"); @@ -164,7 +175,7 @@ main(void) * Step 8: After listen(). This call to setsockopt() should succeed. */ bzero(&afa, sizeof(afa)); - strcpy(afa.af_name, ACCF_NAME); + strncpy(afa.af_name, ACCF_NAME, sizeof(afa.af_name)); ret = setsockopt(lso, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa)); if (ret != 0) errx(-1, "not ok 9 - setsockopt() after listen() failed with %d " From owner-svn-src-stable@freebsd.org Tue Jan 19 01:39:30 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82AABA87FAC; Tue, 19 Jan 2016 01:39:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38CBA1B0F; Tue, 19 Jan 2016 01:39:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0J1dTLZ084813; Tue, 19 Jan 2016 01:39:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0J1dTup084812; Tue, 19 Jan 2016 01:39:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601190139.u0J1dTup084812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 19 Jan 2016 01:39:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294304 - stable/9/tools/regression/sockets/accf_data_attach X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 01:39:30 -0000 Author: ngie Date: Tue Jan 19 01:39:29 2016 New Revision: 294304 URL: https://svnweb.freebsd.org/changeset/base/294304 Log: MFstable/10 r294303: MFC r294103: - Check for accf_filter before running the tests, otherwise it will always fail at subtest 9/11 - Use strncpy instead of strcpy with afa.af_name Modified: stable/9/tools/regression/sockets/accf_data_attach/accf_data_attach.c Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) stable/9/tools/regression/sockets/ (props changed) Modified: stable/9/tools/regression/sockets/accf_data_attach/accf_data_attach.c ============================================================================== --- stable/9/tools/regression/sockets/accf_data_attach/accf_data_attach.c Tue Jan 19 01:38:06 2016 (r294303) +++ stable/9/tools/regression/sockets/accf_data_attach/accf_data_attach.c Tue Jan 19 01:39:29 2016 (r294304) @@ -27,6 +27,7 @@ */ #include +#include #include #include @@ -65,6 +66,16 @@ main(int argc, char *argv[]) socklen_t len; int lso, ret; + /* XXX: PLAIN_TEST_REQUIRE_MODULE "backport" for stable/9 */ + const char *_mod_name = "accf_data"; + + if (modfind(_mod_name) == -1) { + printf("1..0 # SKIP - module %s could not be resolved: %s\n", + _mod_name, strerror(errno)); + _exit(0); + } + /* XXX: PLAIN_TEST_REQUIRE_MODULE for stable/9 */ + printf("1..11\n"); /* @@ -119,7 +130,7 @@ main(int argc, char *argv[]) * yet a listen() socket. */ bzero(&afa, sizeof(afa)); - strcpy(afa.af_name, ACCF_NAME); + strncpy(afa.af_name, ACCF_NAME, sizeof(afa.af_name)); ret = setsockopt(lso, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa)); if (ret == 0) errx(-1, "not ok 5 - setsockopt() before listen() succeeded"); @@ -164,7 +175,7 @@ main(int argc, char *argv[]) * Step 8: After listen(). This call to setsockopt() should succeed. */ bzero(&afa, sizeof(afa)); - strcpy(afa.af_name, ACCF_NAME); + strncpy(afa.af_name, ACCF_NAME, sizeof(afa.af_name)); ret = setsockopt(lso, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa)); if (ret != 0) errx(-1, "not ok 9 - setsockopt() after listen() failed with %d " From owner-svn-src-stable@freebsd.org Tue Jan 19 01:41:20 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7246A8806C; Tue, 19 Jan 2016 01:41:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B349F1D07; Tue, 19 Jan 2016 01:41:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0J1fJKL084951; Tue, 19 Jan 2016 01:41:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0J1fJOj084949; Tue, 19 Jan 2016 01:41:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601190141.u0J1fJOj084949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 19 Jan 2016 01:41: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: r294305 - stable/10/tools/regression/sockets/unix_gc 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 01:41:21 -0000 Author: ngie Date: Tue Jan 19 01:41:19 2016 New Revision: 294305 URL: https://svnweb.freebsd.org/changeset/base/294305 Log: MFC r294128: Fix -Wunused warning with clang/gcc - Get rid of unused argc/argv variables in main - Bump WARNS to 6 Modified: stable/10/tools/regression/sockets/unix_gc/Makefile stable/10/tools/regression/sockets/unix_gc/unix_gc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/sockets/unix_gc/Makefile ============================================================================== --- stable/10/tools/regression/sockets/unix_gc/Makefile Tue Jan 19 01:39:29 2016 (r294304) +++ stable/10/tools/regression/sockets/unix_gc/Makefile Tue Jan 19 01:41:19 2016 (r294305) @@ -2,6 +2,6 @@ PROG= unix_gc MAN= -WARNS?= 3 +WARNS?= 6 .include Modified: stable/10/tools/regression/sockets/unix_gc/unix_gc.c ============================================================================== --- stable/10/tools/regression/sockets/unix_gc/unix_gc.c Tue Jan 19 01:39:29 2016 (r294304) +++ stable/10/tools/regression/sockets/unix_gc/unix_gc.c Tue Jan 19 01:41:19 2016 (r294305) @@ -752,7 +752,7 @@ recursion(void) #define RMDIR "rm -Rf " int -main(int argc, char *argv[]) +main(void) { char cmd[sizeof(RMDIR) + PATH_MAX]; int serrno; From owner-svn-src-stable@freebsd.org Tue Jan 19 01:42:32 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CA4DA88174; Tue, 19 Jan 2016 01:42:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D6371FBA; Tue, 19 Jan 2016 01:42:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0J1gV9u087484; Tue, 19 Jan 2016 01:42:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0J1gVKB087482; Tue, 19 Jan 2016 01:42:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601190142.u0J1gVKB087482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 19 Jan 2016 01:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294306 - stable/9/tools/regression/sockets/unix_gc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 01:42:32 -0000 Author: ngie Date: Tue Jan 19 01:42:31 2016 New Revision: 294306 URL: https://svnweb.freebsd.org/changeset/base/294306 Log: MFstable/10 r294305: MFC r294128: Fix -Wunused warning with clang/gcc - Get rid of unused argc/argv variables in main - Bump WARNS to 6 Modified: stable/9/tools/regression/sockets/unix_gc/Makefile stable/9/tools/regression/sockets/unix_gc/unix_gc.c Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) stable/9/tools/regression/sockets/ (props changed) Modified: stable/9/tools/regression/sockets/unix_gc/Makefile ============================================================================== --- stable/9/tools/regression/sockets/unix_gc/Makefile Tue Jan 19 01:41:19 2016 (r294305) +++ stable/9/tools/regression/sockets/unix_gc/Makefile Tue Jan 19 01:42:31 2016 (r294306) @@ -2,6 +2,6 @@ PROG= unix_gc NO_MAN= -WARNS?= 3 +WARNS?= 6 .include Modified: stable/9/tools/regression/sockets/unix_gc/unix_gc.c ============================================================================== --- stable/9/tools/regression/sockets/unix_gc/unix_gc.c Tue Jan 19 01:41:19 2016 (r294305) +++ stable/9/tools/regression/sockets/unix_gc/unix_gc.c Tue Jan 19 01:42:31 2016 (r294306) @@ -752,7 +752,7 @@ recursion(void) #define RMDIR "rm -Rf " int -main(int argc, char *argv[]) +main(void) { char cmd[sizeof(RMDIR) + PATH_MAX]; int serrno; From owner-svn-src-stable@freebsd.org Tue Jan 19 14:15:11 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86782A883CA; Tue, 19 Jan 2016 14:15:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B09514B8; Tue, 19 Jan 2016 14:15:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JEFAOE013370; Tue, 19 Jan 2016 14:15:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JEF93P013366; Tue, 19 Jan 2016 14:15:09 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601191415.u0JEF93P013366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Jan 2016 14:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294323 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 14:15:11 -0000 Author: pfg Date: Tue Jan 19 14:15:09 2016 New Revision: 294323 URL: https://svnweb.freebsd.org/changeset/base/294323 Log: Revert r294273 MFC r293680 ext4: add support for reading sparse files The change was meant for newer versions and doesn't work out of the box. While it seems easy to adapt I prfer not to have the implementations diverge at this time. Reported by: Arrigo Marchiori PR: 205816 Modified: stable/9/sys/fs/ext2fs/ext2_bmap.c stable/9/sys/fs/ext2fs/ext2_extents.c stable/9/sys/fs/ext2fs/ext2_extents.h stable/9/sys/fs/ext2fs/ext2_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_bmap.c Tue Jan 19 13:15:57 2016 (r294322) +++ stable/9/sys/fs/ext2fs/ext2_bmap.c Tue Jan 19 14:15:09 2016 (r294323) @@ -102,6 +102,9 @@ ext4_bmapext(struct vnode *vp, int32_t b fs = ip->i_e2fs; lbn = bn; + /* + * TODO: need to implement read ahead to improve the performance. + */ if (runp != NULL) *runp = 0; @@ -109,25 +112,15 @@ ext4_bmapext(struct vnode *vp, int32_t b *runb = 0; ext4_ext_find_extent(fs, ip, lbn, &path); - if (path.ep_is_sparse) { - *bnp = -1; - if (runp != NULL) - *runp = path.ep_sparse_ext.e_len - - (lbn - path.ep_sparse_ext.e_blk) - 1; - } else { - ep = path.ep_ext; - if (ep == NULL) - ret = EIO; - else { - *bnp = fsbtodb(fs, lbn - ep->e_blk + - (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); + ep = path.ep_ext; + if (ep == NULL) + ret = EIO; + else { + *bnp = fsbtodb(fs, lbn - ep->e_blk + + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); - if (*bnp == 0) - *bnp = -1; - - if (runp != NULL) - *runp = ep->e_len - (lbn - ep->e_blk) - 1; - } + if (*bnp == 0) + *bnp = -1; } if (path.ep_bp != NULL) { Modified: stable/9/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_extents.c Tue Jan 19 13:15:57 2016 (r294322) +++ stable/9/sys/fs/ext2fs/ext2_extents.c Tue Jan 19 14:15:09 2016 (r294323) @@ -66,14 +66,13 @@ static void ext4_ext_binsearch(struct inode *ip, struct ext4_extent_path *path, daddr_t lbn) { struct ext4_extent_header *ehp = path->ep_header; - struct ext4_extent *first, *l, *r, *m; + struct ext4_extent *l, *r, *m; if (ehp->eh_ecount == 0) return; - first = (struct ext4_extent *)(char *)(ehp + 1); - l = first; - r = first + ehp->eh_ecount - 1; + l = (struct ext4_extent *)(char *)(ehp + 1); + r = (struct ext4_extent *)(char *)(ehp + 1) + ehp->eh_ecount - 1; while (l <= r) { m = l + (r - l) / 2; if (lbn < m->e_blk) @@ -82,25 +81,7 @@ ext4_ext_binsearch(struct inode *ip, str l = m + 1; } - if (l == first) { - path->ep_sparse_ext.e_blk = lbn; - path->ep_sparse_ext.e_len = first->e_blk - lbn; - path->ep_sparse_ext.e_start_hi = 0; - path->ep_sparse_ext.e_start_lo = 0; - path->ep_is_sparse = 1; - return; - } path->ep_ext = l - 1; - if (path->ep_ext->e_blk + path->ep_ext->e_len <= lbn) { - path->ep_sparse_ext.e_blk = lbn; - if (l <= (first + ehp->eh_ecount - 1)) - path->ep_sparse_ext.e_len = l->e_blk - lbn; - else // XXX: where does it end? - path->ep_sparse_ext.e_len = 1; - path->ep_sparse_ext.e_start_hi = 0; - path->ep_sparse_ext.e_start_lo = 0; - path->ep_is_sparse = 1; - } } /* @@ -188,7 +169,6 @@ ext4_ext_find_extent(struct m_ext2fs *fs path->ep_depth = i; path->ep_ext = NULL; path->ep_index = NULL; - path->ep_is_sparse = 0; ext4_ext_binsearch(ip, path, lbn); return (path); Modified: stable/9/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_extents.h Tue Jan 19 13:15:57 2016 (r294322) +++ stable/9/sys/fs/ext2fs/ext2_extents.h Tue Jan 19 14:15:09 2016 (r294323) @@ -84,11 +84,7 @@ struct ext4_extent_cache { struct ext4_extent_path { uint16_t ep_depth; struct buf *ep_bp; - int ep_is_sparse; - union { - struct ext4_extent ep_sparse_ext; - struct ext4_extent *ep_ext; - }; + struct ext4_extent *ep_ext; struct ext4_extent_index *ep_index; struct ext4_extent_header *ep_header; }; Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_vnops.c Tue Jan 19 13:15:57 2016 (r294322) +++ stable/9/sys/fs/ext2fs/ext2_vnops.c Tue Jan 19 14:15:09 2016 (r294323) @@ -1789,7 +1789,6 @@ ext2_ioctl(struct vop_ioctl_args *ap) static int ext4_ext_read(struct vop_read_args *ap) { - static unsigned char zeroes[EXT2_MAX_BLOCK_SIZE]; struct vnode *vp; struct inode *ip; struct uio *uio; @@ -1834,15 +1833,11 @@ ext4_ext_read(struct vop_read_args *ap) switch (cache_type) { case EXT4_EXT_CACHE_NO: ext4_ext_find_extent(fs, ip, lbn, &path); - if (path.ep_is_sparse) - ep = &path.ep_sparse_ext; - else - ep = path.ep_ext; + ep = path.ep_ext; if (ep == NULL) return (EIO); - ext4_ext_put_cache(ip, ep, - path.ep_is_sparse ? EXT4_EXT_CACHE_GAP : EXT4_EXT_CACHE_IN); + ext4_ext_put_cache(ip, ep, EXT4_EXT_CACHE_IN); newblk = lbn - ep->e_blk + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32); @@ -1855,7 +1850,7 @@ ext4_ext_read(struct vop_read_args *ap) case EXT4_EXT_CACHE_GAP: /* block has not been allocated yet */ - break; + return (0); case EXT4_EXT_CACHE_IN: newblk = lbn - nex.e_blk + (nex.e_start_lo | @@ -1866,34 +1861,24 @@ ext4_ext_read(struct vop_read_args *ap) panic("%s: invalid cache type", __func__); } - if (cache_type == EXT4_EXT_CACHE_GAP || - (cache_type == EXT4_EXT_CACHE_NO && path.ep_is_sparse)) { - if (xfersize > sizeof(zeroes)) - xfersize = sizeof(zeroes); - error = uiomove(zeroes, xfersize, uio); - if (error) - return (error); - } else { - error = bread(ip->i_devvp, fsbtodb(fs, newblk), size, - NOCRED, &bp); - if (error) { - brelse(bp); - return (error); - } + error = bread(ip->i_devvp, fsbtodb(fs, newblk), size, NOCRED, &bp); + if (error) { + brelse(bp); + return (error); + } - size -= bp->b_resid; - if (size < xfersize) { - if (size == 0) { - bqrelse(bp); - break; - } - xfersize = size; + size -= bp->b_resid; + if (size < xfersize) { + if (size == 0) { + bqrelse(bp); + break; } - error = uiomove(bp->b_data + blkoffset, xfersize, uio); - bqrelse(bp); - if (error) - return (error); + xfersize = size; } + error = uiomove(bp->b_data + blkoffset, (int)xfersize, uio); + bqrelse(bp); + if (error) + return (error); } return (0); From owner-svn-src-stable@freebsd.org Tue Jan 19 18:35:23 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB04BA88AB2; Tue, 19 Jan 2016 18:35:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 930341FEB; Tue, 19 Jan 2016 18:35:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JIZM1K090711; Tue, 19 Jan 2016 18:35:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JIZM31090709; Tue, 19 Jan 2016 18:35:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601191835.u0JIZM31090709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 19 Jan 2016 18:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294334 - in stable: 10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 18:35:24 -0000 Author: dim Date: Tue Jan 19 18:35:22 2016 New Revision: 294334 URL: https://svnweb.freebsd.org/changeset/base/294334 Log: MFC r294102: MFV r294101: 6527 Possible access beyond end of string in zpool comment Reviewed by: George Wilson Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Approved by: Gordon Ross illumos/illumos-gate@2bd7a8d078223b122d65fea49bb8641f858b1409 This fixes erroneous double increments of the 'check' variable in a loop in spa_prop_validate(). I ran into this in the clang380-import branch, where clang 3.8.0 warns about it. (It is already fixed there.) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/10/ (props changed) stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 19 18:32:51 2016 (r294333) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 19 18:35:22 2016 (r294334) @@ -585,7 +585,6 @@ spa_prop_validate(spa_t *spa, nvlist_t * error = SET_ERROR(EINVAL); break; } - check++; } if (strlen(strval) > ZPROP_MAX_COMMENT) error = E2BIG; From owner-svn-src-stable@freebsd.org Tue Jan 19 18:35:24 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D770A88ABE; Tue, 19 Jan 2016 18:35:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 213F71FEF; Tue, 19 Jan 2016 18:35:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JIZNAd090723; Tue, 19 Jan 2016 18:35:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JIZNHi090722; Tue, 19 Jan 2016 18:35:23 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601191835.u0JIZNHi090722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 19 Jan 2016 18:35: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: r294334 - in stable: 10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 18:35:24 -0000 Author: dim Date: Tue Jan 19 18:35:22 2016 New Revision: 294334 URL: https://svnweb.freebsd.org/changeset/base/294334 Log: MFC r294102: MFV r294101: 6527 Possible access beyond end of string in zpool comment Reviewed by: George Wilson Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Approved by: Gordon Ross illumos/illumos-gate@2bd7a8d078223b122d65fea49bb8641f858b1409 This fixes erroneous double increments of the 'check' variable in a loop in spa_prop_validate(). I ran into this in the clang380-import branch, where clang 3.8.0 warns about it. (It is already fixed there.) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 19 18:32:51 2016 (r294333) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 19 18:35:22 2016 (r294334) @@ -607,7 +607,6 @@ spa_prop_validate(spa_t *spa, nvlist_t * error = SET_ERROR(EINVAL); break; } - check++; } if (strlen(strval) > ZPROP_MAX_COMMENT) error = E2BIG; From owner-svn-src-stable@freebsd.org Tue Jan 19 18:35:24 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23047A88AB6; Tue, 19 Jan 2016 18:35:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE44F1FED; Tue, 19 Jan 2016 18:35:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JIZM3K090717; Tue, 19 Jan 2016 18:35:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JIZM1u090716; Tue, 19 Jan 2016 18:35:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601191835.u0JIZM1u090716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 19 Jan 2016 18:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r294334 - in stable: 10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 18:35:24 -0000 Author: dim Date: Tue Jan 19 18:35:22 2016 New Revision: 294334 URL: https://svnweb.freebsd.org/changeset/base/294334 Log: MFC r294102: MFV r294101: 6527 Possible access beyond end of string in zpool comment Reviewed by: George Wilson Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Approved by: Gordon Ross illumos/illumos-gate@2bd7a8d078223b122d65fea49bb8641f858b1409 This fixes erroneous double increments of the 'check' variable in a loop in spa_prop_validate(). I ran into this in the clang380-import branch, where clang 3.8.0 warns about it. (It is already fixed there.) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/10/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 19 18:32:51 2016 (r294333) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 19 18:35:22 2016 (r294334) @@ -585,7 +585,6 @@ spa_prop_validate(spa_t *spa, nvlist_t * error = SET_ERROR(EINVAL); break; } - check++; } if (strlen(strval) > ZPROP_MAX_COMMENT) error = E2BIG; From owner-svn-src-stable@freebsd.org Tue Jan 19 19:04:58 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42327A895A6; Tue, 19 Jan 2016 19:04:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F2F61746; Tue, 19 Jan 2016 19:04:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JJ4vAB099394; Tue, 19 Jan 2016 19:04:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JJ4uB1099393; Tue, 19 Jan 2016 19:04:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601191904.u0JJ4uB1099393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Jan 2016 19:04:56 +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: r294338 - in stable: 10/usr.sbin/boot0cfg 9/usr.sbin/boot0cfg 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 19:04:58 -0000 Author: jhb Date: Tue Jan 19 19:04:56 2016 New Revision: 294338 URL: https://svnweb.freebsd.org/changeset/base/294338 Log: MFC 292410,292443,293977: Exit cleanly if malloc() fails to allocate a buffer for a copy of the current MBR. PR: 205322 Submitted by: Alexander Kuleshov Modified: stable/10/usr.sbin/boot0cfg/boot0cfg.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.c Directory Properties: stable/9/usr.sbin/boot0cfg/ (props changed) Modified: stable/10/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- stable/10/usr.sbin/boot0cfg/boot0cfg.c Tue Jan 19 18:57:37 2016 (r294337) +++ stable/10/usr.sbin/boot0cfg/boot0cfg.c Tue Jan 19 19:04:56 2016 (r294338) @@ -336,7 +336,8 @@ read_mbr(const char *disk, u_int8_t **mb close(fd); return (mbr_size); } - *mbr = malloc(sizeof(buf)); + if ((*mbr = malloc(sizeof(buf))) == NULL) + errx(1, "%s: unable to allocate MBR buffer", disk); memcpy(*mbr, buf, sizeof(buf)); close(fd); From owner-svn-src-stable@freebsd.org Tue Jan 19 19:04:58 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 564F8A895A7; Tue, 19 Jan 2016 19:04:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28FBC1747; Tue, 19 Jan 2016 19:04:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JJ4vcL099400; Tue, 19 Jan 2016 19:04:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JJ4vDt099399; Tue, 19 Jan 2016 19:04:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601191904.u0JJ4vDt099399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Jan 2016 19:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294338 - in stable: 10/usr.sbin/boot0cfg 9/usr.sbin/boot0cfg X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 19:04:58 -0000 Author: jhb Date: Tue Jan 19 19:04:56 2016 New Revision: 294338 URL: https://svnweb.freebsd.org/changeset/base/294338 Log: MFC 292410,292443,293977: Exit cleanly if malloc() fails to allocate a buffer for a copy of the current MBR. PR: 205322 Submitted by: Alexander Kuleshov Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.c Directory Properties: stable/9/usr.sbin/boot0cfg/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/boot0cfg/boot0cfg.c Directory Properties: stable/10/ (props changed) Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- stable/9/usr.sbin/boot0cfg/boot0cfg.c Tue Jan 19 18:57:37 2016 (r294337) +++ stable/9/usr.sbin/boot0cfg/boot0cfg.c Tue Jan 19 19:04:56 2016 (r294338) @@ -334,7 +334,8 @@ read_mbr(const char *disk, u_int8_t **mb errx(1, "%s: short read", disk); return (mbr_size); } - *mbr = malloc(sizeof(buf)); + if ((*mbr = malloc(sizeof(buf))) == NULL) + errx(1, "%s: unable to allocate MBR buffer", disk); memcpy(*mbr, buf, sizeof(buf)); return sizeof(buf); From owner-svn-src-stable@freebsd.org Tue Jan 19 21:08:33 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F99FA880A3; Tue, 19 Jan 2016 21:08:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0222C1A89; Tue, 19 Jan 2016 21:08:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JL8WEa034650; Tue, 19 Jan 2016 21:08:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JL8VnT034644; Tue, 19 Jan 2016 21:08:31 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601192108.u0JL8VnT034644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Jan 2016 21:08: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: r294340 - in stable/10: share/man/man9 sys/dev/pci 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 21:08:33 -0000 Author: jhb Date: Tue Jan 19 21:08:31 2016 New Revision: 294340 URL: https://svnweb.freebsd.org/changeset/base/294340 Log: MFC 292669: Add accessor methods to fetch the BAR holding the MSI-X table and PBA. While here, explicitly note the requirement that the BAR(s) must be allocated prior to calling pci_alloc_msix(). Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/pci.9 stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pci_if.m stable/10/sys/dev/pci/pci_private.h stable/10/sys/dev/pci/pcivar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Tue Jan 19 20:46:30 2016 (r294339) +++ stable/10/share/man/man9/Makefile Tue Jan 19 21:08:31 2016 (r294340) @@ -1022,6 +1022,8 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_get_vpd_readonly.9 \ pci.9 pci_msi_count.9 \ pci.9 pci_msix_count.9 \ + pci.9 pci_msix_pba_bar.9 \ + pci.9 pci_msix_table_bar.9 \ pci.9 pci_pending_msix.9 \ pci.9 pci_read_config.9 \ pci.9 pci_release_msi.9 \ Modified: stable/10/share/man/man9/pci.9 ============================================================================== --- stable/10/share/man/man9/pci.9 Tue Jan 19 20:46:30 2016 (r294339) +++ stable/10/share/man/man9/pci.9 Tue Jan 19 21:08:31 2016 (r294340) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2015 +.Dd December 23, 2015 .Dt PCI 9 .Os .Sh NAME @@ -49,6 +49,8 @@ .Nm pci_get_vpd_readonly , .Nm pci_msi_count , .Nm pci_msix_count , +.Nm pci_msix_pba_bar , +.Nm pci_msix_table_bar , .Nm pci_pending_msix , .Nm pci_read_config , .Nm pci_release_msi , @@ -105,6 +107,10 @@ .Ft int .Fn pci_msix_count "device_t dev" .Ft int +.Fn pci_msix_pba_bar "device_t dev" +.Ft int +.Fn pci_msix_table_bar "device_t dev" +.Ft int .Fn pci_pending_msix "device_t dev" "u_int index" .Ft uint32_t .Fn pci_read_config "device_t dev" "int reg" "int width" @@ -618,6 +624,37 @@ then returns zero. .Pp The +.Fn pci_msix_pba_bar +function returns the offset in configuration space of the Base Address Register +.Pq BAR +containing the MSI-X Pending Bit Array (PBA) for device +.Fa dev . +The returned value can be used as the resource ID with +.Xr bus_alloc_resource 9 +and +.Xr bus_release_resource 9 +to allocate the BAR. +If the device does not support MSI-X, +then +.Fn pci_msix_pba_bar +returns -1. +.Pp +The +.Fn pci_msix_table_bar +function returns the offset in configuration space of the BAR +containing the MSI-X vector table for device +.Fa dev . +The returned value can be used as the resource ID with +.Xr bus_alloc_resource 9 +and +.Xr bus_release_resource 9 +to allocate the BAR. +If the device does not support MSI-X, +then +.Fn pci_msix_table_bar +returns -1. +.Pp +The .Fn pci_alloc_msix function attempts to allocate .Fa *count @@ -656,12 +693,21 @@ it returns an error. Unlike MSI, MSI-X does not require message counts that are powers of two. .Pp +The BARs containing the MSI-X vector table and PBA must be +allocated via +.Xr bus_alloc_resource 9 +before calling +.Fn pci_alloc_msix +and must not be released until after calling +.Fn pci_release_msi . +Note that the vector table and PBA may be stored in the same BAR or in +different BARs. +.Pp The .Fn pci_pending_msix function examines the .Fa dev -device's Pending Bit Array -.Pq PBA +device's PBA to determine the pending status of the MSI-X message at table index .Fa index . If the indicated message is pending, @@ -776,3 +822,6 @@ These do not refer to the geographic loc but to the device number assigned by the combination of the PCI IDSEL mechanism and the platform firmware. This should be taken note of when working with the kernel PCI code. +.Pp +The PCI bus driver should allocate the MSI-X vector table and PBA internally +as necessary rather than requiring the caller to do so. Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Tue Jan 19 20:46:30 2016 (r294339) +++ stable/10/sys/dev/pci/pci.c Tue Jan 19 21:08:31 2016 (r294340) @@ -182,6 +182,8 @@ static device_method_t pci_methods[] = { DEVMETHOD(pci_release_msi, pci_release_msi_method), DEVMETHOD(pci_msi_count, pci_msi_count_method), DEVMETHOD(pci_msix_count, pci_msix_count_method), + DEVMETHOD(pci_msix_pba_bar, pci_msix_pba_bar_method), + DEVMETHOD(pci_msix_table_bar, pci_msix_table_bar_method), DEVMETHOD(pci_get_rid, pci_get_rid_method), DEVMETHOD(pci_child_added, pci_child_added_method), @@ -1827,6 +1829,28 @@ pci_msix_count_method(device_t dev, devi return (0); } +int +pci_msix_pba_bar_method(device_t dev, device_t child) +{ + struct pci_devinfo *dinfo = device_get_ivars(child); + struct pcicfg_msix *msix = &dinfo->cfg.msix; + + if (pci_do_msix && msix->msix_location != 0) + return (msix->msix_pba_bar); + return (-1); +} + +int +pci_msix_table_bar_method(device_t dev, device_t child) +{ + struct pci_devinfo *dinfo = device_get_ivars(child); + struct pcicfg_msix *msix = &dinfo->cfg.msix; + + if (pci_do_msix && msix->msix_location != 0) + return (msix->msix_table_bar); + return (-1); +} + /* * HyperTransport MSI mapping control */ Modified: stable/10/sys/dev/pci/pci_if.m ============================================================================== --- stable/10/sys/dev/pci/pci_if.m Tue Jan 19 20:46:30 2016 (r294339) +++ stable/10/sys/dev/pci/pci_if.m Tue Jan 19 21:08:31 2016 (r294340) @@ -36,6 +36,12 @@ CODE { { return (0); } + + static int + null_msix_bar(device_t dev, device_t child) + { + return (-1); + } }; @@ -180,6 +186,16 @@ METHOD int msix_count { device_t child; } DEFAULT null_msi_count; +METHOD int msix_pba_bar { + device_t dev; + device_t child; +} DEFAULT null_msix_bar; + +METHOD int msix_table_bar { + device_t dev; + device_t child; +} DEFAULT null_msix_bar; + METHOD uint16_t get_rid { device_t dev; device_t child; Modified: stable/10/sys/dev/pci/pci_private.h ============================================================================== --- stable/10/sys/dev/pci/pci_private.h Tue Jan 19 20:46:30 2016 (r294339) +++ stable/10/sys/dev/pci/pci_private.h Tue Jan 19 21:08:31 2016 (r294340) @@ -100,6 +100,8 @@ int pci_remap_msix_method(device_t dev, int pci_release_msi_method(device_t dev, device_t child); int pci_msi_count_method(device_t dev, device_t child); int pci_msix_count_method(device_t dev, device_t child); +int pci_msix_pba_bar_method(device_t dev, device_t child); +int pci_msix_table_bar_method(device_t dev, device_t child); struct resource *pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); Modified: stable/10/sys/dev/pci/pcivar.h ============================================================================== --- stable/10/sys/dev/pci/pcivar.h Tue Jan 19 20:46:30 2016 (r294339) +++ stable/10/sys/dev/pci/pcivar.h Tue Jan 19 21:08:31 2016 (r294340) @@ -495,6 +495,18 @@ pci_msix_count(device_t dev) return (PCI_MSIX_COUNT(device_get_parent(dev), dev)); } +static __inline int +pci_msix_pba_bar(device_t dev) +{ + return (PCI_MSIX_PBA_BAR(device_get_parent(dev), dev)); +} + +static __inline int +pci_msix_table_bar(device_t dev) +{ + return (PCI_MSIX_TABLE_BAR(device_get_parent(dev), dev)); +} + static __inline uint16_t pci_get_rid(device_t dev) { From owner-svn-src-stable@freebsd.org Tue Jan 19 21:22:00 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 528CCA885DB; Tue, 19 Jan 2016 21:22:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DC1415D1; Tue, 19 Jan 2016 21:22:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JLLxgu040803; Tue, 19 Jan 2016 21:21:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JLLx7e040802; Tue, 19 Jan 2016 21:21:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601192121.u0JLLx7e040802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 19 Jan 2016 21:21: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: r294341 - stable/10/sys/boot/uboot/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 21:22:00 -0000 Author: ian Date: Tue Jan 19 21:21:59 2016 New Revision: 294341 URL: https://svnweb.freebsd.org/changeset/base/294341 Log: MFC r291164, r291876, r292227: Print more detailed info about the disk and partition chosen for booting. No behavioral changes, just cosmetics. Remove stray unescaped `%` in `Booting from ...` informational message. Enhance the "ubenv import" command to allow importing a u-boot env var directly into a loader (and thus kernel) env var. Modified: stable/10/sys/boot/uboot/common/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/uboot/common/main.c ============================================================================== --- stable/10/sys/boot/uboot/common/main.c Tue Jan 19 21:08:31 2016 (r294340) +++ stable/10/sys/boot/uboot/common/main.c Tue Jan 19 21:21:59 2016 (r294341) @@ -315,7 +315,7 @@ print_disk_probe_info() else strcpy(slice, ""); - if (currdev.d_disk.partition > 0) + if (currdev.d_disk.partition >= 0) sprintf(partition, "%d", currdev.d_disk.partition); else strcpy(partition, ""); @@ -382,7 +382,7 @@ probe_disks(int devidx, int load_type, i printf("\n"); } - printf(" Requested disk type/unit not found\n"); + printf(" Requested disk type/unit/slice/partition not found\n"); return (-1); } @@ -392,7 +392,7 @@ main(void) struct api_signature *sig = NULL; int load_type, load_unit, load_slice, load_partition; int i; - const char * loaderdev; + const char *ldev; /* * If we can't find the magic signature and related info, exit with a @@ -485,10 +485,10 @@ main(void) return (0xbadef1ce); } - env_setenv("currdev", EV_VOLATILE, uboot_fmtdev(&currdev), - uboot_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, uboot_fmtdev(&currdev), - env_noset, env_nounset); + ldev = uboot_fmtdev(&currdev); + env_setenv("currdev", EV_VOLATILE, ldev, uboot_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, ldev, env_noset, env_nounset); + printf("Booting from %s\n", ldev); setenv("LINES", "24", 1); /* optional */ setenv("prompt", "loader>", 1); @@ -573,17 +573,41 @@ enum ubenv_action { static void handle_uboot_env_var(enum ubenv_action action, const char * var) { - const char * val; - char ubv[128]; + char ldvar[128]; + const char *val; + char *wrk; + int len; + + /* + * On an import with the variable name formatted as ldname=ubname, + * import the uboot variable ubname into the loader variable ldname, + * otherwise the historical behavior is to import to uboot.ubname. + */ + if (action == UBENV_IMPORT) { + len = strcspn(var, "="); + if (var[len] == 0) { + strcpy(ldvar, "uboot."); + strncat(ldvar, var, sizeof(ldvar) - 7); + } else { + len = MIN(len, sizeof(ldvar) - 1); + strncpy(ldvar, var, len); + ldvar[len] = 0; + var = &var[len + 1]; + } + } /* * If the user prepended "uboot." (which is how they usually see these * names) strip it off as a convenience. */ if (strncmp(var, "uboot.", 6) == 0) { - snprintf(ubv, sizeof(ubv), "%s", &var[6]); - var = ubv; + var = &var[6]; } + + /* If ldvar is malformed or there's no variable name left, punt. */ + if (ldvar[0] == 0 || var[0] == 0) + return; + val = ub_env_get(var); if (action == UBENV_SHOW) { if (val == NULL) @@ -592,8 +616,7 @@ handle_uboot_env_var(enum ubenv_action a printf("uboot.%s=%s\n", var, val); } else if (action == UBENV_IMPORT) { if (val != NULL) { - snprintf(ubv, sizeof(ubv), "uboot.%s", var); - setenv(ubv, val, 1); + setenv(ldvar, val, 1); } } } From owner-svn-src-stable@freebsd.org Tue Jan 19 21:27:27 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4894DA887A8; Tue, 19 Jan 2016 21:27:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0176C1A8D; Tue, 19 Jan 2016 21:27:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JLRQKR041094; Tue, 19 Jan 2016 21:27:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JLRPHB041091; Tue, 19 Jan 2016 21:27:25 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601192127.u0JLRPHB041091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 19 Jan 2016 21:27:25 +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: r294342 - in stable/10: lib/libstand sys/boot/libstand32 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 21:27:27 -0000 Author: ian Date: Tue Jan 19 21:27:25 2016 New Revision: 294342 URL: https://svnweb.freebsd.org/changeset/base/294342 Log: MFC r292234, r292527: Add strlcat() and strlcpy() to libstand and libstand32. Modified: stable/10/lib/libstand/Makefile stable/10/sys/boot/libstand32/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libstand/Makefile ============================================================================== --- stable/10/lib/libstand/Makefile Tue Jan 19 21:21:59 2016 (r294341) +++ stable/10/lib/libstand/Makefile Tue Jan 19 21:27:25 2016 (r294342) @@ -59,8 +59,8 @@ SRCS+= ntoh.c .if ${MACHINE_CPUARCH} != "ia64" SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ - strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ - strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c + strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ + strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .endif .if ${MACHINE_CPUARCH} == "arm" .PATH: ${.CURDIR}/../libc/arm/gen Modified: stable/10/sys/boot/libstand32/Makefile ============================================================================== --- stable/10/sys/boot/libstand32/Makefile Tue Jan 19 21:21:59 2016 (r294341) +++ stable/10/sys/boot/libstand32/Makefile Tue Jan 19 21:27:25 2016 (r294342) @@ -63,8 +63,8 @@ SRCS+= ntoh.c .if ${MACHINE_CPUARCH} != "ia64" SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ - strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ - strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c + strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ + strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .endif .if ${MACHINE_CPUARCH} == "arm" .PATH: ${LIBC}/arm/gen From owner-svn-src-stable@freebsd.org Tue Jan 19 21:35:11 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27B91A88B50; Tue, 19 Jan 2016 21:35:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03FCB1F0C; Tue, 19 Jan 2016 21:35:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JLZALH044043; Tue, 19 Jan 2016 21:35:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JLZAuf044042; Tue, 19 Jan 2016 21:35:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601192135.u0JLZAuf044042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 19 Jan 2016 21:35:10 +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: r294343 - stable/10/lib/libstand 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 21:35:11 -0000 Author: ian Date: Tue Jan 19 21:35:09 2016 New Revision: 294343 URL: https://svnweb.freebsd.org/changeset/base/294343 Log: MFC r292583: Allow dhcp/bootp server-provided values to be overriden from environment variables in loader(8) and other libstand applications. Sometimes a dhcp server provides incorrect information along with the IP address. It would be useful to have a way to override this with locally-supplied information, such as command line parameters passed from a prior-stage bootloader. This change allows pre-existing env vars to take precedence over values delivered by the dhcp or bootp server. The bootp/dhcp code in libstand automatically creates environment variables from the data provided by the server (dhcp.root-path, dhcp.domain-name, etc). It also transcribes the values to some global variables such as 'rootpath' and 'hostname'. This change does two things: When adding dhcp.* vars to the environment, don't replace existing vars/values. When setting the global vars rootpath and hostname, use the dhcp.root-path and dhcp.host-name env var values if they exist. This allows the platform-specific part of loader(8) to obtain override values in some platform-specific way and store them in the environment before opening the network device. The set of values that can be overriden is currently limited to just string options. The values that are delivered as binary data are things that probably shouldn't be overridden (IP, netmask, gateway, etc). The original patch this evolved from was submitted by martymac@ PR: 202098 Relnotes: Yes Modified: stable/10/lib/libstand/bootp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libstand/bootp.c ============================================================================== --- stable/10/lib/libstand/bootp.c Tue Jan 19 21:27:25 2016 (r294342) +++ stable/10/lib/libstand/bootp.c Tue Jan 19 21:35:09 2016 (r294343) @@ -354,6 +354,7 @@ vend_rfc1048(cp, len) u_char *ep; int size; u_char tag; + const char *val; #ifdef BOOTP_DEBUG if (debug) @@ -380,15 +381,17 @@ vend_rfc1048(cp, len) } if (tag == TAG_SWAPSERVER) { /* let it override bp_siaddr */ - bcopy(cp, &rootip.s_addr, sizeof(swapip.s_addr)); + bcopy(cp, &rootip.s_addr, sizeof(rootip.s_addr)); } if (tag == TAG_ROOTPATH) { - strncpy(rootpath, (char *)cp, sizeof(rootpath)); - rootpath[size] = '\0'; + if ((val = getenv("dhcp.root-path")) == NULL) + val = (const char *)cp; + strlcpy(rootpath, val, sizeof(rootpath)); } if (tag == TAG_HOSTNAME) { - strncpy(hostname, (char *)cp, sizeof(hostname)); - hostname[size] = '\0'; + if ((val = getenv("dhcp.host-name")) == NULL) + val = (const char *)cp; + strlcpy(hostname, val, sizeof(hostname)); } #ifdef SUPPORT_DHCP if (tag == TAG_DHCP_MSGTYPE) { @@ -730,7 +733,11 @@ setenv_(u_char *cp, u_char *ep, struct sprintf(env, op->desc, opts[0].desc, tag); else sprintf(env, "%s%s", opts[0].desc, op->desc); - setenv(env, buf, 1); + /* + * Do not replace existing values in the environment, so that + * locally-obtained values can override server-provided values. + */ + setenv(env, buf, 0); } } if (tp != tags) { From owner-svn-src-stable@freebsd.org Tue Jan 19 21:39:23 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 424BCA88D48; Tue, 19 Jan 2016 21:39:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF26F12B3; Tue, 19 Jan 2016 21:39:22 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JLdLig044323; Tue, 19 Jan 2016 21:39:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JLdLip044322; Tue, 19 Jan 2016 21:39:21 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601192139.u0JLdLip044322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 19 Jan 2016 21:39: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: r294345 - stable/10/sys/boot/efi/loader 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 21:39:23 -0000 Author: ian Date: Tue Jan 19 21:39:21 2016 New Revision: 294345 URL: https://svnweb.freebsd.org/changeset/base/294345 Log: MFC r292584: Set env vars from values on the efi loader command line. Examine each cmdline arg and if it contains an '=' convert it to ascii and pass it to putenv(). This allows var=value settings to come in on the command line. This will allow overriding dhcp server-provided data in loader(8), as discussed in PR 202098 PR: 202098 Relnotes: Yes (this goes together with r294343) Modified: stable/10/sys/boot/efi/loader/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/loader/main.c ============================================================================== --- stable/10/sys/boot/efi/loader/main.c Tue Jan 19 21:37:51 2016 (r294344) +++ stable/10/sys/boot/efi/loader/main.c Tue Jan 19 21:39:21 2016 (r294345) @@ -63,10 +63,10 @@ EFI_GUID debugimg = DEBUG_IMAGE_INFO_TAB EFI_STATUS main(int argc, CHAR16 *argv[]) { - char vendor[128]; + char var[128]; EFI_LOADED_IMAGE *img; EFI_GUID *guid; - int i; + int i, j, vargood; /* * XXX Chicken-and-egg problem; we want to have console output @@ -76,6 +76,29 @@ main(int argc, CHAR16 *argv[]) */ cons_probe(); + /* + * Loop through the args, and for each one that contains an '=' that is + * not the first character, add it to the environment. This allows + * loader and kernel env vars to be passed on the command line. Convert + * args from UCS-2 to ASCII (16 to 8 bit) as they are copied. + */ + for (i = 1; i < argc; i++) { + vargood = 0; + for (j = 0; argv[i][j] != 0; j++) { + if (j == sizeof(var)) { + vargood = 0; + break; + } + if (j > 0 && argv[i][j] == '=') + vargood = 1; + var[j] = (char)argv[i][j]; + } + if (vargood) { + var[j] = 0; + putenv(var); + } + } + if (efi_copy_init()) { printf("failed to allocate staging area\n"); return (EFI_BUFFER_TOO_SMALL); From owner-svn-src-stable@freebsd.org Tue Jan 19 21:42:20 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FDAAA88E59; Tue, 19 Jan 2016 21:42:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E59C185B; Tue, 19 Jan 2016 21:42:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JLgJFO046963; Tue, 19 Jan 2016 21:42:19 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JLgJ0Z046962; Tue, 19 Jan 2016 21:42:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601192142.u0JLgJ0Z046962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 19 Jan 2016 21:42: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: r294346 - stable/10/sys/boot/uboot/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 21:42:20 -0000 Author: ian Date: Tue Jan 19 21:42:19 2016 New Revision: 294346 URL: https://svnweb.freebsd.org/changeset/base/294346 Log: MFC r292888: Fix the error checking for the ubenv command. This moves the check for an empty ldvar (which amounts to the varname string starting with '=') into the if block that manipulates ldvar, which avoids later referencing ldvar when it was never initialized. Modified: stable/10/sys/boot/uboot/common/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/uboot/common/main.c ============================================================================== --- stable/10/sys/boot/uboot/common/main.c Tue Jan 19 21:39:21 2016 (r294345) +++ stable/10/sys/boot/uboot/common/main.c Tue Jan 19 21:42:19 2016 (r294346) @@ -585,6 +585,10 @@ handle_uboot_env_var(enum ubenv_action a */ if (action == UBENV_IMPORT) { len = strcspn(var, "="); + if (len == 0) { + printf("name cannot start with '=': '%s'\n", var); + return; + } if (var[len] == 0) { strcpy(ldvar, "uboot."); strncat(ldvar, var, sizeof(ldvar) - 7); @@ -604,9 +608,11 @@ handle_uboot_env_var(enum ubenv_action a var = &var[6]; } - /* If ldvar is malformed or there's no variable name left, punt. */ - if (ldvar[0] == 0 || var[0] == 0) + /* If there is no variable name left, punt. */ + if (var[0] == 0) { + printf("empty variable name\n"); return; + } val = ub_env_get(var); if (action == UBENV_SHOW) { From owner-svn-src-stable@freebsd.org Tue Jan 19 23:18:50 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3D04A882FB; Tue, 19 Jan 2016 23:18:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0C2614A3; Tue, 19 Jan 2016 23:18:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JNInBW075191; Tue, 19 Jan 2016 23:18:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JNInrR075190; Tue, 19 Jan 2016 23:18:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601192318.u0JNInrR075190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 19 Jan 2016 23:18:49 +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: r294359 - stable/10/lib/libc/tests/net 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 23:18:51 -0000 Author: ngie Date: Tue Jan 19 23:18:49 2016 New Revision: 294359 URL: https://svnweb.freebsd.org/changeset/base/294359 Log: Default __MAKE_SHELL to /bin/sh when generating aton_ether_subr.c via `gen_ether_subr`. __MAKE_SHELL is only defined when installworld is run on stable/10, which breaks workflows dealing with source trees mounted with noexec [*] This is a direct commit to stable/10 Reported by: Mark Martinec Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/tests/net/Makefile Modified: stable/10/lib/libc/tests/net/Makefile ============================================================================== --- stable/10/lib/libc/tests/net/Makefile Tue Jan 19 23:16:24 2016 (r294358) +++ stable/10/lib/libc/tests/net/Makefile Tue Jan 19 23:18:49 2016 (r294359) @@ -28,6 +28,8 @@ PROGS+= h_dns_server DPADD.h_nsd_recurse+= ${LIBPTHREAD} LDADD.h_nsd_recurse+= -lpthread +__MAKE_SHELL?= /bin/sh + CLEANFILES+= aton_ether_subr.c aton_ether_subr.c: gen_ether_subr ${.CURDIR:H:H:H:H}/sys/net/if_ethersubr.c ${__MAKE_SHELL} ${.ALLSRC} ${.TARGET} From owner-svn-src-stable@freebsd.org Tue Jan 19 23:36:51 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E3CBA88C84; Tue, 19 Jan 2016 23:36:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3520A17A3; Tue, 19 Jan 2016 23:36:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0JNaoUq081137; Tue, 19 Jan 2016 23:36:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0JNanUg081127; Tue, 19 Jan 2016 23:36:49 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601192336.u0JNanUg081127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 19 Jan 2016 23:36:49 +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: r294364 - in stable/10: contrib/smbfs/lib/smb lib usr.sbin 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 23:36:51 -0000 Author: ian Date: Tue Jan 19 23:36:49 2016 New Revision: 294364 URL: https://svnweb.freebsd.org/changeset/base/294364 Log: MFC r292337, r292552, r292553: Build mount_smbfs for arm. Also sort the subdirs. Avoid unaligned memory accesses when encoding netbios names in libsmb. The current code for encoding a netbios name converts each byte to a 16-bit value and stores the result by casting a char* to u_short*, resulting in alignment faults on strict-alignment platforms. This change reimplements the encoding routine using only byte accesses to memory. There is no particular reason to work with 16-bit values just because the encoding process creates two bytes of output for every byte of input. Working a byte at at time also avoids endian problems for big-endian platforms. Make the building of libsmb and mount_smbfs unconditional, now that r292552 has eliminated alignment and endian problems that were making it fail on some platforms. PR: 180438 PR: 189415 Relnotes: Yes Modified: stable/10/contrib/smbfs/lib/smb/nb_name.c stable/10/lib/Makefile stable/10/usr.sbin/Makefile stable/10/usr.sbin/Makefile.amd64 stable/10/usr.sbin/Makefile.arm stable/10/usr.sbin/Makefile.i386 stable/10/usr.sbin/Makefile.ia64 stable/10/usr.sbin/Makefile.powerpc stable/10/usr.sbin/Makefile.sparc64 Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/smbfs/lib/smb/nb_name.c ============================================================================== --- stable/10/contrib/smbfs/lib/smb/nb_name.c Tue Jan 19 23:35:12 2016 (r294363) +++ stable/10/contrib/smbfs/lib/smb/nb_name.c Tue Jan 19 23:36:49 2016 (r294364) @@ -143,15 +143,13 @@ nb_encname_len(const char *str) return len; } -#define NBENCODE(c) (htole16((u_short)(((u_char)(c) >> 4) | \ - (((u_char)(c) & 0xf) << 8)) + 0x4141)) - -static void -memsetw(char *dst, int n, u_short word) +static inline void +nb_char_encode(u_char **ptr, u_char c, int n) { + while (n--) { - *(u_short*)dst = word; - dst += 2; + *(*ptr)++ = 0x41 + (c >> 4); + *(*ptr)++ = 0x41 + (c & 0x0f); } } @@ -165,19 +163,15 @@ nb_name_encode(struct nb_name *np, u_cha *cp++ = NB_ENCNAMELEN; name = np->nn_name; if (name[0] == '*' && name[1] == 0) { - *(u_short*)cp = NBENCODE('*'); - memsetw(cp + 2, NB_NAMELEN - 1, NBENCODE(' ')); - cp += NB_ENCNAMELEN; + nb_char_encode(&cp, '*', 1); + nb_char_encode(&cp, ' ', NB_NAMELEN - 1); } else { - for (i = 0; *name && i < NB_NAMELEN - 1; i++, cp += 2, name++) - *(u_short*)cp = NBENCODE(toupper(*name)); - i = NB_NAMELEN - i - 1; - if (i > 0) { - memsetw(cp, i, NBENCODE(' ')); - cp += i * 2; - } - *(u_short*)cp = NBENCODE(np->nn_type); - cp += 2; + for (i = 0; i < NB_NAMELEN - 1; i++) + if (*name != 0) + nb_char_encode(&cp, toupper(*name++), 1); + else + nb_char_encode(&cp, ' ', 1); + nb_char_encode(&cp, np->nn_type, 1); } *cp = 0; if (np->nn_scope == NULL) Modified: stable/10/lib/Makefile ============================================================================== --- stable/10/lib/Makefile Tue Jan 19 23:35:12 2016 (r294363) +++ stable/10/lib/Makefile Tue Jan 19 23:36:49 2016 (r294364) @@ -84,7 +84,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libsbuf \ ${_libsdp} \ ${_libsm} \ - ${_libsmb} \ + libsmb \ ${_libsmdb} \ ${_libsmutil} \ libstand \ @@ -214,7 +214,6 @@ _libypclnt= libypclnt .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -_libsmb= libsmb _libvgl= libvgl _libproc= libproc _librtld_db= librtld_db @@ -228,7 +227,6 @@ _libvmmapi= libvmmapi .if ${MACHINE_CPUARCH} == "ia64" _libefi= libefi -_libsmb= libsmb .endif .if ${MACHINE_CPUARCH} == "mips" @@ -239,11 +237,6 @@ _librtld_db= librtld_db .if ${MACHINE_CPUARCH} == "powerpc" _libproc= libproc _librtld_db= librtld_db -_libsmb= libsmb -.endif - -.if ${MACHINE_CPUARCH} == "sparc64" -_libsmb= libsmb .endif .if ${MK_OPENSSL} != "no" Modified: stable/10/usr.sbin/Makefile ============================================================================== --- stable/10/usr.sbin/Makefile Tue Jan 19 23:35:12 2016 (r294363) +++ stable/10/usr.sbin/Makefile Tue Jan 19 23:36:49 2016 (r294364) @@ -44,6 +44,7 @@ SUBDIR= adduser \ mixer \ mlxcontrol \ mountd \ + mount_smbfs \ mptutil \ mtest \ ${_mtree} \ Modified: stable/10/usr.sbin/Makefile.amd64 ============================================================================== --- stable/10/usr.sbin/Makefile.amd64 Tue Jan 19 23:35:12 2016 (r294363) +++ stable/10/usr.sbin/Makefile.amd64 Tue Jan 19 23:36:49 2016 (r294364) @@ -25,7 +25,6 @@ SUBDIR+= hyperv .endif SUBDIR+= kgmon SUBDIR+= lptcontrol -SUBDIR+= mount_smbfs SUBDIR+= mptable .if ${MK_NDIS} != "no" SUBDIR+= ndiscvt Modified: stable/10/usr.sbin/Makefile.arm ============================================================================== --- stable/10/usr.sbin/Makefile.arm Tue Jan 19 23:35:12 2016 (r294363) +++ stable/10/usr.sbin/Makefile.arm Tue Jan 19 23:36:49 2016 (r294364) @@ -1,4 +1,4 @@ # $FreeBSD$ -SUBDIR+= ofwdump SUBDIR+= kgmon +SUBDIR+= ofwdump Modified: stable/10/usr.sbin/Makefile.i386 ============================================================================== --- stable/10/usr.sbin/Makefile.i386 Tue Jan 19 23:35:12 2016 (r294363) +++ stable/10/usr.sbin/Makefile.i386 Tue Jan 19 23:36:49 2016 (r294364) @@ -15,7 +15,6 @@ SUBDIR+= hyperv SUBDIR+= kgmon SUBDIR+= kgzip SUBDIR+= lptcontrol -SUBDIR+= mount_smbfs SUBDIR+= mptable .if ${MK_NDIS} != "no" SUBDIR+= ndiscvt Modified: stable/10/usr.sbin/Makefile.ia64 ============================================================================== --- stable/10/usr.sbin/Makefile.ia64 Tue Jan 19 23:35:12 2016 (r294363) +++ stable/10/usr.sbin/Makefile.ia64 Tue Jan 19 23:36:49 2016 (r294364) @@ -4,6 +4,5 @@ SUBDIR+= acpi .endif SUBDIR+= kgmon -SUBDIR+= mount_smbfs SUBDIR:= ${SUBDIR:Nuathload} SUBDIR+= zzz Modified: stable/10/usr.sbin/Makefile.powerpc ============================================================================== --- stable/10/usr.sbin/Makefile.powerpc Tue Jan 19 23:35:12 2016 (r294363) +++ stable/10/usr.sbin/Makefile.powerpc Tue Jan 19 23:36:49 2016 (r294364) @@ -1,5 +1,4 @@ # $FreeBSD$ -SUBDIR+= mount_smbfs SUBDIR+= nvram SUBDIR+= ofwdump Modified: stable/10/usr.sbin/Makefile.sparc64 ============================================================================== --- stable/10/usr.sbin/Makefile.sparc64 Tue Jan 19 23:35:12 2016 (r294363) +++ stable/10/usr.sbin/Makefile.sparc64 Tue Jan 19 23:36:49 2016 (r294364) @@ -1,5 +1,4 @@ # $FreeBSD$ SUBDIR+= eeprom -SUBDIR+= mount_smbfs SUBDIR+= ofwdump From owner-svn-src-stable@freebsd.org Wed Jan 20 01:09:56 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA28FA82785; Wed, 20 Jan 2016 01:09:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A96CD1B5A; Wed, 20 Jan 2016 01:09:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K19sVf007802; Wed, 20 Jan 2016 01:09:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K19rv4007791; Wed, 20 Jan 2016 01:09:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601200109.u0K19rv4007791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 Jan 2016 01:09:53 +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: r294368 - in stable/10/sys: amd64/linux amd64/linux32 cddl/dev/systrace compat/linux kern modules/dtrace modules/dtrace/systrace_linux modules/dtrace/systrace_linux32 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 01:09:56 -0000 Author: jhb Date: Wed Jan 20 01:09:53 2016 New Revision: 294368 URL: https://svnweb.freebsd.org/changeset/base/294368 Log: MFC 289769,289822,290143,290144: Rename remaining linux32 symbols from linux_* to linux32_*. 289769: Rename remaining linux32 symbols such as linux_sysent[] and linux_syscallnames[] from linux_* to linux32_* to avoid conflicts with linux64.ko. While here, add support for linux64 binaries to systrace. - Update NOPROTO entries in amd64/linux/syscalls.master to match the main table to fix systrace build. - Add a special case for union l_semun arguments to the systrace generation. - The systrace_linux32 module now only builds the systrace_linux32.ko. module on amd64. - Add a new systrace_linux module that builds on both i386 and amd64. For i386 it builds the existing systrace_linux.ko. For amd64 it builds a systrace_linux.ko for 64-bit binaries. 289822: Fix build for the KTR-enabled kernels. 290143: Fix build with DEBUG defined. 290144: Update for LINUX32 rename. The assembler didn't complain about undefined symbols but just used 0 after the rename. Added: stable/10/sys/modules/dtrace/systrace_linux/ - copied from r289769, head/sys/modules/dtrace/systrace_linux/ Modified: stable/10/sys/amd64/linux/syscalls.master stable/10/sys/amd64/linux32/linux.h stable/10/sys/amd64/linux32/linux32_locore.s stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/amd64/linux32/syscalls.conf stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/cddl/dev/systrace/systrace.c stable/10/sys/compat/linux/linux_misc.c stable/10/sys/kern/makesyscalls.sh stable/10/sys/modules/dtrace/Makefile stable/10/sys/modules/dtrace/systrace_linux32/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Wed Jan 20 00:26:50 2016 (r294367) +++ stable/10/sys/amd64/linux/syscalls.master Wed Jan 20 01:09:53 2016 (r294368) @@ -49,8 +49,8 @@ struct l_newstat *buf); } 6 AUE_LSTAT STD { int linux_newlstat(char *path, \ struct l_newstat *buf); } -7 AUE_POLL NOPROTO { int poll(struct pollfd*, \ - unsigned int nfds, int timeout); } +7 AUE_POLL NOPROTO { int poll(struct pollfd *fds, u_int nfds, \ + int timeout); } 8 AUE_LSEEK STD { int linux_lseek(l_uint fdes, l_off_t off, \ l_int whence); } 9 AUE_MMAP STD { int linux_mmap2(l_ulong addr, l_ulong len, \ @@ -316,7 +316,7 @@ 161 AUE_CHROOT NOPROTO { int chroot(char *path); } 162 AUE_SYNC NOPROTO { int sync(void); } 163 AUE_ACCT NOPROTO { int acct(char *path); } -164 AUE_SETTIMEOFDAY NOPROTO { int settimeofday(struct l_timeval *tp, struct timezone *tzp); } +164 AUE_SETTIMEOFDAY NOPROTO { int settimeofday(struct l_timeval *tv, struct timezone *tzp); } 165 AUE_MOUNT STD { int linux_mount(char *specialfile, \ char *dir, char *filesystemtype, \ l_ulong rwflag, void *data); } Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Wed Jan 20 00:26:50 2016 (r294367) +++ stable/10/sys/amd64/linux32/linux.h Wed Jan 20 01:09:53 2016 (r294368) @@ -40,7 +40,7 @@ * debugging support */ extern u_char linux_debug_map[]; -#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name) +#define ldebug(name) isclr(linux_debug_map, LINUX32_SYS_linux_ ## name) #define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \ (long)td->td_proc->p_pid, (long)td->td_tid #define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \ Modified: stable/10/sys/amd64/linux32/linux32_locore.s ============================================================================== --- stable/10/sys/amd64/linux32/linux32_locore.s Wed Jan 20 00:26:50 2016 (r294367) +++ stable/10/sys/amd64/linux32/linux32_locore.s Wed Jan 20 01:09:53 2016 (r294368) @@ -28,7 +28,7 @@ NON_GPROF_ENTRY(linux32_sigcode) jmp *LINUX_SIGF_HANDLER(%ebx) .startsigcode: popl %eax - movl $LINUX_SYS_linux_sigreturn,%eax /* linux_sigreturn() */ + movl $LINUX32_SYS_linux_sigreturn,%eax /* linux_sigreturn() */ int $0x80 /* enter kernel with args */ .endsigcode: 0: jmp 0b @@ -44,7 +44,7 @@ NON_GPROF_ENTRY(linux32_rt_sigcode) push %eax jmp *LINUX_RT_SIGF_HANDLER(%edi) .startrtsigcode: - movl $LINUX_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */ + movl $LINUX32_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */ int $0x80 /* enter kernel with args */ .endrtsigcode: 0: jmp 0b Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Wed Jan 20 00:26:50 2016 (r294367) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Wed Jan 20 01:09:53 2016 (r294368) @@ -105,8 +105,8 @@ MODULE_VERSION(linux, 1); * to syscall 0. This is slightly less bogus than using * ldebug(sigreturn). */ -#define LINUX_SYS_linux_rt_sendsig 0 -#define LINUX_SYS_linux_sendsig 0 +#define LINUX32_SYS_linux_rt_sendsig 0 +#define LINUX32_SYS_linux_sendsig 0 const char *linux_kplatform; static int linux_szsigcode; @@ -115,7 +115,7 @@ static char *linux_shared_page_mapping; extern char _binary_linux32_locore_o_start; extern char _binary_linux32_locore_o_end; -extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL]; +extern struct sysent linux32_sysent[LINUX32_SYS_MAXSYSCALL]; SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); @@ -1008,8 +1008,8 @@ linux32_fixlimit(struct rlimit *rl, int } struct sysentvec elf_linux_sysvec = { - .sv_size = LINUX_SYS_MAXSYSCALL, - .sv_table = linux_sysent, + .sv_size = LINUX32_SYS_MAXSYSCALL, + .sv_table = linux32_sysent, .sv_mask = 0, .sv_sigsize = 0, .sv_sigtbl = NULL, Modified: stable/10/sys/amd64/linux32/syscalls.conf ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.conf Wed Jan 20 00:26:50 2016 (r294367) +++ stable/10/sys/amd64/linux32/syscalls.conf Wed Jan 20 01:09:53 2016 (r294368) @@ -1,11 +1,11 @@ # $FreeBSD$ sysnames="linux32_syscalls.c" sysproto="linux32_proto.h" -sysproto_h=_LINUX_SYSPROTO_H_ +sysproto_h=_LINUX32_SYSPROTO_H_ syshdr="linux32_syscall.h" syssw="linux32_sysent.c" sysmk="/dev/null" -syscallprefix="LINUX_SYS_" -switchname="linux_sysent" -namesname="linux_syscallnames" +syscallprefix="LINUX32_SYS_" +switchname="linux32_sysent" +namesname="linux32_syscallnames" systrace="linux32_systrace_args.c" Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Wed Jan 20 00:26:50 2016 (r294367) +++ stable/10/sys/amd64/linux32/syscalls.master Wed Jan 20 01:09:53 2016 (r294368) @@ -2,7 +2,7 @@ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 ; System call name/number master file (or rather, slave, from LINUX). -; Processed to create linux_sysent.c, linux_proto.h and linux_syscall.h. +; Processed to create linux32_sysent.c, linux32_proto.h and linux32_syscall.h. ; Columns: number audit type nargs name alt{name,tag,rtyp}/comments ; number system call number, must be in order Modified: stable/10/sys/cddl/dev/systrace/systrace.c ============================================================================== --- stable/10/sys/cddl/dev/systrace/systrace.c Wed Jan 20 00:26:50 2016 (r294367) +++ stable/10/sys/cddl/dev/systrace/systrace.c Wed Jan 20 01:09:53 2016 (r294368) @@ -60,24 +60,37 @@ #ifdef LINUX_SYSTRACE #if defined(__amd64__) -#include -#include -#include -#include -#define MODNAME "linux32" +#include +#include +#include +#include #elif defined(__i386__) #include #include #include #include -#define MODNAME "linux" #else #error Only i386 and amd64 are supported. #endif +#define MODNAME "linux" extern struct sysent linux_sysent[]; #define MAXSYSCALL LINUX_SYS_MAXSYSCALL #define SYSCALLNAMES linux_syscallnames #define SYSENT linux_sysent +#elif defined(LINUX32_SYSTRACE) +#if defined(__amd64__) +#include +#include +#include +#include +#else +#error Only amd64 is supported. +#endif +#define MODNAME "linux32" +extern struct sysent linux32_sysent[]; +#define MAXSYSCALL LINUX32_SYS_MAXSYSCALL +#define SYSCALLNAMES linux32_syscallnames +#define SYSENT linux32_sysent #elif defined(FREEBSD32_SYSTRACE) /* * The syscall arguments are processed into a DTrace argument array @@ -103,6 +116,7 @@ extern const char *freebsd32_syscallname #define MAXSYSCALL SYS_MAXSYSCALL #define SYSCALLNAMES syscallnames #define SYSENT sysent +#define NATIVE_ABI #endif #define PROVNAME "syscall" @@ -132,7 +146,7 @@ static void systrace_load(void *); static struct cdevsw systrace_cdevsw = { .d_version = D_VERSION, .d_open = systrace_open, -#ifdef LINUX_SYSTRACE +#ifndef NATIVE_ABI .d_name = "systrace_" MODNAME, #else .d_name = "systrace", @@ -171,7 +185,7 @@ static dtrace_provider_id_t systrace_id; typedef void (*systrace_dtrace_probe_t)(dtrace_id_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -#if !defined(LINUX_SYSTRACE) +#ifdef NATIVE_ABI /* * Probe callback function. * @@ -314,7 +328,7 @@ systrace_load(void *dummy) NULL, &systrace_pops, NULL, &systrace_id) != 0) return; -#if !defined(LINUX_SYSTRACE) +#ifdef NATIVE_ABI systrace_probe_func = systrace_probe; #endif } @@ -328,7 +342,7 @@ systrace_unload() if ((error = dtrace_unregister(systrace_id)) != 0) return (error); -#if !defined(LINUX_SYSTRACE) +#ifdef NATIVE_ABI systrace_probe_func = NULL; #endif @@ -370,6 +384,16 @@ SYSINIT(systrace_load, SI_SUB_DTRACE_PRO SYSUNINIT(systrace_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_unload, NULL); #ifdef LINUX_SYSTRACE +DEV_MODULE(systrace_linux, systrace_modevent, NULL); +MODULE_VERSION(systrace_linux, 1); +#ifdef __amd64__ +MODULE_DEPEND(systrace_linux, linux64, 1, 1, 1); +#else +MODULE_DEPEND(systrace_linux, linux, 1, 1, 1); +#endif +MODULE_DEPEND(systrace_linux, dtrace, 1, 1, 1); +MODULE_DEPEND(systrace_linux, opensolaris, 1, 1, 1); +#elif defined(LINUX32_SYSTRACE) DEV_MODULE(systrace_linux32, systrace_modevent, NULL); MODULE_VERSION(systrace_linux32, 1); MODULE_DEPEND(systrace_linux32, linux, 1, 1, 1); Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Wed Jan 20 00:26:50 2016 (r294367) +++ stable/10/sys/compat/linux/linux_misc.c Wed Jan 20 01:09:53 2016 (r294368) @@ -2362,7 +2362,13 @@ linux_ppoll(struct thread *td, struct li #if defined(DEBUG) || defined(KTR) /* XXX: can be removed when every ldebug(...) and KTR stuff are removed. */ -u_char linux_debug_map[howmany(LINUX_SYS_MAXSYSCALL, sizeof(u_char))]; +#ifdef COMPAT_LINUX32 +#define L_MAXSYSCALL LINUX32_SYS_MAXSYSCALL +#else +#define L_MAXSYSCALL LINUX_SYS_MAXSYSCALL +#endif + +u_char linux_debug_map[howmany(L_MAXSYSCALL, sizeof(u_char))]; static int linux_debug(int syscall, int toggle, int global) @@ -2374,7 +2380,7 @@ linux_debug(int syscall, int toggle, int memset(linux_debug_map, c, sizeof(linux_debug_map)); return (0); } - if (syscall < 0 || syscall >= LINUX_SYS_MAXSYSCALL) + if (syscall < 0 || syscall >= L_MAXSYSCALL) return (EINVAL); if (toggle) clrbit(linux_debug_map, syscall); @@ -2382,6 +2388,7 @@ linux_debug(int syscall, int toggle, int setbit(linux_debug_map, syscall); return (0); } +#undef L_MAXSYSCALL /* * Usage: sysctl linux.debug=.<0/1> Modified: stable/10/sys/kern/makesyscalls.sh ============================================================================== --- stable/10/sys/kern/makesyscalls.sh Wed Jan 20 00:26:50 2016 (r294367) +++ stable/10/sys/kern/makesyscalls.sh Wed Jan 20 01:09:53 2016 (r294368) @@ -410,6 +410,10 @@ s/\$//g printf("\t\tuarg[%d] = (intptr_t) p->%s; /* %s */\n", \ i - 1, \ argname[i], arg) > systrace + else if (arg == "union l_semun") + printf("\t\tuarg[%d] = p->%s.buf; /* %s */\n", \ + i - 1, \ + argname[i], arg) > systrace else if (substr(arg, 1, 1) == "u" || arg == "size_t") printf("\t\tuarg[%d] = p->%s; /* %s */\n", \ i - 1, \ Modified: stable/10/sys/modules/dtrace/Makefile ============================================================================== --- stable/10/sys/modules/dtrace/Makefile Wed Jan 20 00:26:50 2016 (r294367) +++ stable/10/sys/modules/dtrace/Makefile Wed Jan 20 01:09:53 2016 (r294368) @@ -16,7 +16,10 @@ SUBDIR= dtmalloc \ systrace .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -SUBDIR+= fasttrap fbt systrace_linux32 +SUBDIR+= fasttrap fbt systrace_linux +.endif +.if ${MACHINE_CPUARCH} == "amd64" +SUBDIR+= systrace_linux32 .endif .if ${MACHINE_CPUARCH} == "powerpc" SUBDIR+= fbt fasttrap Modified: stable/10/sys/modules/dtrace/systrace_linux32/Makefile ============================================================================== --- stable/10/sys/modules/dtrace/systrace_linux32/Makefile Wed Jan 20 00:26:50 2016 (r294367) +++ stable/10/sys/modules/dtrace/systrace_linux32/Makefile Wed Jan 20 01:09:53 2016 (r294368) @@ -2,18 +2,14 @@ .PATH: ${.CURDIR}/../../../cddl/dev/systrace -.if ${MACHINE} == "amd64" KMOD= systrace_linux32 -.else -KMOD= systrace_linux -.endif SRCS= systrace.c SRCS+= vnode_if.h CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. -DLINUX_SYSTRACE + -I${.CURDIR}/../../.. -DLINUX32_SYSTRACE .include From owner-svn-src-stable@freebsd.org Wed Jan 20 01:11:03 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEC4DA82847; Wed, 20 Jan 2016 01:11:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5CB91D1D; Wed, 20 Jan 2016 01:11:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K1B2Jc007927; Wed, 20 Jan 2016 01:11:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K1B2gF007919; Wed, 20 Jan 2016 01:11:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601200111.u0K1B2gF007919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 Jan 2016 01:11:02 +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: r294369 - in stable/10/sys/amd64: linux linux32 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 01:11:04 -0000 Author: jhb Date: Wed Jan 20 01:11:01 2016 New Revision: 294369 URL: https://svnweb.freebsd.org/changeset/base/294369 Log: Regen for r294368. Modified: stable/10/sys/amd64/linux/linux_proto.h stable/10/sys/amd64/linux/linux_syscall.h stable/10/sys/amd64/linux/linux_syscalls.c stable/10/sys/amd64/linux/linux_sysent.c stable/10/sys/amd64/linux/linux_systrace_args.c stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c Modified: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/10/sys/amd64/linux/linux_proto.h Wed Jan 20 01:09:53 2016 (r294368) +++ stable/10/sys/amd64/linux/linux_proto.h Wed Jan 20 01:11:01 2016 (r294369) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 294368 2016-01-20 01:09:53Z jhb */ #ifndef _LINUX_SYSPROTO_H_ Modified: stable/10/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/10/sys/amd64/linux/linux_syscall.h Wed Jan 20 01:09:53 2016 (r294368) +++ stable/10/sys/amd64/linux/linux_syscall.h Wed Jan 20 01:11:01 2016 (r294369) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 294368 2016-01-20 01:09:53Z jhb */ #define LINUX_SYS_read 0 Modified: stable/10/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux/linux_syscalls.c Wed Jan 20 01:09:53 2016 (r294368) +++ stable/10/sys/amd64/linux/linux_syscalls.c Wed Jan 20 01:11:01 2016 (r294369) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 294368 2016-01-20 01:09:53Z jhb */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysent.c Wed Jan 20 01:09:53 2016 (r294368) +++ stable/10/sys/amd64/linux/linux_sysent.c Wed Jan 20 01:11:01 2016 (r294369) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 294368 2016-01-20 01:09:53Z jhb */ #include Modified: stable/10/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux/linux_systrace_args.c Wed Jan 20 01:09:53 2016 (r294368) +++ stable/10/sys/amd64/linux/linux_systrace_args.c Wed Jan 20 01:11:01 2016 (r294369) @@ -73,8 +73,8 @@ systrace_args(int sysnum, void *params, /* poll */ case 7: { struct poll_args *p = params; - iarg[0] = p->*; /* struct pollfd */ - uarg[1] = p->nfds; /* unsigned int */ + uarg[0] = (intptr_t) p->fds; /* struct pollfd * */ + uarg[1] = p->nfds; /* u_int */ iarg[2] = p->timeout; /* int */ *n_args = 3; break; @@ -591,7 +591,7 @@ systrace_args(int sysnum, void *params, iarg[0] = p->semid; /* l_int */ iarg[1] = p->semnum; /* l_int */ iarg[2] = p->cmd; /* l_int */ - uarg[3] = p->arg; /* union l_semun */ + uarg[3] = p->arg.buf; /* union l_semun */ *n_args = 4; break; } @@ -1327,7 +1327,7 @@ systrace_args(int sysnum, void *params, /* settimeofday */ case 164: { struct settimeofday_args *p = params; - uarg[0] = (intptr_t) p->tp; /* struct l_timeval * */ + uarg[0] = (intptr_t) p->tv; /* struct l_timeval * */ uarg[1] = (intptr_t) p->tzp; /* struct timezone * */ *n_args = 2; break; @@ -2380,10 +2380,10 @@ systrace_entry_setargdesc(int sysnum, in case 7: switch(ndx) { case 0: - p = "struct pollfd"; + p = "struct pollfd *"; break; case 1: - p = "unsigned int"; + p = "u_int"; break; case 2: p = "int"; Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Wed Jan 20 01:09:53 2016 (r294368) +++ stable/10/sys/amd64/linux32/linux32_proto.h Wed Jan 20 01:11:01 2016 (r294369) @@ -3,11 +3,11 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293592 2016-01-09 17:54:37Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 294368 2016-01-20 01:09:53Z jhb */ -#ifndef _LINUX_SYSPROTO_H_ -#define _LINUX_SYSPROTO_H_ +#ifndef _LINUX32_SYSPROTO_H_ +#define _LINUX32_SYSPROTO_H_ #include #include @@ -1464,286 +1464,286 @@ int linux_process_vm_writev(struct threa #endif /* COMPAT_FREEBSD7 */ -#define LINUX_SYS_AUE_linux_exit AUE_EXIT -#define LINUX_SYS_AUE_linux_fork AUE_FORK -#define LINUX_SYS_AUE_linux_open AUE_OPEN_RWTC -#define LINUX_SYS_AUE_linux_waitpid AUE_WAIT4 -#define LINUX_SYS_AUE_linux_creat AUE_CREAT -#define LINUX_SYS_AUE_linux_link AUE_LINK -#define LINUX_SYS_AUE_linux_unlink AUE_UNLINK -#define LINUX_SYS_AUE_linux_execve AUE_EXECVE -#define LINUX_SYS_AUE_linux_chdir AUE_CHDIR -#define LINUX_SYS_AUE_linux_time AUE_NULL -#define LINUX_SYS_AUE_linux_mknod AUE_MKNOD -#define LINUX_SYS_AUE_linux_chmod AUE_CHMOD -#define LINUX_SYS_AUE_linux_lchown16 AUE_LCHOWN -#define LINUX_SYS_AUE_linux_stat AUE_STAT -#define LINUX_SYS_AUE_linux_lseek AUE_LSEEK -#define LINUX_SYS_AUE_linux_getpid AUE_GETPID -#define LINUX_SYS_AUE_linux_mount AUE_MOUNT -#define LINUX_SYS_AUE_linux_oldumount AUE_UMOUNT -#define LINUX_SYS_AUE_linux_setuid16 AUE_SETUID -#define LINUX_SYS_AUE_linux_getuid16 AUE_GETUID -#define LINUX_SYS_AUE_linux_stime AUE_SETTIMEOFDAY -#define LINUX_SYS_AUE_linux_ptrace AUE_PTRACE -#define LINUX_SYS_AUE_linux_alarm AUE_NULL -#define LINUX_SYS_AUE_linux_pause AUE_NULL -#define LINUX_SYS_AUE_linux_utime AUE_UTIME -#define LINUX_SYS_AUE_linux_access AUE_ACCESS -#define LINUX_SYS_AUE_linux_nice AUE_NICE -#define LINUX_SYS_AUE_linux_kill AUE_KILL -#define LINUX_SYS_AUE_linux_rename AUE_RENAME -#define LINUX_SYS_AUE_linux_mkdir AUE_MKDIR -#define LINUX_SYS_AUE_linux_rmdir AUE_RMDIR -#define LINUX_SYS_AUE_linux_pipe AUE_PIPE -#define LINUX_SYS_AUE_linux_times AUE_NULL -#define LINUX_SYS_AUE_linux_brk AUE_NULL -#define LINUX_SYS_AUE_linux_setgid16 AUE_SETGID -#define LINUX_SYS_AUE_linux_getgid16 AUE_GETGID -#define LINUX_SYS_AUE_linux_signal AUE_NULL -#define LINUX_SYS_AUE_linux_geteuid16 AUE_GETEUID -#define LINUX_SYS_AUE_linux_getegid16 AUE_GETEGID -#define LINUX_SYS_AUE_linux_umount AUE_UMOUNT -#define LINUX_SYS_AUE_linux_ioctl AUE_IOCTL -#define LINUX_SYS_AUE_linux_fcntl AUE_FCNTL -#define LINUX_SYS_AUE_linux_olduname AUE_NULL -#define LINUX_SYS_AUE_linux_ustat AUE_NULL -#define LINUX_SYS_AUE_linux_getppid AUE_GETPPID -#define LINUX_SYS_AUE_linux_sigaction AUE_NULL -#define LINUX_SYS_AUE_linux_sgetmask AUE_NULL -#define LINUX_SYS_AUE_linux_ssetmask AUE_NULL -#define LINUX_SYS_AUE_linux_setreuid16 AUE_SETREUID -#define LINUX_SYS_AUE_linux_setregid16 AUE_SETREGID -#define LINUX_SYS_AUE_linux_sigsuspend AUE_NULL -#define LINUX_SYS_AUE_linux_sigpending AUE_NULL -#define LINUX_SYS_AUE_linux_sethostname AUE_SYSCTL -#define LINUX_SYS_AUE_linux_setrlimit AUE_SETRLIMIT -#define LINUX_SYS_AUE_linux_old_getrlimit AUE_GETRLIMIT -#define LINUX_SYS_AUE_linux_getrusage AUE_GETRUSAGE -#define LINUX_SYS_AUE_linux_gettimeofday AUE_NULL -#define LINUX_SYS_AUE_linux_settimeofday AUE_SETTIMEOFDAY -#define LINUX_SYS_AUE_linux_getgroups16 AUE_GETGROUPS -#define LINUX_SYS_AUE_linux_setgroups16 AUE_SETGROUPS -#define LINUX_SYS_AUE_linux_old_select AUE_SELECT -#define LINUX_SYS_AUE_linux_symlink AUE_SYMLINK -#define LINUX_SYS_AUE_linux_lstat AUE_LSTAT -#define LINUX_SYS_AUE_linux_readlink AUE_READLINK -#define LINUX_SYS_AUE_linux_reboot AUE_REBOOT -#define LINUX_SYS_AUE_linux_readdir AUE_GETDIRENTRIES -#define LINUX_SYS_AUE_linux_mmap AUE_MMAP -#define LINUX_SYS_AUE_linux_truncate AUE_TRUNCATE -#define LINUX_SYS_AUE_linux_ftruncate AUE_FTRUNCATE -#define LINUX_SYS_AUE_linux_getpriority AUE_GETPRIORITY -#define LINUX_SYS_AUE_linux_statfs AUE_STATFS -#define LINUX_SYS_AUE_linux_fstatfs AUE_FSTATFS -#define LINUX_SYS_AUE_linux_socketcall AUE_NULL -#define LINUX_SYS_AUE_linux_syslog AUE_NULL -#define LINUX_SYS_AUE_linux_setitimer AUE_SETITIMER -#define LINUX_SYS_AUE_linux_getitimer AUE_GETITIMER -#define LINUX_SYS_AUE_linux_newstat AUE_STAT -#define LINUX_SYS_AUE_linux_newlstat AUE_LSTAT -#define LINUX_SYS_AUE_linux_newfstat AUE_FSTAT -#define LINUX_SYS_AUE_linux_uname AUE_NULL -#define LINUX_SYS_AUE_linux_iopl AUE_NULL -#define LINUX_SYS_AUE_linux_vhangup AUE_NULL -#define LINUX_SYS_AUE_linux_wait4 AUE_WAIT4 -#define LINUX_SYS_AUE_linux_swapoff AUE_SWAPOFF -#define LINUX_SYS_AUE_linux_sysinfo AUE_NULL -#define LINUX_SYS_AUE_linux_ipc AUE_NULL -#define LINUX_SYS_AUE_linux_sigreturn AUE_SIGRETURN -#define LINUX_SYS_AUE_linux_clone AUE_RFORK -#define LINUX_SYS_AUE_linux_setdomainname AUE_SYSCTL -#define LINUX_SYS_AUE_linux_newuname AUE_NULL -#define LINUX_SYS_AUE_linux_adjtimex AUE_ADJTIME -#define LINUX_SYS_AUE_linux_mprotect AUE_MPROTECT -#define LINUX_SYS_AUE_linux_sigprocmask AUE_SIGPROCMASK -#define LINUX_SYS_AUE_linux_create_module AUE_NULL -#define LINUX_SYS_AUE_linux_init_module AUE_NULL -#define LINUX_SYS_AUE_linux_delete_module AUE_NULL -#define LINUX_SYS_AUE_linux_get_kernel_syms AUE_NULL -#define LINUX_SYS_AUE_linux_quotactl AUE_QUOTACTL -#define LINUX_SYS_AUE_linux_bdflush AUE_BDFLUSH -#define LINUX_SYS_AUE_linux_sysfs AUE_NULL -#define LINUX_SYS_AUE_linux_personality AUE_PERSONALITY -#define LINUX_SYS_AUE_linux_setfsuid16 AUE_SETFSUID -#define LINUX_SYS_AUE_linux_setfsgid16 AUE_SETFSGID -#define LINUX_SYS_AUE_linux_llseek AUE_LSEEK -#define LINUX_SYS_AUE_linux_getdents AUE_GETDIRENTRIES -#define LINUX_SYS_AUE_linux_select AUE_SELECT -#define LINUX_SYS_AUE_linux_msync AUE_MSYNC -#define LINUX_SYS_AUE_linux_readv AUE_READV -#define LINUX_SYS_AUE_linux_writev AUE_WRITEV -#define LINUX_SYS_AUE_linux_getsid AUE_GETSID -#define LINUX_SYS_AUE_linux_fdatasync AUE_NULL -#define LINUX_SYS_AUE_linux_sysctl AUE_SYSCTL -#define LINUX_SYS_AUE_linux_sched_setparam AUE_SCHED_SETPARAM -#define LINUX_SYS_AUE_linux_sched_getparam AUE_SCHED_GETPARAM -#define LINUX_SYS_AUE_linux_sched_setscheduler AUE_SCHED_SETSCHEDULER -#define LINUX_SYS_AUE_linux_sched_getscheduler AUE_SCHED_GETSCHEDULER -#define LINUX_SYS_AUE_linux_sched_get_priority_max AUE_SCHED_GET_PRIORITY_MAX -#define LINUX_SYS_AUE_linux_sched_get_priority_min AUE_SCHED_GET_PRIORITY_MIN -#define LINUX_SYS_AUE_linux_sched_rr_get_interval AUE_SCHED_RR_GET_INTERVAL -#define LINUX_SYS_AUE_linux_nanosleep AUE_NULL -#define LINUX_SYS_AUE_linux_mremap AUE_NULL -#define LINUX_SYS_AUE_linux_setresuid16 AUE_SETRESUID -#define LINUX_SYS_AUE_linux_getresuid16 AUE_GETRESUID -#define LINUX_SYS_AUE_linux_query_module AUE_NULL -#define LINUX_SYS_AUE_linux_nfsservctl AUE_NULL -#define LINUX_SYS_AUE_linux_setresgid16 AUE_SETRESGID -#define LINUX_SYS_AUE_linux_getresgid16 AUE_GETRESGID -#define LINUX_SYS_AUE_linux_prctl AUE_PRCTL -#define LINUX_SYS_AUE_linux_rt_sigreturn AUE_NULL -#define LINUX_SYS_AUE_linux_rt_sigaction AUE_NULL -#define LINUX_SYS_AUE_linux_rt_sigprocmask AUE_NULL -#define LINUX_SYS_AUE_linux_rt_sigpending AUE_NULL -#define LINUX_SYS_AUE_linux_rt_sigtimedwait AUE_NULL -#define LINUX_SYS_AUE_linux_rt_sigqueueinfo AUE_NULL -#define LINUX_SYS_AUE_linux_rt_sigsuspend AUE_NULL -#define LINUX_SYS_AUE_linux_pread AUE_PREAD -#define LINUX_SYS_AUE_linux_pwrite AUE_PWRITE -#define LINUX_SYS_AUE_linux_chown16 AUE_CHOWN -#define LINUX_SYS_AUE_linux_getcwd AUE_GETCWD -#define LINUX_SYS_AUE_linux_capget AUE_CAPGET -#define LINUX_SYS_AUE_linux_capset AUE_CAPSET -#define LINUX_SYS_AUE_linux_sigaltstack AUE_NULL -#define LINUX_SYS_AUE_linux_sendfile AUE_SENDFILE -#define LINUX_SYS_AUE_linux_vfork AUE_VFORK -#define LINUX_SYS_AUE_linux_getrlimit AUE_GETRLIMIT -#define LINUX_SYS_AUE_linux_mmap2 AUE_MMAP -#define LINUX_SYS_AUE_linux_truncate64 AUE_TRUNCATE -#define LINUX_SYS_AUE_linux_ftruncate64 AUE_FTRUNCATE -#define LINUX_SYS_AUE_linux_stat64 AUE_STAT -#define LINUX_SYS_AUE_linux_lstat64 AUE_LSTAT -#define LINUX_SYS_AUE_linux_fstat64 AUE_FSTAT -#define LINUX_SYS_AUE_linux_lchown AUE_LCHOWN -#define LINUX_SYS_AUE_linux_getuid AUE_GETUID -#define LINUX_SYS_AUE_linux_getgid AUE_GETGID -#define LINUX_SYS_AUE_linux_getgroups AUE_GETGROUPS -#define LINUX_SYS_AUE_linux_setgroups AUE_SETGROUPS -#define LINUX_SYS_AUE_linux_chown AUE_CHOWN -#define LINUX_SYS_AUE_linux_setfsuid AUE_SETFSUID -#define LINUX_SYS_AUE_linux_setfsgid AUE_SETFSGID -#define LINUX_SYS_AUE_linux_pivot_root AUE_PIVOT_ROOT -#define LINUX_SYS_AUE_linux_mincore AUE_MINCORE -#define LINUX_SYS_AUE_linux_getdents64 AUE_GETDIRENTRIES -#define LINUX_SYS_AUE_linux_fcntl64 AUE_FCNTL -#define LINUX_SYS_AUE_linux_gettid AUE_NULL -#define LINUX_SYS_AUE_linux_setxattr AUE_NULL -#define LINUX_SYS_AUE_linux_lsetxattr AUE_NULL -#define LINUX_SYS_AUE_linux_fsetxattr AUE_NULL -#define LINUX_SYS_AUE_linux_getxattr AUE_NULL -#define LINUX_SYS_AUE_linux_lgetxattr AUE_NULL -#define LINUX_SYS_AUE_linux_fgetxattr AUE_NULL -#define LINUX_SYS_AUE_linux_listxattr AUE_NULL -#define LINUX_SYS_AUE_linux_llistxattr AUE_NULL -#define LINUX_SYS_AUE_linux_flistxattr AUE_NULL -#define LINUX_SYS_AUE_linux_removexattr AUE_NULL -#define LINUX_SYS_AUE_linux_lremovexattr AUE_NULL -#define LINUX_SYS_AUE_linux_fremovexattr AUE_NULL -#define LINUX_SYS_AUE_linux_tkill AUE_NULL -#define LINUX_SYS_AUE_linux_sys_futex AUE_NULL -#define LINUX_SYS_AUE_linux_sched_setaffinity AUE_NULL -#define LINUX_SYS_AUE_linux_sched_getaffinity AUE_NULL -#define LINUX_SYS_AUE_linux_set_thread_area AUE_NULL -#define LINUX_SYS_AUE_linux_fadvise64 AUE_NULL -#define LINUX_SYS_AUE_linux_exit_group AUE_EXIT -#define LINUX_SYS_AUE_linux_lookup_dcookie AUE_NULL -#define LINUX_SYS_AUE_linux_epoll_create AUE_NULL -#define LINUX_SYS_AUE_linux_epoll_ctl AUE_NULL -#define LINUX_SYS_AUE_linux_epoll_wait AUE_NULL -#define LINUX_SYS_AUE_linux_remap_file_pages AUE_NULL -#define LINUX_SYS_AUE_linux_set_tid_address AUE_NULL -#define LINUX_SYS_AUE_linux_timer_create AUE_NULL -#define LINUX_SYS_AUE_linux_timer_settime AUE_NULL -#define LINUX_SYS_AUE_linux_timer_gettime AUE_NULL -#define LINUX_SYS_AUE_linux_timer_getoverrun AUE_NULL -#define LINUX_SYS_AUE_linux_timer_delete AUE_NULL -#define LINUX_SYS_AUE_linux_clock_settime AUE_CLOCK_SETTIME -#define LINUX_SYS_AUE_linux_clock_gettime AUE_NULL -#define LINUX_SYS_AUE_linux_clock_getres AUE_NULL -#define LINUX_SYS_AUE_linux_clock_nanosleep AUE_NULL -#define LINUX_SYS_AUE_linux_statfs64 AUE_STATFS -#define LINUX_SYS_AUE_linux_fstatfs64 AUE_FSTATFS -#define LINUX_SYS_AUE_linux_tgkill AUE_NULL -#define LINUX_SYS_AUE_linux_utimes AUE_UTIMES -#define LINUX_SYS_AUE_linux_fadvise64_64 AUE_NULL -#define LINUX_SYS_AUE_linux_mbind AUE_NULL -#define LINUX_SYS_AUE_linux_get_mempolicy AUE_NULL -#define LINUX_SYS_AUE_linux_set_mempolicy AUE_NULL -#define LINUX_SYS_AUE_linux_mq_open AUE_NULL -#define LINUX_SYS_AUE_linux_mq_unlink AUE_NULL -#define LINUX_SYS_AUE_linux_mq_timedsend AUE_NULL -#define LINUX_SYS_AUE_linux_mq_timedreceive AUE_NULL -#define LINUX_SYS_AUE_linux_mq_notify AUE_NULL -#define LINUX_SYS_AUE_linux_mq_getsetattr AUE_NULL -#define LINUX_SYS_AUE_linux_kexec_load AUE_NULL -#define LINUX_SYS_AUE_linux_waitid AUE_WAIT6 -#define LINUX_SYS_AUE_linux_add_key AUE_NULL -#define LINUX_SYS_AUE_linux_request_key AUE_NULL -#define LINUX_SYS_AUE_linux_keyctl AUE_NULL -#define LINUX_SYS_AUE_linux_ioprio_set AUE_NULL -#define LINUX_SYS_AUE_linux_ioprio_get AUE_NULL -#define LINUX_SYS_AUE_linux_inotify_init AUE_NULL -#define LINUX_SYS_AUE_linux_inotify_add_watch AUE_NULL -#define LINUX_SYS_AUE_linux_inotify_rm_watch AUE_NULL -#define LINUX_SYS_AUE_linux_migrate_pages AUE_NULL -#define LINUX_SYS_AUE_linux_openat AUE_OPEN_RWTC -#define LINUX_SYS_AUE_linux_mkdirat AUE_MKDIRAT -#define LINUX_SYS_AUE_linux_mknodat AUE_MKNODAT -#define LINUX_SYS_AUE_linux_fchownat AUE_FCHOWNAT -#define LINUX_SYS_AUE_linux_futimesat AUE_FUTIMESAT -#define LINUX_SYS_AUE_linux_fstatat64 AUE_FSTATAT -#define LINUX_SYS_AUE_linux_unlinkat AUE_UNLINKAT -#define LINUX_SYS_AUE_linux_renameat AUE_RENAMEAT -#define LINUX_SYS_AUE_linux_linkat AUE_LINKAT -#define LINUX_SYS_AUE_linux_symlinkat AUE_SYMLINKAT -#define LINUX_SYS_AUE_linux_readlinkat AUE_READLINKAT -#define LINUX_SYS_AUE_linux_fchmodat AUE_FCHMODAT -#define LINUX_SYS_AUE_linux_faccessat AUE_FACCESSAT -#define LINUX_SYS_AUE_linux_pselect6 AUE_SELECT -#define LINUX_SYS_AUE_linux_ppoll AUE_POLL -#define LINUX_SYS_AUE_linux_unshare AUE_NULL -#define LINUX_SYS_AUE_linux_set_robust_list AUE_NULL -#define LINUX_SYS_AUE_linux_get_robust_list AUE_NULL -#define LINUX_SYS_AUE_linux_splice AUE_NULL -#define LINUX_SYS_AUE_linux_sync_file_range AUE_NULL -#define LINUX_SYS_AUE_linux_tee AUE_NULL -#define LINUX_SYS_AUE_linux_vmsplice AUE_NULL -#define LINUX_SYS_AUE_linux_move_pages AUE_NULL -#define LINUX_SYS_AUE_linux_getcpu AUE_NULL -#define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL -#define LINUX_SYS_AUE_linux_utimensat AUE_FUTIMESAT -#define LINUX_SYS_AUE_linux_signalfd AUE_NULL -#define LINUX_SYS_AUE_linux_timerfd_create AUE_NULL -#define LINUX_SYS_AUE_linux_eventfd AUE_NULL -#define LINUX_SYS_AUE_linux_fallocate AUE_NULL -#define LINUX_SYS_AUE_linux_timerfd_settime AUE_NULL -#define LINUX_SYS_AUE_linux_timerfd_gettime AUE_NULL -#define LINUX_SYS_AUE_linux_signalfd4 AUE_NULL -#define LINUX_SYS_AUE_linux_eventfd2 AUE_NULL -#define LINUX_SYS_AUE_linux_epoll_create1 AUE_NULL -#define LINUX_SYS_AUE_linux_dup3 AUE_NULL -#define LINUX_SYS_AUE_linux_pipe2 AUE_NULL -#define LINUX_SYS_AUE_linux_inotify_init1 AUE_NULL -#define LINUX_SYS_AUE_linux_preadv AUE_NULL -#define LINUX_SYS_AUE_linux_pwritev AUE_NULL -#define LINUX_SYS_AUE_linux_rt_tsigqueueinfo AUE_NULL -#define LINUX_SYS_AUE_linux_perf_event_open AUE_NULL -#define LINUX_SYS_AUE_linux_recvmmsg AUE_NULL -#define LINUX_SYS_AUE_linux_fanotify_init AUE_NULL -#define LINUX_SYS_AUE_linux_fanotify_mark AUE_NULL -#define LINUX_SYS_AUE_linux_prlimit64 AUE_NULL -#define LINUX_SYS_AUE_linux_name_to_handle_at AUE_NULL -#define LINUX_SYS_AUE_linux_open_by_handle_at AUE_NULL -#define LINUX_SYS_AUE_linux_clock_adjtime AUE_NULL -#define LINUX_SYS_AUE_linux_syncfs AUE_SYNC -#define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL -#define LINUX_SYS_AUE_linux_setns AUE_NULL -#define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL -#define LINUX_SYS_AUE_linux_process_vm_writev AUE_NULL +#define LINUX32_SYS_AUE_linux_exit AUE_EXIT +#define LINUX32_SYS_AUE_linux_fork AUE_FORK +#define LINUX32_SYS_AUE_linux_open AUE_OPEN_RWTC +#define LINUX32_SYS_AUE_linux_waitpid AUE_WAIT4 +#define LINUX32_SYS_AUE_linux_creat AUE_CREAT +#define LINUX32_SYS_AUE_linux_link AUE_LINK +#define LINUX32_SYS_AUE_linux_unlink AUE_UNLINK +#define LINUX32_SYS_AUE_linux_execve AUE_EXECVE +#define LINUX32_SYS_AUE_linux_chdir AUE_CHDIR +#define LINUX32_SYS_AUE_linux_time AUE_NULL +#define LINUX32_SYS_AUE_linux_mknod AUE_MKNOD +#define LINUX32_SYS_AUE_linux_chmod AUE_CHMOD +#define LINUX32_SYS_AUE_linux_lchown16 AUE_LCHOWN +#define LINUX32_SYS_AUE_linux_stat AUE_STAT +#define LINUX32_SYS_AUE_linux_lseek AUE_LSEEK +#define LINUX32_SYS_AUE_linux_getpid AUE_GETPID +#define LINUX32_SYS_AUE_linux_mount AUE_MOUNT +#define LINUX32_SYS_AUE_linux_oldumount AUE_UMOUNT +#define LINUX32_SYS_AUE_linux_setuid16 AUE_SETUID +#define LINUX32_SYS_AUE_linux_getuid16 AUE_GETUID +#define LINUX32_SYS_AUE_linux_stime AUE_SETTIMEOFDAY +#define LINUX32_SYS_AUE_linux_ptrace AUE_PTRACE +#define LINUX32_SYS_AUE_linux_alarm AUE_NULL +#define LINUX32_SYS_AUE_linux_pause AUE_NULL +#define LINUX32_SYS_AUE_linux_utime AUE_UTIME +#define LINUX32_SYS_AUE_linux_access AUE_ACCESS +#define LINUX32_SYS_AUE_linux_nice AUE_NICE +#define LINUX32_SYS_AUE_linux_kill AUE_KILL +#define LINUX32_SYS_AUE_linux_rename AUE_RENAME +#define LINUX32_SYS_AUE_linux_mkdir AUE_MKDIR +#define LINUX32_SYS_AUE_linux_rmdir AUE_RMDIR +#define LINUX32_SYS_AUE_linux_pipe AUE_PIPE +#define LINUX32_SYS_AUE_linux_times AUE_NULL +#define LINUX32_SYS_AUE_linux_brk AUE_NULL +#define LINUX32_SYS_AUE_linux_setgid16 AUE_SETGID +#define LINUX32_SYS_AUE_linux_getgid16 AUE_GETGID +#define LINUX32_SYS_AUE_linux_signal AUE_NULL +#define LINUX32_SYS_AUE_linux_geteuid16 AUE_GETEUID +#define LINUX32_SYS_AUE_linux_getegid16 AUE_GETEGID +#define LINUX32_SYS_AUE_linux_umount AUE_UMOUNT +#define LINUX32_SYS_AUE_linux_ioctl AUE_IOCTL +#define LINUX32_SYS_AUE_linux_fcntl AUE_FCNTL +#define LINUX32_SYS_AUE_linux_olduname AUE_NULL +#define LINUX32_SYS_AUE_linux_ustat AUE_NULL +#define LINUX32_SYS_AUE_linux_getppid AUE_GETPPID +#define LINUX32_SYS_AUE_linux_sigaction AUE_NULL +#define LINUX32_SYS_AUE_linux_sgetmask AUE_NULL +#define LINUX32_SYS_AUE_linux_ssetmask AUE_NULL +#define LINUX32_SYS_AUE_linux_setreuid16 AUE_SETREUID +#define LINUX32_SYS_AUE_linux_setregid16 AUE_SETREGID +#define LINUX32_SYS_AUE_linux_sigsuspend AUE_NULL +#define LINUX32_SYS_AUE_linux_sigpending AUE_NULL +#define LINUX32_SYS_AUE_linux_sethostname AUE_SYSCTL +#define LINUX32_SYS_AUE_linux_setrlimit AUE_SETRLIMIT +#define LINUX32_SYS_AUE_linux_old_getrlimit AUE_GETRLIMIT +#define LINUX32_SYS_AUE_linux_getrusage AUE_GETRUSAGE +#define LINUX32_SYS_AUE_linux_gettimeofday AUE_NULL +#define LINUX32_SYS_AUE_linux_settimeofday AUE_SETTIMEOFDAY +#define LINUX32_SYS_AUE_linux_getgroups16 AUE_GETGROUPS +#define LINUX32_SYS_AUE_linux_setgroups16 AUE_SETGROUPS +#define LINUX32_SYS_AUE_linux_old_select AUE_SELECT +#define LINUX32_SYS_AUE_linux_symlink AUE_SYMLINK +#define LINUX32_SYS_AUE_linux_lstat AUE_LSTAT +#define LINUX32_SYS_AUE_linux_readlink AUE_READLINK +#define LINUX32_SYS_AUE_linux_reboot AUE_REBOOT +#define LINUX32_SYS_AUE_linux_readdir AUE_GETDIRENTRIES +#define LINUX32_SYS_AUE_linux_mmap AUE_MMAP +#define LINUX32_SYS_AUE_linux_truncate AUE_TRUNCATE +#define LINUX32_SYS_AUE_linux_ftruncate AUE_FTRUNCATE +#define LINUX32_SYS_AUE_linux_getpriority AUE_GETPRIORITY +#define LINUX32_SYS_AUE_linux_statfs AUE_STATFS +#define LINUX32_SYS_AUE_linux_fstatfs AUE_FSTATFS +#define LINUX32_SYS_AUE_linux_socketcall AUE_NULL +#define LINUX32_SYS_AUE_linux_syslog AUE_NULL +#define LINUX32_SYS_AUE_linux_setitimer AUE_SETITIMER +#define LINUX32_SYS_AUE_linux_getitimer AUE_GETITIMER +#define LINUX32_SYS_AUE_linux_newstat AUE_STAT +#define LINUX32_SYS_AUE_linux_newlstat AUE_LSTAT +#define LINUX32_SYS_AUE_linux_newfstat AUE_FSTAT +#define LINUX32_SYS_AUE_linux_uname AUE_NULL +#define LINUX32_SYS_AUE_linux_iopl AUE_NULL +#define LINUX32_SYS_AUE_linux_vhangup AUE_NULL +#define LINUX32_SYS_AUE_linux_wait4 AUE_WAIT4 +#define LINUX32_SYS_AUE_linux_swapoff AUE_SWAPOFF +#define LINUX32_SYS_AUE_linux_sysinfo AUE_NULL +#define LINUX32_SYS_AUE_linux_ipc AUE_NULL +#define LINUX32_SYS_AUE_linux_sigreturn AUE_SIGRETURN +#define LINUX32_SYS_AUE_linux_clone AUE_RFORK +#define LINUX32_SYS_AUE_linux_setdomainname AUE_SYSCTL +#define LINUX32_SYS_AUE_linux_newuname AUE_NULL +#define LINUX32_SYS_AUE_linux_adjtimex AUE_ADJTIME +#define LINUX32_SYS_AUE_linux_mprotect AUE_MPROTECT +#define LINUX32_SYS_AUE_linux_sigprocmask AUE_SIGPROCMASK +#define LINUX32_SYS_AUE_linux_create_module AUE_NULL +#define LINUX32_SYS_AUE_linux_init_module AUE_NULL +#define LINUX32_SYS_AUE_linux_delete_module AUE_NULL +#define LINUX32_SYS_AUE_linux_get_kernel_syms AUE_NULL +#define LINUX32_SYS_AUE_linux_quotactl AUE_QUOTACTL +#define LINUX32_SYS_AUE_linux_bdflush AUE_BDFLUSH +#define LINUX32_SYS_AUE_linux_sysfs AUE_NULL +#define LINUX32_SYS_AUE_linux_personality AUE_PERSONALITY +#define LINUX32_SYS_AUE_linux_setfsuid16 AUE_SETFSUID +#define LINUX32_SYS_AUE_linux_setfsgid16 AUE_SETFSGID +#define LINUX32_SYS_AUE_linux_llseek AUE_LSEEK +#define LINUX32_SYS_AUE_linux_getdents AUE_GETDIRENTRIES +#define LINUX32_SYS_AUE_linux_select AUE_SELECT +#define LINUX32_SYS_AUE_linux_msync AUE_MSYNC +#define LINUX32_SYS_AUE_linux_readv AUE_READV +#define LINUX32_SYS_AUE_linux_writev AUE_WRITEV +#define LINUX32_SYS_AUE_linux_getsid AUE_GETSID +#define LINUX32_SYS_AUE_linux_fdatasync AUE_NULL +#define LINUX32_SYS_AUE_linux_sysctl AUE_SYSCTL +#define LINUX32_SYS_AUE_linux_sched_setparam AUE_SCHED_SETPARAM +#define LINUX32_SYS_AUE_linux_sched_getparam AUE_SCHED_GETPARAM +#define LINUX32_SYS_AUE_linux_sched_setscheduler AUE_SCHED_SETSCHEDULER +#define LINUX32_SYS_AUE_linux_sched_getscheduler AUE_SCHED_GETSCHEDULER +#define LINUX32_SYS_AUE_linux_sched_get_priority_max AUE_SCHED_GET_PRIORITY_MAX +#define LINUX32_SYS_AUE_linux_sched_get_priority_min AUE_SCHED_GET_PRIORITY_MIN +#define LINUX32_SYS_AUE_linux_sched_rr_get_interval AUE_SCHED_RR_GET_INTERVAL +#define LINUX32_SYS_AUE_linux_nanosleep AUE_NULL +#define LINUX32_SYS_AUE_linux_mremap AUE_NULL +#define LINUX32_SYS_AUE_linux_setresuid16 AUE_SETRESUID +#define LINUX32_SYS_AUE_linux_getresuid16 AUE_GETRESUID +#define LINUX32_SYS_AUE_linux_query_module AUE_NULL +#define LINUX32_SYS_AUE_linux_nfsservctl AUE_NULL +#define LINUX32_SYS_AUE_linux_setresgid16 AUE_SETRESGID +#define LINUX32_SYS_AUE_linux_getresgid16 AUE_GETRESGID +#define LINUX32_SYS_AUE_linux_prctl AUE_PRCTL +#define LINUX32_SYS_AUE_linux_rt_sigreturn AUE_NULL +#define LINUX32_SYS_AUE_linux_rt_sigaction AUE_NULL +#define LINUX32_SYS_AUE_linux_rt_sigprocmask AUE_NULL +#define LINUX32_SYS_AUE_linux_rt_sigpending AUE_NULL +#define LINUX32_SYS_AUE_linux_rt_sigtimedwait AUE_NULL +#define LINUX32_SYS_AUE_linux_rt_sigqueueinfo AUE_NULL +#define LINUX32_SYS_AUE_linux_rt_sigsuspend AUE_NULL +#define LINUX32_SYS_AUE_linux_pread AUE_PREAD +#define LINUX32_SYS_AUE_linux_pwrite AUE_PWRITE +#define LINUX32_SYS_AUE_linux_chown16 AUE_CHOWN +#define LINUX32_SYS_AUE_linux_getcwd AUE_GETCWD +#define LINUX32_SYS_AUE_linux_capget AUE_CAPGET +#define LINUX32_SYS_AUE_linux_capset AUE_CAPSET +#define LINUX32_SYS_AUE_linux_sigaltstack AUE_NULL +#define LINUX32_SYS_AUE_linux_sendfile AUE_SENDFILE +#define LINUX32_SYS_AUE_linux_vfork AUE_VFORK +#define LINUX32_SYS_AUE_linux_getrlimit AUE_GETRLIMIT +#define LINUX32_SYS_AUE_linux_mmap2 AUE_MMAP +#define LINUX32_SYS_AUE_linux_truncate64 AUE_TRUNCATE +#define LINUX32_SYS_AUE_linux_ftruncate64 AUE_FTRUNCATE +#define LINUX32_SYS_AUE_linux_stat64 AUE_STAT +#define LINUX32_SYS_AUE_linux_lstat64 AUE_LSTAT +#define LINUX32_SYS_AUE_linux_fstat64 AUE_FSTAT +#define LINUX32_SYS_AUE_linux_lchown AUE_LCHOWN +#define LINUX32_SYS_AUE_linux_getuid AUE_GETUID +#define LINUX32_SYS_AUE_linux_getgid AUE_GETGID +#define LINUX32_SYS_AUE_linux_getgroups AUE_GETGROUPS +#define LINUX32_SYS_AUE_linux_setgroups AUE_SETGROUPS +#define LINUX32_SYS_AUE_linux_chown AUE_CHOWN +#define LINUX32_SYS_AUE_linux_setfsuid AUE_SETFSUID +#define LINUX32_SYS_AUE_linux_setfsgid AUE_SETFSGID +#define LINUX32_SYS_AUE_linux_pivot_root AUE_PIVOT_ROOT +#define LINUX32_SYS_AUE_linux_mincore AUE_MINCORE +#define LINUX32_SYS_AUE_linux_getdents64 AUE_GETDIRENTRIES +#define LINUX32_SYS_AUE_linux_fcntl64 AUE_FCNTL +#define LINUX32_SYS_AUE_linux_gettid AUE_NULL +#define LINUX32_SYS_AUE_linux_setxattr AUE_NULL +#define LINUX32_SYS_AUE_linux_lsetxattr AUE_NULL +#define LINUX32_SYS_AUE_linux_fsetxattr AUE_NULL +#define LINUX32_SYS_AUE_linux_getxattr AUE_NULL +#define LINUX32_SYS_AUE_linux_lgetxattr AUE_NULL +#define LINUX32_SYS_AUE_linux_fgetxattr AUE_NULL +#define LINUX32_SYS_AUE_linux_listxattr AUE_NULL +#define LINUX32_SYS_AUE_linux_llistxattr AUE_NULL +#define LINUX32_SYS_AUE_linux_flistxattr AUE_NULL +#define LINUX32_SYS_AUE_linux_removexattr AUE_NULL +#define LINUX32_SYS_AUE_linux_lremovexattr AUE_NULL +#define LINUX32_SYS_AUE_linux_fremovexattr AUE_NULL +#define LINUX32_SYS_AUE_linux_tkill AUE_NULL +#define LINUX32_SYS_AUE_linux_sys_futex AUE_NULL +#define LINUX32_SYS_AUE_linux_sched_setaffinity AUE_NULL +#define LINUX32_SYS_AUE_linux_sched_getaffinity AUE_NULL +#define LINUX32_SYS_AUE_linux_set_thread_area AUE_NULL +#define LINUX32_SYS_AUE_linux_fadvise64 AUE_NULL +#define LINUX32_SYS_AUE_linux_exit_group AUE_EXIT +#define LINUX32_SYS_AUE_linux_lookup_dcookie AUE_NULL +#define LINUX32_SYS_AUE_linux_epoll_create AUE_NULL +#define LINUX32_SYS_AUE_linux_epoll_ctl AUE_NULL +#define LINUX32_SYS_AUE_linux_epoll_wait AUE_NULL +#define LINUX32_SYS_AUE_linux_remap_file_pages AUE_NULL +#define LINUX32_SYS_AUE_linux_set_tid_address AUE_NULL +#define LINUX32_SYS_AUE_linux_timer_create AUE_NULL +#define LINUX32_SYS_AUE_linux_timer_settime AUE_NULL +#define LINUX32_SYS_AUE_linux_timer_gettime AUE_NULL +#define LINUX32_SYS_AUE_linux_timer_getoverrun AUE_NULL +#define LINUX32_SYS_AUE_linux_timer_delete AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_settime AUE_CLOCK_SETTIME +#define LINUX32_SYS_AUE_linux_clock_gettime AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_getres AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_nanosleep AUE_NULL +#define LINUX32_SYS_AUE_linux_statfs64 AUE_STATFS +#define LINUX32_SYS_AUE_linux_fstatfs64 AUE_FSTATFS +#define LINUX32_SYS_AUE_linux_tgkill AUE_NULL +#define LINUX32_SYS_AUE_linux_utimes AUE_UTIMES +#define LINUX32_SYS_AUE_linux_fadvise64_64 AUE_NULL +#define LINUX32_SYS_AUE_linux_mbind AUE_NULL +#define LINUX32_SYS_AUE_linux_get_mempolicy AUE_NULL +#define LINUX32_SYS_AUE_linux_set_mempolicy AUE_NULL +#define LINUX32_SYS_AUE_linux_mq_open AUE_NULL +#define LINUX32_SYS_AUE_linux_mq_unlink AUE_NULL +#define LINUX32_SYS_AUE_linux_mq_timedsend AUE_NULL +#define LINUX32_SYS_AUE_linux_mq_timedreceive AUE_NULL +#define LINUX32_SYS_AUE_linux_mq_notify AUE_NULL +#define LINUX32_SYS_AUE_linux_mq_getsetattr AUE_NULL +#define LINUX32_SYS_AUE_linux_kexec_load AUE_NULL +#define LINUX32_SYS_AUE_linux_waitid AUE_WAIT6 +#define LINUX32_SYS_AUE_linux_add_key AUE_NULL +#define LINUX32_SYS_AUE_linux_request_key AUE_NULL +#define LINUX32_SYS_AUE_linux_keyctl AUE_NULL +#define LINUX32_SYS_AUE_linux_ioprio_set AUE_NULL +#define LINUX32_SYS_AUE_linux_ioprio_get AUE_NULL +#define LINUX32_SYS_AUE_linux_inotify_init AUE_NULL +#define LINUX32_SYS_AUE_linux_inotify_add_watch AUE_NULL +#define LINUX32_SYS_AUE_linux_inotify_rm_watch AUE_NULL +#define LINUX32_SYS_AUE_linux_migrate_pages AUE_NULL +#define LINUX32_SYS_AUE_linux_openat AUE_OPEN_RWTC +#define LINUX32_SYS_AUE_linux_mkdirat AUE_MKDIRAT +#define LINUX32_SYS_AUE_linux_mknodat AUE_MKNODAT +#define LINUX32_SYS_AUE_linux_fchownat AUE_FCHOWNAT +#define LINUX32_SYS_AUE_linux_futimesat AUE_FUTIMESAT +#define LINUX32_SYS_AUE_linux_fstatat64 AUE_FSTATAT +#define LINUX32_SYS_AUE_linux_unlinkat AUE_UNLINKAT +#define LINUX32_SYS_AUE_linux_renameat AUE_RENAMEAT +#define LINUX32_SYS_AUE_linux_linkat AUE_LINKAT +#define LINUX32_SYS_AUE_linux_symlinkat AUE_SYMLINKAT +#define LINUX32_SYS_AUE_linux_readlinkat AUE_READLINKAT +#define LINUX32_SYS_AUE_linux_fchmodat AUE_FCHMODAT +#define LINUX32_SYS_AUE_linux_faccessat AUE_FACCESSAT +#define LINUX32_SYS_AUE_linux_pselect6 AUE_SELECT +#define LINUX32_SYS_AUE_linux_ppoll AUE_POLL +#define LINUX32_SYS_AUE_linux_unshare AUE_NULL +#define LINUX32_SYS_AUE_linux_set_robust_list AUE_NULL +#define LINUX32_SYS_AUE_linux_get_robust_list AUE_NULL +#define LINUX32_SYS_AUE_linux_splice AUE_NULL +#define LINUX32_SYS_AUE_linux_sync_file_range AUE_NULL +#define LINUX32_SYS_AUE_linux_tee AUE_NULL +#define LINUX32_SYS_AUE_linux_vmsplice AUE_NULL +#define LINUX32_SYS_AUE_linux_move_pages AUE_NULL +#define LINUX32_SYS_AUE_linux_getcpu AUE_NULL +#define LINUX32_SYS_AUE_linux_epoll_pwait AUE_NULL +#define LINUX32_SYS_AUE_linux_utimensat AUE_FUTIMESAT +#define LINUX32_SYS_AUE_linux_signalfd AUE_NULL +#define LINUX32_SYS_AUE_linux_timerfd_create AUE_NULL +#define LINUX32_SYS_AUE_linux_eventfd AUE_NULL +#define LINUX32_SYS_AUE_linux_fallocate AUE_NULL +#define LINUX32_SYS_AUE_linux_timerfd_settime AUE_NULL +#define LINUX32_SYS_AUE_linux_timerfd_gettime AUE_NULL +#define LINUX32_SYS_AUE_linux_signalfd4 AUE_NULL +#define LINUX32_SYS_AUE_linux_eventfd2 AUE_NULL +#define LINUX32_SYS_AUE_linux_epoll_create1 AUE_NULL +#define LINUX32_SYS_AUE_linux_dup3 AUE_NULL +#define LINUX32_SYS_AUE_linux_pipe2 AUE_NULL +#define LINUX32_SYS_AUE_linux_inotify_init1 AUE_NULL +#define LINUX32_SYS_AUE_linux_preadv AUE_NULL +#define LINUX32_SYS_AUE_linux_pwritev AUE_NULL +#define LINUX32_SYS_AUE_linux_rt_tsigqueueinfo AUE_NULL +#define LINUX32_SYS_AUE_linux_perf_event_open AUE_NULL +#define LINUX32_SYS_AUE_linux_recvmmsg AUE_NULL +#define LINUX32_SYS_AUE_linux_fanotify_init AUE_NULL +#define LINUX32_SYS_AUE_linux_fanotify_mark AUE_NULL +#define LINUX32_SYS_AUE_linux_prlimit64 AUE_NULL +#define LINUX32_SYS_AUE_linux_name_to_handle_at AUE_NULL +#define LINUX32_SYS_AUE_linux_open_by_handle_at AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_adjtime AUE_NULL +#define LINUX32_SYS_AUE_linux_syncfs AUE_SYNC +#define LINUX32_SYS_AUE_linux_sendmmsg AUE_NULL +#define LINUX32_SYS_AUE_linux_setns AUE_NULL +#define LINUX32_SYS_AUE_linux_process_vm_readv AUE_NULL +#define LINUX32_SYS_AUE_linux_process_vm_writev AUE_NULL #undef PAD_ #undef PADL_ #undef PADR_ -#endif /* !_LINUX_SYSPROTO_H_ */ +#endif /* !_LINUX32_SYSPROTO_H_ */ Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Wed Jan 20 01:09:53 2016 (r294368) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Wed Jan 20 01:11:01 2016 (r294369) @@ -3,322 +3,322 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293592 2016-01-09 17:54:37Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 294368 2016-01-20 01:09:53Z jhb */ -#define LINUX_SYS_linux_exit 1 -#define LINUX_SYS_linux_fork 2 -#define LINUX_SYS_read 3 -#define LINUX_SYS_write 4 -#define LINUX_SYS_linux_open 5 -#define LINUX_SYS_close 6 -#define LINUX_SYS_linux_waitpid 7 -#define LINUX_SYS_linux_creat 8 -#define LINUX_SYS_linux_link 9 -#define LINUX_SYS_linux_unlink 10 -#define LINUX_SYS_linux_execve 11 -#define LINUX_SYS_linux_chdir 12 -#define LINUX_SYS_linux_time 13 -#define LINUX_SYS_linux_mknod 14 -#define LINUX_SYS_linux_chmod 15 -#define LINUX_SYS_linux_lchown16 16 -#define LINUX_SYS_linux_stat 18 -#define LINUX_SYS_linux_lseek 19 -#define LINUX_SYS_linux_getpid 20 -#define LINUX_SYS_linux_mount 21 -#define LINUX_SYS_linux_oldumount 22 -#define LINUX_SYS_linux_setuid16 23 -#define LINUX_SYS_linux_getuid16 24 -#define LINUX_SYS_linux_stime 25 -#define LINUX_SYS_linux_ptrace 26 -#define LINUX_SYS_linux_alarm 27 -#define LINUX_SYS_linux_pause 29 -#define LINUX_SYS_linux_utime 30 -#define LINUX_SYS_linux_access 33 -#define LINUX_SYS_linux_nice 34 -#define LINUX_SYS_sync 36 -#define LINUX_SYS_linux_kill 37 -#define LINUX_SYS_linux_rename 38 -#define LINUX_SYS_linux_mkdir 39 -#define LINUX_SYS_linux_rmdir 40 -#define LINUX_SYS_dup 41 -#define LINUX_SYS_linux_pipe 42 -#define LINUX_SYS_linux_times 43 -#define LINUX_SYS_linux_brk 45 -#define LINUX_SYS_linux_setgid16 46 -#define LINUX_SYS_linux_getgid16 47 -#define LINUX_SYS_linux_signal 48 -#define LINUX_SYS_linux_geteuid16 49 -#define LINUX_SYS_linux_getegid16 50 -#define LINUX_SYS_acct 51 -#define LINUX_SYS_linux_umount 52 -#define LINUX_SYS_linux_ioctl 54 -#define LINUX_SYS_linux_fcntl 55 -#define LINUX_SYS_setpgid 57 -#define LINUX_SYS_linux_olduname 59 -#define LINUX_SYS_umask 60 -#define LINUX_SYS_chroot 61 -#define LINUX_SYS_linux_ustat 62 -#define LINUX_SYS_dup2 63 -#define LINUX_SYS_linux_getppid 64 -#define LINUX_SYS_getpgrp 65 -#define LINUX_SYS_setsid 66 -#define LINUX_SYS_linux_sigaction 67 -#define LINUX_SYS_linux_sgetmask 68 -#define LINUX_SYS_linux_ssetmask 69 -#define LINUX_SYS_linux_setreuid16 70 -#define LINUX_SYS_linux_setregid16 71 -#define LINUX_SYS_linux_sigsuspend 72 -#define LINUX_SYS_linux_sigpending 73 -#define LINUX_SYS_linux_sethostname 74 -#define LINUX_SYS_linux_setrlimit 75 -#define LINUX_SYS_linux_old_getrlimit 76 -#define LINUX_SYS_linux_getrusage 77 -#define LINUX_SYS_linux_gettimeofday 78 -#define LINUX_SYS_linux_settimeofday 79 -#define LINUX_SYS_linux_getgroups16 80 -#define LINUX_SYS_linux_setgroups16 81 -#define LINUX_SYS_linux_old_select 82 -#define LINUX_SYS_linux_symlink 83 -#define LINUX_SYS_linux_lstat 84 -#define LINUX_SYS_linux_readlink 85 -#define LINUX_SYS_swapon 87 -#define LINUX_SYS_linux_reboot 88 -#define LINUX_SYS_linux_readdir 89 -#define LINUX_SYS_linux_mmap 90 -#define LINUX_SYS_munmap 91 -#define LINUX_SYS_linux_truncate 92 -#define LINUX_SYS_linux_ftruncate 93 -#define LINUX_SYS_fchmod 94 -#define LINUX_SYS_fchown 95 -#define LINUX_SYS_linux_getpriority 96 -#define LINUX_SYS_setpriority 97 -#define LINUX_SYS_linux_statfs 99 -#define LINUX_SYS_linux_fstatfs 100 -#define LINUX_SYS_linux_socketcall 102 -#define LINUX_SYS_linux_syslog 103 -#define LINUX_SYS_linux_setitimer 104 -#define LINUX_SYS_linux_getitimer 105 -#define LINUX_SYS_linux_newstat 106 -#define LINUX_SYS_linux_newlstat 107 -#define LINUX_SYS_linux_newfstat 108 -#define LINUX_SYS_linux_uname 109 -#define LINUX_SYS_linux_iopl 110 -#define LINUX_SYS_linux_vhangup 111 -#define LINUX_SYS_linux_wait4 114 -#define LINUX_SYS_linux_swapoff 115 -#define LINUX_SYS_linux_sysinfo 116 -#define LINUX_SYS_linux_ipc 117 -#define LINUX_SYS_fsync 118 -#define LINUX_SYS_linux_sigreturn 119 -#define LINUX_SYS_linux_clone 120 -#define LINUX_SYS_linux_setdomainname 121 -#define LINUX_SYS_linux_newuname 122 -#define LINUX_SYS_linux_adjtimex 124 -#define LINUX_SYS_linux_mprotect 125 -#define LINUX_SYS_linux_sigprocmask 126 -#define LINUX_SYS_linux_create_module 127 -#define LINUX_SYS_linux_init_module 128 -#define LINUX_SYS_linux_delete_module 129 -#define LINUX_SYS_linux_get_kernel_syms 130 -#define LINUX_SYS_linux_quotactl 131 -#define LINUX_SYS_getpgid 132 -#define LINUX_SYS_fchdir 133 -#define LINUX_SYS_linux_bdflush 134 -#define LINUX_SYS_linux_sysfs 135 -#define LINUX_SYS_linux_personality 136 -#define LINUX_SYS_linux_setfsuid16 138 -#define LINUX_SYS_linux_setfsgid16 139 -#define LINUX_SYS_linux_llseek 140 -#define LINUX_SYS_linux_getdents 141 -#define LINUX_SYS_linux_select 142 -#define LINUX_SYS_flock 143 -#define LINUX_SYS_linux_msync 144 -#define LINUX_SYS_linux_readv 145 -#define LINUX_SYS_linux_writev 146 -#define LINUX_SYS_linux_getsid 147 -#define LINUX_SYS_linux_fdatasync 148 -#define LINUX_SYS_linux_sysctl 149 -#define LINUX_SYS_mlock 150 -#define LINUX_SYS_munlock 151 -#define LINUX_SYS_mlockall 152 -#define LINUX_SYS_munlockall 153 -#define LINUX_SYS_linux_sched_setparam 154 -#define LINUX_SYS_linux_sched_getparam 155 -#define LINUX_SYS_linux_sched_setscheduler 156 -#define LINUX_SYS_linux_sched_getscheduler 157 -#define LINUX_SYS_sched_yield 158 -#define LINUX_SYS_linux_sched_get_priority_max 159 -#define LINUX_SYS_linux_sched_get_priority_min 160 -#define LINUX_SYS_linux_sched_rr_get_interval 161 -#define LINUX_SYS_linux_nanosleep 162 -#define LINUX_SYS_linux_mremap 163 -#define LINUX_SYS_linux_setresuid16 164 -#define LINUX_SYS_linux_getresuid16 165 -#define LINUX_SYS_linux_query_module 167 -#define LINUX_SYS_poll 168 -#define LINUX_SYS_linux_nfsservctl 169 -#define LINUX_SYS_linux_setresgid16 170 -#define LINUX_SYS_linux_getresgid16 171 -#define LINUX_SYS_linux_prctl 172 -#define LINUX_SYS_linux_rt_sigreturn 173 -#define LINUX_SYS_linux_rt_sigaction 174 -#define LINUX_SYS_linux_rt_sigprocmask 175 -#define LINUX_SYS_linux_rt_sigpending 176 -#define LINUX_SYS_linux_rt_sigtimedwait 177 -#define LINUX_SYS_linux_rt_sigqueueinfo 178 -#define LINUX_SYS_linux_rt_sigsuspend 179 -#define LINUX_SYS_linux_pread 180 -#define LINUX_SYS_linux_pwrite 181 -#define LINUX_SYS_linux_chown16 182 -#define LINUX_SYS_linux_getcwd 183 -#define LINUX_SYS_linux_capget 184 -#define LINUX_SYS_linux_capset 185 -#define LINUX_SYS_linux_sigaltstack 186 -#define LINUX_SYS_linux_sendfile 187 -#define LINUX_SYS_linux_vfork 190 -#define LINUX_SYS_linux_getrlimit 191 -#define LINUX_SYS_linux_mmap2 192 -#define LINUX_SYS_linux_truncate64 193 -#define LINUX_SYS_linux_ftruncate64 194 -#define LINUX_SYS_linux_stat64 195 -#define LINUX_SYS_linux_lstat64 196 -#define LINUX_SYS_linux_fstat64 197 -#define LINUX_SYS_linux_lchown 198 -#define LINUX_SYS_linux_getuid 199 -#define LINUX_SYS_linux_getgid 200 -#define LINUX_SYS_geteuid 201 -#define LINUX_SYS_getegid 202 -#define LINUX_SYS_setreuid 203 -#define LINUX_SYS_setregid 204 -#define LINUX_SYS_linux_getgroups 205 -#define LINUX_SYS_linux_setgroups 206 -#define LINUX_SYS_setresuid 208 -#define LINUX_SYS_getresuid 209 -#define LINUX_SYS_setresgid 210 -#define LINUX_SYS_getresgid 211 -#define LINUX_SYS_linux_chown 212 -#define LINUX_SYS_setuid 213 -#define LINUX_SYS_setgid 214 -#define LINUX_SYS_linux_setfsuid 215 -#define LINUX_SYS_linux_setfsgid 216 -#define LINUX_SYS_linux_pivot_root 217 -#define LINUX_SYS_linux_mincore 218 -#define LINUX_SYS_madvise 219 -#define LINUX_SYS_linux_getdents64 220 -#define LINUX_SYS_linux_fcntl64 221 -#define LINUX_SYS_linux_gettid 224 -#define LINUX_SYS_linux_setxattr 226 -#define LINUX_SYS_linux_lsetxattr 227 -#define LINUX_SYS_linux_fsetxattr 228 -#define LINUX_SYS_linux_getxattr 229 -#define LINUX_SYS_linux_lgetxattr 230 -#define LINUX_SYS_linux_fgetxattr 231 -#define LINUX_SYS_linux_listxattr 232 -#define LINUX_SYS_linux_llistxattr 233 -#define LINUX_SYS_linux_flistxattr 234 -#define LINUX_SYS_linux_removexattr 235 -#define LINUX_SYS_linux_lremovexattr 236 -#define LINUX_SYS_linux_fremovexattr 237 -#define LINUX_SYS_linux_tkill 238 -#define LINUX_SYS_linux_sys_futex 240 -#define LINUX_SYS_linux_sched_setaffinity 241 -#define LINUX_SYS_linux_sched_getaffinity 242 -#define LINUX_SYS_linux_set_thread_area 243 -#define LINUX_SYS_linux_fadvise64 250 -#define LINUX_SYS_linux_exit_group 252 -#define LINUX_SYS_linux_lookup_dcookie 253 -#define LINUX_SYS_linux_epoll_create 254 -#define LINUX_SYS_linux_epoll_ctl 255 -#define LINUX_SYS_linux_epoll_wait 256 -#define LINUX_SYS_linux_remap_file_pages 257 -#define LINUX_SYS_linux_set_tid_address 258 -#define LINUX_SYS_linux_timer_create 259 -#define LINUX_SYS_linux_timer_settime 260 -#define LINUX_SYS_linux_timer_gettime 261 -#define LINUX_SYS_linux_timer_getoverrun 262 -#define LINUX_SYS_linux_timer_delete 263 -#define LINUX_SYS_linux_clock_settime 264 -#define LINUX_SYS_linux_clock_gettime 265 -#define LINUX_SYS_linux_clock_getres 266 -#define LINUX_SYS_linux_clock_nanosleep 267 -#define LINUX_SYS_linux_statfs64 268 -#define LINUX_SYS_linux_fstatfs64 269 -#define LINUX_SYS_linux_tgkill 270 -#define LINUX_SYS_linux_utimes 271 -#define LINUX_SYS_linux_fadvise64_64 272 -#define LINUX_SYS_linux_mbind 274 -#define LINUX_SYS_linux_get_mempolicy 275 -#define LINUX_SYS_linux_set_mempolicy 276 -#define LINUX_SYS_linux_mq_open 277 -#define LINUX_SYS_linux_mq_unlink 278 -#define LINUX_SYS_linux_mq_timedsend 279 -#define LINUX_SYS_linux_mq_timedreceive 280 -#define LINUX_SYS_linux_mq_notify 281 -#define LINUX_SYS_linux_mq_getsetattr 282 -#define LINUX_SYS_linux_kexec_load 283 -#define LINUX_SYS_linux_waitid 284 -#define LINUX_SYS_linux_add_key 286 -#define LINUX_SYS_linux_request_key 287 -#define LINUX_SYS_linux_keyctl 288 -#define LINUX_SYS_linux_ioprio_set 289 -#define LINUX_SYS_linux_ioprio_get 290 -#define LINUX_SYS_linux_inotify_init 291 -#define LINUX_SYS_linux_inotify_add_watch 292 -#define LINUX_SYS_linux_inotify_rm_watch 293 -#define LINUX_SYS_linux_migrate_pages 294 -#define LINUX_SYS_linux_openat 295 -#define LINUX_SYS_linux_mkdirat 296 -#define LINUX_SYS_linux_mknodat 297 -#define LINUX_SYS_linux_fchownat 298 -#define LINUX_SYS_linux_futimesat 299 -#define LINUX_SYS_linux_fstatat64 300 -#define LINUX_SYS_linux_unlinkat 301 -#define LINUX_SYS_linux_renameat 302 -#define LINUX_SYS_linux_linkat 303 -#define LINUX_SYS_linux_symlinkat 304 -#define LINUX_SYS_linux_readlinkat 305 -#define LINUX_SYS_linux_fchmodat 306 -#define LINUX_SYS_linux_faccessat 307 -#define LINUX_SYS_linux_pselect6 308 -#define LINUX_SYS_linux_ppoll 309 -#define LINUX_SYS_linux_unshare 310 -#define LINUX_SYS_linux_set_robust_list 311 -#define LINUX_SYS_linux_get_robust_list 312 -#define LINUX_SYS_linux_splice 313 -#define LINUX_SYS_linux_sync_file_range 314 -#define LINUX_SYS_linux_tee 315 -#define LINUX_SYS_linux_vmsplice 316 -#define LINUX_SYS_linux_move_pages 317 -#define LINUX_SYS_linux_getcpu 318 -#define LINUX_SYS_linux_epoll_pwait 319 -#define LINUX_SYS_linux_utimensat 320 -#define LINUX_SYS_linux_signalfd 321 -#define LINUX_SYS_linux_timerfd_create 322 -#define LINUX_SYS_linux_eventfd 323 -#define LINUX_SYS_linux_fallocate 324 -#define LINUX_SYS_linux_timerfd_settime 325 -#define LINUX_SYS_linux_timerfd_gettime 326 -#define LINUX_SYS_linux_signalfd4 327 -#define LINUX_SYS_linux_eventfd2 328 -#define LINUX_SYS_linux_epoll_create1 329 -#define LINUX_SYS_linux_dup3 330 -#define LINUX_SYS_linux_pipe2 331 -#define LINUX_SYS_linux_inotify_init1 332 -#define LINUX_SYS_linux_preadv 333 -#define LINUX_SYS_linux_pwritev 334 -#define LINUX_SYS_linux_rt_tsigqueueinfo 335 -#define LINUX_SYS_linux_perf_event_open 336 -#define LINUX_SYS_linux_recvmmsg 337 -#define LINUX_SYS_linux_fanotify_init 338 -#define LINUX_SYS_linux_fanotify_mark 339 -#define LINUX_SYS_linux_prlimit64 340 -#define LINUX_SYS_linux_name_to_handle_at 341 -#define LINUX_SYS_linux_open_by_handle_at 342 -#define LINUX_SYS_linux_clock_adjtime 343 -#define LINUX_SYS_linux_syncfs 344 -#define LINUX_SYS_linux_sendmmsg 345 -#define LINUX_SYS_linux_setns 346 -#define LINUX_SYS_linux_process_vm_readv 347 -#define LINUX_SYS_linux_process_vm_writev 348 -#define LINUX_SYS_MAXSYSCALL 350 +#define LINUX32_SYS_linux_exit 1 +#define LINUX32_SYS_linux_fork 2 +#define LINUX32_SYS_read 3 +#define LINUX32_SYS_write 4 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Wed Jan 20 07:33:47 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EC6BA89610; Wed, 20 Jan 2016 07:33:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01C301893; Wed, 20 Jan 2016 07:33:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K7XjUB021031; Wed, 20 Jan 2016 07:33:45 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K7XjDT021030; Wed, 20 Jan 2016 07:33:45 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601200733.u0K7XjDT021030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 20 Jan 2016 07:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294376 - stable/9/contrib/bind9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 07:33:47 -0000 Author: delphij Date: Wed Jan 20 07:33:45 2016 New Revision: 294376 URL: https://svnweb.freebsd.org/changeset/base/294376 Log: Mergeinfo fixup. Modified: Directory Properties: stable/9/contrib/bind9/ (props changed) From owner-svn-src-stable@freebsd.org Wed Jan 20 07:42:33 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9543A899FB; Wed, 20 Jan 2016 07:42:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3A3C1D54; Wed, 20 Jan 2016 07:42:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K7gVS2023955; Wed, 20 Jan 2016 07:42:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K7gVJQ023948; Wed, 20 Jan 2016 07:42:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200742.u0K7gVJQ023948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 07:42: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: r294377 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 07:42:33 -0000 Author: arybchik Date: Wed Jan 20 07:42:31 2016 New Revision: 294377 URL: https://svnweb.freebsd.org/changeset/base/294377 Log: MFC r293887 sfxge: add Medford NIC methods Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/ef10_impl.h stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/efx_nic.c stable/10/sys/dev/sfxge/common/hunt_impl.h stable/10/sys/dev/sfxge/common/hunt_nic.c stable/10/sys/dev/sfxge/common/medford_impl.h stable/10/sys/dev/sfxge/common/medford_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_impl.h Wed Jan 20 07:33:45 2016 (r294376) +++ stable/10/sys/dev/sfxge/common/ef10_impl.h Wed Jan 20 07:42:31 2016 (r294377) @@ -45,6 +45,47 @@ extern "C" { #define EF10_MAX_PIOBUF_NBUFS MEDFORD_PIOBUF_NBUFS #endif +extern __checkReturn efx_rc_t +efx_mcdi_get_port_assignment( + __in efx_nic_t *enp, + __out uint32_t *portp); + +extern __checkReturn efx_rc_t +efx_mcdi_get_port_modes( + __in efx_nic_t *enp, + __out uint32_t *modesp); + +extern __checkReturn efx_rc_t +efx_mcdi_get_mac_address_pf( + __in efx_nic_t *enp, + __out_ecount_opt(6) uint8_t mac_addrp[6]); + +extern __checkReturn efx_rc_t +efx_mcdi_get_mac_address_vf( + __in efx_nic_t *enp, + __out_ecount_opt(6) uint8_t mac_addrp[6]); + +extern __checkReturn efx_rc_t +efx_mcdi_get_clock( + __in efx_nic_t *enp, + __out uint32_t *sys_freqp); + +extern __checkReturn efx_rc_t +efx_mcdi_get_vector_cfg( + __in efx_nic_t *enp, + __out_opt uint32_t *vec_basep, + __out_opt uint32_t *pf_nvecp, + __out_opt uint32_t *vf_nvecp); + +extern __checkReturn efx_rc_t +ef10_get_datapath_caps( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_external_port_mapping( + __in efx_nic_t *enp, + __in uint32_t port, + __out uint8_t *external_portp); #ifdef __cplusplus Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 07:33:45 2016 (r294376) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 07:42:31 2016 (r294377) @@ -358,6 +358,7 @@ typedef struct efx_intr_s { typedef struct efx_nic_ops_s { efx_rc_t (*eno_probe)(efx_nic_t *); + efx_rc_t (*eno_board_cfg)(efx_nic_t *); efx_rc_t (*eno_set_drv_limits)(efx_nic_t *, efx_drv_limits_t*); efx_rc_t (*eno_reset)(efx_nic_t *); efx_rc_t (*eno_init)(efx_nic_t *); Modified: stable/10/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_nic.c Wed Jan 20 07:33:45 2016 (r294376) +++ stable/10/sys/dev/sfxge/common/efx_nic.c Wed Jan 20 07:42:31 2016 (r294377) @@ -244,6 +244,7 @@ fail1: static efx_nic_ops_t __efx_nic_falcon_ops = { falcon_nic_probe, /* eno_probe */ + NULL, /* eno_board_cfg */ NULL, /* eno_set_drv_limits */ falcon_nic_reset, /* eno_reset */ falcon_nic_init, /* eno_init */ @@ -263,6 +264,7 @@ static efx_nic_ops_t __efx_nic_falcon_op static efx_nic_ops_t __efx_nic_siena_ops = { siena_nic_probe, /* eno_probe */ + NULL, /* eno_board_cfg */ NULL, /* eno_set_drv_limits */ siena_nic_reset, /* eno_reset */ siena_nic_init, /* eno_init */ @@ -282,6 +284,7 @@ static efx_nic_ops_t __efx_nic_siena_ops static efx_nic_ops_t __efx_nic_hunt_ops = { ef10_nic_probe, /* eno_probe */ + hunt_board_cfg, /* eno_board_cfg */ ef10_nic_set_drv_limits, /* eno_set_drv_limits */ ef10_nic_reset, /* eno_reset */ ef10_nic_init, /* eno_init */ @@ -297,6 +300,27 @@ static efx_nic_ops_t __efx_nic_hunt_ops #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + +static efx_nic_ops_t __efx_nic_medford_ops = { + ef10_nic_probe, /* eno_probe */ + medford_board_cfg, /* eno_board_cfg */ + ef10_nic_set_drv_limits, /* eno_set_drv_limits */ + ef10_nic_reset, /* eno_reset */ + ef10_nic_init, /* eno_init */ + ef10_nic_get_vi_pool, /* eno_get_vi_pool */ + ef10_nic_get_bar_region, /* eno_get_bar_region */ +#if EFSYS_OPT_DIAG + ef10_sram_test, /* eno_sram_test */ + ef10_nic_register_test, /* eno_register_test */ +#endif /* EFSYS_OPT_DIAG */ + ef10_nic_fini, /* eno_fini */ + ef10_nic_unprobe, /* eno_unprobe */ +}; + +#endif /* EFSYS_OPT_MEDFORD */ + + __checkReturn efx_rc_t efx_nic_create( __in efx_family_t family, @@ -361,6 +385,24 @@ efx_nic_create( break; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + enp->en_enop = (efx_nic_ops_t *)&__efx_nic_medford_ops; + /* + * FW_ASSISTED_TSO ommitted as Medford only supports firmware + * assisted TSO version 2, not the v1 scheme used on Huntington. + */ + enp->en_features = + EFX_FEATURE_IPV6 | + EFX_FEATURE_LINK_EVENTS | + EFX_FEATURE_PERIODIC_MAC_STATS | + EFX_FEATURE_MCDI | + EFX_FEATURE_MAC_HEADER_FILTERS | + EFX_FEATURE_MCDI_DMA | + EFX_FEATURE_PIO_BUFFERS; + break; +#endif /* EFSYS_OPT_MEDFORD */ + default: rc = ENOTSUP; goto fail2; Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 07:33:45 2016 (r294376) +++ stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 07:42:31 2016 (r294377) @@ -54,6 +54,13 @@ extern "C" { */ #define EF10_RX_WPTR_ALIGN 8 +/* + * Max byte offset into the packet the TCP header must start for the hardware + * to be able to parse the packet correctly. + * FIXME: Move to ef10_impl.h when it is included in all driver builds. + */ +#define EF10_TCP_HEADER_OFFSET_LIMIT 208 + /* Invalid RSS context handle */ #define EF10_RSS_CONTEXT_INVALID (0xffffffff) @@ -165,6 +172,10 @@ ef10_nic_probe( __in efx_nic_t *enp); extern __checkReturn efx_rc_t +hunt_board_cfg( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t ef10_nic_set_drv_limits( __inout efx_nic_t *enp, __in efx_drv_limits_t *edlp); Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 07:33:45 2016 (r294376) +++ stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 07:42:31 2016 (r294377) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include "ef10_tlv_layout.h" -static __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_mcdi_get_port_assignment( __in efx_nic_t *enp, __out uint32_t *portp) @@ -85,7 +85,7 @@ fail1: return (rc); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_mcdi_get_port_modes( __in efx_nic_t *enp, __out uint32_t *modesp) @@ -205,7 +205,7 @@ fail1: return (rc); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_mcdi_get_mac_address_pf( __in efx_nic_t *enp, __out_ecount_opt(6) uint8_t mac_addrp[6]) @@ -263,7 +263,7 @@ fail1: return (rc); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_mcdi_get_mac_address_vf( __in efx_nic_t *enp, __out_ecount_opt(6) uint8_t mac_addrp[6]) @@ -326,7 +326,7 @@ fail1: return (rc); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_mcdi_get_clock( __in efx_nic_t *enp, __out uint32_t *sys_freqp) @@ -376,7 +376,7 @@ fail1: return (rc); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_mcdi_get_vector_cfg( __in efx_nic_t *enp, __out_opt uint32_t *vec_basep, @@ -889,7 +889,7 @@ ef10_nic_pio_unlink( return (efx_mcdi_unlink_piobuf(enp, vi_index)); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t ef10_get_datapath_caps( __in efx_nic_t *enp) { @@ -992,6 +992,13 @@ static struct { (1 << TLV_PORT_MODE_10G_10G_10G_10G), 1 }, + { + EFX_FAMILY_MEDFORD, + (1 << TLV_PORT_MODE_10G) | + (1 << TLV_PORT_MODE_10G_10G) | + (1 << TLV_PORT_MODE_10G_10G_10G_10G), + 1 + }, /* Supported modes requiring 2 outputs per port */ { EFX_FAMILY_HUNTINGTON, @@ -1000,18 +1007,25 @@ static struct { (1 << TLV_PORT_MODE_40G_10G_10G) | (1 << TLV_PORT_MODE_10G_10G_40G), 2 - } - /* - * NOTE: Medford modes will require 4 outputs per port: - * TLV_PORT_MODE_10G_10G_10G_10G_Q - * TLV_PORT_MODE_10G_10G_10G_10G_Q2 - * The Q2 mode routes outputs to external port 2. Support for this - * will require a new field specifying the number to add after - * scaling by stride. This is fixed at 1 currently. - */ + }, + { + EFX_FAMILY_MEDFORD, + (1 << TLV_PORT_MODE_40G) | + (1 << TLV_PORT_MODE_40G_40G) | + (1 << TLV_PORT_MODE_40G_10G_10G) | + (1 << TLV_PORT_MODE_10G_10G_40G), + 2 + }, + /* Supported modes requiring 4 outputs per port */ + { + EFX_FAMILY_MEDFORD, + (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q) | + (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q2), + 4 + }, }; -static __checkReturn efx_rc_t + __checkReturn efx_rc_t ef10_external_port_mapping( __in efx_nic_t *enp, __in uint32_t port, @@ -1064,7 +1078,7 @@ fail1: return (rc); } -static __checkReturn efx_rc_t + __checkReturn efx_rc_t hunt_board_cfg( __in efx_nic_t *enp) { @@ -1320,7 +1334,7 @@ hunt_board_cfg( * Maximum number of bytes into the frame the TCP header can start for * firmware assisted TSO to work. */ - encp->enc_tx_tso_tcp_header_offset_limit = 208; + encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; return (0); @@ -1361,6 +1375,7 @@ fail1: ef10_nic_probe( __in efx_nic_t *enp) { + efx_nic_ops_t *enop = enp->en_enop; efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_drv_cfg_t *edcp = &(enp->en_drv_cfg); efx_rc_t rc; @@ -1380,7 +1395,7 @@ ef10_nic_probe( if ((rc = efx_mcdi_drv_attach(enp, B_TRUE)) != 0) goto fail3; - if ((rc = hunt_board_cfg(enp)) != 0) + if ((rc = enop->eno_board_cfg(enp)) != 0) if (rc != EACCES) goto fail4; Modified: stable/10/sys/dev/sfxge/common/medford_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/medford_impl.h Wed Jan 20 07:33:45 2016 (r294376) +++ stable/10/sys/dev/sfxge/common/medford_impl.h Wed Jan 20 07:42:31 2016 (r294377) @@ -37,7 +37,29 @@ extern "C" { #endif +/* Alignment requirement for value written to RX WPTR: + * the WPTR must be aligned to an 8 descriptor boundary + * + * FIXME: Is this the same on Medford as Huntington? + */ +#define MEDFORD_RX_WPTR_ALIGN 8 + + + +#ifndef ER_EZ_TX_PIOBUF_SIZE +#define ER_EZ_TX_PIOBUF_SIZE 4096 +#endif + + #define MEDFORD_PIOBUF_NBUFS (16) +#define MEDFORD_PIOBUF_SIZE (ER_EZ_TX_PIOBUF_SIZE) + +#define MEDFORD_MIN_PIO_ALLOC_SIZE (MEDFORD_PIOBUF_SIZE / 32) + + +extern __checkReturn efx_rc_t +medford_board_cfg( + __in efx_nic_t *enp); #ifdef __cplusplus Modified: stable/10/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/medford_nic.c Wed Jan 20 07:33:45 2016 (r294376) +++ stable/10/sys/dev/sfxge/common/medford_nic.c Wed Jan 20 07:42:31 2016 (r294377) @@ -39,7 +39,205 @@ __FBSDID("$FreeBSD$"); #include "ef10_tlv_layout.h" + __checkReturn efx_rc_t +medford_board_cfg( + __in efx_nic_t *enp) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + uint8_t mac_addr[6] = { 0 }; + uint32_t board_type = 0; + hunt_link_state_t hls; + efx_port_t *epp = &(enp->en_port); + uint32_t port; + uint32_t pf; + uint32_t vf; + uint32_t mask; + uint32_t flags; + uint32_t sysclk; + uint32_t base, nvec; + efx_rc_t rc; + /* + * FIXME: Likely to be incomplete and incorrect. + * Parts of this should be shared with Huntington. + */ + if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0) + goto fail1; + + /* + * NOTE: The MCDI protocol numbers ports from zero. + * The common code MCDI interface numbers ports from one. + */ + emip->emi_port = port + 1; + + if ((rc = ef10_external_port_mapping(enp, port, + &encp->enc_external_port)) != 0) + goto fail2; + + /* + * Get PCIe function number from firmware (used for + * per-function privilege and dynamic config info). + * - PCIe PF: pf = PF number, vf = 0xffff. + * - PCIe VF: pf = parent PF, vf = VF number. + */ + if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0) + goto fail3; + + encp->enc_pf = pf; + encp->enc_vf = vf; + + /* MAC address for this function */ + if (EFX_PCI_FUNCTION_IS_PF(encp)) { + rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); + if ((rc == 0) && (mac_addr[0] & 0x02)) { + /* + * If the static config does not include a global MAC + * address pool then the board may return a locally + * administered MAC address (this should only happen on + * incorrectly programmed boards). + */ + rc = EINVAL; + } + } else { + rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); + } + if (rc != 0) + goto fail4; + + EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); + + /* Board configuration */ + rc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL); + if (rc != 0) { + /* Unprivileged functions may not be able to read board cfg */ + if (rc == EACCES) + board_type = 0; + else + goto fail5; + } + + encp->enc_board_type = board_type; + encp->enc_clk_mult = 1; /* not used for Medford */ + + /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ + if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) + goto fail6; + + /* Obtain the default PHY advertised capabilities */ + if ((rc = hunt_phy_get_link(enp, &hls)) != 0) + goto fail7; + epp->ep_default_adv_cap_mask = hls.hls_adv_cap_mask; + epp->ep_adv_cap_mask = hls.hls_adv_cap_mask; + + if (EFX_PCI_FUNCTION_IS_VF(encp)) { + /* + * Interrupt testing does not work for VFs. See bug50084. + * FIXME: Does this still apply to Medford? + */ + encp->enc_bug41750_workaround = B_TRUE; + } + + /* Chained multicast is always enabled on Medford */ + encp->enc_bug26807_workaround = B_TRUE; + + /* Get sysclk frequency (in MHz). */ + if ((rc = efx_mcdi_get_clock(enp, &sysclk)) != 0) + goto fail8; + + /* + * The timer quantum is 1536 sysclk cycles, documented for the + * EV_TMR_VAL field of EV_TIMER_TBL. Scale for MHz and ns units. + */ + encp->enc_evq_timer_quantum_ns = 1536000UL / sysclk; /* 1536 cycles */ + encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns << + FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000; + + /* Check capabilities of running datapath firmware */ + if ((rc = ef10_get_datapath_caps(enp)) != 0) + goto fail9; + + /* Alignment for receive packet DMA buffers */ + encp->enc_rx_buf_align_start = 1; + + /* FIXME: RX DMA end padding is configurable on Medford */ + encp->enc_rx_buf_align_end = 64; + + /* Alignment for WPTR updates */ + encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + + /* + * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use + * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available + * resources (allocated to this PCIe function), which is zero until + * after we have allocated VIs. + */ + encp->enc_evq_limit = 1024; + encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; + encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; + + encp->enc_buftbl_limit = 0xFFFFFFFF; + + encp->enc_piobuf_limit = MEDFORD_PIOBUF_NBUFS; + encp->enc_piobuf_size = MEDFORD_PIOBUF_SIZE; + encp->enc_piobuf_min_alloc_size = MEDFORD_MIN_PIO_ALLOC_SIZE; + + /* + * Get the current privilege mask. Note that this may be modified + * dynamically, so this value is informational only. DO NOT use + * the privilege mask to check for sufficient privileges, as that + * can result in time-of-check/time-of-use bugs. + */ + if ((rc = efx_mcdi_privilege_mask(enp, pf, vf, &mask)) != 0) + goto fail10; + + encp->enc_privilege_mask = mask; + + /* Get interrupt vector limits */ + if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { + if (EFX_PCI_FUNCTION_IS_PF(encp)) + goto fail11; + + /* Ignore error (cannot query vector limits from a VF). */ + base = 0; + nvec = 1024; + } + encp->enc_intr_vec_base = base; + encp->enc_intr_limit = nvec; + + /* + * Maximum number of bytes into the frame the TCP header can start for + * firmware assisted TSO to work. + */ + encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; + + return (0); + +fail11: + EFSYS_PROBE(fail11); +fail10: + EFSYS_PROBE(fail10); +fail9: + EFSYS_PROBE(fail9); +fail8: + EFSYS_PROBE(fail8); +fail7: + EFSYS_PROBE(fail7); +fail6: + EFSYS_PROBE(fail6); +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} #endif /* EFSYS_OPT_MEDFORD */ From owner-svn-src-stable@freebsd.org Wed Jan 20 07:44:07 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E5C1A89ABA; Wed, 20 Jan 2016 07:44:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D200D1EB5; Wed, 20 Jan 2016 07:44:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K7i5jp024094; Wed, 20 Jan 2016 07:44:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K7i5NH024088; Wed, 20 Jan 2016 07:44:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200744.u0K7i5NH024088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 07:44:05 +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: r294378 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 07:44:07 -0000 Author: arybchik Date: Wed Jan 20 07:44:05 2016 New Revision: 294378 URL: https://svnweb.freebsd.org/changeset/base/294378 Log: MFC r293888 sfxge: rework MCDI start request Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/efx_mcdi.c stable/10/sys/dev/sfxge/common/hunt_impl.h stable/10/sys/dev/sfxge/common/hunt_mcdi.c stable/10/sys/dev/sfxge/common/siena_impl.h stable/10/sys/dev/sfxge/common/siena_mcdi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 07:42:31 2016 (r294377) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 07:44:05 2016 (r294378) @@ -457,8 +457,8 @@ falconsiena_filter_tbl_clear( typedef struct efx_mcdi_ops_s { efx_rc_t (*emco_init)(efx_nic_t *, const efx_mcdi_transport_t *); - void (*emco_request_copyin)(efx_nic_t *, efx_mcdi_req_t *, - unsigned int, boolean_t, boolean_t); + void (*emco_send_request)(efx_nic_t *, void *, size_t, + void *, size_t); void (*emco_request_copyout)(efx_nic_t *, efx_mcdi_req_t *); efx_rc_t (*emco_poll_reboot)(efx_nic_t *); boolean_t (*emco_poll_response)(efx_nic_t *); Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Jan 20 07:42:31 2016 (r294377) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Jan 20 07:44:05 2016 (r294378) @@ -36,12 +36,32 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_MCDI +/* + * There are three versions of the MCDI interface: + * - MCDIv0: Siena BootROM. Transport uses MCDIv1 headers. + * - MCDIv1: Siena firmware and Huntington BootROM. + * - MCDIv2: EF10 firmware (Huntington/Medford) and Medford BootROM. + * Transport uses MCDIv2 headers. + * + * MCDIv2 Header NOT_EPOCH flag + * ---------------------------- + * A new epoch begins at initial startup or after an MC reboot, and defines when + * the MC should reject stale MCDI requests. + * + * The first MCDI request sent by the host should contain NOT_EPOCH=0, and all + * subsequent requests (until the next MC reboot) should contain NOT_EPOCH=1. + * + * After rebooting the MC will fail all requests with NOT_EPOCH=1 by writing a + * response with ERROR=1 and DATALEN=0 until a request is seen with NOT_EPOCH=0. + */ + + #if EFSYS_OPT_SIENA static efx_mcdi_ops_t __efx_mcdi_siena_ops = { siena_mcdi_init, /* emco_init */ - siena_mcdi_request_copyin, /* emco_request_copyin */ + siena_mcdi_send_request, /* emco_send_request */ siena_mcdi_request_copyout, /* emco_request_copyout */ siena_mcdi_poll_reboot, /* emco_poll_reboot */ siena_mcdi_poll_response, /* emco_poll_response */ @@ -56,7 +76,7 @@ static efx_mcdi_ops_t __efx_mcdi_siena_o static efx_mcdi_ops_t __efx_mcdi_ef10_ops = { ef10_mcdi_init, /* emco_init */ - ef10_mcdi_request_copyin, /* emco_request_copyin */ + ef10_mcdi_send_request, /* emco_send_request */ ef10_mcdi_request_copyout, /* emco_request_copyout */ ef10_mcdi_poll_reboot, /* emco_poll_reboot */ ef10_mcdi_poll_response, /* emco_poll_response */ @@ -179,16 +199,16 @@ efx_mcdi_new_epoch( } static void -efx_mcdi_request_copyin( +efx_mcdi_send_request( __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp, - __in unsigned int seq, - __in boolean_t ev_cpl, - __in boolean_t new_epoch) + __in void *hdrp, + __in size_t hdr_len, + __in void *sdup, + __in size_t sdu_len) { efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; - emcop->emco_request_copyin(enp, emrp, seq, ev_cpl, new_epoch); + emcop->emco_send_request(enp, hdrp, hdr_len, sdup, sdu_len); } static void @@ -241,8 +261,15 @@ efx_mcdi_request_start( __in efx_mcdi_req_t *emrp, __in boolean_t ev_cpl) { +#if EFSYS_OPT_MCDI_LOGGING + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; +#endif efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_dword_t hdr[2]; + size_t hdr_len; + unsigned int max_version; unsigned int seq; + unsigned int xflags; boolean_t new_epoch; int state; @@ -269,9 +296,60 @@ efx_mcdi_request_start( emip->emi_poll_cnt = 0; seq = emip->emi_seq++ & EFX_MASK32(MCDI_HEADER_SEQ); new_epoch = emip->emi_new_epoch; + max_version = emip->emi_max_version; EFSYS_UNLOCK(enp->en_eslp, state); - efx_mcdi_request_copyin(enp, emrp, seq, ev_cpl, new_epoch); + xflags = 0; + if (ev_cpl) + xflags |= MCDI_HEADER_XFLAGS_EVREQ; + + /* + * Huntington firmware supports MCDIv2, but the Huntington BootROM only + * supports MCDIv1. Use MCDIv1 headers for MCDIv1 commands where + * possible to support this. + */ + if ((max_version >= 2) && + ((emrp->emr_cmd > MC_CMD_CMD_SPACE_ESCAPE_7) || + (emrp->emr_in_length > MCDI_CTL_SDU_LEN_MAX_V1))) { + /* Construct MCDI v2 header */ + hdr_len = sizeof (hdr); + EFX_POPULATE_DWORD_8(hdr[0], + MCDI_HEADER_CODE, MC_CMD_V2_EXTN, + MCDI_HEADER_RESYNC, 1, + MCDI_HEADER_DATALEN, 0, + MCDI_HEADER_SEQ, seq, + MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1, + MCDI_HEADER_ERROR, 0, + MCDI_HEADER_RESPONSE, 0, + MCDI_HEADER_XFLAGS, xflags); + + EFX_POPULATE_DWORD_2(hdr[1], + MC_CMD_V2_EXTN_IN_EXTENDED_CMD, emrp->emr_cmd, + MC_CMD_V2_EXTN_IN_ACTUAL_LEN, emrp->emr_in_length); + } else { + /* Construct MCDI v1 header */ + hdr_len = sizeof (hdr[0]); + EFX_POPULATE_DWORD_8(hdr[0], + MCDI_HEADER_CODE, emrp->emr_cmd, + MCDI_HEADER_RESYNC, 1, + MCDI_HEADER_DATALEN, emrp->emr_in_length, + MCDI_HEADER_SEQ, seq, + MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1, + MCDI_HEADER_ERROR, 0, + MCDI_HEADER_RESPONSE, 0, + MCDI_HEADER_XFLAGS, xflags); + } + +#if EFSYS_OPT_MCDI_LOGGING + if (emtp->emt_logger != NULL) { + emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_REQUEST, + &hdr, hdr_len, + emrp->emr_in_buf, emrp->emr_in_length); + } +#endif /* EFSYS_OPT_MCDI_LOGGING */ + + efx_mcdi_send_request(enp, &hdr[0], hdr_len, + emrp->emr_in_buf, emrp->emr_in_length); } Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 07:42:31 2016 (r294377) +++ stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 07:44:05 2016 (r294378) @@ -287,12 +287,12 @@ ef10_mcdi_fini( __in efx_nic_t *enp); extern void -ef10_mcdi_request_copyin( +ef10_mcdi_send_request( __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp, - __in unsigned int seq, - __in boolean_t ev_cpl, - __in boolean_t new_epoch); + __in void *hdrp, + __in size_t hdr_len, + __in void *sdup, + __in size_t sdu_len); extern __checkReturn boolean_t ef10_mcdi_poll_response( Modified: stable/10/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_mcdi.c Wed Jan 20 07:42:31 2016 (r294377) +++ stable/10/sys/dev/sfxge/common/hunt_mcdi.c Wed Jan 20 07:44:05 2016 (r294378) @@ -43,37 +43,6 @@ __FBSDID("$FreeBSD$"); #error "WITH_MCDI_V2 required for EF10 MCDIv2 commands." #endif -typedef enum efx_mcdi_header_type_e { - EFX_MCDI_HEADER_TYPE_V1, /* MCDIv0 (BootROM), MCDIv1 commands */ - EFX_MCDI_HEADER_TYPE_V2, /* MCDIv2 commands */ -} efx_mcdi_header_type_t; - -/* - * Return the header format to use for sending an MCDI request. - * - * An MCDIv1 (Siena compatible) command should use MCDIv2 encapsulation if the - * request input buffer or response output buffer are too large for the MCDIv1 - * format. An MCDIv2 command must always be sent using MCDIv2 encapsulation. - */ -#define EFX_MCDI_HEADER_TYPE(_cmd, _length) \ - ((((_cmd) & ~EFX_MASK32(MCDI_HEADER_CODE)) || \ - ((_length) & ~EFX_MASK32(MCDI_HEADER_DATALEN))) ? \ - EFX_MCDI_HEADER_TYPE_V2 : EFX_MCDI_HEADER_TYPE_V1) - - -/* - * MCDI Header NOT_EPOCH flag - * ========================== - * A new epoch begins at initial startup or after an MC reboot, and defines when - * the MC should reject stale MCDI requests. - * - * The first MCDI request sent by the host should contain NOT_EPOCH=0, and all - * subsequent requests (until the next MC reboot) should contain NOT_EPOCH=1. - * - * After rebooting the MC will fail all requests with NOT_EPOCH=1 by writing a - * response with ERROR=1 and DATALEN=0 until a request is seen with NOT_EPOCH=0. - */ - __checkReturn efx_rc_t ef10_mcdi_init( @@ -139,7 +108,7 @@ ef10_mcdi_fini( emip->emi_new_epoch = B_FALSE; } -static void + void ef10_mcdi_send_request( __in efx_nic_t *enp, __in void *hdrp, @@ -182,74 +151,6 @@ ef10_mcdi_send_request( } void -ef10_mcdi_request_copyin( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp, - __in unsigned int seq, - __in boolean_t ev_cpl, - __in boolean_t new_epoch) -{ -#if EFSYS_OPT_MCDI_LOGGING - const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; -#endif /* EFSYS_OPT_MCDI_LOGGING */ - efx_mcdi_header_type_t hdr_type; - efx_dword_t hdr[2]; - size_t hdr_len; - unsigned int xflags; - - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); - - xflags = 0; - if (ev_cpl) - xflags |= MCDI_HEADER_XFLAGS_EVREQ; - - hdr_type = EFX_MCDI_HEADER_TYPE(emrp->emr_cmd, - MAX(emrp->emr_in_length, emrp->emr_out_length)); - - if (hdr_type == EFX_MCDI_HEADER_TYPE_V2) { - /* Construct MCDI v2 header */ - hdr_len = sizeof (hdr); - EFX_POPULATE_DWORD_8(hdr[0], - MCDI_HEADER_CODE, MC_CMD_V2_EXTN, - MCDI_HEADER_RESYNC, 1, - MCDI_HEADER_DATALEN, 0, - MCDI_HEADER_SEQ, seq, - MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1, - MCDI_HEADER_ERROR, 0, - MCDI_HEADER_RESPONSE, 0, - MCDI_HEADER_XFLAGS, xflags); - - EFX_POPULATE_DWORD_2(hdr[1], - MC_CMD_V2_EXTN_IN_EXTENDED_CMD, emrp->emr_cmd, - MC_CMD_V2_EXTN_IN_ACTUAL_LEN, emrp->emr_in_length); - } else { - /* Construct MCDI v1 header */ - hdr_len = sizeof (hdr[0]); - EFX_POPULATE_DWORD_8(hdr[0], - MCDI_HEADER_CODE, emrp->emr_cmd, - MCDI_HEADER_RESYNC, 1, - MCDI_HEADER_DATALEN, emrp->emr_in_length, - MCDI_HEADER_SEQ, seq, - MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1, - MCDI_HEADER_ERROR, 0, - MCDI_HEADER_RESPONSE, 0, - MCDI_HEADER_XFLAGS, xflags); - } - -#if EFSYS_OPT_MCDI_LOGGING - if (emtp->emt_logger != NULL) { - emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_REQUEST, - &hdr, hdr_len, - emrp->emr_in_buf, emrp->emr_in_length); - } -#endif /* EFSYS_OPT_MCDI_LOGGING */ - - ef10_mcdi_send_request(enp, &hdr[0], hdr_len, - emrp->emr_in_buf, emrp->emr_in_length); -} - - void ef10_mcdi_request_copyout( __in efx_nic_t *enp, __in efx_mcdi_req_t *emrp) Modified: stable/10/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_impl.h Wed Jan 20 07:42:31 2016 (r294377) +++ stable/10/sys/dev/sfxge/common/siena_impl.h Wed Jan 20 07:44:05 2016 (r294378) @@ -114,12 +114,12 @@ siena_mcdi_init( __in const efx_mcdi_transport_t *mtp); extern void -siena_mcdi_request_copyin( +siena_mcdi_send_request( __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp, - __in unsigned int seq, - __in boolean_t ev_cpl, - __in boolean_t new_epoch); + __in void *hdrp, + __in size_t hdr_len, + __in void *sdup, + __in size_t sdu_len); extern __checkReturn boolean_t siena_mcdi_poll_response( Modified: stable/10/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_mcdi.c Wed Jan 20 07:42:31 2016 (r294377) +++ stable/10/sys/dev/sfxge/common/siena_mcdi.c Wed Jan 20 07:44:05 2016 (r294378) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); : MC_SMEM_P1_STATUS_OFST >> 2) -static void + void siena_mcdi_send_request( __in efx_nic_t *enp, __in void *hdrp, @@ -90,50 +90,6 @@ siena_mcdi_send_request( } void -siena_mcdi_request_copyin( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp, - __in unsigned int seq, - __in boolean_t ev_cpl, - __in boolean_t new_epoch) -{ -#if EFSYS_OPT_MCDI_LOGGING - const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; -#endif - efx_dword_t hdr; - size_t hdr_len; - unsigned int xflags; - - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); - _NOTE(ARGUNUSED(new_epoch)) - - xflags = 0; - if (ev_cpl) - xflags |= MCDI_HEADER_XFLAGS_EVREQ; - - /* Construct the header */ - hdr_len = sizeof (hdr); - EFX_POPULATE_DWORD_6(hdr, - MCDI_HEADER_CODE, emrp->emr_cmd, - MCDI_HEADER_RESYNC, 1, - MCDI_HEADER_DATALEN, emrp->emr_in_length, - MCDI_HEADER_SEQ, seq, - MCDI_HEADER_RESPONSE, 0, - MCDI_HEADER_XFLAGS, xflags); - -#if EFSYS_OPT_MCDI_LOGGING - if (emtp->emt_logger != NULL) { - emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_REQUEST, - &hdr, sizeof (hdr), - emrp->emr_in_buf, emrp->emr_in_length); - } -#endif /* EFSYS_OPT_MCDI_LOGGING */ - - siena_mcdi_send_request(enp, &hdr, hdr_len, - emrp->emr_in_buf, emrp->emr_in_length); -} - - void siena_mcdi_request_copyout( __in efx_nic_t *enp, __in efx_mcdi_req_t *emrp) From owner-svn-src-stable@freebsd.org Wed Jan 20 07:48:51 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34CAEA89C66; Wed, 20 Jan 2016 07:48:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 040EE109D; Wed, 20 Jan 2016 07:48:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K7mo43024377; Wed, 20 Jan 2016 07:48:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K7mnEr024371; Wed, 20 Jan 2016 07:48:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200748.u0K7mnEr024371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 07:48:49 +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: r294379 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 07:48:51 -0000 Author: arybchik Date: Wed Jan 20 07:48:49 2016 New Revision: 294379 URL: https://svnweb.freebsd.org/changeset/base/294379 Log: MFC r293889,r294080,r294093,r294201,r294249-r294252 sfxge: convert nvram methods to use partition id Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/efx_nvram.c stable/10/sys/dev/sfxge/common/hunt_impl.h stable/10/sys/dev/sfxge/common/hunt_nvram.c stable/10/sys/dev/sfxge/common/siena_impl.h stable/10/sys/dev/sfxge/common/siena_nvram.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 07:44:05 2016 (r294378) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 07:48:49 2016 (r294379) @@ -480,21 +480,21 @@ typedef struct efx_nvram_ops_s { #if EFSYS_OPT_DIAG efx_rc_t (*envo_test)(efx_nic_t *); #endif /* EFSYS_OPT_DIAG */ - efx_rc_t (*envo_size)(efx_nic_t *, efx_nvram_type_t, size_t *); - efx_rc_t (*envo_get_version)(efx_nic_t *, efx_nvram_type_t, - uint32_t *, uint16_t *); - efx_rc_t (*envo_rw_start)(efx_nic_t *, efx_nvram_type_t, size_t *); - efx_rc_t (*envo_read_chunk)(efx_nic_t *, efx_nvram_type_t, + efx_rc_t (*envo_type_to_partn)(efx_nic_t *, efx_nvram_type_t, + uint32_t *); + efx_rc_t (*envo_partn_size)(efx_nic_t *, uint32_t, size_t *); + efx_rc_t (*envo_partn_rw_start)(efx_nic_t *, uint32_t, size_t *); + efx_rc_t (*envo_partn_read)(efx_nic_t *, uint32_t, unsigned int, caddr_t, size_t); - efx_rc_t (*envo_erase)(efx_nic_t *, efx_nvram_type_t); - efx_rc_t (*envo_write_chunk)(efx_nic_t *, efx_nvram_type_t, + efx_rc_t (*envo_partn_erase)(efx_nic_t *, uint32_t, + unsigned int, size_t); + efx_rc_t (*envo_partn_write)(efx_nic_t *, uint32_t, unsigned int, caddr_t, size_t); - void (*envo_rw_finish)(efx_nic_t *, efx_nvram_type_t); - efx_rc_t (*envo_set_version)(efx_nic_t *, efx_nvram_type_t, + void (*envo_partn_rw_finish)(efx_nic_t *, uint32_t); + efx_rc_t (*envo_partn_get_version)(efx_nic_t *, uint32_t, + uint32_t *, uint16_t *); + efx_rc_t (*envo_partn_set_version)(efx_nic_t *, uint32_t, uint16_t *); - - efx_rc_t (*envo_type_to_partn)(efx_nic_t *, efx_nvram_type_t, - uint32_t *); } efx_nvram_ops_t; #endif /* EFSYS_OPT_NVRAM */ Modified: stable/10/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_nvram.c Wed Jan 20 07:44:05 2016 (r294378) +++ stable/10/sys/dev/sfxge/common/efx_nvram.c Wed Jan 20 07:48:49 2016 (r294379) @@ -42,15 +42,15 @@ static efx_nvram_ops_t __efx_nvram_falco #if EFSYS_OPT_DIAG falcon_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ - falcon_nvram_size, /* envo_size */ - falcon_nvram_get_version, /* envo_get_version */ - falcon_nvram_rw_start, /* envo_rw_start */ - falcon_nvram_read_chunk, /* envo_read_chunk */ - falcon_nvram_erase, /* envo_erase */ - falcon_nvram_write_chunk, /* envo_write_chunk */ - falcon_nvram_rw_finish, /* envo_rw_finish */ - falcon_nvram_set_version, /* envo_set_version */ falcon_nvram_type_to_partn, /* envo_type_to_partn */ + falcon_nvram_partn_size, /* envo_partn_size */ + falcon_nvram_partn_rw_start, /* envo_partn_rw_start */ + falcon_nvram_partn_read, /* envo_partn_read */ + falcon_nvram_partn_erase, /* envo_partn_erase */ + falcon_nvram_partn_write, /* envo_partn_write */ + falcon_nvram_partn_rw_finish, /* envo_partn_rw_finish */ + falcon_nvram_partn_get_version, /* envo_partn_get_version */ + falcon_nvram_partn_set_version, /* envo_partn_set_version */ }; #endif /* EFSYS_OPT_FALCON */ @@ -61,15 +61,15 @@ static efx_nvram_ops_t __efx_nvram_siena #if EFSYS_OPT_DIAG siena_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ - siena_nvram_size, /* envo_size */ - siena_nvram_get_version, /* envo_get_version */ - siena_nvram_rw_start, /* envo_rw_start */ - siena_nvram_read_chunk, /* envo_read_chunk */ - siena_nvram_erase, /* envo_erase */ - siena_nvram_write_chunk, /* envo_write_chunk */ - siena_nvram_rw_finish, /* envo_rw_finish */ - siena_nvram_set_version, /* envo_set_version */ siena_nvram_type_to_partn, /* envo_type_to_partn */ + siena_nvram_partn_size, /* envo_partn_size */ + siena_nvram_partn_rw_start, /* envo_partn_rw_start */ + siena_nvram_partn_read, /* envo_partn_read */ + siena_nvram_partn_erase, /* envo_partn_erase */ + siena_nvram_partn_write, /* envo_partn_write */ + siena_nvram_partn_rw_finish, /* envo_partn_rw_finish */ + siena_nvram_partn_get_version, /* envo_partn_get_version */ + siena_nvram_partn_set_version, /* envo_partn_set_version */ }; #endif /* EFSYS_OPT_SIENA */ @@ -80,15 +80,15 @@ static efx_nvram_ops_t __efx_nvram_ef10_ #if EFSYS_OPT_DIAG ef10_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ - ef10_nvram_size, /* envo_size */ - ef10_nvram_get_version, /* envo_get_version */ - ef10_nvram_rw_start, /* envo_rw_start */ - ef10_nvram_read_chunk, /* envo_read_chunk */ - ef10_nvram_erase, /* envo_erase */ - ef10_nvram_write_chunk, /* envo_write_chunk */ - ef10_nvram_rw_finish, /* envo_rw_finish */ - ef10_nvram_set_version, /* envo_set_version */ ef10_nvram_type_to_partn, /* envo_type_to_partn */ + ef10_nvram_partn_size, /* envo_partn_size */ + ef10_nvram_partn_rw_start, /* envo_partn_rw_start */ + ef10_nvram_partn_read, /* envo_partn_read */ + ef10_nvram_partn_erase, /* envo_partn_erase */ + ef10_nvram_partn_write, /* envo_partn_write */ + ef10_nvram_partn_rw_finish, /* envo_partn_rw_finish */ + ef10_nvram_partn_get_version, /* envo_partn_get_version */ + ef10_nvram_partn_set_version, /* envo_partn_set_version */ }; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ @@ -178,6 +178,7 @@ efx_nvram_size( __out size_t *sizep) { efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -185,13 +186,19 @@ efx_nvram_size( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_size(enp, type, sizep)) != 0) + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + if ((rc = envop->envo_partn_size(enp, partn, sizep)) != 0) + goto fail2; + return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); + *sizep = 0; return (rc); } @@ -204,6 +211,7 @@ efx_nvram_get_version( __out_ecount(4) uint16_t version[4]) { efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -212,11 +220,17 @@ efx_nvram_get_version( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_get_version(enp, type, subtypep, version)) != 0) + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + if ((rc = envop->envo_partn_get_version(enp, partn, + subtypep, version)) != 0) + goto fail2; + return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -230,6 +244,7 @@ efx_nvram_rw_start( __out_opt size_t *chunk_sizep) { efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -240,13 +255,18 @@ efx_nvram_rw_start( EFSYS_ASSERT3U(enp->en_nvram_locked, ==, EFX_NVRAM_INVALID); - if ((rc = envop->envo_rw_start(enp, type, chunk_sizep)) != 0) + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + if ((rc = envop->envo_partn_rw_start(enp, partn, chunk_sizep)) != 0) + goto fail2; + enp->en_nvram_locked = type; return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -262,6 +282,7 @@ efx_nvram_read_chunk( __in size_t size) { efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -272,11 +293,16 @@ efx_nvram_read_chunk( EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - if ((rc = envop->envo_read_chunk(enp, type, offset, data, size)) != 0) + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + if ((rc = envop->envo_partn_read(enp, partn, offset, data, size)) != 0) + goto fail2; + return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -289,6 +315,9 @@ efx_nvram_erase( __in efx_nvram_type_t type) { efx_nvram_ops_t *envop = enp->en_envop; + unsigned int offset = 0; + size_t size = 0; + uint32_t partn; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -299,11 +328,21 @@ efx_nvram_erase( EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - if ((rc = envop->envo_erase(enp, type)) != 0) + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + if ((rc = envop->envo_partn_size(enp, partn, &size)) != 0) + goto fail2; + + if ((rc = envop->envo_partn_erase(enp, partn, offset, size)) != 0) + goto fail3; + return (0); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -319,6 +358,7 @@ efx_nvram_write_chunk( __in size_t size) { efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -329,11 +369,16 @@ efx_nvram_write_chunk( EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - if ((rc = envop->envo_write_chunk(enp, type, offset, data, size)) != 0) + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + if ((rc = envop->envo_partn_write(enp, partn, offset, data, size)) != 0) + goto fail2; + return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -346,6 +391,7 @@ efx_nvram_rw_finish( __in efx_nvram_type_t type) { efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); @@ -355,7 +401,8 @@ efx_nvram_rw_finish( EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - envop->envo_rw_finish(enp, type); + if (envop->envo_type_to_partn(enp, type, &partn) == 0) + envop->envo_partn_rw_finish(enp, partn); enp->en_nvram_locked = EFX_NVRAM_INVALID; } @@ -367,6 +414,7 @@ efx_nvram_set_version( __in_ecount(4) uint16_t version[4]) { efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -382,11 +430,16 @@ efx_nvram_set_version( */ EFSYS_ASSERT3U(enp->en_nvram_locked, ==, EFX_NVRAM_INVALID); - if ((rc = envop->envo_set_version(enp, type, version)) != 0) + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + if ((rc = envop->envo_partn_set_version(enp, partn, version)) != 0) + goto fail2; + return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 07:44:05 2016 (r294378) +++ stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 07:48:49 2016 (r294379) @@ -370,39 +370,10 @@ ef10_nvram_partn_write_segment_tlv( __in boolean_t all_segments); extern __checkReturn efx_rc_t -ef10_nvram_partn_size( - __in efx_nic_t *enp, - __in uint32_t partn, - __out size_t *sizep); - -extern __checkReturn efx_rc_t ef10_nvram_partn_lock( __in efx_nic_t *enp, __in uint32_t partn); -extern __checkReturn efx_rc_t -ef10_nvram_partn_read( - __in efx_nic_t *enp, - __in uint32_t partn, - __in unsigned int offset, - __out_bcount(size) caddr_t data, - __in size_t size); - -extern __checkReturn efx_rc_t -ef10_nvram_partn_erase( - __in efx_nic_t *enp, - __in uint32_t partn, - __in unsigned int offset, - __in size_t size); - -extern __checkReturn efx_rc_t -ef10_nvram_partn_write( - __in efx_nic_t *enp, - __in uint32_t partn, - __in unsigned int offset, - __out_bcount(size) caddr_t data, - __in size_t size); - extern void ef10_nvram_partn_unlock( __in efx_nic_t *enp, @@ -421,68 +392,64 @@ ef10_nvram_test( #endif /* EFSYS_OPT_DIAG */ extern __checkReturn efx_rc_t -ef10_nvram_size( +ef10_nvram_type_to_partn( __in efx_nic_t *enp, __in efx_nvram_type_t type, - __out size_t *sizep); + __out uint32_t *partnp); extern __checkReturn efx_rc_t -ef10_nvram_get_version( +ef10_nvram_partn_size( __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out uint32_t *subtypep, - __out_ecount(4) uint16_t version[4]); + __in uint32_t partn, + __out size_t *sizep); extern __checkReturn efx_rc_t -ef10_nvram_rw_start( +ef10_nvram_partn_rw_start( __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out size_t *pref_chunkp); + __in uint32_t partn, + __out size_t *chunk_sizep); extern __checkReturn efx_rc_t -ef10_nvram_read_chunk( +ef10_nvram_partn_read( __in efx_nic_t *enp, - __in efx_nvram_type_t type, + __in uint32_t partn, __in unsigned int offset, __out_bcount(size) caddr_t data, __in size_t size); -extern __checkReturn efx_rc_t -ef10_nvram_erase( +extern __checkReturn efx_rc_t +ef10_nvram_partn_erase( __in efx_nic_t *enp, - __in efx_nvram_type_t type); + __in uint32_t partn, + __in unsigned int offset, + __in size_t size); extern __checkReturn efx_rc_t -ef10_nvram_write_chunk( +ef10_nvram_partn_write( __in efx_nic_t *enp, - __in efx_nvram_type_t type, + __in uint32_t partn, __in unsigned int offset, - __in_bcount(size) caddr_t data, + __out_bcount(size) caddr_t data, __in size_t size); extern void -ef10_nvram_rw_finish( +ef10_nvram_partn_rw_finish( __in efx_nic_t *enp, - __in efx_nvram_type_t type); + __in uint32_t partn); extern __checkReturn efx_rc_t -ef10_nvram_partn_set_version( +ef10_nvram_partn_get_version( __in efx_nic_t *enp, __in uint32_t partn, - __in_ecount(4) uint16_t version[4]); + __out uint32_t *subtypep, + __out_ecount(4) uint16_t version[4]); extern __checkReturn efx_rc_t -ef10_nvram_set_version( +ef10_nvram_partn_set_version( __in efx_nic_t *enp, - __in efx_nvram_type_t type, + __in uint32_t partn, __in_ecount(4) uint16_t version[4]); -extern __checkReturn efx_rc_t -ef10_nvram_type_to_partn( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out uint32_t *partnp); - #endif /* EFSYS_OPT_NVRAM */ Modified: stable/10/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 20 07:44:05 2016 (r294378) +++ stable/10/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 20 07:48:49 2016 (r294379) @@ -1707,56 +1707,23 @@ fail1: #endif /* EFSYS_OPT_DIAG */ __checkReturn efx_rc_t -ef10_nvram_size( +ef10_nvram_partn_get_version( __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out size_t *sizep) -{ - uint32_t partn; - efx_rc_t rc; - - if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - - if ((rc = ef10_nvram_partn_size(enp, partn, sizep)) != 0) - goto fail2; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - *sizep = 0; - - return (rc); -} - - __checkReturn efx_rc_t -ef10_nvram_get_version( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, + __in uint32_t partn, __out uint32_t *subtypep, __out_ecount(4) uint16_t version[4]) { - uint32_t partn; efx_rc_t rc; - if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - /* FIXME: get highest partn version from all ports */ /* FIXME: return partn description if available */ if ((rc = efx_mcdi_nvram_metadata(enp, partn, subtypep, version, NULL, 0)) != 0) - goto fail2; + goto fail1; return (0); -fail2: - EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -1764,111 +1731,21 @@ fail1: } __checkReturn efx_rc_t -ef10_nvram_rw_start( +ef10_nvram_partn_rw_start( __in efx_nic_t *enp, - __in efx_nvram_type_t type, + __in uint32_t partn, __out size_t *chunk_sizep) { - uint32_t partn; efx_rc_t rc; - if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0) - goto fail2; + goto fail1; if (chunk_sizep != NULL) *chunk_sizep = EF10_NVRAM_CHUNK; return (0); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -ef10_nvram_read_chunk( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __in unsigned int offset, - __out_bcount(size) caddr_t data, - __in size_t size) -{ - uint32_t partn; - efx_rc_t rc; - - if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - - if ((rc = ef10_nvram_partn_read(enp, partn, offset, data, size)) != 0) - goto fail2; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -ef10_nvram_erase( - __in efx_nic_t *enp, - __in efx_nvram_type_t type) -{ - uint32_t partn; - size_t size; - efx_rc_t rc; - - if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - - if ((rc = ef10_nvram_partn_size(enp, partn, &size)) != 0) - goto fail2; - - if ((rc = ef10_nvram_partn_erase(enp, partn, 0, size)) != 0) - goto fail3; - - return (0); - -fail3: - EFSYS_PROBE(fail3); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -ef10_nvram_write_chunk( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __in unsigned int offset, - __in_bcount(size) caddr_t data, - __in size_t size) -{ - uint32_t partn; - efx_rc_t rc; - - if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - - if ((rc = ef10_nvram_partn_write(enp, partn, offset, data, size)) != 0) - goto fail2; - - return (0); - -fail2: - EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -1876,40 +1753,11 @@ fail1: } void -ef10_nvram_rw_finish( - __in efx_nic_t *enp, - __in efx_nvram_type_t type) -{ - uint32_t partn; - efx_rc_t rc; - - if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) == 0) - ef10_nvram_partn_unlock(enp, partn); -} - - __checkReturn efx_rc_t -ef10_nvram_set_version( +ef10_nvram_partn_rw_finish( __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __in_ecount(4) uint16_t version[4]) + __in uint32_t partn) { - uint32_t partn; - efx_rc_t rc; - - if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - - if ((rc = ef10_nvram_partn_set_version(enp, partn, version)) != 0) - goto fail2; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); + ef10_nvram_partn_unlock(enp, partn); } #endif /* EFSYS_OPT_NVRAM */ Modified: stable/10/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_impl.h Wed Jan 20 07:44:05 2016 (r294378) +++ stable/10/sys/dev/sfxge/common/siena_impl.h Wed Jan 20 07:48:49 2016 (r294379) @@ -156,39 +156,10 @@ siena_mcdi_feature_supported( #if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD extern __checkReturn efx_rc_t -siena_nvram_partn_size( - __in efx_nic_t *enp, - __in uint32_t partn, - __out size_t *sizep); - -extern __checkReturn efx_rc_t siena_nvram_partn_lock( __in efx_nic_t *enp, __in uint32_t partn); -extern __checkReturn efx_rc_t -siena_nvram_partn_read( - __in efx_nic_t *enp, - __in uint32_t partn, - __in unsigned int offset, - __out_bcount(size) caddr_t data, - __in size_t size); - -extern __checkReturn efx_rc_t -siena_nvram_partn_erase( - __in efx_nic_t *enp, - __in uint32_t partn, - __in unsigned int offset, - __in size_t size); - -extern __checkReturn efx_rc_t -siena_nvram_partn_write( - __in efx_nic_t *enp, - __in uint32_t partn, - __in unsigned int offset, - __out_bcount(size) caddr_t data, - __in size_t size); - extern void siena_nvram_partn_unlock( __in efx_nic_t *enp, @@ -215,67 +186,69 @@ siena_nvram_test( #endif /* EFSYS_OPT_DIAG */ extern __checkReturn efx_rc_t -siena_nvram_size( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out size_t *sizep); - -extern __checkReturn efx_rc_t siena_nvram_get_subtype( __in efx_nic_t *enp, __in uint32_t partn, __out uint32_t *subtypep); extern __checkReturn efx_rc_t -siena_nvram_get_version( +siena_nvram_type_to_partn( __in efx_nic_t *enp, __in efx_nvram_type_t type, - __out uint32_t *subtypep, - __out_ecount(4) uint16_t version[4]); + __out uint32_t *partnp); extern __checkReturn efx_rc_t -siena_nvram_rw_start( +siena_nvram_partn_size( __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out size_t *pref_chunkp); + __in uint32_t partn, + __out size_t *sizep); extern __checkReturn efx_rc_t -siena_nvram_read_chunk( +siena_nvram_partn_rw_start( __in efx_nic_t *enp, - __in efx_nvram_type_t type, + __in uint32_t partn, + __out size_t *chunk_sizep); + +extern __checkReturn efx_rc_t +siena_nvram_partn_read( + __in efx_nic_t *enp, + __in uint32_t partn, __in unsigned int offset, __out_bcount(size) caddr_t data, __in size_t size); -extern __checkReturn efx_rc_t -siena_nvram_erase( +extern __checkReturn efx_rc_t +siena_nvram_partn_erase( __in efx_nic_t *enp, - __in efx_nvram_type_t type); + __in uint32_t partn, + __in unsigned int offset, + __in size_t size); extern __checkReturn efx_rc_t -siena_nvram_write_chunk( +siena_nvram_partn_write( __in efx_nic_t *enp, - __in efx_nvram_type_t type, + __in uint32_t partn, __in unsigned int offset, - __in_bcount(size) caddr_t data, + __out_bcount(size) caddr_t data, __in size_t size); extern void -siena_nvram_rw_finish( +siena_nvram_partn_rw_finish( __in efx_nic_t *enp, - __in efx_nvram_type_t type); + __in uint32_t partn); extern __checkReturn efx_rc_t -siena_nvram_set_version( +siena_nvram_partn_get_version( __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __in_ecount(4) uint16_t version[4]); + __in uint32_t partn, + __out uint32_t *subtypep, + __out_ecount(4) uint16_t version[4]); extern __checkReturn efx_rc_t -siena_nvram_type_to_partn( +siena_nvram_partn_set_version( __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out uint32_t *partnp); + __in uint32_t partn, + __in_ecount(4) uint16_t version[4]); #endif /* EFSYS_OPT_NVRAM */ Modified: stable/10/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nvram.c Wed Jan 20 07:44:05 2016 (r294378) +++ stable/10/sys/dev/sfxge/common/siena_nvram.c Wed Jan 20 07:48:49 2016 (r294379) @@ -291,32 +291,6 @@ fail1: #endif /* EFSYS_OPT_DIAG */ - __checkReturn efx_rc_t -siena_nvram_size( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __out size_t *sizep) -{ - uint32_t partn; - efx_rc_t rc; - - if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - - if ((rc = siena_nvram_partn_size(enp, partn, sizep)) != 0) - goto fail2; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - *sizep = 0; - - return (rc); -} #define SIENA_DYNAMIC_CFG_SIZE(_nitems) \ (sizeof (siena_mc_dynamic_config_hdr_t) + ((_nitems) * \ @@ -506,29 +480,25 @@ fail1: } __checkReturn efx_rc_t -siena_nvram_get_version( +siena_nvram_partn_get_version( __in efx_nic_t *enp, - __in efx_nvram_type_t type, + __in uint32_t partn, __out uint32_t *subtypep, __out_ecount(4) uint16_t version[4]) { siena_mc_dynamic_config_hdr_t *dcfg; siena_parttbl_entry_t *entry; uint32_t dcfg_partn; - uint32_t partn; unsigned int i; efx_rc_t rc; - if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - if ((1 << partn) & ~enp->en_u.siena.enu_partn_mask) { rc = ENOTSUP; - goto fail2; + goto fail1; } if ((rc = siena_nvram_get_subtype(enp, partn, subtypep)) != 0) - goto fail3; + goto fail2; /* * Some partitions are accessible from both ports (for instance BOOTROM) @@ -537,6 +507,7 @@ siena_nvram_get_version( */ version[0] = version[1] = version[2] = version[3] = 0; for (i = 0; i < EFX_ARRAY_SIZE(siena_parttbl); i++) { + siena_mc_fw_version_t *verp; unsigned int nitems; uint16_t temp[4]; size_t length; @@ -559,32 +530,27 @@ siena_nvram_get_version( if ((rc = siena_nvram_get_dynamic_cfg(enp, dcfg_partn, B_FALSE, &dcfg, &length)) != 0) - goto fail4; + goto fail3; nitems = EFX_DWORD_FIELD(dcfg->num_fw_version_items, EFX_DWORD_0); if (nitems < entry->partn) goto done; - temp[0] = EFX_WORD_FIELD(dcfg->fw_version[partn].version_w, - EFX_WORD_0); - temp[1] = EFX_WORD_FIELD(dcfg->fw_version[partn].version_x, - EFX_WORD_0); - temp[2] = EFX_WORD_FIELD(dcfg->fw_version[partn].version_y, - EFX_WORD_0); - temp[3] = EFX_WORD_FIELD(dcfg->fw_version[partn].version_z, - EFX_WORD_0); + verp = &dcfg->fw_version[partn]; + temp[0] = EFX_WORD_FIELD(verp->version_w, EFX_WORD_0); + temp[1] = EFX_WORD_FIELD(verp->version_x, EFX_WORD_0); + temp[2] = EFX_WORD_FIELD(verp->version_y, EFX_WORD_0); + temp[3] = EFX_WORD_FIELD(verp->version_z, EFX_WORD_0); if (memcmp(version, temp, sizeof (temp)) < 0) memcpy(version, temp, sizeof (temp)); - done: +done: EFSYS_KMEM_FREE(enp->en_esip, length, dcfg); } return (0); -fail4: - EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: @@ -596,111 +562,21 @@ fail1: } __checkReturn efx_rc_t -siena_nvram_rw_start( +siena_nvram_partn_rw_start( __in efx_nic_t *enp, - __in efx_nvram_type_t type, + __in uint32_t partn, __out size_t *chunk_sizep) { - uint32_t partn; efx_rc_t rc; - if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - if ((rc = siena_nvram_partn_lock(enp, partn)) != 0) - goto fail2; + goto fail1; if (chunk_sizep != NULL) *chunk_sizep = SIENA_NVRAM_CHUNK; return (0); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -siena_nvram_read_chunk( - __in efx_nic_t *enp, - __in efx_nvram_type_t type, - __in unsigned int offset, - __out_bcount(size) caddr_t data, - __in size_t size) -{ - uint32_t partn; - efx_rc_t rc; - - if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - - if ((rc = siena_nvram_partn_read(enp, partn, offset, data, size)) != 0) - goto fail2; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -siena_nvram_erase( *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Wed Jan 20 07:50:02 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 262E0A89CD2; Wed, 20 Jan 2016 07:50:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6FE41240; Wed, 20 Jan 2016 07:50:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K7o02l024495; Wed, 20 Jan 2016 07:50:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K7o0CF024492; Wed, 20 Jan 2016 07:50:00 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200750.u0K7o0CF024492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 07:50: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: r294380 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 07:50:02 -0000 Author: arybchik Date: Wed Jan 20 07:50:00 2016 New Revision: 294380 URL: https://svnweb.freebsd.org/changeset/base/294380 Log: MFC r293890 sfxge: rx_prefix_pktlen methods do not require EFSYS_OPT_RX_SCALE Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_rx.c stable/10/sys/dev/sfxge/common/hunt_impl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_rx.c Wed Jan 20 07:48:49 2016 (r294379) +++ stable/10/sys/dev/sfxge/common/efx_rx.c Wed Jan 20 07:50:00 2016 (r294380) @@ -78,14 +78,14 @@ falconsiena_rx_prefix_hash( __in efx_rx_hash_alg_t func, __in uint8_t *buffer); +#endif /* EFSYS_OPT_RX_SCALE */ + static __checkReturn efx_rc_t falconsiena_rx_prefix_pktlen( __in efx_nic_t *enp, __in uint8_t *buffer, __out uint16_t *lengthp); -#endif /* EFSYS_OPT_RX_SCALE */ - static void falconsiena_rx_qpost( __in efx_rxq_t *erp, Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 07:48:49 2016 (r294379) +++ stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 07:50:00 2016 (r294380) @@ -864,14 +864,14 @@ ef10_rx_prefix_hash( __in efx_rx_hash_alg_t func, __in uint8_t *buffer); +#endif /* EFSYS_OPT_RX_SCALE */ + extern __checkReturn efx_rc_t ef10_rx_prefix_pktlen( __in efx_nic_t *enp, __in uint8_t *buffer, __out uint16_t *lengthp); -#endif /* EFSYS_OPT_RX_SCALE */ - extern void ef10_rx_qpost( __in efx_rxq_t *erp, From owner-svn-src-stable@freebsd.org Wed Jan 20 07:51:25 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADFB6A89EA1; Wed, 20 Jan 2016 07:51:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8ABB41739; Wed, 20 Jan 2016 07:51:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K7pOfm024699; Wed, 20 Jan 2016 07:51:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K7pNKq024691; Wed, 20 Jan 2016 07:51:23 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200751.u0K7pNKq024691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 07:51: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: r294381 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 07:51:25 -0000 Author: arybchik Date: Wed Jan 20 07:51:23 2016 New Revision: 294381 URL: https://svnweb.freebsd.org/changeset/base/294381 Log: MFC r293891 sfxge: support FATSOv2 in common code Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/efx_nic.c stable/10/sys/dev/sfxge/common/efx_tx.c stable/10/sys/dev/sfxge/common/hunt_impl.h stable/10/sys/dev/sfxge/common/hunt_nic.c stable/10/sys/dev/sfxge/common/hunt_tx.c stable/10/sys/dev/sfxge/common/siena_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Wed Jan 20 07:50:00 2016 (r294380) +++ stable/10/sys/dev/sfxge/common/efx.h Wed Jan 20 07:51:23 2016 (r294381) @@ -1071,6 +1071,7 @@ efx_bist_stop( #define EFX_FEATURE_TX_SRC_FILTERS 0x00000400 #define EFX_FEATURE_PIO_BUFFERS 0x00000800 #define EFX_FEATURE_FW_ASSISTED_TSO 0x00001000 +#define EFX_FEATURE_FW_ASSISTED_TSO_V2 0x00002000 typedef struct efx_nic_cfg_s { uint32_t enc_board_type; @@ -1152,6 +1153,7 @@ typedef struct efx_nic_cfg_s { */ uint32_t enc_tx_tso_tcp_header_offset_limit; boolean_t enc_fw_assisted_tso_enabled; + boolean_t enc_fw_assisted_tso_v2_enabled; boolean_t enc_hw_tx_insert_vlan_enabled; /* Datapath firmware vadapter/vport/vswitch support */ boolean_t enc_datapath_cap_evb; @@ -2002,6 +2004,7 @@ efx_tx_fini( #define EFX_TXQ_CKSUM_IPV4 0x0001 #define EFX_TXQ_CKSUM_TCPUDP 0x0002 +#define EFX_TXQ_FATSOV2 0x0004 extern __checkReturn efx_rc_t efx_tx_qcreate( @@ -2089,6 +2092,21 @@ efx_tx_qdesc_tso_create( __in uint8_t tcp_flags, __out efx_desc_t *edp); +/* Number of FATSOv2 option descriptors */ +#define EFX_TX_FATSOV2_OPT_NDESCS 2 + +/* Maximum number of DMA segments per TSO packet (not superframe) */ +#define EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX 24 + +extern void +efx_tx_qdesc_tso2_create( + __in efx_txq_t *etp, + __in uint16_t ipv4_id, + __in uint32_t tcp_seq, + __in uint16_t tcp_mss, + __out_ecount(count) efx_desc_t *edp, + __in int count); + extern void efx_tx_qdesc_vlantci_create( __in efx_txq_t *etp, Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 07:50:00 2016 (r294380) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 07:51:23 2016 (r294381) @@ -146,6 +146,9 @@ typedef struct efx_tx_ops_s { void (*etxo_qdesc_tso_create)(efx_txq_t *, uint16_t, uint32_t, uint8_t, efx_desc_t *); + void (*etxo_qdesc_tso2_create)(efx_txq_t *, uint16_t, + uint32_t, uint16_t, + efx_desc_t *, int); void (*etxo_qdesc_vlantci_create)(efx_txq_t *, uint16_t, efx_desc_t *); #if EFSYS_OPT_QSTATS Modified: stable/10/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_nic.c Wed Jan 20 07:50:00 2016 (r294380) +++ stable/10/sys/dev/sfxge/common/efx_nic.c Wed Jan 20 07:51:23 2016 (r294381) @@ -381,7 +381,8 @@ efx_nic_create( EFX_FEATURE_MAC_HEADER_FILTERS | EFX_FEATURE_MCDI_DMA | EFX_FEATURE_PIO_BUFFERS | - EFX_FEATURE_FW_ASSISTED_TSO; + EFX_FEATURE_FW_ASSISTED_TSO | + EFX_FEATURE_FW_ASSISTED_TSO_V2; break; #endif /* EFSYS_OPT_HUNTINGTON */ Modified: stable/10/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_tx.c Wed Jan 20 07:50:00 2016 (r294380) +++ stable/10/sys/dev/sfxge/common/efx_tx.c Wed Jan 20 07:51:23 2016 (r294381) @@ -142,6 +142,7 @@ static efx_tx_ops_t __efx_tx_falcon_ops falconsiena_tx_qdesc_post, /* etxo_qdesc_post */ falconsiena_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ NULL, /* etxo_qdesc_tso_create */ + NULL, /* etxo_qdesc_tso2_create */ NULL, /* etxo_qdesc_vlantci_create */ #if EFSYS_OPT_QSTATS falconsiena_tx_qstats_update, /* etxo_qstats_update */ @@ -167,6 +168,7 @@ static efx_tx_ops_t __efx_tx_siena_ops = falconsiena_tx_qdesc_post, /* etxo_qdesc_post */ falconsiena_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ NULL, /* etxo_qdesc_tso_create */ + NULL, /* etxo_qdesc_tso2_create */ NULL, /* etxo_qdesc_vlantci_create */ #if EFSYS_OPT_QSTATS falconsiena_tx_qstats_update, /* etxo_qstats_update */ @@ -192,6 +194,7 @@ static efx_tx_ops_t __efx_tx_hunt_ops = ef10_tx_qdesc_post, /* etxo_qdesc_post */ ef10_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ hunt_tx_qdesc_tso_create, /* etxo_qdesc_tso_create */ + ef10_tx_qdesc_tso2_create, /* etxo_qdesc_tso2_create */ ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ #if EFSYS_OPT_QSTATS ef10_tx_qstats_update, /* etxo_qstats_update */ @@ -217,6 +220,7 @@ static efx_tx_ops_t __efx_tx_medford_ops ef10_tx_qdesc_post, /* etxo_qdesc_post */ ef10_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ NULL, /* etxo_qdesc_tso_create */ + ef10_tx_qdesc_tso2_create, /* etxo_qdesc_tso2_create */ ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ #if EFSYS_OPT_QSTATS ef10_tx_qstats_update, /* etxo_qstats_update */ @@ -641,6 +645,24 @@ efx_tx_qdesc_tso_create( } void +efx_tx_qdesc_tso2_create( + __in efx_txq_t *etp, + __in uint16_t ipv4_id, + __in uint32_t tcp_seq, + __in uint16_t mss, + __out_ecount(count) efx_desc_t *edp, + __in int count) +{ + efx_nic_t *enp = etp->et_enp; + efx_tx_ops_t *etxop = enp->en_etxop; + + EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); + EFSYS_ASSERT(etxop->etxo_qdesc_tso2_create != NULL); + + etxop->etxo_qdesc_tso2_create(etp, ipv4_id, tcp_seq, mss, edp, count); +} + + void efx_tx_qdesc_vlantci_create( __in efx_txq_t *etp, __in uint16_t tci, Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 07:50:00 2016 (r294380) +++ stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 07:51:23 2016 (r294381) @@ -674,6 +674,15 @@ hunt_tx_qdesc_tso_create( __out efx_desc_t *edp); extern void +ef10_tx_qdesc_tso2_create( + __in efx_txq_t *etp, + __in uint16_t ipv4_id, + __in uint32_t tcp_seq, + __in uint16_t tcp_mss, + __out_ecount(count) efx_desc_t *edp, + __in int count); + +extern void ef10_tx_qdesc_vlantci_create( __in efx_txq_t *etp, __in uint16_t vlan_tci, Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 07:50:00 2016 (r294380) +++ stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 07:51:23 2016 (r294381) @@ -920,6 +920,13 @@ ef10_get_datapath_caps( else encp->enc_fw_assisted_tso_enabled = B_FALSE; + /* Check if the firmware supports FATSOv2 */ + if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities_v2, + GET_CAPABILITIES_V2_OUT_TX_TSO_V2) == 1) + encp->enc_fw_assisted_tso_v2_enabled = B_TRUE; + else + encp->enc_fw_assisted_tso_v2_enabled = B_FALSE; + /* Check if the firmware has vadapter/vport/vswitch support */ if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, GET_CAPABILITIES_OUT_EVB) == 1) Modified: stable/10/sys/dev/sfxge/common/hunt_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_tx.c Wed Jan 20 07:50:00 2016 (r294380) +++ stable/10/sys/dev/sfxge/common/hunt_tx.c Wed Jan 20 07:51:23 2016 (r294381) @@ -87,12 +87,13 @@ efx_mcdi_init_txq( MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label); MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance); - MCDI_IN_POPULATE_DWORD_6(req, INIT_TXQ_IN_FLAGS, + MCDI_IN_POPULATE_DWORD_7(req, INIT_TXQ_IN_FLAGS, INIT_TXQ_IN_FLAG_BUFF_MODE, 0, INIT_TXQ_IN_FLAG_IP_CSUM_DIS, (flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1, INIT_TXQ_IN_FLAG_TCP_CSUM_DIS, (flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1, + INIT_TXQ_EXT_IN_FLAG_TSOV2_EN, (flags & EFX_TXQ_FATSOV2) ? 1 : 0, INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0, INIT_TXQ_IN_CRC_MODE, 0, INIT_TXQ_IN_FLAG_TIMESTAMP, 0); @@ -589,6 +590,38 @@ hunt_tx_qdesc_tso_create( } void +ef10_tx_qdesc_tso2_create( + __in efx_txq_t *etp, + __in uint16_t ipv4_id, + __in uint32_t tcp_seq, + __in uint16_t tcp_mss, + __out_ecount(count) efx_desc_t *edp, + __in int count) +{ + EFSYS_PROBE4(tx_desc_tso2_create, unsigned int, etp->et_index, + uint16_t, ipv4_id, uint32_t, tcp_seq, + uint16_t, tcp_mss); + + EFSYS_ASSERT(count >= EFX_TX_FATSOV2_OPT_NDESCS); + + EFX_POPULATE_QWORD_5(edp[0].ed_eq, + ESF_DZ_TX_DESC_IS_OPT, 1, + ESF_DZ_TX_OPTION_TYPE, + ESE_DZ_TX_OPTION_DESC_TSO, + ESF_DZ_TX_TSO_OPTION_TYPE, + ESE_DZ_TX_TSO_OPTION_DESC_FATSO2A, + ESF_DZ_TX_TSO_IP_ID, ipv4_id, + ESF_DZ_TX_TSO_TCP_SEQNO, tcp_seq); + EFX_POPULATE_QWORD_4(edp[1].ed_eq, + ESF_DZ_TX_DESC_IS_OPT, 1, + ESF_DZ_TX_OPTION_TYPE, + ESE_DZ_TX_OPTION_DESC_TSO, + ESF_DZ_TX_TSO_OPTION_TYPE, + ESE_DZ_TX_TSO_OPTION_DESC_FATSO2B, + ESF_DZ_TX_TSO_TCP_MSS, tcp_mss); +} + + void ef10_tx_qdesc_vlantci_create( __in efx_txq_t *etp, __in uint16_t tci, Modified: stable/10/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nic.c Wed Jan 20 07:50:00 2016 (r294380) +++ stable/10/sys/dev/sfxge/common/siena_nic.c Wed Jan 20 07:51:23 2016 (r294381) @@ -169,6 +169,7 @@ siena_board_cfg( encp->enc_hw_tx_insert_vlan_enabled = B_FALSE; encp->enc_fw_assisted_tso_enabled = B_FALSE; + encp->enc_fw_assisted_tso_v2_enabled = B_FALSE; encp->enc_allow_set_mac_with_installed_filters = B_TRUE; return (0); From owner-svn-src-stable@freebsd.org Wed Jan 20 07:52:25 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86A62A89F13; Wed, 20 Jan 2016 07:52:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 535421A1F; Wed, 20 Jan 2016 07:52:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K7qOgR027226; Wed, 20 Jan 2016 07:52:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K7qOoe027225; Wed, 20 Jan 2016 07:52:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200752.u0K7qOoe027225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 07:52:24 +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: r294382 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 07:52:25 -0000 Author: arybchik Date: Wed Jan 20 07:52:24 2016 New Revision: 294382 URL: https://svnweb.freebsd.org/changeset/base/294382 Log: MFC r293892 sfxge: use correct register definitions for setting interrupt moderation on Medford The only value which has changed is the number of rows (ER_DZ_EVQ_TMR_REG_ROWS is 2048 vs 1024 for FR_BZ_TIMER_COMMAND_REGP0_ROWS) but that isn't used, so this shouldn't change behaviour. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/hunt_ev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/hunt_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_ev.c Wed Jan 20 07:51:23 2016 (r294381) +++ stable/10/sys/dev/sfxge/common/hunt_ev.c Wed Jan 20 07:52:24 2016 (r294382) @@ -444,9 +444,9 @@ ef10_ev_qmoderate( eep->ee_index, &dword, 0); } else { EFX_POPULATE_DWORD_2(dword, - FRF_CZ_TC_TIMER_MODE, mode, - FRF_CZ_TC_TIMER_VAL, timer_val); - EFX_BAR_TBL_WRITED(enp, FR_BZ_TIMER_COMMAND_REGP0, + ERF_DZ_TC_TIMER_MODE, mode, + ERF_DZ_TC_TIMER_VAL, timer_val); + EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_TMR_REG, eep->ee_index, &dword, 0); } From owner-svn-src-stable@freebsd.org Wed Jan 20 07:53:27 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBC75A89002; Wed, 20 Jan 2016 07:53:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A33031BC1; Wed, 20 Jan 2016 07:53:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K7rQWn027317; Wed, 20 Jan 2016 07:53:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K7rQJH027314; Wed, 20 Jan 2016 07:53:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200753.u0K7rQJH027314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 07:53: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: r294383 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 07:53:27 -0000 Author: arybchik Date: Wed Jan 20 07:53:26 2016 New Revision: 294383 URL: https://svnweb.freebsd.org/changeset/base/294383 Log: MFC r293895 sfxge: fix common code VPD iterator and duplicate tag verification Fix efx_vpd_hunk_next() which has -- since its inception -- failed to correctly iterate over the tags and keywords contained in the VPD data. Only the first tag or keyword would be returned and the next call with *contp == 1 would walk to the end of the data and finish. This was spotted when fixing up errors spotted by Prefast code analysis (which neglected to set all of the out parameters in all successful cases) Also fix efx_vpd_verify() on Siena and EF10 which (as a side effect of correctly iterating over all the tags and keywords) was failing as it detected that both the static VPD and dynamic VPD storage contained an RV keyword in the VPD-R tag. This is intentional as the static VPD and dynamic VPD are stored separately (firmware merges their contents and computes a new RV keyword checksum for the data readable from the VPD capability in PCIe configuration space). Submitted by: Andrew Lee Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_vpd.c stable/10/sys/dev/sfxge/common/hunt_vpd.c stable/10/sys/dev/sfxge/common/siena_vpd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_vpd.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_vpd.c Wed Jan 20 07:52:24 2016 (r294382) +++ stable/10/sys/dev/sfxge/common/efx_vpd.c Wed Jan 20 07:53:26 2016 (r294383) @@ -669,7 +669,7 @@ efx_vpd_hunk_next( __in size_t size, __out efx_vpd_tag_t *tagp, __out efx_vpd_keyword_t *keywordp, - __out_bcount_opt(*paylenp) unsigned int *payloadp, + __out_opt unsigned int *payloadp, __out_opt uint8_t *paylenp, __inout unsigned int *contp) { @@ -689,12 +689,18 @@ efx_vpd_hunk_next( if ((rc = efx_vpd_next_tag(data, size, &offset, &tag, &taglen)) != 0) goto fail1; - if (tag == EFX_VPD_END) + + if (tag == EFX_VPD_END) { + keyword = 0; + paylen = 0; + index = 0; break; + } if (tag == EFX_VPD_ID) { - if (index == *contp) { + if (index++ == *contp) { EFSYS_ASSERT3U(taglen, <, 0x100); + keyword = 0; paylen = (uint8_t)MIN(taglen, 0xff); goto done; @@ -705,7 +711,7 @@ efx_vpd_hunk_next( taglen, pos, &keyword, &keylen)) != 0) goto fail2; - if (index == *contp) { + if (index++ == *contp) { offset += pos + 3; paylen = keylen; @@ -717,9 +723,6 @@ efx_vpd_hunk_next( offset += taglen; } - *contp = 0; - return (0); - done: *tagp = tag; *keywordp = keyword; @@ -728,7 +731,7 @@ done: if (paylenp != NULL) *paylenp = paylen; - ++(*contp); + *contp = index; return (0); fail2: Modified: stable/10/sys/dev/sfxge/common/hunt_vpd.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_vpd.c Wed Jan 20 07:52:24 2016 (r294382) +++ stable/10/sys/dev/sfxge/common/hunt_vpd.c Wed Jan 20 07:53:26 2016 (r294383) @@ -210,6 +210,13 @@ ef10_vpd_verify( if (dcont == 0) break; + /* + * Skip the RV keyword. It should be present in both the static + * and dynamic cfg sectors. + */ + if (dtag == EFX_VPD_RO && dkey == EFX_VPD_KEYWORD('R', 'V')) + continue; + scont = 0; _NOTE(CONSTANTCONDITION) while (1) { Modified: stable/10/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_vpd.c Wed Jan 20 07:52:24 2016 (r294382) +++ stable/10/sys/dev/sfxge/common/siena_vpd.c Wed Jan 20 07:53:26 2016 (r294383) @@ -326,6 +326,13 @@ siena_vpd_verify( if (dcont == 0) break; + /* + * Skip the RV keyword. It should be present in both the static + * and dynamic cfg sectors. + */ + if (dtag == EFX_VPD_RO && dkey == EFX_VPD_KEYWORD('R', 'V')) + continue; + scont = 0; _NOTE(CONSTANTCONDITION) while (1) { From owner-svn-src-stable@freebsd.org Wed Jan 20 07:57:20 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 065D0A89165; Wed, 20 Jan 2016 07:57:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD57A1D6A; Wed, 20 Jan 2016 07:57:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K7vIQA027511; Wed, 20 Jan 2016 07:57:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K7vI9P027510; Wed, 20 Jan 2016 07:57:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200757.u0K7vI9P027510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 07:57:18 +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: r294384 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 07:57:20 -0000 Author: arybchik Date: Wed Jan 20 07:57:18 2016 New Revision: 294384 URL: https://svnweb.freebsd.org/changeset/base/294384 Log: MFC r293899 sfxge: cleanup: adjust efx_mcdi_get_port_modes() comment for clarity Fix an explanatory comment which did not explain very well. Submitted by: Richard Houldsworth Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 07:53:26 2016 (r294383) +++ stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 07:57:18 2016 (r294384) @@ -112,7 +112,10 @@ efx_mcdi_get_port_modes( goto fail1; } - /* Accept pre-Medford size (8 bytes - no CurrentMode field) */ + /* + * Require only Modes and DefaultMode fields. + * (CurrentMode field was added for Medford) + */ if (req.emr_out_length_used < MC_CMD_GET_PORT_MODES_OUT_CURRENT_MODE_OFST) { rc = EMSGSIZE; From owner-svn-src-stable@freebsd.org Wed Jan 20 07:59:06 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40F80A891FE; Wed, 20 Jan 2016 07:59:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 194371EC1; Wed, 20 Jan 2016 07:59:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K7x5vn027624; Wed, 20 Jan 2016 07:59:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K7x4gl027621; Wed, 20 Jan 2016 07:59:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200759.u0K7x4gl027621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 07:59:04 +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: r294385 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 07:59:06 -0000 Author: arybchik Date: Wed Jan 20 07:59:04 2016 New Revision: 294385 URL: https://svnweb.freebsd.org/changeset/base/294385 Log: MFC r293900 sfxge: add table entries for License NVRAM partition Submitted by: Richard Houldsworth Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/hunt_nvram.c stable/10/sys/dev/sfxge/common/siena_nvram.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Wed Jan 20 07:57:18 2016 (r294384) +++ stable/10/sys/dev/sfxge/common/efx.h Wed Jan 20 07:59:04 2016 (r294385) @@ -1317,6 +1317,7 @@ typedef enum efx_nvram_type_e { EFX_NVRAM_CPLD, EFX_NVRAM_FPGA_BACKUP, EFX_NVRAM_DYNAMIC_CFG, + EFX_NVRAM_LICENSE, EFX_NVRAM_NTYPES, } efx_nvram_type_t; Modified: stable/10/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 20 07:57:18 2016 (r294384) +++ stable/10/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 20 07:59:04 2016 (r294385) @@ -1541,7 +1541,11 @@ static ef10_parttbl_entry_t hunt_parttbl {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 1, EFX_NVRAM_FPGA_BACKUP}, {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 2, EFX_NVRAM_FPGA_BACKUP}, {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 3, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP} + {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP}, + {NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE} }; static ef10_parttbl_entry_t medford_parttbl[] = { @@ -1572,7 +1576,11 @@ static ef10_parttbl_entry_t medford_part {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 1, EFX_NVRAM_FPGA_BACKUP}, {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 2, EFX_NVRAM_FPGA_BACKUP}, {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 3, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP} + {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP}, + {NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE} }; static __checkReturn efx_rc_t Modified: stable/10/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nvram.c Wed Jan 20 07:57:18 2016 (r294384) +++ stable/10/sys/dev/sfxge/common/siena_nvram.c Wed Jan 20 07:59:04 2016 (r294385) @@ -227,6 +227,8 @@ static siena_parttbl_entry_t siena_partt {MC_CMD_NVRAM_TYPE_FC_FW, 2, EFX_NVRAM_FCFW}, {MC_CMD_NVRAM_TYPE_CPLD, 1, EFX_NVRAM_CPLD}, {MC_CMD_NVRAM_TYPE_CPLD, 2, EFX_NVRAM_CPLD}, + {MC_CMD_NVRAM_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE}, + {MC_CMD_NVRAM_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE} }; __checkReturn efx_rc_t From owner-svn-src-stable@freebsd.org Wed Jan 20 08:01:24 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C5A3A89579; Wed, 20 Jan 2016 08:01:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B52D2114C; Wed, 20 Jan 2016 08:01:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K81M1e027805; Wed, 20 Jan 2016 08:01:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K81MYl027797; Wed, 20 Jan 2016 08:01:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200801.u0K81MYl027797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:01:22 +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: r294386 - in stable/10/sys: conf dev/sfxge/common modules/sfxge 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:01:24 -0000 Author: arybchik Date: Wed Jan 20 08:01:21 2016 New Revision: 294386 URL: https://svnweb.freebsd.org/changeset/base/294386 Log: MFC r293901,r294371 sfxge: add accessors for license-related MCDI calls to common code Add support for Huntington MCDI licensing interface to common code. Ported from Linux net driver IOCTL functions with restructuring for initial support for V3 licensing API. Submitted by: Richard Houldsworth Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Added: stable/10/sys/dev/sfxge/common/efx_lic.c - copied unchanged from r293901, head/sys/dev/sfxge/common/efx_lic.c Modified: stable/10/sys/conf/files.amd64 stable/10/sys/dev/sfxge/common/efsys.h stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_check.h stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/efx_nic.c stable/10/sys/modules/sfxge/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Wed Jan 20 07:59:04 2016 (r294385) +++ stable/10/sys/conf/files.amd64 Wed Jan 20 08:01:21 2016 (r294386) @@ -317,6 +317,7 @@ dev/sfxge/common/efx_ev.c optional sfxge dev/sfxge/common/efx_filter.c optional sfxge pci dev/sfxge/common/efx_hash.c optional sfxge pci dev/sfxge/common/efx_intr.c optional sfxge pci +dev/sfxge/common/efx_lic.c optional sfxge pci dev/sfxge/common/efx_mac.c optional sfxge pci dev/sfxge/common/efx_mcdi.c optional sfxge pci dev/sfxge/common/efx_mon.c optional sfxge pci Modified: stable/10/sys/dev/sfxge/common/efsys.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efsys.h Wed Jan 20 07:59:04 2016 (r294385) +++ stable/10/sys/dev/sfxge/common/efsys.h Wed Jan 20 08:01:21 2016 (r294386) @@ -211,6 +211,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define __out_ecount_opt(_n) #define __out_bcount(_n) #define __out_bcount_opt(_n) +#define __out_bcount_part(_n, _l) +#define __out_bcount_part_opt(_n, _l) #define __deref_out @@ -293,6 +295,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_DECODE_INTR_FATAL 1 +#define EFSYS_OPT_LICENSING 0 + /* ID */ typedef struct __efsys_identifier_s efsys_identifier_t; Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Wed Jan 20 07:59:04 2016 (r294385) +++ stable/10/sys/dev/sfxge/common/efx.h Wed Jan 20 08:01:21 2016 (r294386) @@ -2310,6 +2310,57 @@ efx_hash_bytes( __in size_t length, __in uint32_t init); +#if EFSYS_OPT_LICENSING + +/* LICENSING */ + +typedef struct efx_key_stats_s { + uint32_t eks_valid; + uint32_t eks_invalid; + uint32_t eks_blacklisted; + uint32_t eks_unverifiable; + uint32_t eks_wrong_node; + uint32_t eks_licensed_apps_lo; + uint32_t eks_licensed_apps_hi; + uint32_t eks_licensed_features_lo; + uint32_t eks_licensed_features_hi; +} efx_key_stats_t; + +extern __checkReturn efx_rc_t +efx_lic_init( + __in efx_nic_t *enp); + +extern void +efx_lic_fini( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +efx_lic_update_licenses( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +efx_lic_get_key_stats( + __in efx_nic_t *enp, + __out efx_key_stats_t *ksp); + +extern __checkReturn efx_rc_t +efx_lic_app_state( + __in efx_nic_t *enp, + __in uint64_t app_id, + __out boolean_t *licensedp); + +extern __checkReturn efx_rc_t +efx_lic_get_id( + __in efx_nic_t *enp, + __in size_t buffer_size, + __out uint32_t *typep, + __out size_t *lengthp, + __out_opt uint8_t *bufferp); + + +#endif /* EFSYS_OPT_LICENSING */ + + #ifdef __cplusplus } Modified: stable/10/sys/dev/sfxge/common/efx_check.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_check.h Wed Jan 20 07:59:04 2016 (r294385) +++ stable/10/sys/dev/sfxge/common/efx_check.h Wed Jan 20 08:01:21 2016 (r294386) @@ -401,4 +401,15 @@ # endif #endif /* EFSYS_OPT_BIST */ +/* Support MCDI licensing API */ +#if EFSYS_OPT_LICENSING +# if !EFSYS_OPT_MCDI +# error "LICENSING requires MCDI" +# endif +# if !EFSYS_HAS_UINT64 +# error "LICENSING requires UINT64" +# endif +#endif /* EFSYS_OPT_LICENSING */ + + #endif /* _SYS_EFX_CHECK_H */ Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 07:59:04 2016 (r294385) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 08:01:21 2016 (r294386) @@ -84,6 +84,7 @@ extern "C" { #define EFX_MOD_WOL 0x00000800 #define EFX_MOD_FILTER 0x00001000 #define EFX_MOD_PKTFILTER 0x00002000 +#define EFX_MOD_LIC 0x00004000 #define EFX_RESET_MAC 0x00000001 #define EFX_RESET_PHY 0x00000002 @@ -591,6 +592,18 @@ efx_mcdi_nvram_test( #endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */ +#if EFSYS_OPT_LICENSING + +typedef struct efx_lic_ops_s { + efx_rc_t (*elo_update_licenses)(efx_nic_t *); + efx_rc_t (*elo_get_key_stats)(efx_nic_t *, efx_key_stats_t *); + efx_rc_t (*elo_app_state)(efx_nic_t *, uint64_t, boolean_t *); + efx_rc_t (*elo_get_id)(efx_nic_t *, size_t, uint32_t *, + size_t *, uint8_t *); +} efx_lic_ops_t; + +#endif + typedef struct efx_drv_cfg_s { uint32_t edc_min_vi_count; uint32_t edc_max_vi_count; @@ -640,6 +653,9 @@ struct efx_nic_s { uint32_t en_rss_context; #endif /* EFSYS_OPT_RX_SCALE */ uint32_t en_vport_id; +#if EFSYS_OPT_LICENSING + efx_lic_ops_t *en_elop; +#endif union { #if EFSYS_OPT_FALCON struct { Copied: stable/10/sys/dev/sfxge/common/efx_lic.c (from r293901, head/sys/dev/sfxge/common/efx_lic.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/sfxge/common/efx_lic.c Wed Jan 20 08:01:21 2016 (r294386, copy of r293901, head/sys/dev/sfxge/common/efx_lic.c) @@ -0,0 +1,792 @@ +/*- + * Copyright (c) 2009-2015 Solarflare Communications Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of the FreeBSD Project. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "efx.h" +#include "efx_impl.h" + +#if EFSYS_OPT_LICENSING + +#if EFSYS_OPT_SIENA + +static __checkReturn efx_rc_t +efx_mcdi_fc_license_update_license( + __in efx_nic_t *enp); + +static __checkReturn efx_rc_t +efx_mcdi_fc_license_get_key_stats( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp); + +static efx_lic_ops_t __efx_lic_v1_ops = { + efx_mcdi_fc_license_update_license, /* elo_update_licenses */ + efx_mcdi_fc_license_get_key_stats, /* elo_get_key_stats */ + NULL, /* elo_app_state */ + NULL, /* elo_get_id */ +}; + +#endif /* EFSYS_OPT_SIENA */ + +#if EFSYS_OPT_HUNTINGTON + +static __checkReturn efx_rc_t +efx_mcdi_licensing_update_licenses( + __in efx_nic_t *enp); + +static __checkReturn efx_rc_t +efx_mcdi_licensing_get_key_stats( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp); + +static __checkReturn efx_rc_t +efx_mcdi_licensed_app_state( + __in efx_nic_t *enp, + __in uint64_t app_id, + __out boolean_t *licensedp); + +static efx_lic_ops_t __efx_lic_v2_ops = { + efx_mcdi_licensing_update_licenses, /* elo_update_licenses */ + efx_mcdi_licensing_get_key_stats, /* elo_get_key_stats */ + efx_mcdi_licensed_app_state, /* elo_app_state */ + NULL, /* elo_get_id */ +}; + +#endif /* EFSYS_OPT_HUNTINGTON */ + +#if EFSYS_OPT_MEDFORD + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_update_licenses( + __in efx_nic_t *enp); + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_report_license( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp); + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_app_state( + __in efx_nic_t *enp, + __in uint64_t app_id, + __out boolean_t *licensedp); + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_get_id( + __in efx_nic_t *enp, + __in size_t buffer_size, + __out uint32_t *typep, + __out size_t *lengthp, + __out_bcount_part_opt(buffer_size, *lengthp) + uint8_t *bufferp); + +static efx_lic_ops_t __efx_lic_v3_ops = { + efx_mcdi_licensing_v3_update_licenses, /* elo_update_licenses */ + efx_mcdi_licensing_v3_report_license, /* elo_get_key_stats */ + efx_mcdi_licensing_v3_app_state, /* elo_app_state */ + efx_mcdi_licensing_v3_get_id, /* elo_get_id */ +}; + +#endif /* EFSYS_OPT_MEDFORD */ + + +/* V1 Licensing - used in Siena Modena only */ + +#if EFSYS_OPT_SIENA + +static __checkReturn efx_rc_t +efx_mcdi_fc_license_update_license( + __in efx_nic_t *enp) +{ + efx_mcdi_req_t req; + uint8_t payload[MC_CMD_FC_IN_LICENSE_LEN]; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_FC_OP_LICENSE; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_FC_IN_LICENSE_LEN; + req.emr_out_buf = payload; + req.emr_out_length = 0; + + MCDI_IN_SET_DWORD(req, FC_IN_LICENSE_OP, + MC_CMD_FC_IN_LICENSE_UPDATE_LICENSE); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used != 0) { + rc = EIO; + goto fail2; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +efx_mcdi_fc_license_get_key_stats( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_FC_IN_LICENSE_LEN, + MC_CMD_FC_OUT_LICENSE_LEN)]; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_FC_OP_LICENSE; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_FC_IN_LICENSE_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_FC_OUT_LICENSE_LEN; + + MCDI_IN_SET_DWORD(req, FC_IN_LICENSE_OP, + MC_CMD_FC_IN_LICENSE_GET_KEY_STATS); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_FC_OUT_LICENSE_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + eksp->eks_valid = + MCDI_OUT_DWORD(req, FC_OUT_LICENSE_VALID_KEYS); + eksp->eks_invalid = + MCDI_OUT_DWORD(req, FC_OUT_LICENSE_INVALID_KEYS); + eksp->eks_blacklisted = + MCDI_OUT_DWORD(req, FC_OUT_LICENSE_BLACKLISTED_KEYS); + eksp->eks_unverifiable = 0; + eksp->eks_wrong_node = 0; + eksp->eks_licensed_apps_lo = 0; + eksp->eks_licensed_apps_hi = 0; + eksp->eks_licensed_features_lo = 0; + eksp->eks_licensed_features_hi = 0; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +#endif /* EFSYS_OPT_SIENA */ + +/* V2 Licensing - used by Huntington family only. See SF-113611-TC */ + +#if EFSYS_OPT_HUNTINGTON + +static __checkReturn efx_rc_t +efx_mcdi_licensed_app_state( + __in efx_nic_t *enp, + __in uint64_t app_id, + __out boolean_t *licensedp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_LICENSED_APP_STATE_IN_LEN, + MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN)]; + uint32_t app_state; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + + /* V2 licensing supports 32bit app id only */ + if ((app_id >> 32) != 0) { + rc = EINVAL; + goto fail1; + } + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_LICENSED_APP_STATE; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_LICENSED_APP_STATE_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN; + + MCDI_IN_SET_DWORD(req, GET_LICENSED_APP_STATE_IN_APP_ID, + app_id & 0xffffffff); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail2; + } + + if (req.emr_out_length_used < MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN) { + rc = EMSGSIZE; + goto fail3; + } + + app_state = (MCDI_OUT_DWORD(req, GET_LICENSED_APP_STATE_OUT_STATE)); + if (app_state != MC_CMD_GET_LICENSED_APP_STATE_OUT_NOT_LICENSED) { + *licensedp = B_TRUE; + } else { + *licensedp = B_FALSE; + } + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +efx_mcdi_licensing_update_licenses( + __in efx_nic_t *enp) +{ + efx_mcdi_req_t req; + uint8_t payload[MC_CMD_LICENSING_IN_LEN]; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_LICENSING; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_LICENSING_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = 0; + + MCDI_IN_SET_DWORD(req, LICENSING_IN_OP, + MC_CMD_LICENSING_IN_OP_UPDATE_LICENSE); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used != 0) { + rc = EIO; + goto fail2; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +efx_mcdi_licensing_get_key_stats( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_LICENSING_IN_LEN, + MC_CMD_LICENSING_OUT_LEN)]; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_LICENSING; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_LICENSING_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_LICENSING_OUT_LEN; + + MCDI_IN_SET_DWORD(req, LICENSING_IN_OP, + MC_CMD_LICENSING_IN_OP_GET_KEY_STATS); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_LICENSING_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + eksp->eks_valid = + MCDI_OUT_DWORD(req, LICENSING_OUT_VALID_APP_KEYS); + eksp->eks_invalid = + MCDI_OUT_DWORD(req, LICENSING_OUT_INVALID_APP_KEYS); + eksp->eks_blacklisted = + MCDI_OUT_DWORD(req, LICENSING_OUT_BLACKLISTED_APP_KEYS); + eksp->eks_unverifiable = + MCDI_OUT_DWORD(req, LICENSING_OUT_UNVERIFIABLE_APP_KEYS); + eksp->eks_wrong_node = + MCDI_OUT_DWORD(req, LICENSING_OUT_WRONG_NODE_APP_KEYS); + eksp->eks_licensed_apps_lo = 0; + eksp->eks_licensed_apps_hi = 0; + eksp->eks_licensed_features_lo = 0; + eksp->eks_licensed_features_hi = 0; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +#endif /* EFSYS_OPT_HUNTINGTON */ + +/* V3 Licensing - used starting from Medford family. See SF-114884-SW */ + +#if EFSYS_OPT_MEDFORD + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_update_licenses( + __in efx_nic_t *enp) +{ + efx_mcdi_req_t req; + uint8_t payload[MC_CMD_LICENSING_V3_IN_LEN]; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_LICENSING_V3; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_LICENSING_V3_IN_LEN; + req.emr_out_buf = NULL; + req.emr_out_length = 0; + + MCDI_IN_SET_DWORD(req, LICENSING_V3_IN_OP, + MC_CMD_LICENSING_V3_IN_OP_UPDATE_LICENSE); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_report_license( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_LICENSING_V3_IN_LEN, + MC_CMD_LICENSING_V3_OUT_LEN)]; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_LICENSING_V3; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_LICENSING_V3_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_LICENSING_V3_OUT_LEN; + + MCDI_IN_SET_DWORD(req, LICENSING_V3_IN_OP, + MC_CMD_LICENSING_V3_IN_OP_REPORT_LICENSE); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_LICENSING_V3_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + eksp->eks_valid = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_VALID_KEYS); + eksp->eks_invalid = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_INVALID_KEYS); + eksp->eks_blacklisted = 0; + eksp->eks_unverifiable = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_UNVERIFIABLE_KEYS); + eksp->eks_wrong_node = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_WRONG_NODE_KEYS); + eksp->eks_licensed_apps_lo = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_LICENSED_APPS_LO); + eksp->eks_licensed_apps_hi = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_LICENSED_APPS_HI); + eksp->eks_licensed_features_lo = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_LICENSED_FEATURES_LO); + eksp->eks_licensed_features_hi = + MCDI_OUT_DWORD(req, LICENSING_V3_OUT_LICENSED_FEATURES_HI); + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_app_state( + __in efx_nic_t *enp, + __in uint64_t app_id, + __out boolean_t *licensedp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN, + MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN)]; + uint32_t app_state; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_LICENSED_V3_APP_STATE; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN; + + MCDI_IN_SET_DWORD(req, GET_LICENSED_V3_APP_STATE_IN_APP_ID_LO, + app_id & 0xffffffff); + MCDI_IN_SET_DWORD(req, GET_LICENSED_V3_APP_STATE_IN_APP_ID_HI, + app_id >> 32); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + app_state = (MCDI_OUT_DWORD(req, GET_LICENSED_V3_APP_STATE_OUT_STATE)); + if (app_state != MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_NOT_LICENSED) { + *licensedp = B_TRUE; + } else { + *licensedp = B_FALSE; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +efx_mcdi_licensing_v3_get_id( + __in efx_nic_t *enp, + __in size_t buffer_size, + __out uint32_t *typep, + __out size_t *lengthp, + __out_bcount_part_opt(buffer_size, *lengthp) + uint8_t *bufferp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_LICENSING_GET_ID_V3_IN_LEN, + MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN)]; + efx_rc_t rc; + + req.emr_cmd = MC_CMD_LICENSING_GET_ID_V3; + + if (bufferp == NULL) { + /* Request id type and length only */ + req.emr_in_buf = bufferp; + req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN; + req.emr_out_buf = bufferp; + req.emr_out_length = MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN; + (void) memset(payload, 0, sizeof (payload)); + } else { + /* Request full buffer */ + req.emr_in_buf = bufferp; + req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN; + req.emr_out_buf = bufferp; + req.emr_out_length = MIN(buffer_size, MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN); + (void) memset(bufferp, 0, req.emr_out_length); + } + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN) { + rc = EMSGSIZE; + goto fail2; + } + + *typep = MCDI_OUT_DWORD(req, LICENSING_GET_ID_V3_OUT_LICENSE_TYPE); + *lengthp = MCDI_OUT_DWORD(req, LICENSING_GET_ID_V3_OUT_LICENSE_ID_LENGTH); + + if (bufferp == NULL) { + /* modify length requirements to indicate to caller the extra buffering + ** needed to read the complete output. + */ + *lengthp += MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN; + } else { + /* Shift ID down to start of buffer */ + memmove(bufferp, + bufferp+MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST, + *lengthp); + memset(bufferp+(*lengthp), 0, MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST); + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + +#endif /* EFSYS_OPT_MEDFORD */ + + __checkReturn efx_rc_t +efx_lic_init( + __in efx_nic_t *enp) +{ + efx_lic_ops_t *elop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); + EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_LIC)); + + switch (enp->en_family) { + +#if EFSYS_OPT_SIENA + case EFX_FAMILY_SIENA: + elop = (efx_lic_ops_t *)&__efx_lic_v1_ops; + break; +#endif /* EFSYS_OPT_SIENA */ + +#if EFSYS_OPT_HUNTINGTON + case EFX_FAMILY_HUNTINGTON: + elop = (efx_lic_ops_t *)&__efx_lic_v2_ops; + break; +#endif /* EFSYS_OPT_HUNTINGTON */ + +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + elop = (efx_lic_ops_t *)&__efx_lic_v3_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ + + default: + EFSYS_ASSERT(0); + rc = ENOTSUP; + goto fail1; + } + + enp->en_elop = elop; + enp->en_mod_flags |= EFX_MOD_LIC; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + void +efx_lic_fini( + __in efx_nic_t *enp) +{ + efx_lic_ops_t *elop = enp->en_elop; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + enp->en_elop = NULL; + enp->en_mod_flags &= ~EFX_MOD_LIC; +} + + + __checkReturn efx_rc_t +efx_lic_update_licenses( + __in efx_nic_t *enp) +{ + efx_lic_ops_t *elop = enp->en_elop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + if ((rc = elop->elo_update_licenses(enp)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_lic_get_key_stats( + __in efx_nic_t *enp, + __out efx_key_stats_t *eksp) +{ + efx_lic_ops_t *elop = enp->en_elop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + if ((rc = elop->elo_get_key_stats(enp, eksp)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_lic_app_state( + __in efx_nic_t *enp, + __in uint64_t app_id, + __out boolean_t *licensedp) +{ + efx_lic_ops_t *elop = enp->en_elop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + if (elop->elo_app_state == NULL) { + rc = ENOTSUP; + goto fail1; + } + if ((rc = elop->elo_app_state(enp, app_id, licensedp)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_lic_get_id( + __in efx_nic_t *enp, + __in size_t buffer_size, + __out uint32_t *typep, + __out size_t *lengthp, + __out_opt uint8_t *bufferp + ) +{ + efx_lic_ops_t *elop = enp->en_elop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + if (elop->elo_get_id == NULL) { + rc = ENOTSUP; + goto fail1; + } + + if ((rc = elop->elo_get_id(enp, buffer_size, typep, + lengthp, bufferp)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +#endif /* EFSYS_OPT_LICENSING */ Modified: stable/10/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_nic.c Wed Jan 20 07:59:04 2016 (r294385) +++ stable/10/sys/dev/sfxge/common/efx_nic.c Wed Jan 20 08:01:21 2016 (r294386) @@ -708,8 +708,9 @@ efx_nic_reset( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_PROBE); /* - * All modules except the MCDI, PROBE, NVRAM, VPD, MON (which we - * do not reset here) must have been shut down or never initialized. + * All modules except the MCDI, PROBE, NVRAM, VPD, MON, LIC + * (which we do not reset here) must have been shut down or never + * initialized. * * A rule of thumb here is: If the controller or MC reboots, is *any* * state lost. If it's lost and needs reapplying, then the module @@ -717,7 +718,7 @@ efx_nic_reset( */ mod_flags = enp->en_mod_flags; mod_flags &= ~(EFX_MOD_MCDI | EFX_MOD_PROBE | EFX_MOD_NVRAM | - EFX_MOD_VPD | EFX_MOD_MON); + EFX_MOD_VPD | EFX_MOD_MON | EFX_MOD_LIC); EFSYS_ASSERT3U(mod_flags, ==, 0); if (mod_flags != 0) { rc = EINVAL; Modified: stable/10/sys/modules/sfxge/Makefile ============================================================================== --- stable/10/sys/modules/sfxge/Makefile Wed Jan 20 07:59:04 2016 (r294385) +++ stable/10/sys/modules/sfxge/Makefile Wed Jan 20 08:01:21 2016 (r294386) @@ -16,7 +16,7 @@ SRCS+= sfxge_port.c sfxge_rx.c sfxge_tx. SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h sfxge_version.h .PATH: ${.CURDIR}/../../dev/sfxge/common -SRCS+= efx_bootcfg.c efx_crc32.c efx_ev.c efx_intr.c efx_mac.c +SRCS+= efx_bootcfg.c efx_crc32.c efx_ev.c efx_intr.c efx_lic.c efx_mac.c SRCS+= efx_mcdi.c efx_mon.c efx_nic.c SRCS+= efx_nvram.c efx_phy.c efx_port.c efx_rx.c efx_sram.c efx_tx.c SRCS+= efx_vpd.c efx_wol.c efx_filter.c efx_hash.c From owner-svn-src-stable@freebsd.org Wed Jan 20 08:02:12 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69128A896CE; Wed, 20 Jan 2016 08:02:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35E351373; Wed, 20 Jan 2016 08:02:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K82BiE030321; Wed, 20 Jan 2016 08:02:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K82B8e030320; Wed, 20 Jan 2016 08:02:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200802.u0K82B8e030320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:02:11 +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: r294387 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:02:12 -0000 Author: arybchik Date: Wed Jan 20 08:02:11 2016 New Revision: 294387 URL: https://svnweb.freebsd.org/changeset/base/294387 Log: MFC r293902 sfxge: cleanup: quieten efx_mcdi_read_resonse_header error reporting The "mcdi_err_arg" probe still reports results of failed MCDI commands, unless the caller invoked efx_mcdi_execute_quiet(). Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Jan 20 08:01:21 2016 (r294386) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Jan 20 08:02:11 2016 (r294387) @@ -462,15 +462,8 @@ efx_mcdi_read_response_header( return; fail3: - if (!emrp->emr_quiet) - EFSYS_PROBE(fail3); fail2: - if (!emrp->emr_quiet) - EFSYS_PROBE(fail2); fail1: - if (!emrp->emr_quiet) - EFSYS_PROBE1(fail1, efx_rc_t, rc); - emrp->emr_rc = rc; emrp->emr_out_length_used = 0; } From owner-svn-src-stable@freebsd.org Wed Jan 20 08:03:32 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A689A897AC; Wed, 20 Jan 2016 08:03:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71908164C; Wed, 20 Jan 2016 08:03:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K83VbW030421; Wed, 20 Jan 2016 08:03:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K83Ub4030415; Wed, 20 Jan 2016 08:03:30 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200803.u0K83Ub4030415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:03:30 +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: r294388 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:03:32 -0000 Author: arybchik Date: Wed Jan 20 08:03:30 2016 New Revision: 294388 URL: https://svnweb.freebsd.org/changeset/base/294388 Log: MFC r294075 sfxge: rename hunt_link_state_t to ef10_link_state_t Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h stable/10/sys/dev/sfxge/common/hunt_mac.c stable/10/sys/dev/sfxge/common/hunt_nic.c stable/10/sys/dev/sfxge/common/hunt_phy.c stable/10/sys/dev/sfxge/common/medford_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:02:11 2016 (r294387) +++ stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:03:30 2016 (r294388) @@ -455,16 +455,16 @@ ef10_nvram_partn_set_version( /* PHY */ -typedef struct hunt_link_state_s { - uint32_t hls_adv_cap_mask; - uint32_t hls_lp_cap_mask; - unsigned int hls_fcntl; - efx_link_mode_t hls_link_mode; +typedef struct ef10_link_state_s { + uint32_t els_adv_cap_mask; + uint32_t els_lp_cap_mask; + unsigned int els_fcntl; + efx_link_mode_t els_link_mode; #if EFSYS_OPT_LOOPBACK - efx_loopback_type_t hls_loopback; + efx_loopback_type_t els_loopback; #endif - boolean_t hls_mac_up; -} hunt_link_state_t; + boolean_t els_mac_up; +} ef10_link_state_t; extern void hunt_phy_link_ev( @@ -475,7 +475,7 @@ hunt_phy_link_ev( extern __checkReturn efx_rc_t hunt_phy_get_link( __in efx_nic_t *enp, - __out hunt_link_state_t *hlsp); + __out ef10_link_state_t *elsp); extern __checkReturn efx_rc_t hunt_phy_power( Modified: stable/10/sys/dev/sfxge/common/hunt_mac.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_mac.c Wed Jan 20 08:02:11 2016 (r294387) +++ stable/10/sys/dev/sfxge/common/hunt_mac.c Wed Jan 20 08:03:30 2016 (r294388) @@ -48,16 +48,16 @@ hunt_mac_poll( */ efx_port_t *epp = &(enp->en_port); - hunt_link_state_t hls; + ef10_link_state_t els; efx_rc_t rc; - if ((rc = hunt_phy_get_link(enp, &hls)) != 0) + if ((rc = hunt_phy_get_link(enp, &els)) != 0) goto fail1; - epp->ep_adv_cap_mask = hls.hls_adv_cap_mask; - epp->ep_fcntl = hls.hls_fcntl; + epp->ep_adv_cap_mask = els.els_adv_cap_mask; + epp->ep_fcntl = els.els_fcntl; - *link_modep = hls.hls_link_mode; + *link_modep = els.els_link_mode; return (0); @@ -79,17 +79,17 @@ hunt_mac_up( * essentially identical. */ - hunt_link_state_t hls; + ef10_link_state_t els; efx_rc_t rc; /* * Because Huntington doesn't *require* polling, we can't rely on * hunt_mac_poll() being executed to populate epp->ep_mac_up. */ - if ((rc = hunt_phy_get_link(enp, &hls)) != 0) + if ((rc = hunt_phy_get_link(enp, &els)) != 0) goto fail1; - *mac_upp = hls.hls_mac_up; + *mac_upp = els.els_mac_up; return (0); Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 08:02:11 2016 (r294387) +++ stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 08:03:30 2016 (r294388) @@ -1096,7 +1096,7 @@ hunt_board_cfg( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint8_t mac_addr[6]; uint32_t board_type = 0; - hunt_link_state_t hls; + ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); uint32_t port; uint32_t pf; @@ -1170,10 +1170,10 @@ hunt_board_cfg( goto fail6; /* Obtain the default PHY advertised capabilities */ - if ((rc = hunt_phy_get_link(enp, &hls)) != 0) + if ((rc = hunt_phy_get_link(enp, &els)) != 0) goto fail7; - epp->ep_default_adv_cap_mask = hls.hls_adv_cap_mask; - epp->ep_adv_cap_mask = hls.hls_adv_cap_mask; + epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; + epp->ep_adv_cap_mask = els.els_adv_cap_mask; /* * Enable firmware workarounds for hardware errata. Modified: stable/10/sys/dev/sfxge/common/hunt_phy.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_phy.c Wed Jan 20 08:02:11 2016 (r294387) +++ stable/10/sys/dev/sfxge/common/hunt_phy.c Wed Jan 20 08:03:30 2016 (r294388) @@ -219,7 +219,7 @@ fail1: __checkReturn efx_rc_t hunt_phy_get_link( __in efx_nic_t *enp, - __out hunt_link_state_t *hlsp) + __out ef10_link_state_t *elsp) { /* * TBD: consider common Siena/Hunt function: Hunt is very similar @@ -252,14 +252,14 @@ hunt_phy_get_link( } hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_CAP), - &hlsp->hls_adv_cap_mask); + &elsp->els_adv_cap_mask); hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP), - &hlsp->hls_lp_cap_mask); + &elsp->els_lp_cap_mask); hunt_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS), MCDI_OUT_DWORD(req, GET_LINK_OUT_LINK_SPEED), MCDI_OUT_DWORD(req, GET_LINK_OUT_FCNTL), - &hlsp->hls_link_mode, &hlsp->hls_fcntl); + &elsp->els_link_mode, &elsp->els_fcntl); #if EFSYS_OPT_LOOPBACK /* Assert the MC_CMD_LOOPBACK and EFX_LOOPBACK namespace agree */ @@ -282,10 +282,10 @@ hunt_phy_get_link( EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PCS == EFX_LOOPBACK_PCS); EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PMAPMD == EFX_LOOPBACK_PMA_PMD); - hlsp->hls_loopback = MCDI_OUT_DWORD(req, GET_LINK_OUT_LOOPBACK_MODE); + elsp->els_loopback = MCDI_OUT_DWORD(req, GET_LINK_OUT_LOOPBACK_MODE); #endif /* EFSYS_OPT_LOOPBACK */ - hlsp->hls_mac_up = MCDI_OUT_DWORD(req, GET_LINK_OUT_MAC_FAULT) == 0; + elsp->els_mac_up = MCDI_OUT_DWORD(req, GET_LINK_OUT_MAC_FAULT) == 0; return (0); Modified: stable/10/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/medford_nic.c Wed Jan 20 08:02:11 2016 (r294387) +++ stable/10/sys/dev/sfxge/common/medford_nic.c Wed Jan 20 08:03:30 2016 (r294388) @@ -47,7 +47,7 @@ medford_board_cfg( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint8_t mac_addr[6] = { 0 }; uint32_t board_type = 0; - hunt_link_state_t hls; + ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); uint32_t port; uint32_t pf; @@ -126,10 +126,10 @@ medford_board_cfg( goto fail6; /* Obtain the default PHY advertised capabilities */ - if ((rc = hunt_phy_get_link(enp, &hls)) != 0) + if ((rc = hunt_phy_get_link(enp, &els)) != 0) goto fail7; - epp->ep_default_adv_cap_mask = hls.hls_adv_cap_mask; - epp->ep_adv_cap_mask = hls.hls_adv_cap_mask; + epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; + epp->ep_adv_cap_mask = els.els_adv_cap_mask; if (EFX_PCI_FUNCTION_IS_VF(encp)) { /* From owner-svn-src-stable@freebsd.org Wed Jan 20 08:05:58 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37B37A8988D; Wed, 20 Jan 2016 08:05:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 125E4193F; Wed, 20 Jan 2016 08:05:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K85v8H030564; Wed, 20 Jan 2016 08:05:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K85uKd030556; Wed, 20 Jan 2016 08:05:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200805.u0K85uKd030556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:05:56 +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: r294389 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:05:58 -0000 Author: arybchik Date: Wed Jan 20 08:05:56 2016 New Revision: 294389 URL: https://svnweb.freebsd.org/changeset/base/294389 Log: MFC r294076 sfxge: rework MCDI request completion Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/efx_mcdi.c stable/10/sys/dev/sfxge/common/efx_mcdi.h stable/10/sys/dev/sfxge/common/hunt_impl.h stable/10/sys/dev/sfxge/common/hunt_mcdi.c stable/10/sys/dev/sfxge/common/siena_impl.h stable/10/sys/dev/sfxge/common/siena_mcdi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 08:03:30 2016 (r294388) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 08:05:56 2016 (r294389) @@ -463,7 +463,6 @@ typedef struct efx_mcdi_ops_s { efx_rc_t (*emco_init)(efx_nic_t *, const efx_mcdi_transport_t *); void (*emco_send_request)(efx_nic_t *, void *, size_t, void *, size_t); - void (*emco_request_copyout)(efx_nic_t *, efx_mcdi_req_t *); efx_rc_t (*emco_poll_reboot)(efx_nic_t *); boolean_t (*emco_poll_response)(efx_nic_t *); void (*emco_read_response)(efx_nic_t *, void *, size_t, size_t); Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Jan 20 08:03:30 2016 (r294388) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Jan 20 08:05:56 2016 (r294389) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); static efx_mcdi_ops_t __efx_mcdi_siena_ops = { siena_mcdi_init, /* emco_init */ siena_mcdi_send_request, /* emco_send_request */ - siena_mcdi_request_copyout, /* emco_request_copyout */ siena_mcdi_poll_reboot, /* emco_poll_reboot */ siena_mcdi_poll_response, /* emco_poll_response */ siena_mcdi_read_response, /* emco_read_response */ @@ -77,7 +76,6 @@ static efx_mcdi_ops_t __efx_mcdi_siena_o static efx_mcdi_ops_t __efx_mcdi_ef10_ops = { ef10_mcdi_init, /* emco_init */ ef10_mcdi_send_request, /* emco_send_request */ - ef10_mcdi_request_copyout, /* emco_request_copyout */ ef10_mcdi_poll_reboot, /* emco_poll_reboot */ ef10_mcdi_poll_response, /* emco_poll_response */ ef10_mcdi_read_response, /* emco_read_response */ @@ -211,16 +209,6 @@ efx_mcdi_send_request( emcop->emco_send_request(enp, hdrp, hdr_len, sdup, sdu_len); } -static void -efx_mcdi_request_copyout( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp) -{ - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; - - emcop->emco_request_copyout(enp, emrp); -} - static efx_rc_t efx_mcdi_poll_reboot( __in efx_nic_t *enp) @@ -353,7 +341,7 @@ efx_mcdi_request_start( } - void +static void efx_mcdi_read_response_header( __in efx_nic_t *enp, __inout efx_mcdi_req_t *emrp) @@ -468,6 +456,50 @@ fail1: emrp->emr_out_length_used = 0; } +static void +efx_mcdi_finish_response( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp) +{ +#if EFSYS_OPT_MCDI_LOGGING + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; +#endif /* EFSYS_OPT_MCDI_LOGGING */ + efx_dword_t hdr[2]; + unsigned int hdr_len; + size_t bytes; + + if (emrp->emr_out_buf == NULL) + return; + + /* Read the command header to detect MCDI response format */ + hdr_len = sizeof (hdr[0]); + efx_mcdi_read_response(enp, &hdr[0], 0, hdr_len); + if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) { + /* + * Read the actual payload length. The length given in the event + * is only correct for responses with the V1 format. + */ + efx_mcdi_read_response(enp, &hdr[1], hdr_len, sizeof (hdr[1])); + hdr_len += sizeof (hdr[1]); + + emrp->emr_out_length_used = EFX_DWORD_FIELD(hdr[1], + MC_CMD_V2_EXTN_IN_ACTUAL_LEN); + } + + /* Copy payload out into caller supplied buffer */ + bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length); + efx_mcdi_read_response(enp, emrp->emr_out_buf, hdr_len, bytes); + +#if EFSYS_OPT_MCDI_LOGGING + if (emtp->emt_logger != NULL) { + emtp->emt_logger(emtp->emt_context, + EFX_LOG_MCDI_RESPONSE, + &hdr, hdr_len, + emrp->emr_out_buf, bytes); + } +#endif /* EFSYS_OPT_MCDI_LOGGING */ +} + __checkReturn boolean_t efx_mcdi_request_poll( @@ -515,7 +547,7 @@ efx_mcdi_request_poll( if ((rc = emrp->emr_rc) != 0) goto fail2; - efx_mcdi_request_copyout(enp, emrp); + efx_mcdi_finish_response(enp, emrp); return (B_TRUE); fail2: @@ -709,7 +741,6 @@ efx_mcdi_ev_cpl( { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; efx_mcdi_req_t *emrp; int state; @@ -751,7 +782,7 @@ efx_mcdi_ev_cpl( } } if (errcode == 0) { - emcop->emco_request_copyout(enp, emrp); + efx_mcdi_finish_response(enp, emrp); } emtp->emt_ev_cpl(emtp->emt_context); Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.h Wed Jan 20 08:03:30 2016 (r294388) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.h Wed Jan 20 08:05:56 2016 (r294389) @@ -88,11 +88,6 @@ efx_mcdi_execute_quiet( __in efx_nic_t *enp, __inout efx_mcdi_req_t *emrp); - extern void -efx_mcdi_read_response_header( - __in efx_nic_t *enp, - __inout efx_mcdi_req_t *emrp); - extern void efx_mcdi_ev_cpl( __in efx_nic_t *enp, Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:03:30 2016 (r294388) +++ stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:05:56 2016 (r294389) @@ -305,11 +305,6 @@ ef10_mcdi_read_response( __in size_t offset, __in size_t length); -extern void -ef10_mcdi_request_copyout( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp); - extern efx_rc_t ef10_mcdi_poll_reboot( __in efx_nic_t *enp); Modified: stable/10/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_mcdi.c Wed Jan 20 08:03:30 2016 (r294388) +++ stable/10/sys/dev/sfxge/common/hunt_mcdi.c Wed Jan 20 08:05:56 2016 (r294389) @@ -150,50 +150,6 @@ ef10_mcdi_send_request( EFX_BAR_WRITED(enp, ER_DZ_MC_DB_HWRD_REG, &dword, B_FALSE); } - void -ef10_mcdi_request_copyout( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp) -{ -#if EFSYS_OPT_MCDI_LOGGING - const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; -#endif /* EFSYS_OPT_MCDI_LOGGING */ - efx_dword_t hdr[2]; - unsigned int hdr_len; - size_t bytes; - - if (emrp->emr_out_buf == NULL) - return; - - /* Read the command header to detect MCDI response format */ - hdr_len = sizeof (hdr[0]); - ef10_mcdi_read_response(enp, &hdr[0], 0, hdr_len); - if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) { - /* - * Read the actual payload length. The length given in the event - * is only correct for responses with the V1 format. - */ - ef10_mcdi_read_response(enp, &hdr[1], hdr_len, sizeof (hdr[1])); - hdr_len += sizeof (hdr[1]); - - emrp->emr_out_length_used = EFX_DWORD_FIELD(hdr[1], - MC_CMD_V2_EXTN_IN_ACTUAL_LEN); - } - - /* Copy payload out into caller supplied buffer */ - bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length); - ef10_mcdi_read_response(enp, emrp->emr_out_buf, hdr_len, bytes); - -#if EFSYS_OPT_MCDI_LOGGING - if (emtp->emt_logger != NULL) { - emtp->emt_logger(emtp->emt_context, - EFX_LOG_MCDI_RESPONSE, - &hdr, hdr_len, - emrp->emr_out_buf, bytes); - } -#endif /* EFSYS_OPT_MCDI_LOGGING */ -} - __checkReturn boolean_t ef10_mcdi_poll_response( __in efx_nic_t *enp) Modified: stable/10/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_impl.h Wed Jan 20 08:03:30 2016 (r294388) +++ stable/10/sys/dev/sfxge/common/siena_impl.h Wed Jan 20 08:05:56 2016 (r294389) @@ -132,11 +132,6 @@ siena_mcdi_read_response( __in size_t offset, __in size_t length); -extern void -siena_mcdi_request_copyout( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp); - extern efx_rc_t siena_mcdi_poll_reboot( __in efx_nic_t *enp); Modified: stable/10/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_mcdi.c Wed Jan 20 08:03:30 2016 (r294388) +++ stable/10/sys/dev/sfxge/common/siena_mcdi.c Wed Jan 20 08:05:56 2016 (r294389) @@ -89,35 +89,6 @@ siena_mcdi_send_request( EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, dbr, &dword, B_FALSE); } - void -siena_mcdi_request_copyout( - __in efx_nic_t *enp, - __in efx_mcdi_req_t *emrp) -{ -#if EFSYS_OPT_MCDI_LOGGING - const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; - efx_dword_t hdr; -#endif - size_t bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length); - - /* Copy payload out if caller supplied buffer */ - if (emrp->emr_out_buf != NULL) { - siena_mcdi_read_response(enp, emrp->emr_out_buf, - sizeof (efx_dword_t), bytes); - } - -#if EFSYS_OPT_MCDI_LOGGING - if (emtp->emt_logger != NULL) { - siena_mcdi_read_response(enp, &hdr, 0, sizeof (hdr)); - - emtp->emt_logger(emtp->emt_context, - EFX_LOG_MCDI_RESPONSE, - &hdr, sizeof (hdr), - emrp->emr_out_buf, bytes); - } -#endif /* EFSYS_OPT_MCDI_LOGGING */ -} - efx_rc_t siena_mcdi_poll_reboot( __in efx_nic_t *enp) From owner-svn-src-stable@freebsd.org Wed Jan 20 08:07:32 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DF5AA89960; Wed, 20 Jan 2016 08:07:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29D7E1AA2; Wed, 20 Jan 2016 08:07:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K87VWH030678; Wed, 20 Jan 2016 08:07:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K87Ub1030673; Wed, 20 Jan 2016 08:07:30 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200807.u0K87Ub1030673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:07:30 +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: r294390 - in stable/10: share/man/man4 sys/dev/sfxge 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:07:32 -0000 Author: arybchik Date: Wed Jan 20 08:07:30 2016 New Revision: 294390 URL: https://svnweb.freebsd.org/changeset/base/294390 Log: MFC r294077 sfxge: support FATSOv2 Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/share/man/man4/sfxge.4 stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/sfxge.4 ============================================================================== --- stable/10/share/man/man4/sfxge.4 Wed Jan 20 08:05:56 2016 (r294389) +++ stable/10/share/man/man4/sfxge.4 Wed Jan 20 08:07:30 2016 (r294390) @@ -121,8 +121,10 @@ If a packet is dropped, the counter is incremented and the local sender receives ENOBUFS. The value must be greater than or equal to 0. .It Va hw.sfxge.tso_fw_assisted -Enable/disable usage of FW-assisted TSO if supported by NIC firmware. -Enabled by default. +Bitmask to enable/disable usage of FW-assisted TSO version if supported +by NIC firmware. +FATSOv1 (bit 0) and FATSOv2 (bit 1) are supported. +All enabled by default. .It Va hw.sfxge.N.max_rss_channels The maximum number of allocated RSS channels for the Nth adapter. If set to 0 or unset, the number of channels is determined by the number Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Jan 20 08:05:56 2016 (r294389) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Jan 20 08:07:30 2016 (r294390) @@ -283,7 +283,10 @@ struct sfxge_softc { unsigned int rxq_count; unsigned int txq_count; - int tso_fw_assisted; + unsigned int tso_fw_assisted; +#define SFXGE_FATSOV1 (1 << 0) +#define SFXGE_FATSOV2 (1 << 1) + #if EFSYS_OPT_MCDI_LOGGING int mcdi_logging; #endif Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Jan 20 08:05:56 2016 (r294389) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Jan 20 08:07:30 2016 (r294390) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -96,11 +97,11 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_p "Maximum number of any packets in deferred packet put-list"); #define SFXGE_PARAM_TSO_FW_ASSISTED SFXGE_PARAM(tso_fw_assisted) -static int sfxge_tso_fw_assisted = 1; +static int sfxge_tso_fw_assisted = (SFXGE_FATSOV1 | SFXGE_FATSOV2); TUNABLE_INT(SFXGE_PARAM_TSO_FW_ASSISTED, &sfxge_tso_fw_assisted); SYSCTL_INT(_hw_sfxge, OID_AUTO, tso_fw_assisted, CTLFLAG_RDTUN, &sfxge_tso_fw_assisted, 0, - "Use FW-assisted TSO if supported by NIC firmware"); + "Bitmask of FW-assisted TSO allowed to use if supported by NIC firmware"); static const struct { @@ -850,6 +851,8 @@ struct sfxge_tso_state { unsigned out_len; /* Remaining length in current segment */ unsigned seqnum; /* Current sequence number */ unsigned packet_space; /* Remaining space in current packet */ + unsigned segs_space; /* Remaining number of DMA segments + for the packet (FATSOv2 only) */ /* Input position */ uint64_t dma_addr; /* DMA address of current position */ @@ -952,7 +955,7 @@ static void tso_start(struct sfxge_txq * struct tcphdr th_copy; #endif - tso->fw_assisted = txq->sc->tso_fw_assisted; + tso->fw_assisted = txq->tso_fw_assisted; tso->mbuf = mbuf; /* Find network protocol and header */ @@ -1059,6 +1062,8 @@ static void tso_fill_packet_with_fragmen { efx_desc_t *desc; int n; + uint64_t dma_addr = tso->dma_addr; + boolean_t eop; if (tso->in_len == 0 || tso->packet_space == 0) return; @@ -1066,20 +1071,38 @@ static void tso_fill_packet_with_fragmen KASSERT(tso->in_len > 0, ("TSO input length went negative")); KASSERT(tso->packet_space > 0, ("TSO packet space went negative")); - n = min(tso->in_len, tso->packet_space); + if (tso->fw_assisted & SFXGE_FATSOV2) { + n = tso->in_len; + tso->out_len -= n; + tso->seqnum += n; + tso->in_len = 0; + if (n < tso->packet_space) { + tso->packet_space -= n; + tso->segs_space--; + } else { + tso->packet_space = tso->seg_size - + (n - tso->packet_space) % tso->seg_size; + tso->segs_space = + EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX - 1 - + (tso->packet_space != tso->seg_size); + } + } else { + n = min(tso->in_len, tso->packet_space); + tso->packet_space -= n; + tso->out_len -= n; + tso->dma_addr += n; + tso->in_len -= n; + } - tso->packet_space -= n; - tso->out_len -= n; - tso->in_len -= n; + /* + * It is OK to use binary OR below to avoid extra branching + * since all conditions may always be checked. + */ + eop = (tso->out_len == 0) | (tso->packet_space == 0) | + (tso->segs_space == 0); desc = &txq->pend_desc[txq->n_pend_desc++]; - efx_tx_qdesc_dma_create(txq->common, - tso->dma_addr, - n, - tso->out_len == 0 || tso->packet_space == 0, - desc); - - tso->dma_addr += n; + efx_tx_qdesc_dma_create(txq->common, dma_addr, n, eop, desc); } /* Callback from bus_dmamap_load() for long TSO headers. */ @@ -1112,28 +1135,47 @@ static int tso_start_new_packet(struct s int rc; if (tso->fw_assisted) { - uint8_t tcp_flags = tso->tcp_flags; + if (tso->fw_assisted & SFXGE_FATSOV2) { + /* Add 2 FATSOv2 option descriptors */ + desc = &txq->pend_desc[txq->n_pend_desc]; + efx_tx_qdesc_tso2_create(txq->common, + tso->packet_id, + tso->seqnum, + tso->seg_size, + desc, + EFX_TX_FATSOV2_OPT_NDESCS); + desc += EFX_TX_FATSOV2_OPT_NDESCS; + txq->n_pend_desc += EFX_TX_FATSOV2_OPT_NDESCS; + KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0")); + id = (id + EFX_TX_FATSOV2_OPT_NDESCS) & txq->ptr_mask; - if (tso->out_len > tso->seg_size) - tcp_flags &= ~(TH_FIN | TH_PUSH); + tso->segs_space = + EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX - 1; + } else { + uint8_t tcp_flags = tso->tcp_flags; - /* TSO option descriptor */ - desc = &txq->pend_desc[txq->n_pend_desc++]; - efx_tx_qdesc_tso_create(txq->common, - tso->packet_id, - tso->seqnum, - tcp_flags, - desc++); - KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0")); - id = (id + 1) & txq->ptr_mask; + if (tso->out_len > tso->seg_size) + tcp_flags &= ~(TH_FIN | TH_PUSH); + + /* Add FATSOv1 option descriptor */ + desc = &txq->pend_desc[txq->n_pend_desc++]; + efx_tx_qdesc_tso_create(txq->common, + tso->packet_id, + tso->seqnum, + tcp_flags, + desc++); + KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0")); + id = (id + 1) & txq->ptr_mask; + + tso->seqnum += tso->seg_size; + tso->segs_space = UINT_MAX; + } /* Header DMA descriptor */ *desc = tso->header_desc; txq->n_pend_desc++; KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0")); id = (id + 1) & txq->ptr_mask; - - tso->seqnum += tso->seg_size; } else { /* Allocate a DMA-mapped header buffer. */ if (__predict_true(tso->header_len <= TSOH_STD_SIZE)) { @@ -1215,6 +1257,8 @@ static int tso_start_new_packet(struct s 0, desc); id = (id + 1) & txq->ptr_mask; + + tso->segs_space = UINT_MAX; } tso->packet_space = tso->seg_size; txq->tso_packets++; @@ -1264,15 +1308,19 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq } /* End of packet? */ - if (tso.packet_space == 0) { + if ((tso.packet_space == 0) | (tso.segs_space == 0)) { + unsigned int n_fatso_opt_desc = + (tso.fw_assisted & SFXGE_FATSOV2) ? + EFX_TX_FATSOV2_OPT_NDESCS : + (tso.fw_assisted & SFXGE_FATSOV1) ? 1 : 0; + /* If the queue is now full due to tiny MSS, * or we can't create another header, discard * the remainder of the input mbuf but do not * roll back the work we have done. */ - if (txq->n_pend_desc + tso.fw_assisted + - 1 /* header */ + n_dma_seg > - txq->max_pkt_desc) { + if (txq->n_pend_desc + n_fatso_opt_desc + + 1 /* header */ + n_dma_seg > txq->max_pkt_desc) { txq->tso_pdrop_too_many++; break; } @@ -1407,12 +1455,67 @@ sfxge_tx_qstop(struct sfxge_softc *sc, u SFXGE_TXQ_UNLOCK(txq); } +/* + * Estimate maximum number of Tx descriptors required for TSO packet. + * With minimum MSS and maximum mbuf length we might need more (even + * than a ring-ful of descriptors), but this should not happen in + * practice except due to deliberate attack. In that case we will + * truncate the output at a packet boundary. + */ +static unsigned int +sfxge_tx_max_pkt_desc(const struct sfxge_softc *sc, enum sfxge_txq_type type, + unsigned int tso_fw_assisted) +{ + /* One descriptor for every input fragment */ + unsigned int max_descs = SFXGE_TX_MAPPING_MAX_SEG; + unsigned int sw_tso_max_descs; + unsigned int fa_tso_v1_max_descs = 0; + unsigned int fa_tso_v2_max_descs = 0; + + /* VLAN tagging Tx option descriptor may be required */ + if (efx_nic_cfg_get(sc->enp)->enc_hw_tx_insert_vlan_enabled) + max_descs++; + + if (type == SFXGE_TXQ_IP_TCP_UDP_CKSUM) { + /* + * Plus header and payload descriptor for each output segment. + * Minus one since header fragment is already counted. + * Even if FATSO is used, we should be ready to fallback + * to do it in the driver. + */ + sw_tso_max_descs = SFXGE_TSO_MAX_SEGS * 2 - 1; + + /* FW assisted TSOv1 requires one more descriptor per segment + * in comparison to SW TSO */ + if (tso_fw_assisted & SFXGE_FATSOV1) + fa_tso_v1_max_descs = + sw_tso_max_descs + SFXGE_TSO_MAX_SEGS; + + /* FW assisted TSOv2 requires 3 (2 FATSO plus header) extra + * descriptors per superframe limited by number of DMA fetches + * per packet. The first packet header is already counted. + */ + if (tso_fw_assisted & SFXGE_FATSOV2) { + fa_tso_v2_max_descs = + howmany(SFXGE_TX_MAPPING_MAX_SEG, + EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX - 1) * + (EFX_TX_FATSOV2_OPT_NDESCS + 1) - 1; + } + + max_descs += MAX(sw_tso_max_descs, + MAX(fa_tso_v1_max_descs, fa_tso_v2_max_descs)); + } + + return (max_descs); +} + static int sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int index) { struct sfxge_txq *txq; efsys_mem_t *esmp; uint16_t flags; + unsigned int tso_fw_assisted; struct sfxge_evq *evq; unsigned int desc_index; int rc; @@ -1434,6 +1537,7 @@ sfxge_tx_qstart(struct sfxge_softc *sc, return (rc); /* Determine the kind of queue we are creating. */ + tso_fw_assisted = 0; switch (txq->type) { case SFXGE_TXQ_NON_CKSUM: flags = 0; @@ -1443,6 +1547,9 @@ sfxge_tx_qstart(struct sfxge_softc *sc, break; case SFXGE_TXQ_IP_TCP_UDP_CKSUM: flags = EFX_TXQ_CKSUM_IPV4 | EFX_TXQ_CKSUM_TCPUDP; + tso_fw_assisted = sc->tso_fw_assisted; + if (tso_fw_assisted & SFXGE_FATSOV2) + flags |= EFX_TXQ_FATSOV2; break; default: KASSERT(0, ("Impossible TX queue")); @@ -1453,8 +1560,19 @@ sfxge_tx_qstart(struct sfxge_softc *sc, /* Create the common code transmit queue. */ if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp, sc->txq_entries, txq->buf_base_id, flags, evq->common, - &txq->common, &desc_index)) != 0) - goto fail; + &txq->common, &desc_index)) != 0) { + /* Retry if no FATSOv2 resources, otherwise fail */ + if ((rc != ENOSPC) || (~flags & EFX_TXQ_FATSOV2)) + goto fail; + + /* Looks like all FATSOv2 contexts are used */ + flags &= ~EFX_TXQ_FATSOV2; + tso_fw_assisted &= ~SFXGE_FATSOV2; + if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp, + sc->txq_entries, txq->buf_base_id, flags, evq->common, + &txq->common, &desc_index)) != 0) + goto fail; + } /* Initialise queue descriptor indexes */ txq->added = txq->pending = txq->completed = txq->reaped = desc_index; @@ -1466,6 +1584,10 @@ sfxge_tx_qstart(struct sfxge_softc *sc, txq->init_state = SFXGE_TXQ_STARTED; txq->flush_state = SFXGE_FLUSH_REQUIRED; + txq->tso_fw_assisted = tso_fw_assisted; + + txq->max_pkt_desc = sfxge_tx_max_pkt_desc(sc, txq->type, + tso_fw_assisted); SFXGE_TXQ_UNLOCK(txq); @@ -1574,38 +1696,6 @@ sfxge_tx_qfini(struct sfxge_softc *sc, u free(txq, M_SFXGE); } -/* - * Estimate maximum number of Tx descriptors required for TSO packet. - * With minimum MSS and maximum mbuf length we might need more (even - * than a ring-ful of descriptors), but this should not happen in - * practice except due to deliberate attack. In that case we will - * truncate the output at a packet boundary. - */ -static unsigned int -sfxge_tx_max_pkt_desc(const struct sfxge_softc *sc, enum sfxge_txq_type type) -{ - /* One descriptor for every input fragment */ - unsigned int max_descs = SFXGE_TX_MAPPING_MAX_SEG; - - /* VLAN tagging Tx option descriptor may be required */ - if (efx_nic_cfg_get(sc->enp)->enc_hw_tx_insert_vlan_enabled) - max_descs++; - - if (type == SFXGE_TXQ_IP_TCP_UDP_CKSUM) { - /* - * Plus header and payload descriptor for each output segment. - * Minus one since header fragment is already counted. - */ - max_descs += SFXGE_TSO_MAX_SEGS * 2 - 1; - - /* FW assisted TSO requires one more descriptor per segment */ - if (sc->tso_fw_assisted) - max_descs += SFXGE_TSO_MAX_SEGS; - } - - return (max_descs); -} - static int sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index, enum sfxge_txq_type type, unsigned int evq_index) @@ -1735,8 +1825,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u txq->init_state = SFXGE_TXQ_INITIALIZED; txq->hw_vlan_tci = 0; - txq->max_pkt_desc = sfxge_tx_max_pkt_desc(sc, type); - return (0); fail_txq_stat_init: @@ -1852,10 +1940,12 @@ sfxge_tx_init(struct sfxge_softc *sc) sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc; sc->tso_fw_assisted = sfxge_tso_fw_assisted; - if (sc->tso_fw_assisted) - sc->tso_fw_assisted = - (encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO) && - (encp->enc_fw_assisted_tso_enabled); + if ((~encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO) || + (!encp->enc_fw_assisted_tso_enabled)) + sc->tso_fw_assisted &= ~SFXGE_FATSOV1; + if ((~encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO_V2) || + (!encp->enc_fw_assisted_tso_v2_enabled)) + sc->tso_fw_assisted &= ~SFXGE_FATSOV2; sc->txqs_node = SYSCTL_ADD_NODE( device_get_sysctl_ctx(sc->dev), Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Jan 20 08:05:56 2016 (r294389) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Jan 20 08:07:30 2016 (r294390) @@ -170,6 +170,7 @@ struct sfxge_txq { struct sfxge_softc *sc; enum sfxge_txq_state init_state; enum sfxge_flush_state flush_state; + unsigned int tso_fw_assisted; enum sfxge_txq_type type; unsigned int txq_index; unsigned int evq_index; From owner-svn-src-stable@freebsd.org Wed Jan 20 08:08:45 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD323A89A28; Wed, 20 Jan 2016 08:08:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84C101C28; Wed, 20 Jan 2016 08:08:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K88iQa030770; Wed, 20 Jan 2016 08:08:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K88i1D030767; Wed, 20 Jan 2016 08:08:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200808.u0K88i1D030767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:08:44 +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: r294391 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:08:45 -0000 Author: arybchik Date: Wed Jan 20 08:08:44 2016 New Revision: 294391 URL: https://svnweb.freebsd.org/changeset/base/294391 Log: MFC r294078 sfxge: medford stores a single global copy of VPD Not per PF copies as on Huntington. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/hunt_vpd.c stable/10/sys/dev/sfxge/common/medford_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Wed Jan 20 08:07:30 2016 (r294390) +++ stable/10/sys/dev/sfxge/common/efx.h Wed Jan 20 08:08:44 2016 (r294391) @@ -1162,6 +1162,8 @@ typedef struct efx_nic_cfg_s { /* External port identifier */ uint8_t enc_external_port; uint32_t enc_mcdi_max_payload_length; + /* VPD may be per-PF or global */ + boolean_t enc_vpd_is_global; } efx_nic_cfg_t; #define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff) Modified: stable/10/sys/dev/sfxge/common/hunt_vpd.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_vpd.c Wed Jan 20 08:07:30 2016 (r294390) +++ stable/10/sys/dev/sfxge/common/hunt_vpd.c Wed Jan 20 08:08:44 2016 (r294391) @@ -48,13 +48,20 @@ ef10_vpd_init( caddr_t svpd; size_t svpd_size; uint32_t pci_pf; + uint32_t tag; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - pci_pf = enp->en_nic_cfg.enc_pf; + if (enp->en_nic_cfg.enc_vpd_is_global) { + tag = TLV_TAG_GLOBAL_STATIC_VPD; + } else { + pci_pf = enp->en_nic_cfg.enc_pf; + tag = TLV_TAG_PF_STATIC_VPD(pci_pf); + } + /* * The VPD interface exposes VPD resources from the combined static and * dynamic VPD storage. As the static VPD configuration should *never* @@ -64,8 +71,7 @@ ef10_vpd_init( svpd_size = 0; rc = ef10_nvram_partn_read_tlv(enp, NVRAM_PARTITION_TYPE_STATIC_CONFIG, - TLV_TAG_PF_STATIC_VPD(pci_pf), - &svpd, &svpd_size); + tag, &svpd, &svpd_size); if (rc != 0) { if (rc == EACCES) { /* Unpriviledged functions cannot access VPD */ @@ -132,17 +138,22 @@ ef10_vpd_read( caddr_t dvpd; size_t dvpd_size; uint32_t pci_pf; + uint32_t tag; efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - pci_pf = enp->en_nic_cfg.enc_pf; + if (enp->en_nic_cfg.enc_vpd_is_global) { + tag = TLV_TAG_GLOBAL_DYNAMIC_VPD; + } else { + pci_pf = enp->en_nic_cfg.enc_pf; + tag = TLV_TAG_PF_DYNAMIC_VPD(pci_pf); + } if ((rc = ef10_nvram_partn_read_tlv(enp, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, - TLV_TAG_PF_DYNAMIC_VPD(pci_pf), - &dvpd, &dvpd_size)) != 0) + tag, &dvpd, &dvpd_size)) != 0) goto fail1; if (dvpd_size > size) { @@ -396,12 +407,18 @@ ef10_vpd_write( { size_t vpd_length; uint32_t pci_pf; + uint32_t tag; efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - pci_pf = enp->en_nic_cfg.enc_pf; + if (enp->en_nic_cfg.enc_vpd_is_global) { + tag = TLV_TAG_GLOBAL_DYNAMIC_VPD; + } else { + pci_pf = enp->en_nic_cfg.enc_pf; + tag = TLV_TAG_PF_DYNAMIC_VPD(pci_pf); + } /* Determine total length of new dynamic VPD */ if ((rc = efx_vpd_hunk_length(data, size, &vpd_length)) != 0) @@ -410,8 +427,7 @@ ef10_vpd_write( /* Store new dynamic VPD in all segments in DYNAMIC_CONFIG partition */ if ((rc = ef10_nvram_partn_write_segment_tlv(enp, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, - TLV_TAG_PF_DYNAMIC_VPD(pci_pf), - data, vpd_length, B_TRUE)) != 0) { + tag, data, vpd_length, B_TRUE)) != 0) { goto fail2; } Modified: stable/10/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/medford_nic.c Wed Jan 20 08:07:30 2016 (r294390) +++ stable/10/sys/dev/sfxge/common/medford_nic.c Wed Jan 20 08:08:44 2016 (r294391) @@ -212,6 +212,12 @@ medford_board_cfg( */ encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; + /* + * Medford stores a single global copy of VPD, not per-PF as on + * Huntington. + */ + encp->enc_vpd_is_global = B_TRUE; + return (0); fail11: From owner-svn-src-stable@freebsd.org Wed Jan 20 08:11:13 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAFA5A89B54; Wed, 20 Jan 2016 08:11:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CD371E2F; Wed, 20 Jan 2016 08:11:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8BCY7033488; Wed, 20 Jan 2016 08:11:12 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8BCUE033484; Wed, 20 Jan 2016 08:11:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200811.u0K8BCUE033484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:11: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: r294392 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:11:13 -0000 Author: arybchik Date: Wed Jan 20 08:11:12 2016 New Revision: 294392 URL: https://svnweb.freebsd.org/changeset/base/294392 Log: MFC r294079 sfxge: Medford still needs fallback for no privilege mask Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/ef10_impl.h stable/10/sys/dev/sfxge/common/hunt_impl.h stable/10/sys/dev/sfxge/common/hunt_nic.c stable/10/sys/dev/sfxge/common/medford_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_impl.h Wed Jan 20 08:08:44 2016 (r294391) +++ stable/10/sys/dev/sfxge/common/ef10_impl.h Wed Jan 20 08:11:12 2016 (r294392) @@ -81,6 +81,11 @@ extern __checkReturn efx_rc_t ef10_get_datapath_caps( __in efx_nic_t *enp); +extern __checkReturn efx_rc_t +ef10_get_privilege_mask( + __in efx_nic_t *enp, + __out uint32_t *maskp); + extern __checkReturn efx_rc_t ef10_external_port_mapping( __in efx_nic_t *enp, Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:08:44 2016 (r294391) +++ stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:11:12 2016 (r294392) @@ -715,7 +715,7 @@ ef10_tx_qstats_update( #define HUNT_MIN_PIO_ALLOC_SIZE (HUNT_PIOBUF_SIZE / 32) -#define HUNT_LEGACY_PF_PRIVILEGE_MASK \ +#define EF10_LEGACY_PF_PRIVILEGE_MASK \ (MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN | \ MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK | \ MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD | \ @@ -728,7 +728,7 @@ ef10_tx_qstats_update( MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST | \ MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS) -#define HUNT_LEGACY_VF_PRIVILEGE_MASK 0 +#define EF10_LEGACY_VF_PRIVILEGE_MASK 0 typedef uint32_t efx_piobuf_handle_t; Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 08:08:44 2016 (r294391) +++ stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 08:11:12 2016 (r294392) @@ -980,6 +980,42 @@ fail1: return (rc); } + + __checkReturn efx_rc_t +ef10_get_privilege_mask( + __in efx_nic_t *enp, + __out uint32_t *maskp) +{ + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + uint32_t mask; + efx_rc_t rc; + + if ((rc = efx_mcdi_privilege_mask(enp, encp->enc_pf, encp->enc_vf, + &mask)) != 0) { + if (rc != ENOTSUP) + goto fail1; + + /* Fallback for old firmware without privilege mask support */ + if (EFX_PCI_FUNCTION_IS_PF(encp)) { + /* Assume PF has admin privilege */ + mask = EF10_LEGACY_PF_PRIVILEGE_MASK; + } else { + /* VF is always unprivileged by default */ + mask = EF10_LEGACY_VF_PRIVILEGE_MASK; + } + } + + *maskp = mask; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + /* * The external port mapping is a one-based numbering of the external * connectors on the board. It does not distinguish off-board separated @@ -1312,20 +1348,8 @@ hunt_board_cfg( * the privilege mask to check for sufficient privileges, as that * can result in time-of-check/time-of-use bugs. */ - if ((rc = efx_mcdi_privilege_mask(enp, pf, vf, &mask)) != 0) { - if (rc != ENOTSUP) - goto fail13; - - /* Fallback for old firmware without privilege mask support */ - if (EFX_PCI_FUNCTION_IS_PF(encp)) { - /* Assume PF has admin privilege */ - mask = HUNT_LEGACY_PF_PRIVILEGE_MASK; - } else { - /* VF is always unprivileged by default */ - mask = HUNT_LEGACY_VF_PRIVILEGE_MASK; - } - } - + if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) + goto fail13; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ Modified: stable/10/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/medford_nic.c Wed Jan 20 08:08:44 2016 (r294391) +++ stable/10/sys/dev/sfxge/common/medford_nic.c Wed Jan 20 08:11:12 2016 (r294392) @@ -189,9 +189,8 @@ medford_board_cfg( * the privilege mask to check for sufficient privileges, as that * can result in time-of-check/time-of-use bugs. */ - if ((rc = efx_mcdi_privilege_mask(enp, pf, vf, &mask)) != 0) + if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) goto fail10; - encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ From owner-svn-src-stable@freebsd.org Wed Jan 20 08:13:12 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 178A7A89D97; Wed, 20 Jan 2016 08:13:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD2A81481; Wed, 20 Jan 2016 08:13:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8DAh3033614; Wed, 20 Jan 2016 08:13:10 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8DASY033613; Wed, 20 Jan 2016 08:13:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200813.u0K8DASY033613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:13:10 +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: r294393 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:13:12 -0000 Author: arybchik Date: Wed Jan 20 08:13:10 2016 New Revision: 294393 URL: https://svnweb.freebsd.org/changeset/base/294393 Log: MFC r294081 sfxge: cleanup: simplify ef10_get_datapath_caps Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 08:11:12 2016 (r294392) +++ stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 08:13:10 2016 (r294393) @@ -430,8 +430,8 @@ fail1: static __checkReturn efx_rc_t efx_mcdi_get_capabilities( __in efx_nic_t *enp, - __out efx_dword_t *flagsp, - __out efx_dword_t *flags2p) + __out uint32_t *flagsp, + __out uint32_t *flags2p) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, @@ -457,13 +457,12 @@ efx_mcdi_get_capabilities( goto fail2; } - *flagsp = *MCDI_OUT2(req, efx_dword_t, GET_CAPABILITIES_OUT_FLAGS1); + *flagsp = MCDI_OUT_DWORD(req, GET_CAPABILITIES_OUT_FLAGS1); if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) - EFX_ZERO_DWORD(*flags2p); + *flags2p = 0; else - *flags2p = *MCDI_OUT2(req, efx_dword_t, - GET_CAPABILITIES_V2_OUT_FLAGS2); + *flags2p = MCDI_OUT_DWORD(req, GET_CAPABILITIES_V2_OUT_FLAGS2); return (0); @@ -897,78 +896,63 @@ ef10_get_datapath_caps( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - efx_dword_t datapath_capabilities; - efx_dword_t datapath_capabilities_v2; + uint32_t flags; + uint32_t flags2; efx_rc_t rc; - if ((rc = efx_mcdi_get_capabilities(enp, &datapath_capabilities, - &datapath_capabilities_v2)) != 0) + if ((rc = efx_mcdi_get_capabilities(enp, &flags, &flags2)) != 0) goto fail1; +#define CAP_FLAG(flags1, field) \ + ((flags1) & (1 << (MC_CMD_GET_CAPABILITIES_V2_OUT_ ## field ## _LBN))) + +#define CAP_FLAG2(flags2, field) \ + ((flags2) & (1 << (MC_CMD_GET_CAPABILITIES_V2_OUT_ ## field ## _LBN))) + /* * Huntington RXDP firmware inserts a 0 or 14 byte prefix. * We only support the 14 byte prefix here. */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14) != 1) { + if (CAP_FLAG(flags, RX_PREFIX_LEN_14) == 0) { rc = ENOTSUP; goto fail2; } encp->enc_rx_prefix_size = 14; /* Check if the firmware supports TSO */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_TX_TSO) == 1) - encp->enc_fw_assisted_tso_enabled = B_TRUE; - else - encp->enc_fw_assisted_tso_enabled = B_FALSE; + encp->enc_fw_assisted_tso_enabled = + CAP_FLAG(flags, TX_TSO) ? B_TRUE : B_FALSE; /* Check if the firmware supports FATSOv2 */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities_v2, - GET_CAPABILITIES_V2_OUT_TX_TSO_V2) == 1) - encp->enc_fw_assisted_tso_v2_enabled = B_TRUE; - else - encp->enc_fw_assisted_tso_v2_enabled = B_FALSE; + encp->enc_fw_assisted_tso_v2_enabled = + CAP_FLAG2(flags2, TX_TSO_V2) ? B_TRUE : B_FALSE; /* Check if the firmware has vadapter/vport/vswitch support */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_EVB) == 1) - encp->enc_datapath_cap_evb = B_TRUE; - else - encp->enc_datapath_cap_evb = B_FALSE; + encp->enc_datapath_cap_evb = + CAP_FLAG(flags, EVB) ? B_TRUE : B_FALSE; /* Check if the firmware supports VLAN insertion */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_TX_VLAN_INSERTION) == 1) - encp->enc_hw_tx_insert_vlan_enabled = B_TRUE; - else - encp->enc_hw_tx_insert_vlan_enabled = B_FALSE; + encp->enc_hw_tx_insert_vlan_enabled = + CAP_FLAG(flags, TX_VLAN_INSERTION) ? B_TRUE : B_FALSE; /* Check if the firmware supports RX event batching */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_RX_BATCHING) == 1) { - encp->enc_rx_batching_enabled = B_TRUE; + encp->enc_rx_batching_enabled = + CAP_FLAG(flags, RX_BATCHING) ? B_TRUE : B_FALSE; + + if (encp->enc_rx_batching_enabled) encp->enc_rx_batch_max = 16; - } else { - encp->enc_rx_batching_enabled = B_FALSE; - } /* Check if the firmware supports disabling scatter on RXQs */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_RX_DISABLE_SCATTER) == 1) { - encp->enc_rx_disable_scatter_supported = B_TRUE; - } else { - encp->enc_rx_disable_scatter_supported = B_FALSE; - } + encp->enc_rx_disable_scatter_supported = + CAP_FLAG(flags, RX_DISABLE_SCATTER) ? B_TRUE : B_FALSE; /* Check if the firmware supports set mac with running filters */ - if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, - GET_CAPABILITIES_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED) - == 1) { - encp->enc_allow_set_mac_with_installed_filters = B_TRUE; - } else { - encp->enc_allow_set_mac_with_installed_filters = B_FALSE; - } + encp->enc_allow_set_mac_with_installed_filters = + CAP_FLAG(flags, VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED) ? + B_TRUE : B_FALSE; + +#undef CAP_FLAG +#undef CAP_FLAG2 return (0); From owner-svn-src-stable@freebsd.org Wed Jan 20 08:14:01 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CFFBA89E05; Wed, 20 Jan 2016 08:14:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CF3D1613; Wed, 20 Jan 2016 08:14:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8E0b1033705; Wed, 20 Jan 2016 08:14:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8DxYb033694; Wed, 20 Jan 2016 08:13:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200813.u0K8DxYb033694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:13: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: r294394 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:14:01 -0000 Author: arybchik Date: Wed Jan 20 08:13:59 2016 New Revision: 294394 URL: https://svnweb.freebsd.org/changeset/base/294394 Log: MFC r294091 sfxge: rename common hunt PHY methods to ef10 and use for Medford Leaving BIST methods for now as, though the Medford bootrom now has lots of BIST support, production firmware doesn't appear to have been updated yet. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_phy.c stable/10/sys/dev/sfxge/common/hunt_ev.c stable/10/sys/dev/sfxge/common/hunt_impl.h stable/10/sys/dev/sfxge/common/hunt_mac.c stable/10/sys/dev/sfxge/common/hunt_nic.c stable/10/sys/dev/sfxge/common/hunt_phy.c stable/10/sys/dev/sfxge/common/medford_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_phy.c Wed Jan 20 08:13:10 2016 (r294393) +++ stable/10/sys/dev/sfxge/common/efx_phy.c Wed Jan 20 08:13:59 2016 (r294394) @@ -265,33 +265,34 @@ static efx_phy_ops_t __efx_phy_siena_ops }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON -static efx_phy_ops_t __efx_phy_hunt_ops = { - hunt_phy_power, /* epo_power */ +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +static efx_phy_ops_t __efx_phy_ef10_ops = { + ef10_phy_power, /* epo_power */ NULL, /* epo_reset */ - hunt_phy_reconfigure, /* epo_reconfigure */ - hunt_phy_verify, /* epo_verify */ + ef10_phy_reconfigure, /* epo_reconfigure */ + ef10_phy_verify, /* epo_verify */ NULL, /* epo_uplink_check */ NULL, /* epo_downlink_check */ - hunt_phy_oui_get, /* epo_oui_get */ + ef10_phy_oui_get, /* epo_oui_get */ #if EFSYS_OPT_PHY_STATS - hunt_phy_stats_update, /* epo_stats_update */ + ef10_phy_stats_update, /* epo_stats_update */ #endif /* EFSYS_OPT_PHY_STATS */ #if EFSYS_OPT_PHY_PROPS #if EFSYS_OPT_NAMES - hunt_phy_prop_name, /* epo_prop_name */ + ef10_phy_prop_name, /* epo_prop_name */ #endif - hunt_phy_prop_get, /* epo_prop_get */ - hunt_phy_prop_set, /* epo_prop_set */ + ef10_phy_prop_get, /* epo_prop_get */ + ef10_phy_prop_set, /* epo_prop_set */ #endif /* EFSYS_OPT_PHY_PROPS */ #if EFSYS_OPT_BIST + /* FIXME: Are these BIST methods appropriate for Medford? */ hunt_bist_enable_offline, /* epo_bist_enable_offline */ hunt_bist_start, /* epo_bist_start */ hunt_bist_poll, /* epo_bist_poll */ hunt_bist_stop, /* epo_bist_stop */ #endif /* EFSYS_OPT_BIST */ }; -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ __checkReturn efx_rc_t efx_phy_probe( @@ -356,9 +357,14 @@ efx_phy_probe( #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - epop = (efx_phy_ops_t *)&__efx_phy_hunt_ops; + epop = (efx_phy_ops_t *)&__efx_phy_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + epop = (efx_phy_ops_t *)&__efx_phy_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ default: rc = ENOTSUP; goto fail1; Modified: stable/10/sys/dev/sfxge/common/hunt_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_ev.c Wed Jan 20 08:13:10 2016 (r294393) +++ stable/10/sys/dev/sfxge/common/hunt_ev.c Wed Jan 20 08:13:59 2016 (r294394) @@ -835,7 +835,7 @@ ef10_ev_mcdi( case MCDI_EVENT_CODE_LINKCHANGE: { efx_link_mode_t link_mode; - hunt_phy_link_ev(enp, eqp, &link_mode); + ef10_phy_link_ev(enp, eqp, &link_mode); should_abort = eecp->eec_link_change(arg, link_mode); break; } Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:13:10 2016 (r294393) +++ stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:13:59 2016 (r294394) @@ -462,38 +462,38 @@ typedef struct ef10_link_state_s { } ef10_link_state_t; extern void -hunt_phy_link_ev( +ef10_phy_link_ev( __in efx_nic_t *enp, __in efx_qword_t *eqp, __out efx_link_mode_t *link_modep); extern __checkReturn efx_rc_t -hunt_phy_get_link( +ef10_phy_get_link( __in efx_nic_t *enp, __out ef10_link_state_t *elsp); extern __checkReturn efx_rc_t -hunt_phy_power( +ef10_phy_power( __in efx_nic_t *enp, __in boolean_t on); extern __checkReturn efx_rc_t -hunt_phy_reconfigure( +ef10_phy_reconfigure( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_phy_verify( +ef10_phy_verify( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_phy_oui_get( +ef10_phy_oui_get( __in efx_nic_t *enp, __out uint32_t *ouip); #if EFSYS_OPT_PHY_STATS extern __checkReturn efx_rc_t -hunt_phy_stats_update( +ef10_phy_stats_update( __in efx_nic_t *enp, __in efsys_mem_t *esmp, __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat); @@ -505,21 +505,21 @@ hunt_phy_stats_update( #if EFSYS_OPT_NAMES extern const char * -hunt_phy_prop_name( +ef10_phy_prop_name( __in efx_nic_t *enp, __in unsigned int id); #endif /* EFSYS_OPT_NAMES */ extern __checkReturn efx_rc_t -hunt_phy_prop_get( +ef10_phy_prop_get( __in efx_nic_t *enp, __in unsigned int id, __in uint32_t flags, __out uint32_t *valp); extern __checkReturn efx_rc_t -hunt_phy_prop_set( +ef10_phy_prop_set( __in efx_nic_t *enp, __in unsigned int id, __in uint32_t val); Modified: stable/10/sys/dev/sfxge/common/hunt_mac.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_mac.c Wed Jan 20 08:13:10 2016 (r294393) +++ stable/10/sys/dev/sfxge/common/hunt_mac.c Wed Jan 20 08:13:59 2016 (r294394) @@ -51,7 +51,7 @@ hunt_mac_poll( ef10_link_state_t els; efx_rc_t rc; - if ((rc = hunt_phy_get_link(enp, &els)) != 0) + if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail1; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -86,7 +86,7 @@ hunt_mac_up( * Because Huntington doesn't *require* polling, we can't rely on * hunt_mac_poll() being executed to populate epp->ep_mac_up. */ - if ((rc = hunt_phy_get_link(enp, &els)) != 0) + if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail1; *mac_upp = els.els_mac_up; Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 08:13:10 2016 (r294393) +++ stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 08:13:59 2016 (r294394) @@ -1190,7 +1190,7 @@ hunt_board_cfg( goto fail6; /* Obtain the default PHY advertised capabilities */ - if ((rc = hunt_phy_get_link(enp, &els)) != 0) + if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail7; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; Modified: stable/10/sys/dev/sfxge/common/hunt_phy.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_phy.c Wed Jan 20 08:13:10 2016 (r294393) +++ stable/10/sys/dev/sfxge/common/hunt_phy.c Wed Jan 20 08:13:59 2016 (r294394) @@ -37,15 +37,10 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_HUNTINGTON static void -hunt_phy_decode_cap( +mcdi_phy_decode_cap( __in uint32_t mcdi_cap, __out uint32_t *maskp) { - /* - * TBD: consider common Siena/Hunt function: Hunt is a superset of - * Siena here (adds 40G) - */ - uint32_t mask; mask = 0; @@ -76,7 +71,7 @@ hunt_phy_decode_cap( } static void -hunt_phy_decode_link_mode( +mcdi_phy_decode_link_mode( __in efx_nic_t *enp, __in uint32_t link_flags, __in unsigned int speed, @@ -84,11 +79,6 @@ hunt_phy_decode_link_mode( __out efx_link_mode_t *link_modep, __out unsigned int *fcntlp) { - /* - * TBD: consider common Siena/Hunt function: Hunt is a superset of - * Siena here (adds 40G and generate-only flow control) - */ - boolean_t fd = !!(link_flags & (1 << MC_CMD_GET_LINK_OUT_FULL_DUPLEX_LBN)); boolean_t up = !!(link_flags & @@ -127,16 +117,11 @@ hunt_phy_decode_link_mode( void -hunt_phy_link_ev( +ef10_phy_link_ev( __in efx_nic_t *enp, __in efx_qword_t *eqp, __out efx_link_mode_t *link_modep) { - /* - * TBD: consider common Siena/Hunt function: Hunt is a superset of - * Siena here (adds 40G) - */ - efx_port_t *epp = &(enp->en_port); unsigned int link_flags; unsigned int speed; @@ -167,10 +152,10 @@ hunt_phy_link_ev( } link_flags = MCDI_EV_FIELD(eqp, LINKCHANGE_LINK_FLAGS); - hunt_phy_decode_link_mode(enp, link_flags, speed, + mcdi_phy_decode_link_mode(enp, link_flags, speed, MCDI_EV_FIELD(eqp, LINKCHANGE_FCNTL), &link_mode, &fcntl); - hunt_phy_decode_cap(MCDI_EV_FIELD(eqp, LINKCHANGE_LP_CAP), + mcdi_phy_decode_cap(MCDI_EV_FIELD(eqp, LINKCHANGE_LP_CAP), &lp_cap_mask); /* @@ -191,19 +176,17 @@ hunt_phy_link_ev( } __checkReturn efx_rc_t -hunt_phy_power( +ef10_phy_power( __in efx_nic_t *enp, __in boolean_t power) { - /* TBD: consider common Siena/Hunt function: essentially identical */ - efx_rc_t rc; if (!power) return (0); /* Check if the PHY is a zombie */ - if ((rc = hunt_phy_verify(enp)) != 0) + if ((rc = ef10_phy_verify(enp)) != 0) goto fail1; enp->en_reset_flags |= EFX_RESET_PHY; @@ -217,16 +200,10 @@ fail1: } __checkReturn efx_rc_t -hunt_phy_get_link( +ef10_phy_get_link( __in efx_nic_t *enp, __out ef10_link_state_t *elsp) { - /* - * TBD: consider common Siena/Hunt function: Hunt is very similar - * (at least for now; not clear that the loopbacks should necessarily - * be quite the same...) - */ - efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_LINK_IN_LEN, MC_CMD_GET_LINK_OUT_LEN)]; @@ -251,12 +228,12 @@ hunt_phy_get_link( goto fail2; } - hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_CAP), + mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_CAP), &elsp->els_adv_cap_mask); - hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP), + mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP), &elsp->els_lp_cap_mask); - hunt_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS), + mcdi_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS), MCDI_OUT_DWORD(req, GET_LINK_OUT_LINK_SPEED), MCDI_OUT_DWORD(req, GET_LINK_OUT_FCNTL), &elsp->els_link_mode, &elsp->els_fcntl); @@ -298,15 +275,9 @@ fail1: } __checkReturn efx_rc_t -hunt_phy_reconfigure( +ef10_phy_reconfigure( __in efx_nic_t *enp) { - /* - * TBD: this is a little different for now (no LED support for Hunt - * yet), but ultimately should consider common Siena/Hunt function: - * Hunt should be a superset of Siena here (adds 40G) - */ - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_port_t *epp = &(enp->en_port); efx_mcdi_req_t req; @@ -428,11 +399,9 @@ fail1: } __checkReturn efx_rc_t -hunt_phy_verify( +ef10_phy_verify( __in efx_nic_t *enp) { - /* TBD: consider common Siena/Hunt function: essentially identical */ - efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_PHY_STATE_IN_LEN, MC_CMD_GET_PHY_STATE_OUT_LEN)]; @@ -479,7 +448,7 @@ fail1: } __checkReturn efx_rc_t -hunt_phy_oui_get( +ef10_phy_oui_get( __in efx_nic_t *enp, __out uint32_t *ouip) { @@ -491,7 +460,7 @@ hunt_phy_oui_get( #if EFSYS_OPT_PHY_STATS __checkReturn efx_rc_t -hunt_phy_stats_update( +ef10_phy_stats_update( __in efx_nic_t *enp, __in efsys_mem_t *esmp, __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat) @@ -509,8 +478,8 @@ hunt_phy_stats_update( #if EFSYS_OPT_NAMES -extern const char * -hunt_phy_prop_name( + const char * +ef10_phy_prop_name( __in efx_nic_t *enp, __in unsigned int id) { @@ -521,8 +490,8 @@ hunt_phy_prop_name( #endif /* EFSYS_OPT_NAMES */ -extern __checkReturn efx_rc_t -hunt_phy_prop_get( + __checkReturn efx_rc_t +ef10_phy_prop_get( __in efx_nic_t *enp, __in unsigned int id, __in uint32_t flags, @@ -533,8 +502,8 @@ hunt_phy_prop_get( return (ENOTSUP); } -extern __checkReturn efx_rc_t -hunt_phy_prop_set( + __checkReturn efx_rc_t +ef10_phy_prop_set( __in efx_nic_t *enp, __in unsigned int id, __in uint32_t val) Modified: stable/10/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/medford_nic.c Wed Jan 20 08:13:10 2016 (r294393) +++ stable/10/sys/dev/sfxge/common/medford_nic.c Wed Jan 20 08:13:59 2016 (r294394) @@ -126,7 +126,7 @@ medford_board_cfg( goto fail6; /* Obtain the default PHY advertised capabilities */ - if ((rc = hunt_phy_get_link(enp, &els)) != 0) + if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail7; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; From owner-svn-src-stable@freebsd.org Wed Jan 20 08:14:43 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9465A89E53; Wed, 20 Jan 2016 08:14:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B6141848; Wed, 20 Jan 2016 08:14:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8Egoh033784; Wed, 20 Jan 2016 08:14:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8EgMQ033780; Wed, 20 Jan 2016 08:14:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200814.u0K8EgMQ033780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:14:42 +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: r294395 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:14:43 -0000 Author: arybchik Date: Wed Jan 20 08:14:42 2016 New Revision: 294395 URL: https://svnweb.freebsd.org/changeset/base/294395 Log: MFC r294092 sfxge: rename Huntington MAC methods to EF10 and use for Medford Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/efx_mac.c stable/10/sys/dev/sfxge/common/hunt_impl.h stable/10/sys/dev/sfxge/common/hunt_mac.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 08:13:59 2016 (r294394) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 08:14:42 2016 (r294395) @@ -97,6 +97,7 @@ typedef enum efx_mac_type_e { EFX_MAC_FALCON_XMAC, EFX_MAC_SIENA, EFX_MAC_HUNTINGTON, + EFX_MAC_MEDFORD, EFX_MAC_NTYPES } efx_mac_type_t; Modified: stable/10/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mac.c Wed Jan 20 08:13:59 2016 (r294394) +++ stable/10/sys/dev/sfxge/common/efx_mac.c Wed Jan 20 08:14:42 2016 (r294395) @@ -113,27 +113,27 @@ static efx_mac_ops_t __efx_siena_mac_ops }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON -static efx_mac_ops_t __efx_hunt_mac_ops = { +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +static efx_mac_ops_t __efx_ef10_mac_ops = { NULL, /* emo_reset */ - hunt_mac_poll, /* emo_poll */ - hunt_mac_up, /* emo_up */ - hunt_mac_addr_set, /* emo_addr_set */ - hunt_mac_reconfigure, /* emo_reconfigure */ - hunt_mac_multicast_list_set, /* emo_multicast_list_set */ - hunt_mac_filter_default_rxq_set, /* emo_filter_default_rxq_set */ - hunt_mac_filter_default_rxq_clear, + ef10_mac_poll, /* emo_poll */ + ef10_mac_up, /* emo_up */ + ef10_mac_addr_set, /* emo_addr_set */ + ef10_mac_reconfigure, /* emo_reconfigure */ + ef10_mac_multicast_list_set, /* emo_multicast_list_set */ + ef10_mac_filter_default_rxq_set, /* emo_filter_default_rxq_set */ + ef10_mac_filter_default_rxq_clear, /* emo_filter_default_rxq_clear */ #if EFSYS_OPT_LOOPBACK - hunt_mac_loopback_set, /* emo_loopback_set */ + ef10_mac_loopback_set, /* emo_loopback_set */ #endif /* EFSYS_OPT_LOOPBACK */ #if EFSYS_OPT_MAC_STATS efx_mcdi_mac_stats_upload, /* emo_stats_upload */ efx_mcdi_mac_stats_periodic, /* emo_stats_periodic */ - hunt_mac_stats_update /* emo_stats_update */ + ef10_mac_stats_update /* emo_stats_update */ #endif /* EFSYS_OPT_MAC_STATS */ }; -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ static efx_mac_ops_t *__efx_mac_ops[] = { /* [EFX_MAC_INVALID] */ @@ -158,7 +158,13 @@ static efx_mac_ops_t *__efx_mac_ops[] = #endif /* [EFX_MAC_HUNTINGTON] */ #if EFSYS_OPT_HUNTINGTON - &__efx_hunt_mac_ops, + &__efx_ef10_mac_ops, +#else + NULL, +#endif + /* [EFX_MAC_MEDFORD] */ +#if EFSYS_OPT_MEDFORD + &__efx_ef10_mac_ops, #else NULL, #endif @@ -781,6 +787,13 @@ efx_mac_select( efx_mac_ops_t *emop; int rc = EINVAL; +#if EFSYS_OPT_SIENA + if (enp->en_family == EFX_FAMILY_SIENA) { + type = EFX_MAC_SIENA; + goto chosen; + } +#endif + #if EFSYS_OPT_HUNTINGTON if (enp->en_family == EFX_FAMILY_HUNTINGTON) { type = EFX_MAC_HUNTINGTON; @@ -788,9 +801,9 @@ efx_mac_select( } #endif -#if EFSYS_OPT_SIENA - if (enp->en_family == EFX_FAMILY_SIENA) { - type = EFX_MAC_SIENA; +#if EFSYS_OPT_MEDFORD + if (enp->en_family == EFX_FAMILY_MEDFORD) { + type = EFX_MAC_MEDFORD; goto chosen; } #endif Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:13:59 2016 (r294394) +++ stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:14:42 2016 (r294395) @@ -220,41 +220,41 @@ ef10_nic_unprobe( /* MAC */ extern __checkReturn efx_rc_t -hunt_mac_poll( +ef10_mac_poll( __in efx_nic_t *enp, __out efx_link_mode_t *link_modep); extern __checkReturn efx_rc_t -hunt_mac_up( +ef10_mac_up( __in efx_nic_t *enp, __out boolean_t *mac_upp); extern __checkReturn efx_rc_t -hunt_mac_addr_set( +ef10_mac_addr_set( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_mac_reconfigure( +ef10_mac_reconfigure( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_mac_multicast_list_set( +ef10_mac_multicast_list_set( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_mac_filter_default_rxq_set( +ef10_mac_filter_default_rxq_set( __in efx_nic_t *enp, __in efx_rxq_t *erp, __in boolean_t using_rss); extern void -hunt_mac_filter_default_rxq_clear( +ef10_mac_filter_default_rxq_clear( __in efx_nic_t *enp); #if EFSYS_OPT_LOOPBACK extern __checkReturn efx_rc_t -hunt_mac_loopback_set( +ef10_mac_loopback_set( __in efx_nic_t *enp, __in efx_link_mode_t link_mode, __in efx_loopback_type_t loopback_type); @@ -264,7 +264,7 @@ hunt_mac_loopback_set( #if EFSYS_OPT_MAC_STATS extern __checkReturn efx_rc_t -hunt_mac_stats_update( +ef10_mac_stats_update( __in efx_nic_t *enp, __in efsys_mem_t *esmp, __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat, Modified: stable/10/sys/dev/sfxge/common/hunt_mac.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_mac.c Wed Jan 20 08:13:59 2016 (r294394) +++ stable/10/sys/dev/sfxge/common/hunt_mac.c Wed Jan 20 08:14:42 2016 (r294395) @@ -38,15 +38,10 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_HUNTINGTON __checkReturn efx_rc_t -hunt_mac_poll( +ef10_mac_poll( __in efx_nic_t *enp, __out efx_link_mode_t *link_modep) { - /* - * TBD: Consider a common Siena/Huntington function. The code is - * essentially identical. - */ - efx_port_t *epp = &(enp->en_port); ef10_link_state_t els; efx_rc_t rc; @@ -70,21 +65,16 @@ fail1: } __checkReturn efx_rc_t -hunt_mac_up( +ef10_mac_up( __in efx_nic_t *enp, __out boolean_t *mac_upp) { - /* - * TBD: Consider a common Siena/Huntington function. The code is - * essentially identical. - */ - ef10_link_state_t els; efx_rc_t rc; /* - * Because Huntington doesn't *require* polling, we can't rely on - * hunt_mac_poll() being executed to populate epp->ep_mac_up. + * Because EF10 doesn't *require* polling, we can't rely on + * ef10_mac_poll() being executed to populate epp->ep_mac_up. */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail1; @@ -100,7 +90,7 @@ fail1: } /* - * Huntington uses MC_CMD_VADAPTOR_SET_MAC to set the + * EF10 adapters use MC_CMD_VADAPTOR_SET_MAC to set the * MAC address; the address field in MC_CMD_SET_MAC has no * effect. * MC_CMD_VADAPTOR_SET_MAC requires mac-spoofing privilege and @@ -144,7 +134,7 @@ fail1: } __checkReturn efx_rc_t -hunt_mac_addr_set( +ef10_mac_addr_set( __in efx_nic_t *enp) { efx_rc_t rc; @@ -153,8 +143,11 @@ hunt_mac_addr_set( if (rc != ENOTSUP) goto fail1; - /* Fallback for older firmware without Vadapter support */ - if ((rc = hunt_mac_reconfigure(enp)) != 0) + /* + * Fallback for older Huntington firmware without Vadapter + * support. + */ + if ((rc = ef10_mac_reconfigure(enp)) != 0) goto fail2; } @@ -170,7 +163,7 @@ fail1: } __checkReturn efx_rc_t -hunt_mac_reconfigure( +ef10_mac_reconfigure( __in efx_nic_t *enp) { efx_port_t *epp = &(enp->en_port); @@ -197,6 +190,8 @@ hunt_mac_reconfigure( * from reaching the filters. As Huntington filters drop any * traffic that does not match a filter it is ok to leave the * MAC running in promiscuous mode. See bug41141. + * + * FIXME: Does REJECT_UNCST behave the same way on Medford? */ MCDI_IN_POPULATE_DWORD_2(req, SET_MAC_IN_REJECT, SET_MAC_IN_REJECT_UNCST, 0, @@ -247,16 +242,15 @@ fail1: } __checkReturn efx_rc_t -hunt_mac_multicast_list_set( +ef10_mac_multicast_list_set( __in efx_nic_t *enp) { efx_port_t *epp = &(enp->en_port); efx_mac_ops_t *emop = epp->ep_emop; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); - - /* FIXME: Insert filters for multicast list */ + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); if ((rc = emop->emo_reconfigure(enp)) != 0) goto fail1; @@ -270,7 +264,7 @@ fail1: } __checkReturn efx_rc_t -hunt_mac_filter_default_rxq_set( +ef10_mac_filter_default_rxq_set( __in efx_nic_t *enp, __in efx_rxq_t *erp, __in boolean_t using_rss) @@ -304,7 +298,7 @@ fail1: } void -hunt_mac_filter_default_rxq_clear( +ef10_mac_filter_default_rxq_clear( __in efx_nic_t *enp) { efx_port_t *epp = &(enp->en_port); @@ -322,23 +316,18 @@ hunt_mac_filter_default_rxq_clear( #if EFSYS_OPT_LOOPBACK __checkReturn efx_rc_t -hunt_mac_loopback_set( +ef10_mac_loopback_set( __in efx_nic_t *enp, __in efx_link_mode_t link_mode, __in efx_loopback_type_t loopback_type) { - /* - * TBD: Consider a common Siena/Huntington function. The code is - * essentially identical. - */ - efx_port_t *epp = &(enp->en_port); efx_phy_ops_t *epop = epp->ep_epop; efx_loopback_type_t old_loopback_type; efx_link_mode_t old_loopback_link_mode; efx_rc_t rc; - /* The PHY object handles this on Huntington */ + /* The PHY object handles this on EF10 */ old_loopback_type = epp->ep_loopback_type; old_loopback_link_mode = epp->ep_loopback_link_mode; epp->ep_loopback_type = loopback_type; @@ -362,12 +351,12 @@ fail1: #if EFSYS_OPT_MAC_STATS -#define HUNT_MAC_STAT_READ(_esmp, _field, _eqp) \ +#define EF10_MAC_STAT_READ(_esmp, _field, _eqp) \ EFSYS_MEM_READQ((_esmp), (_field) * sizeof (efx_qword_t), _eqp) __checkReturn efx_rc_t -hunt_mac_stats_update( +ef10_mac_stats_update( __in efx_nic_t *enp, __in efsys_mem_t *esmp, __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat, @@ -381,301 +370,301 @@ hunt_mac_stats_update( /* Read END first so we don't race with the MC */ EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_END, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_END, &generation_end); EFSYS_MEM_READ_BARRIER(); /* TX */ - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_CONTROL_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_CONTROL_PKTS, &value); EFSYS_STAT_SUBR_QWORD(&(stat[EFX_MAC_TX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PAUSE_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PAUSE_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_PAUSE_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_UNICAST_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_UNICAST_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_UNICST_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTICAST_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTICAST_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_MULTICST_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BROADCAST_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BROADCAST_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_BRDCST_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BYTES, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_OCTETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LT64_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LT64_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_64_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_64_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_65_TO_127_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_65_TO_127_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_65_TO_127_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_128_TO_255_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_128_TO_255_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_128_TO_255_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_256_TO_511_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_256_TO_511_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_256_TO_511_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_512_TO_1023_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_512_TO_1023_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_512_TO_1023_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_1024_TO_15XX_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_1024_TO_15XX_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_1024_TO_15XX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_15XX_TO_JUMBO_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_15XX_TO_JUMBO_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_GE_15XX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_GTJUMBO_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_GTJUMBO_PKTS, &value); EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_TX_GE_15XX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BAD_FCS_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BAD_FCS_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_ERRORS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_SINGLE_COLLISION_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_SINGLE_COLLISION_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_SGL_COL_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTIPLE_COLLISION_PKTS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTIPLE_COLLISION_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_MULT_COL_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_COLLISION_PKTS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_COLLISION_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_EX_COL_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LATE_COLLISION_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LATE_COLLISION_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LATE_COL_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_DEFERRED_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_DEFERRED_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_DEF_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_DEFERRED_PKTS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_DEFERRED_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_EX_DEF_PKTS]), &value); /* RX */ - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BYTES, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_OCTETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNICAST_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNICAST_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_UNICST_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MULTICAST_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MULTICAST_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_MULTICST_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BROADCAST_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BROADCAST_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_BRDCST_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PAUSE_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PAUSE_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_PAUSE_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNDERSIZE_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNDERSIZE_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_LE_64_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_64_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_64_PKTS, &value); EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_RX_LE_64_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_65_TO_127_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_65_TO_127_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_65_TO_127_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_128_TO_255_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_128_TO_255_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_128_TO_255_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_256_TO_511_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_256_TO_511_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_256_TO_511_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_512_TO_1023_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_512_TO_1023_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_512_TO_1023_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_1024_TO_15XX_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_1024_TO_15XX_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_1024_TO_15XX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_15XX_TO_JUMBO_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_15XX_TO_JUMBO_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_GE_15XX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_GTJUMBO_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_GTJUMBO_PKTS, &value); EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_RX_GE_15XX_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BAD_FCS_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BAD_FCS_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_FCS_ERRORS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_OVERFLOW_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_OVERFLOW_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_DROP_EVENTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_FALSE_CARRIER_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_FALSE_CARRIER_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_FALSE_CARRIER_ERRORS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_SYMBOL_ERROR_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_SYMBOL_ERROR_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_SYMBOL_ERRORS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_ALIGN_ERROR_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_ALIGN_ERROR_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_ALIGN_ERRORS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_INTERNAL_ERROR_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_INTERNAL_ERROR_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_INTERNAL_ERRORS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_JABBER_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_JABBER_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_JABBER_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_CHAR_ERR, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_CHAR_ERR, &value); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE0_CHAR_ERR]), &(value.eq_dword[0])); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE1_CHAR_ERR]), &(value.eq_dword[1])); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_CHAR_ERR, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_CHAR_ERR, &value); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE2_CHAR_ERR]), &(value.eq_dword[0])); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE3_CHAR_ERR]), &(value.eq_dword[1])); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_DISP_ERR, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_DISP_ERR, &value); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE0_DISP_ERR]), &(value.eq_dword[0])); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE1_DISP_ERR]), &(value.eq_dword[1])); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_DISP_ERR, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_DISP_ERR, &value); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE2_DISP_ERR]), &(value.eq_dword[0])); EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE3_DISP_ERR]), &(value.eq_dword[1])); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MATCH_FAULT, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MATCH_FAULT, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_MATCH_FAULT]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_NODESC_DROPS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_NODESC_DROPS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_NODESC_DROP_CNT]), &value); /* Packet memory (EF10 only) */ - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_TRUNC_BB_OVERFLOW]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_BB_OVERFLOW]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_VFIFO_FULL, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_VFIFO_FULL, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_TRUNC_VFIFO_FULL]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_VFIFO_FULL, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_VFIFO_FULL, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_VFIFO_FULL]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_QBB, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_QBB, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_TRUNC_QBB]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_QBB, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_QBB, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_QBB]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_MAPPING, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_MAPPING, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_MAPPING]), &value); /* RX datapath */ - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_Q_DISABLED_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_Q_DISABLED_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_Q_DISABLED_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_DI_DROPPED_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_DI_DROPPED_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_DI_DROPPED_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_STREAMING_PKTS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_STREAMING_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_STREAMING_PKTS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_FETCH_CONDITIONS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_FETCH_CONDITIONS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_FETCH]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_WAIT_CONDITIONS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_WAIT_CONDITIONS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_WAIT]), &value); /* VADAPTER RX */ - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_UNICAST_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_BYTES, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_UNICAST_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_MULTICAST_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_BYTES, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_MULTICAST_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BROADCAST_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_BYTES, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BROADCAST_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BAD_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_BYTES, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BAD_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_OVERFLOW, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_OVERFLOW, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_OVERFLOW]), &value); /* VADAPTER TX */ - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_UNICAST_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_BYTES, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_UNICAST_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_MULTICAST_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_BYTES, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_MULTICAST_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_PACKETS, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BROADCAST_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_BYTES, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BROADCAST_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_PACKETS, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_PACKETS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BAD_PACKETS]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_BYTES, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_BYTES, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BAD_BYTES]), &value); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_OVERFLOW, &value); + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_OVERFLOW, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_OVERFLOW]), &value); EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE); EFSYS_MEM_READ_BARRIER(); - HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_START, + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_START, &generation_start); /* Check that we didn't read the stats in the middle of a DMA */ From owner-svn-src-stable@freebsd.org Wed Jan 20 08:16:31 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDA24A89F43; Wed, 20 Jan 2016 08:16:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A914E1A1E; Wed, 20 Jan 2016 08:16:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8GU2n033900; Wed, 20 Jan 2016 08:16:30 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8GUVQ033899; Wed, 20 Jan 2016 08:16:30 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200816.u0K8GUVQ033899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:16:30 +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: r294396 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:16:32 -0000 Author: arybchik Date: Wed Jan 20 08:16:30 2016 New Revision: 294396 URL: https://svnweb.freebsd.org/changeset/base/294396 Log: MFC r294094 sfxge: check the RX DMA end padding configuration on Medford Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/medford_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/medford_nic.c Wed Jan 20 08:14:42 2016 (r294395) +++ stable/10/sys/dev/sfxge/common/medford_nic.c Wed Jan 20 08:16:30 2016 (r294396) @@ -39,6 +39,64 @@ __FBSDID("$FreeBSD$"); #include "ef10_tlv_layout.h" +static __checkReturn efx_rc_t +efx_mcdi_get_rxdp_config( + __in efx_nic_t *enp, + __out uint32_t *end_paddingp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_RXDP_CONFIG_IN_LEN, + MC_CMD_GET_RXDP_CONFIG_OUT_LEN)]; + uint32_t end_padding; + efx_rc_t rc; + + memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_RXDP_CONFIG; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_RXDP_CONFIG_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_RXDP_CONFIG_OUT_LEN; + + efx_mcdi_execute(enp, &req); + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, + GET_RXDP_CONFIG_OUT_PAD_HOST_DMA) == 0) { + /* RX DMA end padding is disabled */ + end_padding = 0; + } else { + switch(MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, + GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) { + case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64: + end_padding = 64; + break; + case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_128: + end_padding = 128; + break; + case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_256: + end_padding = 256; + break; + default: + rc = ENOTSUP; + goto fail2; + } + } + + *end_paddingp = end_padding; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t medford_board_cfg( __in efx_nic_t *enp) @@ -56,6 +114,7 @@ medford_board_cfg( uint32_t flags; uint32_t sysclk; uint32_t base, nvec; + uint32_t end_padding; efx_rc_t rc; /* @@ -161,8 +220,10 @@ medford_board_cfg( /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; - /* FIXME: RX DMA end padding is configurable on Medford */ - encp->enc_rx_buf_align_end = 64; + /* Get the RX DMA end padding alignment configuration */ + if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) + goto fail10; + encp->enc_rx_buf_align_end = end_padding; /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; @@ -190,13 +251,13 @@ medford_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail10; + goto fail11; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail11; + goto fail12; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -219,6 +280,8 @@ medford_board_cfg( return (0); +fail12: + EFSYS_PROBE(fail12); fail11: EFSYS_PROBE(fail11); fail10: From owner-svn-src-stable@freebsd.org Wed Jan 20 08:17:30 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3604A88003; Wed, 20 Jan 2016 08:17:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73C6F1B9F; Wed, 20 Jan 2016 08:17:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8HTs9033989; Wed, 20 Jan 2016 08:17:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8HSDD033983; Wed, 20 Jan 2016 08:17:28 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200817.u0K8HSDD033983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:17:28 +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: r294397 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:17:30 -0000 Author: arybchik Date: Wed Jan 20 08:17:28 2016 New Revision: 294397 URL: https://svnweb.freebsd.org/changeset/base/294397 Log: MFC r294253 sfxge: if supported by firmware, use enhanced SET_MAC command to only configure the MTU This allows an MTU change to be requested on unpriviliged functions without also setting all the other parameters supported by MC_CMD_SET_MAC. The enhanced SET_MAC command was introduced in v4_7 firmware. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/efx_mac.c stable/10/sys/dev/sfxge/common/hunt_impl.h stable/10/sys/dev/sfxge/common/hunt_mac.c stable/10/sys/dev/sfxge/common/hunt_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Wed Jan 20 08:16:30 2016 (r294396) +++ stable/10/sys/dev/sfxge/common/efx.h Wed Jan 20 08:17:28 2016 (r294397) @@ -1159,6 +1159,7 @@ typedef struct efx_nic_cfg_s { boolean_t enc_datapath_cap_evb; boolean_t enc_rx_disable_scatter_supported; boolean_t enc_allow_set_mac_with_installed_filters; + boolean_t enc_enhanced_set_mac_supported; /* External port identifier */ uint8_t enc_external_port; uint32_t enc_mcdi_max_payload_length; Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 08:16:30 2016 (r294396) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 08:17:28 2016 (r294397) @@ -194,6 +194,7 @@ typedef struct efx_mac_ops_s { efx_rc_t (*emo_poll)(efx_nic_t *, efx_link_mode_t *); efx_rc_t (*emo_up)(efx_nic_t *, boolean_t *); efx_rc_t (*emo_addr_set)(efx_nic_t *); + efx_rc_t (*emo_pdu_set)(efx_nic_t *); efx_rc_t (*emo_reconfigure)(efx_nic_t *); efx_rc_t (*emo_multicast_list_set)(efx_nic_t *); efx_rc_t (*emo_filter_default_rxq_set)(efx_nic_t *, Modified: stable/10/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mac.c Wed Jan 20 08:16:30 2016 (r294396) +++ stable/10/sys/dev/sfxge/common/efx_mac.c Wed Jan 20 08:17:28 2016 (r294397) @@ -56,6 +56,7 @@ static efx_mac_ops_t __efx_falcon_gmac_o falcon_mac_poll, /* emo_poll */ falcon_mac_up, /* emo_up */ falcon_gmac_reconfigure, /* emo_addr_set */ + falcon_gmac_reconfigure, /* emo_pdu_set */ falcon_gmac_reconfigure, /* emo_reconfigure */ falconsiena_mac_multicast_list_set, /* emo_multicast_list_set */ NULL, /* emo_filter_set_default_rxq */ @@ -77,6 +78,7 @@ static efx_mac_ops_t __efx_falcon_xmac_o falcon_mac_poll, /* emo_poll */ falcon_mac_up, /* emo_up */ falcon_xmac_reconfigure, /* emo_addr_set */ + falcon_xmac_reconfigure, /* emo_pdu_set */ falcon_xmac_reconfigure, /* emo_reconfigure */ falconsiena_mac_multicast_list_set, /* emo_multicast_list_set */ NULL, /* emo_filter_set_default_rxq */ @@ -98,6 +100,7 @@ static efx_mac_ops_t __efx_siena_mac_ops siena_mac_poll, /* emo_poll */ siena_mac_up, /* emo_up */ siena_mac_reconfigure, /* emo_addr_set */ + siena_mac_reconfigure, /* emo_pdu_set */ siena_mac_reconfigure, /* emo_reconfigure */ falconsiena_mac_multicast_list_set, /* emo_multicast_list_set */ NULL, /* emo_filter_set_default_rxq */ @@ -119,6 +122,7 @@ static efx_mac_ops_t __efx_ef10_mac_ops ef10_mac_poll, /* emo_poll */ ef10_mac_up, /* emo_up */ ef10_mac_addr_set, /* emo_addr_set */ + ef10_mac_pdu_set, /* emo_pdu_set */ ef10_mac_reconfigure, /* emo_reconfigure */ ef10_mac_multicast_list_set, /* emo_multicast_list_set */ ef10_mac_filter_default_rxq_set, /* emo_filter_default_rxq_set */ @@ -196,7 +200,7 @@ efx_mac_pdu_set( old_pdu = epp->ep_mac_pdu; epp->ep_mac_pdu = (uint32_t)pdu; - if ((rc = emop->emo_reconfigure(enp)) != 0) + if ((rc = emop->emo_pdu_set(enp)) != 0) goto fail3; return (0); Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:16:30 2016 (r294396) +++ stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:17:28 2016 (r294397) @@ -234,6 +234,10 @@ ef10_mac_addr_set( __in efx_nic_t *enp); extern __checkReturn efx_rc_t +ef10_mac_pdu_set( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t ef10_mac_reconfigure( __in efx_nic_t *enp); Modified: stable/10/sys/dev/sfxge/common/hunt_mac.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_mac.c Wed Jan 20 08:16:30 2016 (r294396) +++ stable/10/sys/dev/sfxge/common/hunt_mac.c Wed Jan 20 08:17:28 2016 (r294397) @@ -162,6 +162,74 @@ fail1: return (rc); } +static __checkReturn efx_rc_t +efx_mcdi_mtu_set( + __in efx_nic_t *enp, + __in uint32_t mtu) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_SET_MAC_EXT_IN_LEN, + MC_CMD_SET_MAC_OUT_LEN)]; + efx_rc_t rc; + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_SET_MAC; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_SET_MAC_EXT_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_SET_MAC_OUT_LEN; + + /* Only configure the MTU in this call to MC_CMD_SET_MAC */ + MCDI_IN_SET_DWORD(req, SET_MAC_EXT_IN_MTU, mtu); + MCDI_IN_POPULATE_DWORD_1(req, SET_MAC_EXT_IN_CONTROL, + SET_MAC_EXT_IN_CFG_MTU, 1); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +ef10_mac_pdu_set( + __in efx_nic_t *enp) +{ + efx_port_t *epp = &(enp->en_port); + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + efx_rc_t rc; + + if (encp->enc_enhanced_set_mac_supported) { + if ((rc = efx_mcdi_mtu_set(enp, epp->ep_mac_pdu)) != 0) + goto fail1; + } else { + /* + * Fallback for older Huntington firmware, which always + * configure all of the parameters to MC_CMD_SET_MAC. This isn't + * suitable for setting the MTU on unpriviliged functions. + */ + if ((rc = ef10_mac_reconfigure(enp)) != 0) + goto fail2; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t ef10_mac_reconfigure( __in efx_nic_t *enp) Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 08:16:30 2016 (r294396) +++ stable/10/sys/dev/sfxge/common/hunt_nic.c Wed Jan 20 08:17:28 2016 (r294397) @@ -951,6 +951,13 @@ ef10_get_datapath_caps( CAP_FLAG(flags, VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED) ? B_TRUE : B_FALSE; + /* + * Check if firmware supports the extended MC_CMD_SET_MAC, which allows + * specifying which parameters to configure. + */ + encp->enc_enhanced_set_mac_supported = + CAP_FLAG(flags, SET_MAC_ENHANCED) ? B_TRUE : B_FALSE; + #undef CAP_FLAG #undef CAP_FLAG2 From owner-svn-src-stable@freebsd.org Wed Jan 20 08:18:45 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F3E9A880FD; Wed, 20 Jan 2016 08:18:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E014B1D24; Wed, 20 Jan 2016 08:18:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8Ihxe034084; Wed, 20 Jan 2016 08:18:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8Ihpn034083; Wed, 20 Jan 2016 08:18:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200818.u0K8Ihpn034083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:18:43 +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: r294398 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:18:45 -0000 Author: arybchik Date: Wed Jan 20 08:18:43 2016 New Revision: 294398 URL: https://svnweb.freebsd.org/changeset/base/294398 Log: MFC r294254 sfxge: support RFID-selectable segments of dynamic configuration tlv_partition_header has field *preset* to support RFID-selectable segments of dynamic configuration Submitted by: Mateusz Wrzesinski Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h Wed Jan 20 08:17:28 2016 (r294397) +++ stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h Wed Jan 20 08:18:43 2016 (r294398) @@ -113,7 +113,11 @@ struct tlv_partition_header { uint32_t tag; uint32_t length; uint16_t type_id; - uint16_t reserved; +/* 0 indicates the default segment (always located at offset 0), while other values + * are for RFID-selectable presets that should immediately follow the default segment. + * The default segment may also have preset > 0, which means that it is a preset + * selected through an RFID command and copied by FW to the location at offset 0. */ + uint16_t preset; uint32_t generation; uint32_t total_length; }; From owner-svn-src-stable@freebsd.org Wed Jan 20 08:20:01 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 874C1A88241; Wed, 20 Jan 2016 08:20:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 555281E8E; Wed, 20 Jan 2016 08:20:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8K0JU034195; Wed, 20 Jan 2016 08:20:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8K0kW034194; Wed, 20 Jan 2016 08:20:00 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200820.u0K8K0kW034194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:20: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: r294399 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:20:01 -0000 Author: arybchik Date: Wed Jan 20 08:20:00 2016 New Revision: 294399 URL: https://svnweb.freebsd.org/changeset/base/294399 Log: MFC r294255 sfxge: highlight that descriptor cache sizes are configured using TLV now Submitted by: Tom Millington Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h Wed Jan 20 08:18:43 2016 (r294398) +++ stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h Wed Jan 20 08:20:00 2016 (r294399) @@ -380,7 +380,7 @@ struct tlv_tmp_gubbins { int8_t with_rmon; /* 0 -> off, 1 -> on, -1 -> leave alone */ /* Consumed by clocks_hunt.c */ int8_t clk_mode; /* 0 -> off, 1 -> on, -1 -> leave alone */ - /* Consumed by sram.c */ + /* No longer used, superseded by TLV_TAG_DESCRIPTOR_CACHE_CONFIG. */ int8_t rx_dc_size; /* -1 -> leave alone */ int8_t tx_dc_size; int16_t num_q_allocs; From owner-svn-src-stable@freebsd.org Wed Jan 20 08:21:08 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80C40A88351; Wed, 20 Jan 2016 08:21:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D4C2112C; Wed, 20 Jan 2016 08:21:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8L7j1034286; Wed, 20 Jan 2016 08:21:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8L7Fv034285; Wed, 20 Jan 2016 08:21:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200821.u0K8L7Fv034285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:21:07 +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: r294400 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:21:08 -0000 Author: arybchik Date: Wed Jan 20 08:21:07 2016 New Revision: 294400 URL: https://svnweb.freebsd.org/changeset/base/294400 Log: MFC r294256 sfxge: cleanup: remove extra empty lines Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h Wed Jan 20 08:20:00 2016 (r294399) +++ stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h Wed Jan 20 08:21:07 2016 (r294400) @@ -694,7 +694,6 @@ struct tlv_mcast_filter_chaining { #define TLV_MCAST_FILTER_CHAINING_ENABLED (1) }; - /* Pacer rate limit per PF */ #define TLV_TAG_RATE_LIMIT(pf) (0x101b0000 + (pf)) @@ -704,7 +703,6 @@ struct tlv_rate_limit { uint32_t rate_mbps; }; - /* OCSD Enable/Disable * * This setting allows OCSD to be disabled. This is a requirement for HP From owner-svn-src-stable@freebsd.org Wed Jan 20 08:24:02 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 535B3A8855E; Wed, 20 Jan 2016 08:24:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 241D51558; Wed, 20 Jan 2016 08:24:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8O1Hx037189; Wed, 20 Jan 2016 08:24:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8O1uM037188; Wed, 20 Jan 2016 08:24:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200824.u0K8O1uM037188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:24: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: r294401 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:24:02 -0000 Author: arybchik Date: Wed Jan 20 08:24:00 2016 New Revision: 294401 URL: https://svnweb.freebsd.org/changeset/base/294401 Log: MFC r294257 sfxge: regenerate siena_flash.h from FW sources Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/siena_flash.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/siena_flash.h ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_flash.h Wed Jan 20 08:21:07 2016 (r294400) +++ stable/10/sys/dev/sfxge/common/siena_flash.h Wed Jan 20 08:24:00 2016 (r294401) @@ -115,14 +115,14 @@ typedef struct siena_mc_boot_hdr_s { /* efx_word_t checksum; /* of whole header area + firmware image */ efx_word_t firmware_version_d; efx_byte_t mcfw_subtype; - efx_byte_t reserved_a[1]; /* (set to 0) */ + efx_byte_t generation; /* Valid for medford, SBZ for earlier chips */ efx_dword_t firmware_text_offset; /* offset to firmware .text */ efx_dword_t firmware_text_size; /* length of firmware .text, in bytes */ efx_dword_t firmware_data_offset; /* offset to firmware .data */ efx_dword_t firmware_data_size; /* length of firmware .data, in bytes */ efx_byte_t spi_rate; /* SPI rate for reading image, 0 is BootROM default */ efx_byte_t spi_phase_adj; /* SPI SDO/SCL phase adjustment, 0 is default (no adj) */ - efx_word_t reserved_b[1]; /* (set to 0) */ + efx_word_t xpm_sector; /* The sector that contains the key, or 0xffff if unsigned (medford) SBZ (earlier) */ efx_dword_t reserved_c[7]; /* (set to 0) */ } siena_mc_boot_hdr_t; From owner-svn-src-stable@freebsd.org Wed Jan 20 08:25:43 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 417BDA88657; Wed, 20 Jan 2016 08:25:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 036AB180A; Wed, 20 Jan 2016 08:25:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8PgFC037460; Wed, 20 Jan 2016 08:25:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8Pgha037459; Wed, 20 Jan 2016 08:25:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200825.u0K8Pgha037459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:25:42 +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: r294402 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:25:43 -0000 Author: arybchik Date: Wed Jan 20 08:25:41 2016 New Revision: 294402 URL: https://svnweb.freebsd.org/changeset/base/294402 Log: MFC r294259 sfxge: regenerate EF10 registers definition for Medford Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_regs_ef10.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_regs_ef10.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_regs_ef10.h Wed Jan 20 08:24:00 2016 (r294401) +++ stable/10/sys/dev/sfxge/common/efx_regs_ef10.h Wed Jan 20 08:25:41 2016 (r294402) @@ -50,7 +50,7 @@ extern "C" { */ #define ER_DZ_BIU_HW_REV_ID_REG_OFST 0x00000000 -/* hunta0=pcie_pf_bar2 */ +/* hunta0,medforda0=pcie_pf_bar2 */ #define ER_DZ_BIU_HW_REV_ID_REG_RESET 0xeb14face @@ -64,7 +64,7 @@ extern "C" { */ #define ER_DZ_BIU_MC_SFT_STATUS_REG_OFST 0x00000010 -/* hunta0=pcie_pf_bar2 */ +/* hunta0,medforda0=pcie_pf_bar2 */ #define ER_DZ_BIU_MC_SFT_STATUS_REG_STEP 4 #define ER_DZ_BIU_MC_SFT_STATUS_REG_ROWS 8 #define ER_DZ_BIU_MC_SFT_STATUS_REG_RESET 0x1111face @@ -80,7 +80,7 @@ extern "C" { */ #define ER_DZ_BIU_INT_ISR_REG_OFST 0x00000090 -/* hunta0=pcie_pf_bar2 */ +/* hunta0,medforda0=pcie_pf_bar2 */ #define ER_DZ_BIU_INT_ISR_REG_RESET 0x0 @@ -94,7 +94,7 @@ extern "C" { */ #define ER_DZ_MC_DB_LWRD_REG_OFST 0x00000200 -/* hunta0=pcie_pf_bar2 */ +/* hunta0,medforda0=pcie_pf_bar2 */ #define ER_DZ_MC_DB_LWRD_REG_RESET 0x0 @@ -108,7 +108,7 @@ extern "C" { */ #define ER_DZ_MC_DB_HWRD_REG_OFST 0x00000204 -/* hunta0=pcie_pf_bar2 */ +/* hunta0,medforda0=pcie_pf_bar2 */ #define ER_DZ_MC_DB_HWRD_REG_RESET 0x0 @@ -122,7 +122,7 @@ extern "C" { */ #define ER_DZ_EVQ_RPTR_REG_OFST 0x00000400 -/* hunta0=pcie_pf_bar2 */ +/* hunta0,medforda0=pcie_pf_bar2 */ #define ER_DZ_EVQ_RPTR_REG_STEP 8192 #define ER_DZ_EVQ_RPTR_REG_ROWS 2048 #define ER_DZ_EVQ_RPTR_REG_RESET 0x0 @@ -140,7 +140,7 @@ extern "C" { */ #define ER_DZ_EVQ_TMR_REG_OFST 0x00000420 -/* hunta0=pcie_pf_bar2 */ +/* hunta0,medforda0=pcie_pf_bar2 */ #define ER_DZ_EVQ_TMR_REG_STEP 8192 #define ER_DZ_EVQ_TMR_REG_ROWS 2048 #define ER_DZ_EVQ_TMR_REG_RESET 0x0 @@ -158,7 +158,7 @@ extern "C" { */ #define ER_DZ_RX_DESC_UPD_REG_OFST 0x00000830 -/* hunta0=pcie_pf_bar2 */ +/* hunta0,medforda0=pcie_pf_bar2 */ #define ER_DZ_RX_DESC_UPD_REG_STEP 8192 #define ER_DZ_RX_DESC_UPD_REG_ROWS 2048 #define ER_DZ_RX_DESC_UPD_REG_RESET 0x0 @@ -174,7 +174,7 @@ extern "C" { */ #define ER_DZ_TX_DESC_UPD_REG_OFST 0x00000a10 -/* hunta0=pcie_pf_bar2 */ +/* hunta0,medforda0=pcie_pf_bar2 */ #define ER_DZ_TX_DESC_UPD_REG_STEP 8192 #define ER_DZ_TX_DESC_UPD_REG_ROWS 2048 #define ER_DZ_TX_DESC_UPD_REG_RESET 0x0 @@ -248,8 +248,14 @@ extern "C" { #define ESF_DZ_RX_OVERRIDE_HOLDOFF_WIDTH 1 #define ESF_DZ_RX_DROP_EVENT_LBN 58 #define ESF_DZ_RX_DROP_EVENT_WIDTH 1 -#define ESF_DZ_RX_EV_RSVD2_LBN 54 -#define ESF_DZ_RX_EV_RSVD2_WIDTH 4 +#define ESF_DD_RX_EV_RSVD2_LBN 54 +#define ESF_DD_RX_EV_RSVD2_WIDTH 4 +#define ESF_EZ_RX_TCP_UDP_INNER_CHKSUM_ERR_LBN 57 +#define ESF_EZ_RX_TCP_UDP_INNER_CHKSUM_ERR_WIDTH 1 +#define ESF_EZ_RX_IP_INNER_CHKSUM_ERR_LBN 56 +#define ESF_EZ_RX_IP_INNER_CHKSUM_ERR_WIDTH 1 +#define ESF_EZ_RX_EV_RSVD2_LBN 54 +#define ESF_EZ_RX_EV_RSVD2_WIDTH 2 #define ESF_DZ_RX_EV_SOFT2_LBN 52 #define ESF_DZ_RX_EV_SOFT2_WIDTH 2 #define ESF_DZ_RX_DSC_PTR_LBITS_LBN 48 @@ -293,10 +299,21 @@ extern "C" { #define ESF_DZ_RX_MAC_CLASS_WIDTH 1 #define ESE_DZ_MAC_CLASS_MCAST 1 #define ESE_DZ_MAC_CLASS_UCAST 0 -#define ESF_DZ_RX_EV_SOFT1_LBN 32 -#define ESF_DZ_RX_EV_SOFT1_WIDTH 3 -#define ESF_DZ_RX_EV_RSVD1_LBN 30 -#define ESF_DZ_RX_EV_RSVD1_WIDTH 2 +#define ESF_DD_RX_EV_SOFT1_LBN 32 +#define ESF_DD_RX_EV_SOFT1_WIDTH 3 +#define ESF_EZ_RX_EV_SOFT1_LBN 34 +#define ESF_EZ_RX_EV_SOFT1_WIDTH 1 +#define ESF_EZ_RX_ENCAP_HDR_LBN 32 +#define ESF_EZ_RX_ENCAP_HDR_WIDTH 2 +#define ESE_EZ_ENCAP_HDR_GRE 2 +#define ESE_EZ_ENCAP_HDR_VXLAN 1 +#define ESE_EZ_ENCAP_HDR_NONE 0 +#define ESF_DD_RX_EV_RSVD1_LBN 30 +#define ESF_DD_RX_EV_RSVD1_WIDTH 2 +#define ESF_EZ_RX_EV_RSVD1_LBN 31 +#define ESF_EZ_RX_EV_RSVD1_WIDTH 1 +#define ESF_EZ_RX_ABORT_LBN 30 +#define ESF_EZ_RX_ABORT_WIDTH 1 #define ESF_DZ_RX_ECC_ERR_LBN 29 #define ESF_DZ_RX_ECC_ERR_WIDTH 1 #define ESF_DZ_RX_CRC1_ERR_LBN 28 @@ -369,12 +386,22 @@ extern "C" { #define ESF_DZ_TX_OVERRIDE_HOLDOFF_WIDTH 1 #define ESF_DZ_TX_DROP_EVENT_LBN 58 #define ESF_DZ_TX_DROP_EVENT_WIDTH 1 -#define ESF_DZ_TX_EV_RSVD_LBN 48 -#define ESF_DZ_TX_EV_RSVD_WIDTH 10 +#define ESF_DD_TX_EV_RSVD_LBN 48 +#define ESF_DD_TX_EV_RSVD_WIDTH 10 +#define ESF_EZ_TCP_UDP_INNER_CHKSUM_ERR_LBN 57 +#define ESF_EZ_TCP_UDP_INNER_CHKSUM_ERR_WIDTH 1 +#define ESF_EZ_IP_INNER_CHKSUM_ERR_LBN 56 +#define ESF_EZ_IP_INNER_CHKSUM_ERR_WIDTH 1 +#define ESF_EZ_TX_EV_RSVD_LBN 48 +#define ESF_EZ_TX_EV_RSVD_WIDTH 8 #define ESF_DZ_TX_SOFT2_LBN 32 #define ESF_DZ_TX_SOFT2_WIDTH 16 -#define ESF_DZ_TX_SOFT1_LBN 24 -#define ESF_DZ_TX_SOFT1_WIDTH 8 +#define ESF_DD_TX_SOFT1_LBN 24 +#define ESF_DD_TX_SOFT1_WIDTH 8 +#define ESF_EZ_TX_CAN_MERGE_LBN 31 +#define ESF_EZ_TX_CAN_MERGE_WIDTH 1 +#define ESF_EZ_TX_SOFT1_LBN 24 +#define ESF_EZ_TX_SOFT1_WIDTH 7 #define ESF_DZ_TX_QLABEL_LBN 16 #define ESF_DZ_TX_QLABEL_WIDTH 5 #define ESF_DZ_TX_DESCR_INDX_LBN 0 From owner-svn-src-stable@freebsd.org Wed Jan 20 08:26:59 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D13FCA88778; Wed, 20 Jan 2016 08:26:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE29D1A3B; Wed, 20 Jan 2016 08:26:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8Qw5t037689; Wed, 20 Jan 2016 08:26:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8QwAM037684; Wed, 20 Jan 2016 08:26:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200826.u0K8QwAM037684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:26:58 +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: r294403 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:26:59 -0000 Author: arybchik Date: Wed Jan 20 08:26:58 2016 New Revision: 294403 URL: https://svnweb.freebsd.org/changeset/base/294403 Log: MFC r294309 sfxge: select whether to read current or backup partition in Medford A/B scheme The dynamic config on Medford is stored using two partitions in flash, and at any time one is the 'current' partition, used to provide the active config, and the other 'backup' partition is used for writes. This means that there are two potential partitions that can be used to service reads, and which is required can depend on, for example, whether the read is to get the current contents or to verify a write. When the partition write lock is held, the default behaviour is to read from the backup partition, which was wrong for most reads in the common code which require the current partition. This change allows the current partition to be read whilst the write lock is held. There is one read in Manftest which needs the backup partition. ef10_nvram_partn_read_mode() is created to avoid changing ef10_nvram_partn_read() which shares a prototype with the equivalent Falcon and Siena methods. MC_CMD_NVRAM_READ_IN_V2 adds an extra field, but firmware which doesn't support it just ignores it. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/efx_nvram.c stable/10/sys/dev/sfxge/common/hunt_impl.h stable/10/sys/dev/sfxge/common/hunt_nvram.c stable/10/sys/dev/sfxge/common/siena_nvram.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 08:25:41 2016 (r294402) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Wed Jan 20 08:26:58 2016 (r294403) @@ -559,7 +559,8 @@ efx_mcdi_nvram_read( __in uint32_t partn, __in uint32_t offset, __out_bcount(size) caddr_t data, - __in size_t size); + __in size_t size, + __in uint32_t mode); __checkReturn efx_rc_t efx_mcdi_nvram_erase( Modified: stable/10/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_nvram.c Wed Jan 20 08:25:41 2016 (r294402) +++ stable/10/sys/dev/sfxge/common/efx_nvram.c Wed Jan 20 08:26:58 2016 (r294403) @@ -721,10 +721,11 @@ efx_mcdi_nvram_read( __in uint32_t partn, __in uint32_t offset, __out_bcount(size) caddr_t data, - __in size_t size) + __in size_t size, + __in uint32_t mode) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_NVRAM_READ_IN_LEN, + uint8_t payload[MAX(MC_CMD_NVRAM_READ_IN_V2_LEN, MC_CMD_NVRAM_READ_OUT_LENMAX)]; efx_rc_t rc; @@ -736,13 +737,14 @@ efx_mcdi_nvram_read( (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_NVRAM_READ; req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_NVRAM_READ_IN_LEN; + req.emr_in_length = MC_CMD_NVRAM_READ_IN_V2_LEN; req.emr_out_buf = payload; req.emr_out_length = MC_CMD_NVRAM_READ_OUT_LENMAX; - MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_TYPE, partn); - MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_OFFSET, offset); - MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_LENGTH, size); + MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_V2_TYPE, partn); + MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_V2_OFFSET, offset); + MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_V2_LENGTH, size); + MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_V2_MODE, mode); efx_mcdi_execute(enp, &req); Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:25:41 2016 (r294402) +++ stable/10/sys/dev/sfxge/common/hunt_impl.h Wed Jan 20 08:26:58 2016 (r294403) @@ -409,6 +409,15 @@ ef10_nvram_partn_rw_start( __out size_t *chunk_sizep); extern __checkReturn efx_rc_t +ef10_nvram_partn_read_mode( + __in efx_nic_t *enp, + __in uint32_t partn, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size, + __in uint32_t mode); + +extern __checkReturn efx_rc_t ef10_nvram_partn_read( __in efx_nic_t *enp, __in uint32_t partn, Modified: stable/10/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 20 08:25:41 2016 (r294402) +++ stable/10/sys/dev/sfxge/common/hunt_nvram.c Wed Jan 20 08:26:58 2016 (r294403) @@ -598,8 +598,9 @@ ef10_nvram_read_tlv_segment( } /* Read initial chunk of the segment, starting at offset */ - if ((rc = ef10_nvram_partn_read(enp, partn, seg_offset, seg_data, - EF10_NVRAM_CHUNK)) != 0) { + if ((rc = ef10_nvram_partn_read_mode(enp, partn, seg_offset, seg_data, + EF10_NVRAM_CHUNK, + MC_CMD_NVRAM_READ_IN_V2_TARGET_CURRENT)) != 0) { goto fail2; } @@ -624,10 +625,11 @@ ef10_nvram_read_tlv_segment( /* Read the remaining segment content */ if (total_length > EF10_NVRAM_CHUNK) { - if ((rc = ef10_nvram_partn_read(enp, partn, + if ((rc = ef10_nvram_partn_read_mode(enp, partn, seg_offset + EF10_NVRAM_CHUNK, seg_data + EF10_NVRAM_CHUNK, - total_length - EF10_NVRAM_CHUNK)) != 0) + total_length - EF10_NVRAM_CHUNK, + MC_CMD_NVRAM_READ_IN_V2_TARGET_CURRENT)) != 0) goto fail6; } @@ -1321,12 +1323,13 @@ fail1: } __checkReturn efx_rc_t -ef10_nvram_partn_read( +ef10_nvram_partn_read_mode( __in efx_nic_t *enp, __in uint32_t partn, __in unsigned int offset, __out_bcount(size) caddr_t data, - __in size_t size) + __in size_t size, + __in uint32_t mode) { size_t chunk; efx_rc_t rc; @@ -1335,7 +1338,7 @@ ef10_nvram_partn_read( chunk = MIN(size, EF10_NVRAM_CHUNK); if ((rc = efx_mcdi_nvram_read(enp, partn, offset, - data, chunk)) != 0) { + data, chunk, mode)) != 0) { goto fail1; } @@ -1353,6 +1356,22 @@ fail1: } __checkReturn efx_rc_t +ef10_nvram_partn_read( + __in efx_nic_t *enp, + __in uint32_t partn, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size) +{ + /* + * Read requests which come in through the EFX API expect to + * read the current, active partition. + */ + return ef10_nvram_partn_read_mode(enp, partn, offset, data, size, + MC_CMD_NVRAM_READ_IN_V2_TARGET_CURRENT); +} + + __checkReturn efx_rc_t ef10_nvram_partn_erase( __in efx_nic_t *enp, __in uint32_t partn, Modified: stable/10/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nvram.c Wed Jan 20 08:25:41 2016 (r294402) +++ stable/10/sys/dev/sfxge/common/siena_nvram.c Wed Jan 20 08:26:58 2016 (r294403) @@ -99,8 +99,8 @@ siena_nvram_partn_read( while (size > 0) { chunk = MIN(size, SIENA_NVRAM_CHUNK); - if ((rc = efx_mcdi_nvram_read(enp, partn, offset, - data, chunk)) != 0) { + if ((rc = efx_mcdi_nvram_read(enp, partn, offset, data, chunk, + MC_CMD_NVRAM_READ_IN_V2_DEFAULT)) != 0) { goto fail1; } From owner-svn-src-stable@freebsd.org Wed Jan 20 08:28:34 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22943A88899; Wed, 20 Jan 2016 08:28:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D79A91C97; Wed, 20 Jan 2016 08:28:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8SWVs037950; Wed, 20 Jan 2016 08:28:32 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8SWSh037949; Wed, 20 Jan 2016 08:28:32 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200828.u0K8SWSh037949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 08:28: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: r294404 - stable/10/sys/dev/sfxge/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:28:34 -0000 Author: arybchik Date: Wed Jan 20 08:28:32 2016 New Revision: 294404 URL: https://svnweb.freebsd.org/changeset/base/294404 Log: MFC r294310 sfxge: improve error handling in ef10_ev_rx() Ensure that checksum flags and L3/L4 fields are ignored if lower level errors are reported in the event. Remove checks for CRC0_ERR (bad iSCSI header CRC) and CRC1_ERR (bad iSCSI payload or FCoE/FCoIP CRC) as they are not used by any existing code. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/hunt_ev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/hunt_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_ev.c Wed Jan 20 08:26:58 2016 (r294403) +++ stable/10/sys/dev/sfxge/common/hunt_ev.c Wed Jan 20 08:28:32 2016 (r294404) @@ -486,17 +486,14 @@ ef10_ev_rx( { efx_nic_t *enp = eep->ee_enp; uint32_t size; -#if 0 - boolean_t parse_err; -#endif uint32_t label; - uint32_t mcast; - uint32_t eth_base_class; + uint32_t mac_class; uint32_t eth_tag_class; uint32_t l3_class; uint32_t l4_class; uint32_t next_read_lbits; uint16_t flags; + boolean_t cont; boolean_t should_abort; efx_evq_rxq_state_t *eersp; unsigned int desc_count; @@ -508,10 +505,15 @@ ef10_ev_rx( if (enp->en_reset_flags & (EFX_RESET_RXQ_ERR | EFX_RESET_TXQ_ERR)) return (B_FALSE); - /* - * FIXME: likely to be incomplete, incorrect and inefficient. - * Improvements in all three areas are required. - */ + /* Basic packet information */ + size = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_BYTES); + next_read_lbits = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DSC_PTR_LBITS); + label = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_QLABEL); + eth_tag_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ETH_TAG_CLASS); + mac_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_MAC_CLASS); + l3_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L3_CLASS); + l4_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L4_CLASS); + cont = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CONT); if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DROP_EVENT) != 0) { /* Drop this event */ @@ -519,9 +521,7 @@ ef10_ev_rx( } flags = 0; - size = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_BYTES); - - if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CONT) != 0) { + if (cont != 0) { /* * This may be part of a scattered frame, or it may be a * truncated frame if scatter is disabled on this RXQ. @@ -534,41 +534,9 @@ ef10_ev_rx( flags |= EFX_PKT_CONT; } -#if 0 - /* TODO What to do if the packet is flagged with parsing error */ - parse_err = (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_PARSE_INCOMPLETE) != 0); -#endif - label = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_QLABEL); - - if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECRC_ERR) != 0) { - /* Ethernet frame CRC bad */ - flags |= EFX_DISCARD; - } - if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CRC0_ERR) != 0) { - /* IP+TCP, bad CRC in iSCSI header */ - flags |= EFX_DISCARD; - } - if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CRC1_ERR) != 0) { - /* IP+TCP, bad CRC in iSCSI payload or FCoE or FCoIP */ - flags |= EFX_DISCARD; - } - if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECC_ERR) != 0) { - /* ECC memory error */ - flags |= EFX_DISCARD; - } - - mcast = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_MAC_CLASS); - if (mcast == ESE_DZ_MAC_CLASS_UCAST) + if (mac_class == ESE_DZ_MAC_CLASS_UCAST) flags |= EFX_PKT_UNICAST; - eth_base_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ETH_BASE_CLASS); - eth_tag_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ETH_TAG_CLASS); - l3_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L3_CLASS); - l4_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L4_CLASS); - - /* bottom 4 bits of incremented index (not last desc consumed) */ - next_read_lbits = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DSC_PTR_LBITS); - /* Increment the count of descriptors read */ eersp = &eep->ee_rxq_state[label]; desc_count = (next_read_lbits - eersp->eers_rx_read_ptr) & @@ -587,88 +555,84 @@ ef10_ev_rx( /* Calculate the index of the the last descriptor consumed */ last_used_id = (eersp->eers_rx_read_ptr - 1) & eersp->eers_rx_mask; - /* EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_OVERRIDE_HOLDOFF); */ - - switch (eth_base_class) { - case ESE_DZ_ETH_BASE_CLASS_LLC_SNAP: - case ESE_DZ_ETH_BASE_CLASS_LLC: - case ESE_DZ_ETH_BASE_CLASS_ETH2: - default: - break; + /* Check for errors that invalidate checksum and L3/L4 fields */ + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECC_ERR) != 0) { + /* RX frame truncated (error flag is misnamed) */ + EFX_EV_QSTAT_INCR(eep, EV_RX_FRM_TRUNC); + flags |= EFX_DISCARD; + goto deliver; + } + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECRC_ERR) != 0) { + /* Bad Ethernet frame CRC */ + EFX_EV_QSTAT_INCR(eep, EV_RX_ETH_CRC_ERR); + flags |= EFX_DISCARD; + goto deliver; + } + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_PARSE_INCOMPLETE)) { + /* + * Hardware parse failed, due to malformed headers + * or headers that are too long for the parser. + * Headers and checksums must be validated by the host. + */ + // TODO: EFX_EV_QSTAT_INCR(eep, EV_RX_PARSE_INCOMPLETE); + goto deliver; } - switch (eth_tag_class) { - case ESE_DZ_ETH_TAG_CLASS_RSVD7: - case ESE_DZ_ETH_TAG_CLASS_RSVD6: - case ESE_DZ_ETH_TAG_CLASS_RSVD5: - case ESE_DZ_ETH_TAG_CLASS_RSVD4: - break; - - case ESE_DZ_ETH_TAG_CLASS_RSVD3: /* Triple tagged */ - case ESE_DZ_ETH_TAG_CLASS_VLAN2: /* Double tagged */ - case ESE_DZ_ETH_TAG_CLASS_VLAN1: /* VLAN tagged */ + if ((eth_tag_class == ESE_DZ_ETH_TAG_CLASS_VLAN1) || + (eth_tag_class == ESE_DZ_ETH_TAG_CLASS_VLAN2)) { flags |= EFX_PKT_VLAN_TAGGED; - break; - - case ESE_DZ_ETH_TAG_CLASS_NONE: - default: - break; } switch (l3_class) { - case ESE_DZ_L3_CLASS_RSVD7: /* Used by firmware for packet overrun */ -#if 0 - parse_err = B_TRUE; -#endif - flags |= EFX_DISCARD; - break; + case ESE_DZ_L3_CLASS_IP4: + case ESE_DZ_L3_CLASS_IP4_FRAG: + flags |= EFX_PKT_IPV4; + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_IPCKSUM_ERR)) { + EFX_EV_QSTAT_INCR(eep, EV_RX_IPV4_HDR_CHKSUM_ERR); + } else { + flags |= EFX_CKSUM_IPV4; + } - case ESE_DZ_L3_CLASS_ARP: - case ESE_DZ_L3_CLASS_FCOE: + if (l4_class == ESE_DZ_L4_CLASS_TCP) { + EFX_EV_QSTAT_INCR(eep, EV_RX_TCP_IPV4); + flags |= EFX_PKT_TCP; + } else if (l4_class == ESE_DZ_L4_CLASS_UDP) { + EFX_EV_QSTAT_INCR(eep, EV_RX_UDP_IPV4); + flags |= EFX_PKT_UDP; + } else { + EFX_EV_QSTAT_INCR(eep, EV_RX_OTHER_IPV4); + } break; - case ESE_DZ_L3_CLASS_IP6_FRAG: case ESE_DZ_L3_CLASS_IP6: + case ESE_DZ_L3_CLASS_IP6_FRAG: flags |= EFX_PKT_IPV6; - break; - case ESE_DZ_L3_CLASS_IP4_FRAG: - case ESE_DZ_L3_CLASS_IP4: - flags |= EFX_PKT_IPV4; - if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_IPCKSUM_ERR) == 0) - flags |= EFX_CKSUM_IPV4; + if (l4_class == ESE_DZ_L4_CLASS_TCP) { + EFX_EV_QSTAT_INCR(eep, EV_RX_TCP_IPV6); + flags |= EFX_PKT_TCP; + } else if (l4_class == ESE_DZ_L4_CLASS_UDP) { + EFX_EV_QSTAT_INCR(eep, EV_RX_UDP_IPV6); + flags |= EFX_PKT_UDP; + } else { + EFX_EV_QSTAT_INCR(eep, EV_RX_OTHER_IPV6); + } break; - case ESE_DZ_L3_CLASS_UNKNOWN: default: + EFX_EV_QSTAT_INCR(eep, EV_RX_NON_IP); break; } - switch (l4_class) { - case ESE_DZ_L4_CLASS_RSVD7: - case ESE_DZ_L4_CLASS_RSVD6: - case ESE_DZ_L4_CLASS_RSVD5: - case ESE_DZ_L4_CLASS_RSVD4: - case ESE_DZ_L4_CLASS_RSVD3: - break; - - case ESE_DZ_L4_CLASS_UDP: - flags |= EFX_PKT_UDP; - if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_TCPUDP_CKSUM_ERR) == 0) - flags |= EFX_CKSUM_TCPUDP; - break; - - case ESE_DZ_L4_CLASS_TCP: - flags |= EFX_PKT_TCP; - if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_TCPUDP_CKSUM_ERR) == 0) + if (flags & (EFX_PKT_TCP | EFX_PKT_UDP)) { + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_TCPUDP_CKSUM_ERR)) { + EFX_EV_QSTAT_INCR(eep, EV_RX_TCP_UDP_CHKSUM_ERR); + } else { flags |= EFX_CKSUM_TCPUDP; - break; - - case ESE_DZ_L4_CLASS_UNKNOWN: - default: - break; + } } +deliver: /* If we're not discarding the packet then it is ok */ if (~flags & EFX_DISCARD) EFX_EV_QSTAT_INCR(eep, EV_RX_OK); From owner-svn-src-stable@freebsd.org Wed Jan 20 08:54:39 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EF0AA8948A; Wed, 20 Jan 2016 08:54:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45DBD19FF; Wed, 20 Jan 2016 08:54:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K8scHg047602; Wed, 20 Jan 2016 08:54:38 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K8sZ3B047570; Wed, 20 Jan 2016 08:54:35 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601200854.u0K8sZ3B047570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 20 Jan 2016 08:54:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294405 - in stable/9: contrib/bind9 contrib/bind9/doc/arm contrib/bind9/lib/dns contrib/bind9/lib/dns/rdata/in_1 lib/bind/dns lib/bind/dns/dns X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 08:54:39 -0000 Author: delphij Date: Wed Jan 20 08:54:35 2016 New Revision: 294405 URL: https://svnweb.freebsd.org/changeset/base/294405 Log: MFV r294374: BIND 9.9.8-P3. Modified: stable/9/contrib/bind9/CHANGES stable/9/contrib/bind9/README stable/9/contrib/bind9/doc/arm/Bv9ARM.ch01.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch02.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch03.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch04.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch05.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch06.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch07.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch08.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch09.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch10.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch11.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch12.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch13.html stable/9/contrib/bind9/doc/arm/Bv9ARM.html stable/9/contrib/bind9/doc/arm/Bv9ARM.pdf stable/9/contrib/bind9/doc/arm/man.arpaname.html stable/9/contrib/bind9/doc/arm/man.ddns-confgen.html stable/9/contrib/bind9/doc/arm/man.dig.html stable/9/contrib/bind9/doc/arm/man.dnssec-checkds.html stable/9/contrib/bind9/doc/arm/man.dnssec-coverage.html stable/9/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html stable/9/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html stable/9/contrib/bind9/doc/arm/man.dnssec-keygen.html stable/9/contrib/bind9/doc/arm/man.dnssec-revoke.html stable/9/contrib/bind9/doc/arm/man.dnssec-settime.html stable/9/contrib/bind9/doc/arm/man.dnssec-signzone.html stable/9/contrib/bind9/doc/arm/man.dnssec-verify.html stable/9/contrib/bind9/doc/arm/man.genrandom.html stable/9/contrib/bind9/doc/arm/man.host.html stable/9/contrib/bind9/doc/arm/man.isc-hmac-fixup.html stable/9/contrib/bind9/doc/arm/man.named-checkconf.html stable/9/contrib/bind9/doc/arm/man.named-checkzone.html stable/9/contrib/bind9/doc/arm/man.named-journalprint.html stable/9/contrib/bind9/doc/arm/man.named.html stable/9/contrib/bind9/doc/arm/man.nsec3hash.html stable/9/contrib/bind9/doc/arm/man.nsupdate.html stable/9/contrib/bind9/doc/arm/man.rndc-confgen.html stable/9/contrib/bind9/doc/arm/man.rndc.conf.html stable/9/contrib/bind9/doc/arm/man.rndc.html stable/9/contrib/bind9/doc/arm/notes.html stable/9/contrib/bind9/doc/arm/notes.pdf stable/9/contrib/bind9/doc/arm/notes.xml stable/9/contrib/bind9/lib/dns/api stable/9/contrib/bind9/lib/dns/rdata/in_1/apl_42.c stable/9/contrib/bind9/lib/dns/resolver.c stable/9/contrib/bind9/version stable/9/lib/bind/dns/code.h stable/9/lib/bind/dns/dns/enumclass.h stable/9/lib/bind/dns/dns/enumtype.h stable/9/lib/bind/dns/dns/rdatastruct.h Directory Properties: stable/9/contrib/bind9/ (props changed) Modified: stable/9/contrib/bind9/CHANGES ============================================================================== --- stable/9/contrib/bind9/CHANGES Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/CHANGES Wed Jan 20 08:54:35 2016 (r294405) @@ -1,3 +1,12 @@ + --- 9.9.8-P3 released --- + +4288. [bug] Fixed a regression in resolver.c:possibly_mark() + which caused known-bogus servers to be queried + anyway. [RT #41321] + +4285. [security] Specific APL data could trigger a INSIST. + (CVE-2015-8704) [RT #41396] + --- 9.9.8-P2 released --- 4270. [security] Update allowed OpenSSL versions as named is Modified: stable/9/contrib/bind9/README ============================================================================== --- stable/9/contrib/bind9/README Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/README Wed Jan 20 08:54:35 2016 (r294405) @@ -51,6 +51,12 @@ BIND 9 For up-to-date release notes and errata, see http://www.isc.org/software/bind9/releasenotes +BIND 9.9.8-P3 + + BIND 9.9.8-P3 is a security release addressing the flaw described in + CVE-2015-8704. It also fixes a serious regression in authoritative + server selection that was introduced in 9.9.8. + BIND 9.9.8-P2 BIND 9.9.8-P2 is a security release addressing the flaws Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch01.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch01.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch01.html Wed Jan 20 08:54:35 2016 (r294405) @@ -556,6 +556,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch02.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch02.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch02.html Wed Jan 20 08:54:35 2016 (r294405) @@ -154,6 +154,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch03.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch03.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch03.html Wed Jan 20 08:54:35 2016 (r294405) @@ -665,6 +665,6 @@ controls { -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch04.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch04.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch04.html Wed Jan 20 08:54:35 2016 (r294405) @@ -1935,6 +1935,6 @@ $ORIGIN 0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2. -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch05.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch05.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch05.html Wed Jan 20 08:54:35 2016 (r294405) @@ -139,6 +139,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch06.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch06.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch06.html Wed Jan 20 08:54:35 2016 (r294405) @@ -12177,6 +12177,6 @@ HOST-127.EXAMPLE. MX 0 . -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch07.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch07.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch07.html Wed Jan 20 08:54:35 2016 (r294405) @@ -247,6 +247,6 @@ zone "example.com" { -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch08.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch08.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch08.html Wed Jan 20 08:54:35 2016 (r294405) @@ -135,6 +135,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch09.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch09.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch09.html Wed Jan 20 08:54:35 2016 (r294405) @@ -45,7 +45,7 @@

-Release Notes for BIND Version 9.9.8-P2

+Release Notes for BIND Version 9.9.8-P3

Introduction

@@ -68,6 +68,11 @@ This document summarizes changes since BIND 9.9.8:

+ BIND 9.9.8-P3 addresses the security issue described in CVE-2015-8704. + It also fixes a serious regression in authoritative server selection + that was introduced in 9.9.8. +

+

BIND 9.9.8-P2 addresses security issues described in CVE-2015-3193 (OpenSSL), CVE-2015-8000 and CVE-2015-8461.

@@ -91,13 +96,13 @@ Security Fixes
  • - Named is potentially vulnerable to the OpenSSL vulnerabilty - described in CVE-2015-3193. + Specific APL data could trigger an INSIST. This flaw + was discovered by Brian Mitchell and is disclosed in + CVE-2015-8704. [RT #41396]

  • - Incorrect reference counting could result in an INSIST - failure if a socket error occurred while performing a - lookup. This flaw is disclosed in CVE-2015-8461. [RT#40945] + Named is potentially vulnerable to the OpenSSL vulnerabilty + described in CVE-2015-3193.

  • Insufficient testing when parsing a message allowed @@ -106,6 +111,11 @@ were subsequently cached. This flaw is disclosed in CVE-2015-8000. [RT #40987]

  • +
  • + Incorrect reference counting could result in an INSIST + failure if a socket error occurred while performing a + lookup. This flaw is disclosed in CVE-2015-8461. [RT#40945] +

@@ -123,7 +133,11 @@

Bug Fixes

-
  • None

+
  • + Authoritative servers that were marked as bogus (e.g. blackholed + in configuration or with invalid addresses) were being queried + anyway. [RT #41321] +

@@ -163,6 +177,6 @@

-

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch10.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch10.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch10.html Wed Jan 20 08:54:35 2016 (r294405) @@ -163,6 +163,6 @@
-

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch11.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch11.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch11.html Wed Jan 20 08:54:35 2016 (r294405) @@ -514,6 +514,6 @@
-

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch12.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch12.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch12.html Wed Jan 20 08:54:35 2016 (r294405) @@ -47,13 +47,13 @@
BIND 9 DNS Library Support
-
Prerequisite
-
Compilation
-
Installation
-
Known Defects/Restrictions
-
The dns.conf File
-
Sample Applications
-
Library References
+
Prerequisite
+
Compilation
+
Installation
+
Known Defects/Restrictions
+
The dns.conf File
+
Sample Applications
+
Library References
@@ -89,7 +89,7 @@

-Prerequisite

+Prerequisite

GNU make is required to build the export libraries (other part of BIND 9 can still be built with other types of make). In the reminder of this document, "make" means GNU make. Note that @@ -98,7 +98,7 @@

-Compilation

+Compilation
 $ ./configure --enable-exportlib [other flags]
 $ make
@@ -113,7 +113,7 @@ $ make
 

-Installation

+Installation
 $ cd lib/export
 $ make install
@@ -135,7 +135,7 @@ $ make i
 
 

-Known Defects/Restrictions

+Known Defects/Restrictions
  • Currently, win32 is not supported for the export library. (Normal BIND 9 application can be built as @@ -175,7 +175,7 @@ $ make

    -The dns.conf File

    +The dns.conf File

The IRS library supports an "advanced" configuration file related to the DNS library for configuration parameters that would be beyond the capability of the @@ -193,14 +193,14 @@ $ make

-Sample Applications

+Sample Applications

Some sample application programs using this API are provided for reference. The following is a brief description of these applications.

-sample: a simple stub resolver utility

+sample: a simple stub resolver utility

It sends a query of a given name (of a given optional RR type) to a specified recursive server, and prints the result as a list of @@ -264,7 +264,7 @@ $ make

-sample-async: a simple stub resolver, working asynchronously

+sample-async: a simple stub resolver, working asynchronously

Similar to "sample", but accepts a list of (query) domain names as a separate file and resolves the names @@ -305,7 +305,7 @@ $ make

-sample-request: a simple DNS transaction client

+sample-request: a simple DNS transaction client

It sends a query to a specified server, and prints the response with minimal processing. It doesn't act as a @@ -346,7 +346,7 @@ $ make

-sample-gai: getaddrinfo() and getnameinfo() test code

+sample-gai: getaddrinfo() and getnameinfo() test code

This is a test program to check getaddrinfo() and getnameinfo() behavior. It takes a @@ -363,7 +363,7 @@ $ make

-sample-update: a simple dynamic update client program

+sample-update: a simple dynamic update client program

It accepts a single update command as a command-line argument, sends an update request message to the @@ -458,7 +458,7 @@ $ sample

-nsprobe: domain/name server checker in terms of RFC 4074

+nsprobe: domain/name server checker in terms of RFC 4074

It checks a set of domains to see the name servers of the domains behave @@ -515,7 +515,7 @@ $ sample

-Library References

+Library References

As of this writing, there is no formal "manual" of the libraries, except this document, header files (some of them provide pretty detailed explanations), and sample application @@ -540,6 +540,6 @@ $ sample -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch13.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch13.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch13.html Wed Jan 20 08:54:35 2016 (r294405) @@ -140,6 +140,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.html Wed Jan 20 08:54:35 2016 (r294405) @@ -41,7 +41,7 @@

BIND 9 Administrator Reference Manual

-

BIND Version 9.9.8-P2

+

BIND Version 9.9.8-P3

@@ -234,7 +234,7 @@
A. Release Notes
-
Release Notes for BIND Version 9.9.8-P2
+
Release Notes for BIND Version 9.9.8-P3
Introduction
Download
@@ -262,13 +262,13 @@
BIND 9 DNS Library Support
-
Prerequisite
-
Compilation
-
Installation
-
Known Defects/Restrictions
-
The dns.conf File
-
Sample Applications
-
Library References
+
Prerequisite
+
Compilation
+
Installation
+
Known Defects/Restrictions
+
The dns.conf File
+
Sample Applications
+
Library References
I. Manual pages
@@ -365,6 +365,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.pdf ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/9/contrib/bind9/doc/arm/man.arpaname.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.arpaname.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/man.arpaname.html Wed Jan 20 08:54:35 2016 (r294405) @@ -50,20 +50,20 @@

arpaname {ipaddress ...}

-

DESCRIPTION

+

DESCRIPTION

arpaname translates IP addresses (IPv4 and IPv6) to the corresponding IN-ADDR.ARPA or IP6.ARPA names.

-

SEE ALSO

+

SEE ALSO

BIND 9 Administrator Reference Manual.

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -87,6 +87,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.ddns-confgen.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.ddns-confgen.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/man.ddns-confgen.html Wed Jan 20 08:54:35 2016 (r294405) @@ -50,7 +50,7 @@

ddns-confgen [-a algorithm] [-h] [-k keyname] [-r randomfile] [ -s name | -z zone ] [-q] [name]

-

DESCRIPTION

+

DESCRIPTION

ddns-confgen generates a key for use by nsupdate and named. It simplifies configuration @@ -77,7 +77,7 @@

-

OPTIONS

+

OPTIONS

-a algorithm

@@ -144,7 +144,7 @@

-

SEE ALSO

+

SEE ALSO

nsupdate(1), named.conf(5), named(8), @@ -152,7 +152,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -176,6 +176,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dig.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dig.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/man.dig.html Wed Jan 20 08:54:35 2016 (r294405) @@ -52,7 +52,7 @@

dig [global-queryopt...] [query...]

-

DESCRIPTION

+

DESCRIPTION

dig (domain information groper) is a flexible tool for interrogating DNS name servers. It performs DNS lookups and @@ -99,7 +99,7 @@

-

SIMPLE USAGE

+

SIMPLE USAGE

A typical invocation of dig looks like:

@@ -152,7 +152,7 @@

-

OPTIONS

+

OPTIONS

-4

@@ -280,7 +280,7 @@

-

QUERY OPTIONS

+

QUERY OPTIONS

dig provides a number of query options which affect the way in which lookups are made and the results displayed. Some of @@ -649,7 +649,7 @@

-

MULTIPLE QUERIES

+

MULTIPLE QUERIES

The BIND 9 implementation of dig supports @@ -695,7 +695,7 @@ dig +qr www.isc.org any -x 127.0.0.1 isc

-

IDN SUPPORT

+

IDN SUPPORT

If dig has been built with IDN (internationalized domain name) support, it can accept and display non-ASCII domain names. @@ -709,14 +709,14 @@ dig +qr www.isc.org any -x 127.0.0.1 isc

-

FILES

+

FILES

/etc/resolv.conf

${HOME}/.digrc

-

SEE ALSO

+

SEE ALSO

host(1), named(8), dnssec-keygen(8), @@ -724,7 +724,7 @@ dig +qr www.isc.org any -x 127.0.0.1 isc

-

BUGS

+

BUGS

There are probably too many query options.

@@ -747,6 +747,6 @@ dig +qr www.isc.org any -x 127.0.0.1 isc
-

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dnssec-checkds.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dnssec-checkds.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/man.dnssec-checkds.html Wed Jan 20 08:54:35 2016 (r294405) @@ -51,7 +51,7 @@

dnssec-dsfromkey [-l domain] [-f file] [-d dig path] [-D dsfromkey path] {zone}

-

DESCRIPTION

+

DESCRIPTION

dnssec-checkds verifies the correctness of Delegation Signer (DS) or DNSSEC Lookaside Validation (DLV) resource records for keys in a specified @@ -59,7 +59,7 @@

-

OPTIONS

+

OPTIONS

-f file

@@ -88,14 +88,14 @@

-

SEE ALSO

+

SEE ALSO

dnssec-dsfromkey(8), dnssec-keygen(8), dnssec-signzone(8),

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -118,6 +118,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dnssec-coverage.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dnssec-coverage.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/man.dnssec-coverage.html Wed Jan 20 08:54:35 2016 (r294405) @@ -50,7 +50,7 @@

dnssec-coverage [-K directory] [-f file] [-d DNSKEY TTL] [-m max TTL] [-r interval] [-c compilezone path] [zone]

-

DESCRIPTION

+

DESCRIPTION

dnssec-coverage verifies that the DNSSEC keys for a given zone or a set of zones have timing metadata set properly to ensure no future lapses in DNSSEC @@ -78,7 +78,7 @@

-

OPTIONS

+

OPTIONS

-f file

@@ -168,7 +168,7 @@

-

SEE ALSO

+

SEE ALSO

dnssec-checkds(8), dnssec-dsfromkey(8), @@ -177,7 +177,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -201,6 +201,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html Wed Jan 20 08:54:35 2016 (r294405) @@ -52,14 +52,14 @@

dnssec-dsfromkey [-h] [-V]

-

DESCRIPTION

+

DESCRIPTION

dnssec-dsfromkey outputs the Delegation Signer (DS) resource record (RR), as defined in RFC 3658 and RFC 4509, for the given key(s).

-

OPTIONS

+

OPTIONS

-1

@@ -150,7 +150,7 @@

-

EXAMPLE

+

EXAMPLE

To build the SHA-256 DS RR from the Kexample.com.+003+26160 @@ -165,7 +165,7 @@

-

FILES

+

FILES

The keyfile can be designed by the key identification Knnnn.+aaa+iiiii or the full file name @@ -179,13 +179,13 @@

-

CAVEAT

+

CAVEAT

A keyfile error can give a "file not found" even if the file exists.

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), dnssec-signzone(8), BIND 9 Administrator Reference Manual, @@ -195,7 +195,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -219,6 +219,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html Wed Jan 20 08:54:35 2016 (r294405) @@ -50,7 +50,7 @@

dnssec-keyfromlabel {-l label} [-3] [-a algorithm] [-A date/offset] [-c class] [-D date/offset] [-E engine] [-f flag] [-G] [-I date/offset] [-i interval] [-k] [-K directory] [-L ttl] [-n nametype] [-P date/offset] [-p protocol] [-R date/offset] [-S key] [-t type] [-v level] [-V] [-y] {name}

-

DESCRIPTION

+

DESCRIPTION

dnssec-keyfromlabel generates a key pair of files that referencing a key object stored in a cryptographic hardware service module (HSM). The private key @@ -66,7 +66,7 @@

-

OPTIONS

+

OPTIONS

-a algorithm
@@ -209,7 +209,7 @@
-

TIMING OPTIONS

+

TIMING OPTIONS

Dates can be expressed in the format YYYYMMDD or YYYYMMDDHHMMSS. If the argument begins with a '+' or '-', it is interpreted as @@ -281,7 +281,7 @@

-

GENERATED KEY FILES

+

GENERATED KEY FILES

When dnssec-keyfromlabel completes successfully, @@ -320,7 +320,7 @@

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), dnssec-signzone(8), BIND 9 Administrator Reference Manual, @@ -328,7 +328,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -352,6 +352,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dnssec-keygen.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dnssec-keygen.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/man.dnssec-keygen.html Wed Jan 20 08:54:35 2016 (r294405) @@ -50,7 +50,7 @@

dnssec-keygen [-a algorithm] [-b keysize] [-n nametype] [-3] [-A date/offset] [-C] [-c class] [-D date/offset] [-E engine] [-f flag] [-G] [-g generator] [-h] [-I date/offset] [-i interval] [-K directory] [-L ttl] [-k] [-P date/offset] [-p protocol] [-q] [-R date/offset] [-r randomdev] [-S key] [-s strength] [-t type] [-v level] [-V] [-z] {name}

-

DESCRIPTION

+

DESCRIPTION

dnssec-keygen generates keys for DNSSEC (Secure DNS), as defined in RFC 2535 and RFC 4034. It can also generate keys for use with @@ -64,7 +64,7 @@

-

OPTIONS

+

OPTIONS

-a algorithm
@@ -280,7 +280,7 @@
-

TIMING OPTIONS

+

TIMING OPTIONS

Dates can be expressed in the format YYYYMMDD or YYYYMMDDHHMMSS. If the argument begins with a '+' or '-', it is interpreted as @@ -354,7 +354,7 @@

-

GENERATED KEYS

+

GENERATED KEYS

When dnssec-keygen completes successfully, @@ -400,7 +400,7 @@

-

EXAMPLE

+

EXAMPLE

To generate a 768-bit DSA key for the domain example.com, the following command would be @@ -421,7 +421,7 @@

-

SEE ALSO

+

SEE ALSO

dnssec-signzone(8), BIND 9 Administrator Reference Manual, RFC 2539, @@ -430,7 +430,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -454,6 +454,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dnssec-revoke.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dnssec-revoke.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/man.dnssec-revoke.html Wed Jan 20 08:54:35 2016 (r294405) @@ -50,7 +50,7 @@

dnssec-revoke [-hr] [-v level] [-V] [-K directory] [-E engine] [-f] [-R] {keyfile}

-

DESCRIPTION

+

DESCRIPTION

dnssec-revoke reads a DNSSEC key file, sets the REVOKED bit on the key as defined in RFC 5011, and creates a new pair of key files containing the @@ -58,7 +58,7 @@

-

OPTIONS

+

OPTIONS

-h

@@ -100,14 +100,14 @@

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), BIND 9 Administrator Reference Manual, RFC 5011.

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -131,6 +131,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dnssec-settime.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dnssec-settime.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/man.dnssec-settime.html Wed Jan 20 08:54:35 2016 (r294405) @@ -50,7 +50,7 @@

dnssec-settime [-f] [-K directory] [-L ttl] [-P date/offset] [-A date/offset] [-R date/offset] [-I date/offset] [-D date/offset] [-h] [-V] [-v level] [-E engine] {keyfile}

-

DESCRIPTION

+

DESCRIPTION

dnssec-settime reads a DNSSEC private key file and sets the key timing metadata as specified by the -P, -A, @@ -76,7 +76,7 @@

-

OPTIONS

+

OPTIONS

-f

@@ -124,7 +124,7 @@

-

TIMING OPTIONS

+

TIMING OPTIONS

Dates can be expressed in the format YYYYMMDD or YYYYMMDDHHMMSS. If the argument begins with a '+' or '-', it is interpreted as @@ -203,7 +203,7 @@

-

PRINTING OPTIONS

+

PRINTING OPTIONS

dnssec-settime can also be used to print the timing metadata associated with a key. @@ -229,7 +229,7 @@

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), dnssec-signzone(8), BIND 9 Administrator Reference Manual, @@ -237,7 +237,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -261,6 +261,6 @@ -

BIND 9.9.8-P2 (Extended Support Version)

+

BIND 9.9.8-P3 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dnssec-signzone.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dnssec-signzone.html Wed Jan 20 08:28:32 2016 (r294404) +++ stable/9/contrib/bind9/doc/arm/man.dnssec-signzone.html Wed Jan 20 08:54:35 2016 (r294405) @@ -50,7 +50,7 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Wed Jan 20 09:00:43 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5F90A89827; Wed, 20 Jan 2016 09:00:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 960561C99; Wed, 20 Jan 2016 09:00:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0K90gqo048221; Wed, 20 Jan 2016 09:00:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0K90gLt048219; Wed, 20 Jan 2016 09:00:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601200900.u0K90gLt048219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 20 Jan 2016 09:00:42 +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: r294406 - stable/10/sys/dev/sfxge 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 09:00:43 -0000 Author: arybchik Date: Wed Jan 20 09:00:42 2016 New Revision: 294406 URL: https://svnweb.freebsd.org/changeset/base/294406 Log: MFC r294372 sfxge: refresh version to note matching version of out-of-tree driver Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_version.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_version.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_version.h Wed Jan 20 08:54:35 2016 (r294405) +++ stable/10/sys/dev/sfxge/sfxge_version.h Wed Jan 20 09:00:42 2016 (r294406) @@ -36,6 +36,6 @@ #ifndef _SFXGE_VERSION_H #define _SFXGE_VERSION_H -#define SFXGE_VERSION_STRING "v4.5.3.1002" +#define SFXGE_VERSION_STRING "v4.8.0.1019" #endif /* _SFXGE_DRIVER_VERSION_H */ From owner-svn-src-stable@freebsd.org Wed Jan 20 13:23:05 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FF42A8A794; Wed, 20 Jan 2016 13:23:05 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0ECDE1938; Wed, 20 Jan 2016 13:23:04 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0KDN48p057938; Wed, 20 Jan 2016 13:23:04 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KDN2s0057920; Wed, 20 Jan 2016 13:23:02 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201601201323.u0KDN2s0057920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 20 Jan 2016 13:23:02 +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: r294417 - in stable/10/sys/boot: common fdt forth i386/libi386 i386/loader 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 13:23:05 -0000 Author: royger Date: Wed Jan 20 13:23:02 2016 New Revision: 294417 URL: https://svnweb.freebsd.org/changeset/base/294417 Log: MFC r277215, r277291, r277418, r280953 and r280954: loader: implement multiboot support for Xen Dom0 Note that only the subset of the multiboot specification needed in order to boot a Xen Dom0 is implemented. Sponsored by: Citrix Systems R&D Added: stable/10/sys/boot/i386/libi386/multiboot.c - copied, changed from r277215, head/sys/boot/i386/libi386/multiboot.c stable/10/sys/boot/i386/libi386/multiboot.h - copied unchanged from r277215, head/sys/boot/i386/libi386/multiboot.h stable/10/sys/boot/i386/libi386/multiboot_tramp.S - copied unchanged from r277215, head/sys/boot/i386/libi386/multiboot_tramp.S Modified: stable/10/sys/boot/common/bootstrap.h stable/10/sys/boot/common/load_elf.c stable/10/sys/boot/common/load_elf_obj.c stable/10/sys/boot/common/module.c stable/10/sys/boot/fdt/fdt_loader_cmd.c stable/10/sys/boot/forth/beastie.4th stable/10/sys/boot/forth/loader.4th stable/10/sys/boot/forth/support.4th stable/10/sys/boot/i386/libi386/Makefile stable/10/sys/boot/i386/libi386/bootinfo64.c stable/10/sys/boot/i386/libi386/elf64_freebsd.c stable/10/sys/boot/i386/libi386/libi386.h stable/10/sys/boot/i386/loader/conf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/bootstrap.h ============================================================================== --- stable/10/sys/boot/common/bootstrap.h Wed Jan 20 13:14:36 2016 (r294416) +++ stable/10/sys/boot/common/bootstrap.h Wed Jan 20 13:23:02 2016 (r294417) @@ -231,9 +231,9 @@ int mod_load(char *name, struct mod_de int mod_loadkld(const char *name, int argc, char *argv[]); struct preloaded_file *file_alloc(void); -struct preloaded_file *file_findfile(char *name, char *type); +struct preloaded_file *file_findfile(const char *name, const char *type); struct file_metadata *file_findmetadata(struct preloaded_file *fp, int type); -struct preloaded_file *file_loadraw(char *name, char *type); +struct preloaded_file *file_loadraw(char *name, char *type, int insert); void file_discard(struct preloaded_file *fp); void file_addmetadata(struct preloaded_file *fp, int type, size_t size, void *p); int file_addmodule(struct preloaded_file *fp, char *modname, int version, @@ -257,6 +257,9 @@ int __elfN(obj_loadfile)(char *filename, int __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr, const void *reldata, int reltype, Elf_Addr relbase, Elf_Addr dataaddr, void *data, size_t len); +int __elfN(loadfile_raw)(char *filename, u_int64_t dest, + struct preloaded_file **result, int multiboot); +int __elfN(load_modmetadata)(struct preloaded_file *fp, u_int64_t dest); #endif /* Modified: stable/10/sys/boot/common/load_elf.c ============================================================================== --- stable/10/sys/boot/common/load_elf.c Wed Jan 20 13:14:36 2016 (r294416) +++ stable/10/sys/boot/common/load_elf.c Wed Jan 20 13:23:02 2016 (r294417) @@ -76,7 +76,8 @@ static int __elfN(loadimage)(struct prel static int __elfN(lookup_symbol)(struct preloaded_file *mp, elf_file_t ef, const char* name, Elf_Sym* sym); static int __elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef, Elf_Addr p, void *val, size_t len); -static int __elfN(parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef); +static int __elfN(parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef, + Elf_Addr p_start, Elf_Addr p_end); static symaddr_fn __elfN(symaddr); static char *fake_modname(const char *name); @@ -85,6 +86,61 @@ const char *__elfN(moduletype) = "elf mo u_int64_t __elfN(relocation_offset) = 0; +static int +__elfN(load_elf_header)(char *filename, elf_file_t ef) +{ + ssize_t bytes_read; + Elf_Ehdr *ehdr; + int err; + + /* + * Open the image, read and validate the ELF header + */ + if (filename == NULL) /* can't handle nameless */ + return (EFTYPE); + if ((ef->fd = open(filename, O_RDONLY)) == -1) + return (errno); + ef->firstpage = malloc(PAGE_SIZE); + if (ef->firstpage == NULL) { + close(ef->fd); + return (ENOMEM); + } + bytes_read = read(ef->fd, ef->firstpage, PAGE_SIZE); + ef->firstlen = (size_t)bytes_read; + if (bytes_read < 0 || ef->firstlen <= sizeof(Elf_Ehdr)) { + err = EFTYPE; /* could be EIO, but may be small file */ + goto error; + } + ehdr = ef->ehdr = (Elf_Ehdr *)ef->firstpage; + + /* Is it ELF? */ + if (!IS_ELF(*ehdr)) { + err = EFTYPE; + goto error; + } + if (ehdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || /* Layout ? */ + ehdr->e_ident[EI_DATA] != ELF_TARG_DATA || + ehdr->e_ident[EI_VERSION] != EV_CURRENT || /* Version ? */ + ehdr->e_version != EV_CURRENT || + ehdr->e_machine != ELF_TARG_MACH) { /* Machine ? */ + err = EFTYPE; + goto error; + } + + return (0); + +error: + if (ef->firstpage != NULL) { + free(ef->firstpage); + ef->firstpage = NULL; + } + if (ef->fd != -1) { + close(ef->fd); + ef->fd = -1; + } + return (err); +} + /* * Attempt to load the file (file) as an ELF module. It will be stored at * (dest), and a pointer to a module structure describing the loaded object @@ -93,54 +149,32 @@ u_int64_t __elfN(relocation_offset) = 0; int __elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result) { + return (__elfN(loadfile_raw)(filename, dest, result, 0)); +} + +int +__elfN(loadfile_raw)(char *filename, u_int64_t dest, + struct preloaded_file **result, int multiboot) +{ struct preloaded_file *fp, *kfp; struct elf_file ef; Elf_Ehdr *ehdr; int err; - ssize_t bytes_read; fp = NULL; bzero(&ef, sizeof(struct elf_file)); + ef.fd = -1; - /* - * Open the image, read and validate the ELF header - */ - if (filename == NULL) /* can't handle nameless */ - return(EFTYPE); - if ((ef.fd = open(filename, O_RDONLY)) == -1) - return(errno); - ef.firstpage = malloc(PAGE_SIZE); - if (ef.firstpage == NULL) { - close(ef.fd); - return(ENOMEM); - } - bytes_read = read(ef.fd, ef.firstpage, PAGE_SIZE); - ef.firstlen = (size_t)bytes_read; - if (bytes_read < 0 || ef.firstlen <= sizeof(Elf_Ehdr)) { - err = EFTYPE; /* could be EIO, but may be small file */ - goto oerr; - } - ehdr = ef.ehdr = (Elf_Ehdr *)ef.firstpage; - - /* Is it ELF? */ - if (!IS_ELF(*ehdr)) { - err = EFTYPE; - goto oerr; - } - if (ehdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || /* Layout ? */ - ehdr->e_ident[EI_DATA] != ELF_TARG_DATA || - ehdr->e_ident[EI_VERSION] != EV_CURRENT || /* Version ? */ - ehdr->e_version != EV_CURRENT || - ehdr->e_machine != ELF_TARG_MACH) { /* Machine ? */ - err = EFTYPE; - goto oerr; - } + err = __elfN(load_elf_header)(filename, &ef); + if (err != 0) + return (err); + ehdr = ef.ehdr; /* * Check to see what sort of module we are. */ - kfp = file_findfile(NULL, NULL); + kfp = file_findfile(NULL, __elfN(kerneltype)); #ifdef __powerpc__ /* * Kernels can be ET_DYN, so just assume the first loaded object is the @@ -177,6 +211,11 @@ __elfN(loadfile)(char *filename, u_int64 } else if (ehdr->e_type == ET_DYN) { /* Looks like a kld module */ + if (multiboot != 0) { + printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: can't load module as multiboot\n"); + err = EPERM; + goto oerr; + } if (kfp == NULL) { printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: can't load module before kernel\n"); err = EPERM; @@ -209,10 +248,14 @@ __elfN(loadfile)(char *filename, u_int64 err = EPERM; goto out; } - if (ef.kernel) + if (ef.kernel == 1 && multiboot == 0) setenv("kernelname", filename, 1); fp->f_name = strdup(filename); - fp->f_type = strdup(ef.kernel ? __elfN(kerneltype) : __elfN(moduletype)); + if (multiboot == 0) + fp->f_type = strdup(ef.kernel ? + __elfN(kerneltype) : __elfN(moduletype)); + else + fp->f_type = strdup("elf multiboot kernel"); #ifdef ELF_VERBOSE if (ef.kernel) @@ -240,7 +283,8 @@ __elfN(loadfile)(char *filename, u_int64 out: if (ef.firstpage) free(ef.firstpage); - close(ef.fd); + if (ef.fd != -1) + close(ef.fd); return(err); } @@ -269,6 +313,8 @@ __elfN(loadimage)(struct preloaded_file int symtabindex; Elf_Size size; u_int fpcopy; + Elf_Sym sym; + Elf_Addr p_start, p_end; dp = NULL; shdr = NULL; @@ -571,7 +617,15 @@ nosyms: COPYOUT(ef->hashtab + 1, &ef->nchains, sizeof(ef->nchains)); ef->buckets = ef->hashtab + 2; ef->chains = ef->buckets + ef->nbuckets; - if (__elfN(parse_modmetadata)(fp, ef) == 0) + + if (__elfN(lookup_symbol)(fp, ef, "__start_set_modmetadata_set", &sym) != 0) + return 0; + p_start = sym.st_value + ef->off; + if (__elfN(lookup_symbol)(fp, ef, "__stop_set_modmetadata_set", &sym) != 0) + return ENOENT; + p_end = sym.st_value + ef->off; + + if (__elfN(parse_modmetadata)(fp, ef, p_start, p_end) == 0) goto out; if (ef->kernel) /* kernel must not depend on anything */ @@ -634,7 +688,123 @@ struct mod_metadata32 { #endif int -__elfN(parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef) +__elfN(load_modmetadata)(struct preloaded_file *fp, u_int64_t dest) +{ + struct elf_file ef; + int err, i, j; + Elf_Shdr *sh_meta, *shdr = NULL; + Elf_Shdr *sh_data[2]; + char *shstrtab = NULL; + size_t size; + Elf_Addr p_start, p_end; + + bzero(&ef, sizeof(struct elf_file)); + ef.fd = -1; + + err = __elfN(load_elf_header)(fp->f_name, &ef); + if (err != 0) + goto out; + + if (ef.ehdr->e_type == ET_EXEC) { + ef.kernel = 1; + } else if (ef.ehdr->e_type != ET_DYN) { + err = EFTYPE; + goto out; + } + + size = ef.ehdr->e_shnum * ef.ehdr->e_shentsize; + shdr = alloc_pread(ef.fd, ef.ehdr->e_shoff, size); + if (shdr == NULL) { + err = ENOMEM; + goto out; + } + + /* Load shstrtab. */ + shstrtab = alloc_pread(ef.fd, shdr[ef.ehdr->e_shstrndx].sh_offset, + shdr[ef.ehdr->e_shstrndx].sh_size); + if (shstrtab == NULL) { + printf("\nelf" __XSTRING(__ELF_WORD_SIZE) + "load_modmetadata: unable to load shstrtab\n"); + err = EFTYPE; + goto out; + } + + /* Find set_modmetadata_set and data sections. */ + sh_data[0] = sh_data[1] = sh_meta = NULL; + for (i = 0, j = 0; i < ef.ehdr->e_shnum; i++) { + if (strcmp(&shstrtab[shdr[i].sh_name], + "set_modmetadata_set") == 0) { + sh_meta = &shdr[i]; + } + if ((strcmp(&shstrtab[shdr[i].sh_name], ".data") == 0) || + (strcmp(&shstrtab[shdr[i].sh_name], ".rodata") == 0)) { + sh_data[j++] = &shdr[i]; + } + } + if (sh_meta == NULL || sh_data[0] == NULL || sh_data[1] == NULL) { + printf("\nelf" __XSTRING(__ELF_WORD_SIZE) + "load_modmetadata: unable to find set_modmetadata_set or data sections\n"); + err = EFTYPE; + goto out; + } + + /* Load set_modmetadata_set into memory */ + err = kern_pread(ef.fd, dest, sh_meta->sh_size, sh_meta->sh_offset); + if (err != 0) { + printf("\nelf" __XSTRING(__ELF_WORD_SIZE) + "load_modmetadata: unable to load set_modmetadata_set: %d\n", err); + goto out; + } + p_start = dest; + p_end = dest + sh_meta->sh_size; + dest += sh_meta->sh_size; + + /* Load data sections into memory. */ + err = kern_pread(ef.fd, dest, sh_data[0]->sh_size, + sh_data[0]->sh_offset); + if (err != 0) { + printf("\nelf" __XSTRING(__ELF_WORD_SIZE) + "load_modmetadata: unable to load data: %d\n", err); + goto out; + } + + /* + * We have to increment the dest, so that the offset is the same into + * both the .rodata and .data sections. + */ + ef.off = -(sh_data[0]->sh_addr - dest); + dest += (sh_data[1]->sh_addr - sh_data[0]->sh_addr); + + err = kern_pread(ef.fd, dest, sh_data[1]->sh_size, + sh_data[1]->sh_offset); + if (err != 0) { + printf("\nelf" __XSTRING(__ELF_WORD_SIZE) + "load_modmetadata: unable to load data: %d\n", err); + goto out; + } + + err = __elfN(parse_modmetadata)(fp, &ef, p_start, p_end); + if (err != 0) { + printf("\nelf" __XSTRING(__ELF_WORD_SIZE) + "load_modmetadata: unable to parse metadata: %d\n", err); + goto out; + } + +out: + if (shstrtab != NULL) + free(shstrtab); + if (shdr != NULL) + free(shdr); + if (ef.firstpage != NULL) + free(ef.firstpage); + if (ef.fd != -1) + close(ef.fd); + return (err); +} + +int +__elfN(parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef, + Elf_Addr p_start, Elf_Addr p_end) { struct mod_metadata md; #if (defined(__i386__) || defined(__powerpc__)) && __ELF_WORD_SIZE == 64 @@ -644,20 +814,13 @@ __elfN(parse_modmetadata)(struct preload #endif struct mod_depend *mdepend; struct mod_version mver; - Elf_Sym sym; char *s; int error, modcnt, minfolen; - Elf_Addr v, p, p_stop; - - if (__elfN(lookup_symbol)(fp, ef, "__start_set_modmetadata_set", &sym) != 0) - return 0; - p = sym.st_value + ef->off; - if (__elfN(lookup_symbol)(fp, ef, "__stop_set_modmetadata_set", &sym) != 0) - return ENOENT; - p_stop = sym.st_value + ef->off; + Elf_Addr v, p; modcnt = 0; - while (p < p_stop) { + p = p_start; + while (p < p_end) { COPYOUT(p, &v, sizeof(v)); error = __elfN(reloc_ptr)(fp, ef, p, &v, sizeof(v)); if (error == EOPNOTSUPP) Modified: stable/10/sys/boot/common/load_elf_obj.c ============================================================================== --- stable/10/sys/boot/common/load_elf_obj.c Wed Jan 20 13:14:36 2016 (r294416) +++ stable/10/sys/boot/common/load_elf_obj.c Wed Jan 20 13:23:02 2016 (r294417) @@ -129,20 +129,13 @@ __elfN(obj_loadfile)(char *filename, u_i goto oerr; } - kfp = file_findfile(NULL, NULL); + kfp = file_findfile(NULL, __elfN(obj_kerneltype)); if (kfp == NULL) { printf("elf" __XSTRING(__ELF_WORD_SIZE) "_obj_loadfile: can't load module before kernel\n"); err = EPERM; goto oerr; } - if (strcmp(__elfN(obj_kerneltype), kfp->f_type)) { - printf("elf" __XSTRING(__ELF_WORD_SIZE) - "_obj_loadfile: can't load module with kernel type '%s'\n", - kfp->f_type); - err = EPERM; - goto oerr; - } if (archsw.arch_loadaddr != NULL) dest = archsw.arch_loadaddr(LOAD_ELF, hdr, dest); Modified: stable/10/sys/boot/common/module.c ============================================================================== --- stable/10/sys/boot/common/module.c Wed Jan 20 13:14:36 2016 (r294416) +++ stable/10/sys/boot/common/module.c Wed Jan 20 13:23:02 2016 (r294417) @@ -138,7 +138,7 @@ command_load(int argc, char *argv[]) command_errmsg = "invalid load type"; return(CMD_ERROR); } - return(file_loadraw(argv[1], typestr) ? CMD_OK : CMD_ERROR); + return (file_loadraw(argv[1], typestr, 1) ? CMD_OK : CMD_ERROR); } /* * Do we have explicit KLD load ? @@ -193,7 +193,7 @@ command_load_geli(int argc, char *argv[] argv += (optind - 1); argc -= (optind - 1); sprintf(typestr, "%s:geli_keyfile%d", argv[1], num); - return(file_loadraw(argv[2], typestr) ? CMD_OK : CMD_ERROR); + return (file_loadraw(argv[2], typestr, 1) ? CMD_OK : CMD_ERROR); } COMMAND_SET(unload, "unload", "unload all modules", command_unload); @@ -362,7 +362,7 @@ file_load_dependencies(struct preloaded_ * no arguments or anything. */ struct preloaded_file * -file_loadraw(char *name, char *type) +file_loadraw(char *name, char *type, int insert) { struct preloaded_file *fp; char *cp; @@ -421,7 +421,8 @@ file_loadraw(char *name, char *type) loadaddr = laddr; /* Add to the list of loaded files */ - file_insert_tail(fp); + if (insert != 0) + file_insert_tail(fp); close(fd); return(fp); } @@ -524,7 +525,7 @@ mod_loadkld(const char *kldname, int arg * NULL may be passed as a wildcard to either. */ struct preloaded_file * -file_findfile(char *name, char *type) +file_findfile(const char *name, const char *type) { struct preloaded_file *fp; Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/10/sys/boot/fdt/fdt_loader_cmd.c Wed Jan 20 13:14:36 2016 (r294416) +++ stable/10/sys/boot/fdt/fdt_loader_cmd.c Wed Jan 20 13:23:02 2016 (r294417) @@ -261,7 +261,7 @@ fdt_load_dtb_file(const char * filename) oldbfp = file_findfile(NULL, "dtb"); /* Attempt to load and validate a new dtb from a file. */ - if ((bfp = file_loadraw(filename, "dtb")) == NULL) { + if ((bfp = file_loadraw(filename, "dtb", 1)) == NULL) { sprintf(command_errbuf, "failed to load file '%s'", filename); return (1); } Modified: stable/10/sys/boot/forth/beastie.4th ============================================================================== --- stable/10/sys/boot/forth/beastie.4th Wed Jan 20 13:14:36 2016 (r294416) +++ stable/10/sys/boot/forth/beastie.4th Wed Jan 20 13:23:02 2016 (r294417) @@ -93,6 +93,7 @@ also support-functions s" beastie_disable" getenv dup -1 <> if s" YES" compare-insensitive 0= if any_conf_read? if + load_xen_throw load_kernel load_modules then Modified: stable/10/sys/boot/forth/loader.4th ============================================================================== --- stable/10/sys/boot/forth/loader.4th Wed Jan 20 13:14:36 2016 (r294416) +++ stable/10/sys/boot/forth/loader.4th Wed Jan 20 13:23:02 2016 (r294417) @@ -147,13 +147,14 @@ only forth definitions also support-func \ was succesfully loaded! any_conf_read? if s" loader_delay" getenv -1 = if + load_xen_throw load_kernel load_modules else drop ." Loading Kernel and Modules (Ctrl-C to Abort)" cr s" also support-functions" evaluate - s" set delay_command='load_kernel load_modules'" evaluate + s" set delay_command='load_xen_throw load_kernel load_modules'" evaluate s" set delay_showdots" evaluate delay_execute then Modified: stable/10/sys/boot/forth/support.4th ============================================================================== --- stable/10/sys/boot/forth/support.4th Wed Jan 20 13:14:36 2016 (r294416) +++ stable/10/sys/boot/forth/support.4th Wed Jan 20 13:23:02 2016 (r294417) @@ -1460,6 +1460,20 @@ also builtins abort" Unable to load a kernel!" ; +: load_xen ( -- ) + s" xen_kernel" getenv dup -1 <> if + 1 1 load + else + drop + 0 + then +; + +: load_xen_throw ( -- ) ( throws: abort ) + load_xen + abort" Unable to load Xen!" +; + : set_defaultoptions ( -- ) s" kernel_options" getenv dup -1 = if drop @@ -1578,12 +1592,15 @@ also builtins else drop then - r> if ( a path was passed ) - load_directory_or_file - else - standard_kernel_search + load_xen + ?dup 0= if ( success ) + r> if ( a path was passed ) + load_directory_or_file + else + standard_kernel_search + then + ?dup 0= if ['] load_modules catch then then - ?dup 0= if ['] load_modules catch then ; only forth definitions Modified: stable/10/sys/boot/i386/libi386/Makefile ============================================================================== --- stable/10/sys/boot/i386/libi386/Makefile Wed Jan 20 13:14:36 2016 (r294416) +++ stable/10/sys/boot/i386/libi386/Makefile Wed Jan 20 13:23:02 2016 (r294417) @@ -6,7 +6,7 @@ INTERNALLIB= SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp.c \ biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \ comconsole.c devicename.c elf32_freebsd.c \ - elf64_freebsd.c \ + elf64_freebsd.c multiboot.c multiboot_tramp.S \ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c .PATH: ${.CURDIR}/../../zfs @@ -65,6 +65,7 @@ machine: # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.amd64_tramp.S= ${CLANG_NO_IAS} +CFLAGS.multiboot_tramp.S= ${CLANG_NO_IAS} CFLAGS+= ${CFLAGS.${.IMPSRC:T}} .if ${MACHINE_CPUARCH} == "amd64" Modified: stable/10/sys/boot/i386/libi386/bootinfo64.c ============================================================================== --- stable/10/sys/boot/i386/libi386/bootinfo64.c Wed Jan 20 13:14:36 2016 (r294416) +++ stable/10/sys/boot/i386/libi386/bootinfo64.c Wed Jan 20 13:23:02 2016 (r294417) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "bootstrap.h" @@ -176,14 +177,15 @@ bi_checkcpu(void) * - Module metadata are formatted and placed in kernel space. */ int -bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp) +bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, + vm_offset_t *kernendp, int add_smap) { struct preloaded_file *xp, *kfp; struct i386_devdesc *rootdev; struct file_metadata *md; - vm_offset_t addr; u_int64_t kernend; u_int64_t envp; + u_int64_t module; vm_offset_t size; char *rootdevname; int howto; @@ -210,21 +212,18 @@ bi_load64(char *args, vm_offset_t *modul /* Try reading the /etc/fstab file to select the root device */ getrootmount(i386_fmtdev((void *)rootdev)); - /* find the last module in the chain */ - addr = 0; - for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - if (addr < (xp->f_addr + xp->f_size)) - addr = xp->f_addr + xp->f_size; + if (addr == 0) { + /* find the last module in the chain */ + for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { + if (addr < (xp->f_addr + xp->f_size)) + addr = xp->f_addr + xp->f_size; + } } /* pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); - /* copy our environment */ - envp = addr; - addr = bi_copyenv(addr); - - /* pad to a page boundary */ - addr = roundup(addr, PAGE_SIZE); + /* place the metadata before anything */ + module = *modulep = addr; kfp = file_findfile(NULL, "elf kernel"); if (kfp == NULL) @@ -235,20 +234,30 @@ bi_load64(char *args, vm_offset_t *modul file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); - bios_addsmapdata(kfp); + file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof module, &module); + if (add_smap != 0) + bios_addsmapdata(kfp); - /* Figure out the size and location of the metadata */ - *modulep = addr; size = bi_copymodules64(0); - kernend = roundup(addr + size, PAGE_SIZE); + + /* copy our environment */ + envp = roundup(addr + size, PAGE_SIZE); + addr = bi_copyenv(envp); + + /* set kernend */ + kernend = roundup(addr, PAGE_SIZE); *kernendp = kernend; /* patch MODINFOMD_KERNEND */ md = file_findmetadata(kfp, MODINFOMD_KERNEND); bcopy(&kernend, md->md_data, sizeof kernend); + /* patch MODINFOMD_ENVP */ + md = file_findmetadata(kfp, MODINFOMD_ENVP); + bcopy(&envp, md->md_data, sizeof envp); + /* copy module list and metadata */ - (void)bi_copymodules64(addr); + (void)bi_copymodules64(*modulep); return(0); } Modified: stable/10/sys/boot/i386/libi386/elf64_freebsd.c ============================================================================== --- stable/10/sys/boot/i386/libi386/elf64_freebsd.c Wed Jan 20 13:14:36 2016 (r294416) +++ stable/10/sys/boot/i386/libi386/elf64_freebsd.c Wed Jan 20 13:23:02 2016 (r294417) @@ -81,7 +81,7 @@ elf64_exec(struct preloaded_file *fp) return(EFTYPE); ehdr = (Elf_Ehdr *)&(md->md_data); - err = bi_load64(fp->f_args, &modulep, &kernend); + err = bi_load64(fp->f_args, 0, &modulep, &kernend, 1); if (err != 0) return(err); Modified: stable/10/sys/boot/i386/libi386/libi386.h ============================================================================== --- stable/10/sys/boot/i386/libi386/libi386.h Wed Jan 20 13:14:36 2016 (r294416) +++ stable/10/sys/boot/i386/libi386/libi386.h Wed Jan 20 13:23:02 2016 (r294417) @@ -117,6 +117,7 @@ void bi_setboothowto(int howto); vm_offset_t bi_copyenv(vm_offset_t addr); int bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t *modulep, vm_offset_t *kernend); -int bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernend); +int bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, + vm_offset_t *kernend, int add_smap); void pxe_enable(void *pxeinfo); Copied and modified: stable/10/sys/boot/i386/libi386/multiboot.c (from r277215, head/sys/boot/i386/libi386/multiboot.c) ============================================================================== --- head/sys/boot/i386/libi386/multiboot.c Thu Jan 15 16:27:20 2015 (r277215, copy source) +++ stable/10/sys/boot/i386/libi386/multiboot.c Wed Jan 20 13:23:02 2016 (r294417) @@ -243,7 +243,7 @@ multiboot_exec(struct preloaded_file *fp /* Find the entry point of the Xen kernel and save it for later */ if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) { printf("Unable to find %s entry point\n", fp->f_name); - error = EFTYPE; + error = EINVAL; goto error; } ehdr = (Elf_Ehdr *)&(md->md_data); @@ -271,10 +271,17 @@ multiboot_exec(struct preloaded_file *fp fp = file_findfile(NULL, "elf kernel"); if (fp == NULL) { printf("No FreeBSD kernel provided, aborting\n"); - error = EFTYPE; + error = EINVAL; goto error; } + mb_mod = malloc(sizeof(struct multiboot_mod_list) * NUM_MODULES); + if (mb_mod == NULL) { + error = ENOMEM; + goto error; + } + + bzero(mb_mod, sizeof(struct multiboot_mod_list) * NUM_MODULES); /* * Calculate how much memory is needed for the metatdata. We did @@ -373,7 +380,7 @@ multiboot_obj_loadfile(char *filename, u printf( "Unable to load %s as a multiboot payload kernel\n", filename); - return (EFTYPE); + return (EINVAL); } /* Load kernel metadata... */ @@ -382,7 +389,7 @@ multiboot_obj_loadfile(char *filename, u if (error) { printf("Unable to load kernel %s metadata error: %d\n", rfp->f_name, error); - return (EFTYPE); + return (EINVAL); } /* Copied: stable/10/sys/boot/i386/libi386/multiboot.h (from r277215, head/sys/boot/i386/libi386/multiboot.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/i386/libi386/multiboot.h Wed Jan 20 13:23:02 2016 (r294417, copy of r277215, head/sys/boot/i386/libi386/multiboot.h) @@ -0,0 +1,225 @@ +/* multiboot.h - Multiboot header file. */ +/* Copyright (C) 1999,2003,2007,2008,2009 Free Software Foundation, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to +* deal in the Software without restriction, including without limitation the +* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +* sell copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ANY +* DEVELOPER OR DISTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +* IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +* +* $FreeBSD$ +*/ + +#ifndef MULTIBOOT_HEADER +#define MULTIBOOT_HEADER 1 + +/* How many bytes from the start of the file we search for the header. */ +#define MULTIBOOT_SEARCH 8192 + +/* The magic field should contain this. */ +#define MULTIBOOT_HEADER_MAGIC 0x1BADB002 + +/* This should be in %eax. */ +#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002 + +/* The bits in the required part of flags field we don't support. */ +#define MULTIBOOT_UNSUPPORTED 0x0000fffc + +/* Alignment of multiboot modules. */ +#define MULTIBOOT_MOD_ALIGN 0x00001000 + +/* Alignment of the multiboot info structure. */ +#define MULTIBOOT_INFO_ALIGN 0x00000004 + +/* Flags set in the 'flags' member of the multiboot header. */ + +/* Align all boot modules on i386 page (4KB) boundaries. */ +#define MULTIBOOT_PAGE_ALIGN 0x00000001 + +/* Must pass memory information to OS. */ +#define MULTIBOOT_MEMORY_INFO 0x00000002 + +/* Must pass video information to OS. */ +#define MULTIBOOT_VIDEO_MODE 0x00000004 + +/* This flag indicates the use of the address fields in the header. */ +#define MULTIBOOT_AOUT_KLUDGE 0x00010000 + +/* Flags to be set in the 'flags' member of the multiboot info structure. */ + +/* is there basic lower/upper memory information? */ +#define MULTIBOOT_INFO_MEMORY 0x00000001 +/* is there a boot device set? */ +#define MULTIBOOT_INFO_BOOTDEV 0x00000002 +/* is the command-line defined? */ +#define MULTIBOOT_INFO_CMDLINE 0x00000004 +/* are there modules to do something with? */ +#define MULTIBOOT_INFO_MODS 0x00000008 + +/* These next two are mutually exclusive */ + +/* is there a symbol table loaded? */ +#define MULTIBOOT_INFO_AOUT_SYMS 0x00000010 +/* is there an ELF section header table? */ +#define MULTIBOOT_INFO_ELF_SHDR 0X00000020 + +/* is there a full memory map? */ +#define MULTIBOOT_INFO_MEM_MAP 0x00000040 + +/* Is there drive info? */ +#define MULTIBOOT_INFO_DRIVE_INFO 0x00000080 + +/* Is there a config table? */ +#define MULTIBOOT_INFO_CONFIG_TABLE 0x00000100 + +/* Is there a boot loader name? */ +#define MULTIBOOT_INFO_BOOT_LOADER_NAME 0x00000200 + +/* Is there a APM table? */ +#define MULTIBOOT_INFO_APM_TABLE 0x00000400 + +/* Is there video information? */ +#define MULTIBOOT_INFO_VIDEO_INFO 0x00000800 + +#ifndef ASM_FILE + +typedef unsigned short multiboot_uint16_t; +typedef unsigned int multiboot_uint32_t; +typedef unsigned long long multiboot_uint64_t; + +struct multiboot_header +{ +/* Must be MULTIBOOT_MAGIC - see above. */ + multiboot_uint32_t magic; + +/* Feature flags. */ + multiboot_uint32_t flags; + +/* The above fields plus this one must equal 0 mod 2^32. */ + multiboot_uint32_t checksum; + +/* These are only valid if MULTIBOOT_AOUT_KLUDGE is set. */ + multiboot_uint32_t header_addr; + multiboot_uint32_t load_addr; + multiboot_uint32_t load_end_addr; + multiboot_uint32_t bss_end_addr; + multiboot_uint32_t entry_addr; + +/* These are only valid if MULTIBOOT_VIDEO_MODE is set. */ + multiboot_uint32_t mode_type; + multiboot_uint32_t width; + multiboot_uint32_t height; + multiboot_uint32_t depth; +}; + +/* The symbol table for a.out. */ +struct multiboot_aout_symbol_table +{ + multiboot_uint32_t tabsize; + multiboot_uint32_t strsize; + multiboot_uint32_t addr; + multiboot_uint32_t reserved; +}; +typedef struct multiboot_aout_symbol_table multiboot_aout_symbol_table_t; + +/* The section header table for ELF. */ +struct multiboot_elf_section_header_table +{ + multiboot_uint32_t num; + multiboot_uint32_t size; + multiboot_uint32_t addr; + multiboot_uint32_t shndx; +}; +typedef struct multiboot_elf_section_header_table multiboot_elf_section_header_table_t; + +struct multiboot_info +{ +/* Multiboot info version number */ + multiboot_uint32_t flags; + +/* Available memory from BIOS */ + multiboot_uint32_t mem_lower; + multiboot_uint32_t mem_upper; + +/* "root" partition */ + multiboot_uint32_t boot_device; + +/* Kernel command line */ + multiboot_uint32_t cmdline; + +/* Boot-Module list */ + multiboot_uint32_t mods_count; + multiboot_uint32_t mods_addr; + + union + { + multiboot_aout_symbol_table_t aout_sym; + multiboot_elf_section_header_table_t elf_sec; + } u; + +/* Memory Mapping buffer */ + multiboot_uint32_t mmap_length; + multiboot_uint32_t mmap_addr; + +/* Drive Info buffer */ + multiboot_uint32_t drives_length; + multiboot_uint32_t drives_addr; + +/* ROM configuration table */ + multiboot_uint32_t config_table; + +/* Boot Loader Name */ + multiboot_uint32_t boot_loader_name; + +/* APM table */ + multiboot_uint32_t apm_table; + +/* Video */ + multiboot_uint32_t vbe_control_info; + multiboot_uint32_t vbe_mode_info; + multiboot_uint16_t vbe_mode; + multiboot_uint16_t vbe_interface_seg; + multiboot_uint16_t vbe_interface_off; + multiboot_uint16_t vbe_interface_len; +}; +typedef struct multiboot_info multiboot_info_t; + +struct multiboot_mmap_entry +{ + multiboot_uint32_t size; + multiboot_uint64_t addr; + multiboot_uint64_t len; +#define MULTIBOOT_MEMORY_AVAILABLE 1 +#define MULTIBOOT_MEMORY_RESERVED 2 + multiboot_uint32_t type; +} __attribute__((packed)); +typedef struct multiboot_mmap_entry multiboot_memory_map_t; + +struct multiboot_mod_list +{ +/* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */ + multiboot_uint32_t mod_start; + multiboot_uint32_t mod_end; + +/* Module command line */ + multiboot_uint32_t cmdline; + +/* padding to take it to 16 bytes (must be zero) */ + multiboot_uint32_t pad; +}; +typedef struct multiboot_mod_list multiboot_module_t; + +#endif /* ! ASM_FILE */ + +#endif /* ! MULTIBOOT_HEADER */ Copied: stable/10/sys/boot/i386/libi386/multiboot_tramp.S (from r277215, head/sys/boot/i386/libi386/multiboot_tramp.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/i386/libi386/multiboot_tramp.S Wed Jan 20 13:23:02 2016 (r294417, copy of r277215, head/sys/boot/i386/libi386/multiboot_tramp.S) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2014 Roger Pau Monné + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define ASM_FILE +#include "multiboot.h" + +/* + * The multiboot specification requires the executable to be launched + * with %cs set to a flat read/execute segment with offset 0 and limit + * 0xFFFFFFFF, and the rest of the segment registers (%ds, %es, %fs, + * %gs, %ss) to flat read/write segments with the same offset and limit. + * This is already done by the BTX code before calling multiboot_tramp, + * so there is no need to do anything here. + */ + + .globl multiboot_tramp +multiboot_tramp: + /* Be sure that interrupts are disabled. */ + cli + + movl $MULTIBOOT_BOOTLOADER_MAGIC, %eax + /* Get the entry point and address of the multiboot_info parameter. */ + movl 8(%esp), %ebx + movl 4(%esp), %ecx + + call *%ecx *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Wed Jan 20 16:41:02 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BA2AA8ADF0; Wed, 20 Jan 2016 16:41:02 +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 24D741125; Wed, 20 Jan 2016 16:41:02 +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 u0KGf11X028314; Wed, 20 Jan 2016 16:41:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KGf1mu028312; Wed, 20 Jan 2016 16:41:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601201641.u0KGf1mu028312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Jan 2016 16:41: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: r294443 - in stable/10/share: man/man7 misc 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 16:41:02 -0000 Author: emaste Date: Wed Jan 20 16:41:00 2016 New Revision: 294443 URL: https://svnweb.freebsd.org/changeset/base/294443 Log: MFC r293281: Use standard name for ASCII LF and FF control codes PR: 205778 Modified: stable/10/share/man/man7/ascii.7 stable/10/share/misc/ascii (contents, props changed) Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/ascii.7 ============================================================================== --- stable/10/share/man/man7/ascii.7 Wed Jan 20 15:02:43 2016 (r294442) +++ stable/10/share/man/man7/ascii.7 Wed Jan 20 16:41:00 2016 (r294443) @@ -32,7 +32,7 @@ .\" @(#)ascii.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd January 20, 2016 .Dt ASCII 7 .Os .Sh NAME @@ -46,7 +46,7 @@ The set: .Bd -literal -offset left 000 NUL 001 SOH 002 STX 003 ETX 004 EOT 005 ENQ 006 ACK 007 BEL -010 BS 011 HT 012 NL 013 VT 014 NP 015 CR 016 SO 017 SI +010 BS 011 HT 012 LF 013 VT 014 FF 015 CR 016 SO 017 SI 020 DLE 021 DC1 022 DC2 023 DC3 024 DC4 025 NAK 026 SYN 027 ETB 030 CAN 031 EM 032 SUB 033 ESC 034 FS 035 GS 036 RS 037 US 040 SP 041 ! 042 " 043 # 044 $ 045 % 046 & 047 ' @@ -68,7 +68,7 @@ The set: .Bd -literal -offset left 00 NUL 01 SOH 02 STX 03 ETX 04 EOT 05 ENQ 06 ACK 07 BEL -08 BS 09 HT 0A NL 0B VT 0C NP 0D CR 0E SO 0F SI +08 BS 09 HT 0A LF 0B VT 0C FF 0D CR 0E SO 0F SI 10 DLE 11 DC1 12 DC2 13 DC3 14 DC4 15 NAK 16 SYN 17 ETB 18 CAN 19 EM 1A SUB 1B ESC 1C FS 1D GS 1E RS 1F US 20 SP 21 ! 22 " 23 # 24 $ 25 % 26 & 27 ' @@ -90,7 +90,7 @@ The set: .Bd -literal -offset left 0 NUL 1 SOH 2 STX 3 ETX 4 EOT 5 ENQ 6 ACK 7 BEL - 8 BS 9 HT 10 NL 11 VT 12 NP 13 CR 14 SO 15 SI + 8 BS 9 HT 10 LF 11 VT 12 FF 13 CR 14 SO 15 SI 16 DLE 17 DC1 18 DC2 19 DC3 20 DC4 21 NAK 22 SYN 23 ETB 24 CAN 25 EM 26 SUB 27 ESC 28 FS 29 GS 30 RS 31 US 32 SP 33 ! 34 " 35 # 36 $ 37 % 38 & 39 ' Modified: stable/10/share/misc/ascii ============================================================================== --- stable/10/share/misc/ascii Wed Jan 20 15:02:43 2016 (r294442) +++ stable/10/share/misc/ascii Wed Jan 20 16:41:00 2016 (r294443) @@ -1,5 +1,5 @@ |000 nul|001 soh|002 stx|003 etx|004 eot|005 enq|006 ack|007 bel| -|010 bs |011 ht |012 nl |013 vt |014 np |015 cr |016 so |017 si | +|010 bs |011 ht |012 lf |013 vt |014 ff |015 cr |016 so |017 si | |020 dle|021 dc1|022 dc2|023 dc3|024 dc4|025 nak|026 syn|027 etb| |030 can|031 em |032 sub|033 esc|034 fs |035 gs |036 rs |037 us | |040 sp |041 ! |042 " |043 # |044 $ |045 % |046 & |047 ' | @@ -16,7 +16,7 @@ |170 x |171 y |172 z |173 { |174 | |175 } |176 ~ |177 del| | 00 nul| 01 soh| 02 stx| 03 etx| 04 eot| 05 enq| 06 ack| 07 bel| -| 08 bs | 09 ht | 0a nl | 0b vt | 0c np | 0d cr | 0e so | 0f si | +| 08 bs | 09 ht | 0a lf | 0b vt | 0c ff | 0d cr | 0e so | 0f si | | 10 dle| 11 dc1| 12 dc2| 13 dc3| 14 dc4| 15 nak| 16 syn| 17 etb| | 18 can| 19 em | 1a sub| 1b esc| 1c fs | 1d gs | 1e rs | 1f us | | 20 sp | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 ' | @@ -33,7 +33,7 @@ | 78 x | 79 y | 7a z | 7b { | 7c | | 7d } | 7e ~ | 7f del| | 0 nul| 1 soh| 2 stx| 3 etx| 4 eot| 5 enq| 6 ack| 7 bel| -| 8 bs | 9 ht | 10 nl | 11 vt | 12 np | 13 cr | 14 so | 15 si | +| 8 bs | 9 ht | 10 lf | 11 vt | 12 ff | 13 cr | 14 so | 15 si | | 16 dle| 17 dc1| 18 dc2| 19 dc3| 20 dc4| 21 nak| 22 syn| 23 etb| | 24 can| 25 em | 26 sub| 27 esc| 28 fs | 29 gs | 30 rs | 31 us | | 32 sp | 33 ! | 34 " | 35 # | 36 $ | 37 % | 38 & | 39 ' | From owner-svn-src-stable@freebsd.org Wed Jan 20 16:53:40 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7DACA89478; Wed, 20 Jan 2016 16:53:40 +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 6257F1B68; Wed, 20 Jan 2016 16:53:40 +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 u0KGrdAB032526; Wed, 20 Jan 2016 16:53:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KGrdEC032522; Wed, 20 Jan 2016 16:53:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601201653.u0KGrdEC032522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Jan 2016 16:53:39 +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: r294445 - in stable/10/sys/boot: efi/libefi efi/loader ficl/amd64 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 16:53:40 -0000 Author: emaste Date: Wed Jan 20 16:53:38 2016 New Revision: 294445 URL: https://svnweb.freebsd.org/changeset/base/294445 Log: MFC r293233: loader.efi: add terminal emulation support This is based on the vidconsole implementation. Submitted by: Toomas Soome Relnotes: Yes Modified: stable/10/sys/boot/efi/libefi/Makefile stable/10/sys/boot/efi/libefi/efi_console.c stable/10/sys/boot/efi/loader/main.c stable/10/sys/boot/ficl/amd64/sysdep.c Modified: stable/10/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/10/sys/boot/efi/libefi/Makefile Wed Jan 20 16:45:39 2016 (r294444) +++ stable/10/sys/boot/efi/libefi/Makefile Wed Jan 20 16:53:38 2016 (r294445) @@ -19,5 +19,6 @@ CFLAGS+= -I${.CURDIR}/../../common # Suppress warning from clang for FreeBSD %b and %D formats CFLAGS+= -fformat-extensions +CFLAGS+= -DTERM_EMU .include Modified: stable/10/sys/boot/efi/libefi/efi_console.c ============================================================================== --- stable/10/sys/boot/efi/libefi/efi_console.c Wed Jan 20 16:45:39 2016 (r294444) +++ stable/10/sys/boot/efi/libefi/efi_console.c Wed Jan 20 16:53:38 2016 (r294445) @@ -35,6 +35,69 @@ __FBSDID("$FreeBSD$"); static SIMPLE_TEXT_OUTPUT_INTERFACE *conout; static SIMPLE_INPUT_INTERFACE *conin; +#ifdef TERM_EMU +#define DEFAULT_FGCOLOR EFI_LIGHTGRAY +#define DEFAULT_BGCOLOR EFI_BLACK + +#define MAXARGS 8 +static int args[MAXARGS], argc; +static int fg_c, bg_c, curx, cury; +static int esc; + +void get_pos(int *x, int *y); +void curs_move(int *_x, int *_y, int x, int y); +static void CL(int); +#endif + +static void efi_cons_probe(struct console *); +static int efi_cons_init(int); +void efi_cons_putchar(int); +int efi_cons_getchar(void); +void efi_cons_efiputchar(int); +int efi_cons_poll(void); + +struct console efi_console = { + "efi", + "EFI console", + 0, + efi_cons_probe, + efi_cons_init, + efi_cons_putchar, + efi_cons_getchar, + efi_cons_poll +}; + +#ifdef TERM_EMU + +/* Get cursor position. */ +void +get_pos(int *x, int *y) +{ + *x = conout->Mode->CursorColumn; + *y = conout->Mode->CursorRow; +} + +/* Move cursor to x rows and y cols (0-based). */ +void +curs_move(int *_x, int *_y, int x, int y) +{ + conout->SetCursorPosition(conout, x, y); + if (_x != NULL) + *_x = conout->Mode->CursorColumn; + if (_y != NULL) + *_y = conout->Mode->CursorRow; +} + +/* Clear internal state of the terminal emulation code. */ +void +end_term(void) +{ + esc = 0; + argc = -1; +} + +#endif + static void efi_cons_probe(struct console *cp) { @@ -46,22 +109,314 @@ efi_cons_probe(struct console *cp) static int efi_cons_init(int arg) { - conout->SetAttribute(conout, EFI_TEXT_ATTR(EFI_LIGHTGRAY, EFI_BLACK)); + conout->SetAttribute(conout, EFI_TEXT_ATTR(DEFAULT_FGCOLOR, + DEFAULT_BGCOLOR)); +#ifdef TERM_EMU + end_term(); + get_pos(&curx, &cury); + curs_move(&curx, &cury, curx, cury); + fg_c = DEFAULT_FGCOLOR; + bg_c = DEFAULT_BGCOLOR; +#endif + conout->EnableCursor(conout, TRUE); return 0; } +static void +efi_cons_rawputchar(int c) +{ + int i; + UINTN x, y; + conout->QueryMode(conout, conout->Mode->Mode, &x, &y); + + if (c == '\t') + /* XXX lame tab expansion */ + for (i = 0; i < 8; i++) + efi_cons_rawputchar(' '); + else { +#ifndef TERM_EMU + if (c == '\n') + efi_cons_efiputchar('\r'); + else + efi_cons_efiputchar(c); +#else + switch (c) { + case '\r': + curx = 0; + curs_move(&curx, &cury, curx, cury); + return; + case '\n': + cury++; + if (cury >= y) { + efi_cons_efiputchar('\n'); + cury--; + } else + curs_move(&curx, &cury, curx, cury); + return; + case '\b': + if (curx > 0) { + curx--; + curs_move(&curx, &cury, curx, cury); + } + return; + default: + efi_cons_efiputchar(c); + curx++; + if (curx > x-1) { + curx = 0; + cury++; + } + if (cury > y-1) { + curx = 0; + cury--; + } + } + curs_move(&curx, &cury, curx, cury); +#endif + } +} + +/* Gracefully exit ESC-sequence processing in case of misunderstanding. */ +static void +bail_out(int c) +{ + char buf[16], *ch; + int i; + + if (esc) { + efi_cons_rawputchar('\033'); + if (esc != '\033') + efi_cons_rawputchar(esc); + for (i = 0; i <= argc; ++i) { + sprintf(buf, "%d", args[i]); + ch = buf; + while (*ch) + efi_cons_rawputchar(*ch++); + } + } + efi_cons_rawputchar(c); + end_term(); +} + +/* Clear display from current position to end of screen. */ +static void +CD(void) { + int i; + UINTN x, y; + + get_pos(&curx, &cury); + if (curx == 0 && cury == 0) { + conout->ClearScreen(conout); + end_term(); + return; + } + + conout->QueryMode(conout, conout->Mode->Mode, &x, &y); + CL(0); /* clear current line from cursor to end */ + for (i = cury + 1; i < y-1; i++) { + curs_move(NULL, NULL, 0, i); + CL(0); + } + curs_move(NULL, NULL, curx, cury); + end_term(); +} + +/* + * Absolute cursor move to args[0] rows and args[1] columns + * (the coordinates are 1-based). + */ +static void +CM(void) +{ + if (args[0] > 0) + args[0]--; + if (args[1] > 0) + args[1]--; + curs_move(&curx, &cury, args[1], args[0]); + end_term(); +} + +/* Home cursor (left top corner), also called from mode command. */ void -efi_cons_putchar(int c) +HO(void) { - CHAR16 buf[2]; + argc = 1; + args[0] = args[1] = 1; + CM(); +} - if (c == '\n') - efi_cons_putchar('\r'); +/* Clear line from current position to end of line */ +static void +CL(int direction) +{ + int i, len; + UINTN x, y; + CHAR16 *line; - buf[0] = c; - buf[1] = 0; + conout->QueryMode(conout, conout->Mode->Mode, &x, &y); + switch (direction) { + case 0: /* from cursor to end */ + len = x - curx + 1; + break; + case 1: /* from beginning to cursor */ + len = curx; + break; + case 2: /* entire line */ + len = x; + break; + } - conout->OutputString(conout, buf); + if (cury == y - 1) + len--; + + line = malloc(len * sizeof (CHAR16)); + if (line == NULL) { + printf("out of memory\n"); + return; + } + for (i = 0; i < len; i++) + line[i] = ' '; + line[len-1] = 0; + + if (direction != 0) + curs_move(NULL, NULL, 0, cury); + + conout->OutputString(conout, line); + /* restore cursor position */ + curs_move(NULL, NULL, curx, cury); + free(line); + end_term(); +} + +static void +get_arg(int c) +{ + if (argc < 0) + argc = 0; + args[argc] *= 10; + args[argc] += c - '0'; +} + +/* Emulate basic capabilities of cons25 terminal */ +static void +efi_term_emu(int c) +{ + static int ansi_col[] = { + 0, 4, 2, 6, 1, 5, 3, 7 + }; + int t, i; + + switch (esc) { + case 0: + switch (c) { + case '\033': + esc = c; + break; + default: + efi_cons_rawputchar(c); + break; + } + break; + case '\033': + switch (c) { + case '[': + esc = c; + args[0] = 0; + argc = -1; + break; + default: + bail_out(c); + break; + } + break; + case '[': + switch (c) { + case ';': + if (argc < 0) + argc = 0; + else if (argc + 1 >= MAXARGS) + bail_out(c); + else + args[++argc] = 0; + break; + case 'H': /* ho = \E[H */ + if (argc < 0) + HO(); + else if (argc == 1) + CM(); + else + bail_out(c); + break; + case 'J': /* cd = \E[J */ + if (argc < 0) + CD(); + else + bail_out(c); + break; + case 'm': + if (argc < 0) { + fg_c = DEFAULT_FGCOLOR; + bg_c = DEFAULT_BGCOLOR; + } + for (i = 0; i <= argc; ++i) { + switch (args[i]) { + case 0: /* back to normal */ + fg_c = DEFAULT_FGCOLOR; + bg_c = DEFAULT_BGCOLOR; + break; + case 1: /* bold */ + fg_c |= 0x8; + break; + case 4: /* underline */ + case 5: /* blink */ + bg_c |= 0x8; + break; + case 7: /* reverse */ + t = fg_c; + fg_c = bg_c; + bg_c = t; + break; + case 30: case 31: case 32: case 33: + case 34: case 35: case 36: case 37: + fg_c = ansi_col[args[i] - 30]; + break; + case 39: /* normal */ + fg_c = DEFAULT_FGCOLOR; + break; + case 40: case 41: case 42: case 43: + case 44: case 45: case 46: case 47: + bg_c = ansi_col[args[i] - 40]; + break; + case 49: /* normal */ + bg_c = DEFAULT_BGCOLOR; + break; + } + } + conout->SetAttribute(conout, EFI_TEXT_ATTR(fg_c, bg_c)); + end_term(); + break; + default: + if (isdigit(c)) + get_arg(c); + else + bail_out(c); + break; + } + break; + default: + bail_out(c); + break; + } +} + +void +efi_cons_putchar(int c) +{ +#ifdef TERM_EMU + efi_term_emu(c); +#else + efi_cons_rawputchar(c); +#endif } int @@ -77,6 +432,12 @@ efi_cons_getchar() BS->WaitForEvent(1, &conin->WaitForKey, &junk); status = conin->ReadKeyStroke(conin, &key); } + switch (key.ScanCode) { + case 0x17: /* ESC */ + return (0x1b); /* esc */ + } + + /* this can return */ return (key.UnicodeChar); } @@ -87,13 +448,36 @@ efi_cons_poll() return (BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS); } -struct console efi_console = { - "efi", - "EFI console", - 0, - efi_cons_probe, - efi_cons_init, - efi_cons_putchar, - efi_cons_getchar, - efi_cons_poll -}; +/* Plain direct access to EFI OutputString(). */ +void +efi_cons_efiputchar(int c) +{ + CHAR16 buf[2]; + + /* + * translate box chars to unicode + */ + switch (c) { + /* single frame */ + case 0xb3: buf[0] = BOXDRAW_VERTICAL; break; + case 0xbf: buf[0] = BOXDRAW_DOWN_LEFT; break; + case 0xc0: buf[0] = BOXDRAW_UP_RIGHT; break; + case 0xc4: buf[0] = BOXDRAW_HORIZONTAL; break; + case 0xda: buf[0] = BOXDRAW_DOWN_RIGHT; break; + case 0xd9: buf[0] = BOXDRAW_UP_LEFT; break; + + /* double frame */ + case 0xba: buf[0] = BOXDRAW_DOUBLE_VERTICAL; break; + case 0xbb: buf[0] = BOXDRAW_DOUBLE_DOWN_LEFT; break; + case 0xbc: buf[0] = BOXDRAW_DOUBLE_UP_LEFT; break; + case 0xc8: buf[0] = BOXDRAW_DOUBLE_UP_RIGHT; break; + case 0xc9: buf[0] = BOXDRAW_DOUBLE_DOWN_RIGHT; break; + case 0xcd: buf[0] = BOXDRAW_DOUBLE_HORIZONTAL; break; + + default: + buf[0] = c; + } + buf[1] = 0; /* terminate string */ + + conout->OutputString(conout, buf); +} Modified: stable/10/sys/boot/efi/loader/main.c ============================================================================== --- stable/10/sys/boot/efi/loader/main.c Wed Jan 20 16:45:39 2016 (r294444) +++ stable/10/sys/boot/efi/loader/main.c Wed Jan 20 16:53:38 2016 (r294445) @@ -331,6 +331,7 @@ command_mode(int argc, char *argv[]) char rowenv[8]; EFI_STATUS status; SIMPLE_TEXT_OUTPUT_INTERFACE *conout; + extern void HO(void); conout = ST->ConOut; @@ -352,7 +353,7 @@ command_mode(int argc, char *argv[]) } sprintf(rowenv, "%u", (unsigned)rows); setenv("LINES", rowenv, 1); - + HO(); /* set cursor */ return (CMD_OK); } Modified: stable/10/sys/boot/ficl/amd64/sysdep.c ============================================================================== --- stable/10/sys/boot/ficl/amd64/sysdep.c Wed Jan 20 16:45:39 2016 (r294444) +++ stable/10/sys/boot/ficl/amd64/sysdep.c Wed Jan 20 16:53:38 2016 (r294445) @@ -55,7 +55,7 @@ void ficlTextOut(FICL_VM *pVM, char *ms IGNORE(pVM); while(*msg != 0) - putchar(*(msg++)); + putchar((unsigned char)*(msg++)); if (fNewline) putchar('\n'); From owner-svn-src-stable@freebsd.org Wed Jan 20 16:59:39 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29013A896C3; Wed, 20 Jan 2016 16:59:39 +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 D41C71EC4; Wed, 20 Jan 2016 16:59:38 +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 u0KGxbeM033049; Wed, 20 Jan 2016 16:59:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KGxb7Q033045; Wed, 20 Jan 2016 16:59:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601201659.u0KGxb7Q033045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Jan 2016 16:59:37 +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: r294446 - stable/10/sys/boot/forth 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 16:59:39 -0000 Author: emaste Date: Wed Jan 20 16:59:37 2016 New Revision: 294446 URL: https://svnweb.freebsd.org/changeset/base/294446 Log: MFC r293234: Enable the beastie menu for the UEFI console As of r294445 [in stable/10] the UEFI console includes basic terminal emulator support. Relnotes: Yes Modified: stable/10/sys/boot/forth/beastie.4th stable/10/sys/boot/forth/beastie.4th.8 stable/10/sys/boot/forth/loader.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/forth/beastie.4th ============================================================================== --- stable/10/sys/boot/forth/beastie.4th Wed Jan 20 16:53:38 2016 (r294445) +++ stable/10/sys/boot/forth/beastie.4th Wed Jan 20 16:59:37 2016 (r294446) @@ -85,11 +85,6 @@ variable logoY also support-functions : beastie-start ( -- ) \ starts the menu - s" console" getenv dup -1 <> if - s" efi" 2swap contains? if - s" set beastie_disable=YES" evaluate - then - else drop then s" beastie_disable" getenv dup -1 <> if s" YES" compare-insensitive 0= if any_conf_read? if Modified: stable/10/sys/boot/forth/beastie.4th.8 ============================================================================== --- stable/10/sys/boot/forth/beastie.4th.8 Wed Jan 20 16:53:38 2016 (r294445) +++ stable/10/sys/boot/forth/beastie.4th.8 Wed Jan 20 16:59:37 2016 (r294446) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2014 +.Dd January 20, 2016 .Dt BEASTIE.4TH 8 .Os .Sh NAME @@ -119,8 +119,7 @@ Sets the desired row position of the log If set to .Dq YES , the beastie boot menu will be skipped. -The beastie boot menu is always skipped if booting UEFI or running non-x86 -hardware. +The beastie boot menu is always skipped if running non-x86 hardware. .It Va loader_delay If set to a number higher than zero, introduces a delay before starting the beastie boot menu. During the delay the user can press either Ctrl-C to skip Modified: stable/10/sys/boot/forth/loader.conf.5 ============================================================================== --- stable/10/sys/boot/forth/loader.conf.5 Wed Jan 20 16:53:38 2016 (r294445) +++ stable/10/sys/boot/forth/loader.conf.5 Wed Jan 20 16:59:37 2016 (r294446) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 27, 2014 +.Dd January 20, 2016 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -236,8 +236,7 @@ be displayed. If set to .Dq YES , the beastie boot menu will be skipped. -The beastie boot menu is always skipped if booting UEFI or running non-x86 -hardware. +The beastie boot menu is always skipped if running non-x86 hardware. .It Va loader_logo Pq Dq Li orbbw Selects a desired logo in the beastie boot menu. Possible values are: From owner-svn-src-stable@freebsd.org Wed Jan 20 17:38:23 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3AFCA8A8CF; Wed, 20 Jan 2016 17:38:22 +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 C12B51F45; Wed, 20 Jan 2016 17:38:22 +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 u0KHcLEO046838; Wed, 20 Jan 2016 17:38:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KHcLVN046837; Wed, 20 Jan 2016 17:38:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601201738.u0KHcLVN046837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Jan 2016 17:38: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: r294449 - stable/10/sys/boot/efi/loader 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 17:38:23 -0000 Author: emaste Date: Wed Jan 20 17:38:21 2016 New Revision: 294449 URL: https://svnweb.freebsd.org/changeset/base/294449 Log: MFC r293245: loader.efi style(9) cleanup Submitted by: smh Modified: stable/10/sys/boot/efi/loader/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/loader/main.c ============================================================================== --- stable/10/sys/boot/efi/loader/main.c Wed Jan 20 17:08:01 2016 (r294448) +++ stable/10/sys/boot/efi/loader/main.c Wed Jan 20 17:38:21 2016 (r294449) @@ -226,50 +226,47 @@ command_memmap(int argc, char *argv[]) status = BS->GetMemoryMap(&sz, 0, &key, &dsz, &dver); if (status != EFI_BUFFER_TOO_SMALL) { printf("Can't determine memory map size\n"); - return CMD_ERROR; + return (CMD_ERROR); } map = malloc(sz); status = BS->GetMemoryMap(&sz, map, &key, &dsz, &dver); if (EFI_ERROR(status)) { printf("Can't read memory map\n"); - return CMD_ERROR; + return (CMD_ERROR); } ndesc = sz / dsz; printf("%23s %12s %12s %8s %4s\n", - "Type", "Physical", "Virtual", "#Pages", "Attr"); + "Type", "Physical", "Virtual", "#Pages", "Attr"); for (i = 0, p = map; i < ndesc; i++, p = NextMemoryDescriptor(p, dsz)) { - printf("%23s %012lx %012lx %08lx ", - types[p->Type], - p->PhysicalStart, - p->VirtualStart, - p->NumberOfPages); - if (p->Attribute & EFI_MEMORY_UC) - printf("UC "); - if (p->Attribute & EFI_MEMORY_WC) - printf("WC "); - if (p->Attribute & EFI_MEMORY_WT) - printf("WT "); - if (p->Attribute & EFI_MEMORY_WB) - printf("WB "); - if (p->Attribute & EFI_MEMORY_UCE) - printf("UCE "); - if (p->Attribute & EFI_MEMORY_WP) - printf("WP "); - if (p->Attribute & EFI_MEMORY_RP) - printf("RP "); - if (p->Attribute & EFI_MEMORY_XP) - printf("XP "); - printf("\n"); + printf("%23s %012lx %012lx %08lx ", types[p->Type], + p->PhysicalStart, p->VirtualStart, p->NumberOfPages); + if (p->Attribute & EFI_MEMORY_UC) + printf("UC "); + if (p->Attribute & EFI_MEMORY_WC) + printf("WC "); + if (p->Attribute & EFI_MEMORY_WT) + printf("WT "); + if (p->Attribute & EFI_MEMORY_WB) + printf("WB "); + if (p->Attribute & EFI_MEMORY_UCE) + printf("UCE "); + if (p->Attribute & EFI_MEMORY_WP) + printf("WP "); + if (p->Attribute & EFI_MEMORY_RP) + printf("RP "); + if (p->Attribute & EFI_MEMORY_XP) + printf("XP "); + printf("\n"); } - return CMD_OK; + return (CMD_OK); } -COMMAND_SET(configuration, "configuration", - "print configuration tables", command_configuration); +COMMAND_SET(configuration, "configuration", "print configuration tables", + command_configuration); static const char * guid_to_string(EFI_GUID *guid) @@ -315,7 +312,7 @@ command_configuration(int argc, char *ar printf(" at %p\n", ST->ConfigurationTable[i].VendorTable); } - return CMD_OK; + return (CMD_OK); } @@ -392,20 +389,17 @@ command_nvram(int argc, char *argv[]) status = RS->GetNextVariableName(&varsz, NULL, NULL); for (; status != EFI_NOT_FOUND; ) { - status = RS->GetNextVariableName(&varsz, var, - &varguid); + status = RS->GetNextVariableName(&varsz, var, &varguid); //if (EFI_ERROR(status)) //break; conout->OutputString(conout, var); printf("="); datasz = 0; - status = RS->GetVariable(var, &varguid, NULL, &datasz, - NULL); + status = RS->GetVariable(var, &varguid, NULL, &datasz, NULL); /* XXX: check status */ data = malloc(datasz); - status = RS->GetVariable(var, &varguid, NULL, &datasz, - data); + status = RS->GetVariable(var, &varguid, NULL, &datasz, data); if (EFI_ERROR(status)) printf(""); else { From owner-svn-src-stable@freebsd.org Wed Jan 20 17:40:12 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB1F0A8A974; Wed, 20 Jan 2016 17:40:12 +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 7BBE711C3; Wed, 20 Jan 2016 17:40:12 +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 u0KHeBXl047069; Wed, 20 Jan 2016 17:40:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KHeBKQ047068; Wed, 20 Jan 2016 17:40:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601201740.u0KHeBKQ047068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Jan 2016 17:40:11 +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: r294450 - stable/10/usr.bin/elfdump 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 17:40:12 -0000 Author: emaste Date: Wed Jan 20 17:40:11 2016 New Revision: 294450 URL: https://svnweb.freebsd.org/changeset/base/294450 Log: MFC r288083, r288138: elfdump: report MIPS-specific ELF section types Modified: stable/10/usr.bin/elfdump/elfdump.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/elfdump/elfdump.c ============================================================================== --- stable/10/usr.bin/elfdump/elfdump.c Wed Jan 20 17:38:21 2016 (r294449) +++ stable/10/usr.bin/elfdump/elfdump.c Wed Jan 20 17:40:11 2016 (r294450) @@ -379,7 +379,9 @@ sh_types(uint64_t machine, uint64_t sht) break; case EM_MIPS: switch (sht) { + case SHT_MIPS_REGINFO: return "SHT_MIPS_REGINFO"; case SHT_MIPS_OPTIONS: return "SHT_MIPS_OPTIONS"; + case SHT_MIPS_ABIFLAGS: return "SHT_MIPS_ABIFLAGS"; } break; } From owner-svn-src-stable@freebsd.org Wed Jan 20 19:08:51 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BE6AA8AA60; Wed, 20 Jan 2016 19:08:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF39E1AD1; Wed, 20 Jan 2016 19:08:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0KJ8n4L078060; Wed, 20 Jan 2016 19:08:49 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KJ8nD9078059; Wed, 20 Jan 2016 19:08:49 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201601201908.u0KJ8nD9078059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 20 Jan 2016 19:08:49 +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: r294453 - stable/10/lib/libc/string 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 19:08:51 -0000 Author: brooks Date: Wed Jan 20 19:08:49 2016 New Revision: 294453 URL: https://svnweb.freebsd.org/changeset/base/294453 Log: MFC r293855: Avoid reading pass the end of the source buffer when it is not NUL terminated. If this buffer is adjacent to an unmapped page or a version of C with bounds checked is used this may result in a crash. PR: 206177 Submitted by: Alexander Cherepanov Modified: stable/10/lib/libc/string/wcsncat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/string/wcsncat.c ============================================================================== --- stable/10/lib/libc/string/wcsncat.c Wed Jan 20 18:47:33 2016 (r294452) +++ stable/10/lib/libc/string/wcsncat.c Wed Jan 20 19:08:49 2016 (r294453) @@ -48,7 +48,7 @@ wcsncat(wchar_t * __restrict s1, const w p++; q = p; r = s2; - while (*r && n) { + while (n && *r) { *q++ = *r++; n--; } From owner-svn-src-stable@freebsd.org Wed Jan 20 19:20:30 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C211A8AF00; Wed, 20 Jan 2016 19:20:30 +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 DD5B810B4; Wed, 20 Jan 2016 19:20:29 +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 u0KJKSPG081443; Wed, 20 Jan 2016 19:20:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KJKSXL081442; Wed, 20 Jan 2016 19:20:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601201920.u0KJKSXL081442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Jan 2016 19:20:28 +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: r294454 - stable/10/sys/sys 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 19:20:30 -0000 Author: emaste Date: Wed Jan 20 19:20:28 2016 New Revision: 294454 URL: https://svnweb.freebsd.org/changeset/base/294454 Log: MFC r288081: Add MIPS ELF section type SHT_MIPS_ABIFLAGS definition Modified: stable/10/sys/sys/elf_common.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/elf_common.h ============================================================================== --- stable/10/sys/sys/elf_common.h Wed Jan 20 19:08:49 2016 (r294453) +++ stable/10/sys/sys/elf_common.h Wed Jan 20 19:20:28 2016 (r294454) @@ -315,6 +315,7 @@ typedef struct { #define SHT_MIPS_REGINFO 0x70000006 #define SHT_MIPS_OPTIONS 0x7000000d #define SHT_MIPS_DWARF 0x7000001e /* MIPS gcc uses MIPS_DWARF */ +#define SHT_MIPS_ABIFLAGS 0x7000002a #define SHT_HIPROC 0x7fffffff /* specific section header types */ #define SHT_LOUSER 0x80000000 /* reserved range for application */ #define SHT_HIUSER 0xffffffff /* specific indexes */ From owner-svn-src-stable@freebsd.org Wed Jan 20 19:26:06 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 291DFA8A2CB; Wed, 20 Jan 2016 19:26:06 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED5C81611; Wed, 20 Jan 2016 19:26:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0KJQ4mV084583; Wed, 20 Jan 2016 19:26:04 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KJQ44X084582; Wed, 20 Jan 2016 19:26:04 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201601201926.u0KJQ44X084582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 20 Jan 2016 19:26:04 +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: r294455 - stable/10/lib/libc/string 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 19:26:06 -0000 Author: brooks Date: Wed Jan 20 19:26:04 2016 New Revision: 294455 URL: https://svnweb.freebsd.org/changeset/base/294455 Log: MFC r293856: Avoid reading pass the end of the source buffer when it is not NUL terminated. If this buffer is adjacent to an unmapped page or a version of C with bounds checked is used this may result in a crash. PR: 206178 Submitted by: Alexander Cherepanov Modified: stable/10/lib/libc/string/wcslcat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/string/wcslcat.c ============================================================================== --- stable/10/lib/libc/string/wcslcat.c Wed Jan 20 19:20:28 2016 (r294454) +++ stable/10/lib/libc/string/wcslcat.c Wed Jan 20 19:26:04 2016 (r294455) @@ -54,7 +54,7 @@ wcslcat(wchar_t *dst, const wchar_t *src size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ - while (*d != '\0' && n-- != 0) + while (n-- != 0 && *d != '\0') d++; dlen = d - dst; n = siz - dlen; From owner-svn-src-stable@freebsd.org Wed Jan 20 19:52:02 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCBF7A8AE49; Wed, 20 Jan 2016 19:52:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FAD71CBC; Wed, 20 Jan 2016 19:52:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0KJq1Nq092386; Wed, 20 Jan 2016 19:52:01 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KJq1Nf092385; Wed, 20 Jan 2016 19:52:01 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201601201952.u0KJq1Nf092385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 20 Jan 2016 19:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294456 - stable/9/lib/libc/string X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 19:52:02 -0000 Author: brooks Date: Wed Jan 20 19:52:01 2016 New Revision: 294456 URL: https://svnweb.freebsd.org/changeset/base/294456 Log: MFC r293855: Avoid reading pass the end of the source buffer when it is not NUL terminated. If this buffer is adjacent to an unmapped page or a version of C with bounds checked is used this may result in a crash. PR: 206177 Submitted by: Alexander Cherepanov Modified: stable/9/lib/libc/string/wcsncat.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/string/wcsncat.c ============================================================================== --- stable/9/lib/libc/string/wcsncat.c Wed Jan 20 19:26:04 2016 (r294455) +++ stable/9/lib/libc/string/wcsncat.c Wed Jan 20 19:52:01 2016 (r294456) @@ -48,7 +48,7 @@ wcsncat(wchar_t * __restrict s1, const w p++; q = p; r = s2; - while (*r && n) { + while (n && *r) { *q++ = *r++; n--; } From owner-svn-src-stable@freebsd.org Wed Jan 20 19:56:45 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85C0DA8AFAC; Wed, 20 Jan 2016 19:56:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AC591097; Wed, 20 Jan 2016 19:56:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0KJuhiW095605; Wed, 20 Jan 2016 19:56:43 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KJuht6095604; Wed, 20 Jan 2016 19:56:43 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201601201956.u0KJuht6095604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 20 Jan 2016 19:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294457 - stable/9/lib/libc/string X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 19:56:45 -0000 Author: brooks Date: Wed Jan 20 19:56:43 2016 New Revision: 294457 URL: https://svnweb.freebsd.org/changeset/base/294457 Log: MFC r293856: Avoid reading pass the end of the source buffer when it is not NUL terminated. If this buffer is adjacent to an unmapped page or a version of C with bounds checked is used this may result in a crash. PR: 206178 Submitted by: Alexander Cherepanov Modified: stable/9/lib/libc/string/wcslcat.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/string/wcslcat.c ============================================================================== --- stable/9/lib/libc/string/wcslcat.c Wed Jan 20 19:52:01 2016 (r294456) +++ stable/9/lib/libc/string/wcslcat.c Wed Jan 20 19:56:43 2016 (r294457) @@ -54,7 +54,7 @@ wcslcat(wchar_t *dst, const wchar_t *src size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ - while (*d != '\0' && n-- != 0) + while (n-- != 0 && *d != '\0') d++; dlen = d - dst; n = siz - dlen; From owner-svn-src-stable@freebsd.org Wed Jan 20 21:06:26 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B715A8AAE6; Wed, 20 Jan 2016 21:06:26 +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 C88171A9B; Wed, 20 Jan 2016 21:06:25 +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 u0KL6OCO019094; Wed, 20 Jan 2016 21:06:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KL6Odf019090; Wed, 20 Jan 2016 21:06:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601202106.u0KL6Odf019090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Jan 2016 21:06:24 +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: r294459 - in stable/10/sys: mips/include sys 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 21:06:26 -0000 Author: emaste Date: Wed Jan 20 21:06:24 2016 New Revision: 294459 URL: https://svnweb.freebsd.org/changeset/base/294459 Log: MFC r276539: Update ELF headers to include additional defines The elftoolchain project includes these additional defines for various userland programs. Given that arch-specific defines are still interesting in the context of userland programs reading or writing ELF metadata, they should be included in top-level ELF headers. Remove duplicate defines from ARM and MIPS elf headers. Submitted by: will (initial version) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/mips/include/elf.h stable/10/sys/sys/elf32.h stable/10/sys/sys/elf64.h stable/10/sys/sys/elf_common.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/mips/include/elf.h ============================================================================== --- stable/10/sys/mips/include/elf.h Wed Jan 20 20:58:42 2016 (r294458) +++ stable/10/sys/mips/include/elf.h Wed Jan 20 21:06:24 2016 (r294459) @@ -238,39 +238,10 @@ __ElfType(Auxinfo); #define R_MIPS_COPY 126 #define R_MIPS_JUMP_SLOT 127 -/* mips dynamic tags */ - -#define DT_MIPS_RLD_VERSION 0x70000001 -#define DT_MIPS_TIME_STAMP 0x70000002 -#define DT_MIPS_ICHECKSUM 0x70000003 -#define DT_MIPS_IVERSION 0x70000004 -#define DT_MIPS_FLAGS 0x70000005 -#define DT_MIPS_BASE_ADDRESS 0x70000006 -#define DT_MIPS_CONFLICT 0x70000008 -#define DT_MIPS_LIBLIST 0x70000009 -#define DT_MIPS_CONFLICTNO 0x7000000b -#define DT_MIPS_LOCAL_GOTNO 0x7000000a /* number of local got ents */ -#define DT_MIPS_LIBLISTNO 0x70000010 -#define DT_MIPS_SYMTABNO 0x70000011 /* number of .dynsym entries */ -#define DT_MIPS_UNREFEXTNO 0x70000012 -#define DT_MIPS_GOTSYM 0x70000013 /* first dynamic sym in got */ -#define DT_MIPS_HIPAGENO 0x70000014 -#define DT_MIPS_RLD_MAP 0x70000016 /* address of loader map */ -#define DT_MIPS_PLTGOT 0x70000032 -#define DT_MIPS_RWPLT 0x70000034 - /* * ELF Flags */ -#define EF_MIPS_PIC 0x00000002 /* Contains PIC code */ -#define EF_MIPS_CPIC 0x00000004 /* STD PIC calling sequence */ -#define EF_MIPS_ABI2 0x00000020 /* N32 */ - -#define EF_MIPS_ARCH_ASE 0x0f000000 /* Architectural extensions */ -#define EF_MIPS_ARCH_MDMX 0x08000000 /* MDMX multimedia extension */ -#define EF_MIPS_ARCH_M16 0x04000000 /* MIPS-16 ISA extensions */ -#define EF_MIPS_ARCH 0xf0000000 /* Architecture field */ #define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code */ #define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code */ #define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code */ Modified: stable/10/sys/sys/elf32.h ============================================================================== --- stable/10/sys/sys/elf32.h Wed Jan 20 20:58:42 2016 (r294458) +++ stable/10/sys/sys/elf32.h Wed Jan 20 21:06:24 2016 (r294459) @@ -70,6 +70,18 @@ typedef struct { } Elf32_Ehdr; /* + * Shared object information, found in SHT_MIPS_LIBLIST. + */ + +typedef struct { + Elf32_Word l_name; /* The name of a shared object. */ + Elf32_Word l_time_stamp; /* 32-bit timestamp. */ + Elf32_Word l_checksum; /* Checksum of visible symbols, sizes. */ + Elf32_Word l_version; /* Interface version string index. */ + Elf32_Word l_flags; /* Flags (LL_*). */ +} Elf32_Lib; + +/* * Section header. */ Modified: stable/10/sys/sys/elf64.h ============================================================================== --- stable/10/sys/sys/elf64.h Wed Jan 20 20:58:42 2016 (r294458) +++ stable/10/sys/sys/elf64.h Wed Jan 20 21:06:24 2016 (r294459) @@ -79,6 +79,18 @@ typedef struct { } Elf64_Ehdr; /* + * Shared object information, found in SHT_MIPS_LIBLIST. + */ + +typedef struct { + Elf64_Word l_name; /* The name of a shared object. */ + Elf64_Word l_time_stamp; /* 64-bit timestamp. */ + Elf64_Word l_checksum; /* Checksum of visible symbols, sizes. */ + Elf64_Word l_version; /* Interface version string index. */ + Elf64_Word l_flags; /* Flags (LL_*). */ +} Elf64_Lib; + +/* * Section header. */ Modified: stable/10/sys/sys/elf_common.h ============================================================================== --- stable/10/sys/sys/elf_common.h Wed Jan 20 20:58:42 2016 (r294458) +++ stable/10/sys/sys/elf_common.h Wed Jan 20 21:06:24 2016 (r294459) @@ -50,6 +50,61 @@ typedef struct { } Elf_Note; /* + * Option kinds. + */ +#define ODK_NULL 0 /* undefined */ +#define ODK_REGINFO 1 /* register usage info */ +#define ODK_EXCEPTIONS 2 /* exception processing info */ +#define ODK_PAD 3 /* section padding */ +#define ODK_HWPATCH 4 /* hardware patch applied */ +#define ODK_FILL 5 /* fill value used by the linker */ +#define ODK_TAGS 6 /* reserved space for tools */ +#define ODK_HWAND 7 /* hardware AND patch applied */ +#define ODK_HWOR 8 /* hardware OR patch applied */ +#define ODK_GP_GROUP 9 /* GP group for text/data sections */ +#define ODK_IDENT 10 /* ID information */ +#define ODK_PAGESIZE 11 /* page size information */ + +/* + * ODK_EXCEPTIONS info field masks. + */ +#define OEX_FPU_MIN 0x0000001f /* min FPU exception required */ +#define OEX_FPU_MAX 0x00001f00 /* max FPU exception allowed */ +#define OEX_PAGE0 0x00010000 /* page zero must be mapped */ +#define OEX_SMM 0x00020000 /* run in sequential memory mode */ +#define OEX_PRECISEFP 0x00040000 /* run in precise FP exception mode */ +#define OEX_DISMISS 0x00080000 /* dismiss invalid address traps */ + +/* + * ODK_PAD info field masks. + */ +#define OPAD_PREFIX 0x0001 +#define OPAD_POSTFIX 0x0002 +#define OPAD_SYMBOL 0x0004 + +/* + * ODK_HWPATCH info field masks. + */ +#define OHW_R4KEOP 0x00000001 /* patch for R4000 branch at end-of-page bug */ +#define OHW_R8KPFETCH 0x00000002 /* R8000 prefetch bug may occur */ +#define OHW_R5KEOP 0x00000004 /* patch for R5000 branch at end-of-page bug */ +#define OHW_R5KCVTL 0x00000008 /* R5000 cvt.[ds].l bug: clean == 1 */ +#define OHW_R10KLDL 0x00000010UL /* need patch for R10000 misaligned load */ + +/* + * ODK_HWAND/ODK_HWOR info field and hwp_flags[12] masks. + */ +#define OHWA0_R4KEOP_CHECKED 0x00000001 /* object checked for R4000 end-of-page bug */ +#define OHWA0_R4KEOP_CLEAN 0x00000002 /* object verified clean for R4000 end-of-page bug */ +#define OHWO0_FIXADE 0x00000001 /* object requires call to fixade */ + +/* + * ODK_IDENT/ODK_GP_GROUP info field masks. + */ +#define OGP_GROUP 0x0000ffff /* GP group number */ +#define OGP_SELF 0x00010000 /* GP group is self-contained */ + +/* * The header for GNU-style hash sections. */ @@ -121,6 +176,7 @@ typedef struct { #define ELFOSABI_SYSV ELFOSABI_NONE /* symbol used in old spec */ #define ELFOSABI_MONTEREY ELFOSABI_AIX /* Monterey */ +#define ELFOSABI_GNU ELFOSABI_LINUX /* e_ident */ #define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \ @@ -249,6 +305,60 @@ typedef struct { #define EM_ALPHA_STD 41 /* Digital Alpha (standard value). */ #define EM_ALPHA 0x9026 /* Alpha (written in the absence of an ABI) */ +/** + * e_flags + */ +#define EF_ARM_RELEXEC 0x1 +#define EF_ARM_HASENTRY 0x2 +#define EF_ARM_SYMSARESORTED 0x4 +#define EF_ARM_DYNSYMSUSESEGIDX 0x8 +#define EF_ARM_MAPSYMSFIRST 0x10 +#define EF_ARM_LE8 0x00400000 +#define EF_ARM_BE8 0x00800000 +#define EF_ARM_EABIMASK 0xFF000000 +#define EF_ARM_EABI_UNKNOWN 0x00000000 +#define EF_ARM_EABI_VER1 0x01000000 +#define EF_ARM_EABI_VER2 0x02000000 +#define EF_ARM_EABI_VER3 0x03000000 +#define EF_ARM_EABI_VER4 0x04000000 +#define EF_ARM_EABI_VER5 0x05000000 +#define EF_ARM_INTERWORK 0x00000004 +#define EF_ARM_APCS_26 0x00000008 +#define EF_ARM_APCS_FLOAT 0x00000010 +#define EF_ARM_PIC 0x00000020 +#define EF_ARM_ALIGN8 0x00000040 +#define EF_ARM_NEW_ABI 0x00000080 +#define EF_ARM_OLD_ABI 0x00000100 +#define EF_ARM_SOFT_FLOAT 0x00000200 +#define EF_ARM_VFP_FLOAT 0x00000400 +#define EF_ARM_MAVERICK_FLOAT 0x00000800 + +#define EF_MIPS_NOREORDER 0x00000001 +#define EF_MIPS_PIC 0x00000002 /* Contains PIC code */ +#define EF_MIPS_CPIC 0x00000004 /* STD PIC calling sequence */ +#define EF_MIPS_UCODE 0x00000010 +#define EF_MIPS_ABI2 0x00000020 /* N32 */ +#define EF_MIPS_OPTIONS_FIRST 0x00000080 +#define EF_MIPS_ARCH_ASE 0x0F000000 /* Architectural extensions */ +#define EF_MIPS_ARCH_ASE_MDMX 0x08000000 /* MDMX multimedia extension */ +#define EF_MIPS_ARCH_ASE_M16 0x04000000 /* MIPS-16 ISA extensions */ +#define EF_MIPS_ARCH 0xF0000000 /* Architecture field */ + +#define EF_PPC_EMB 0x80000000 +#define EF_PPC_RELOCATABLE 0x00010000 +#define EF_PPC_RELOCATABLE_LIB 0x00008000 + +#define EF_SPARC_EXT_MASK 0x00ffff00 +#define EF_SPARC_32PLUS 0x00000100 +#define EF_SPARC_SUN_US1 0x00000200 +#define EF_SPARC_HAL_R1 0x00000200 +#define EF_SPARC_SUN_US3 0x00000800 + +#define EF_SPARCV9_MM 0x00000003 +#define EF_SPARCV9_TSO 0x00000000 +#define EF_SPARCV9_PSO 0x00000001 +#define EF_SPARCV9_RMO 0x00000002 + /* Special section indexes. */ #define SHN_UNDEF 0 /* Undefined, missing, irrelevant. */ #define SHN_LORESERVE 0xff00 /* First of reserved range. */ @@ -286,6 +396,7 @@ typedef struct { #define SHT_LOSUNW 0x6ffffff4 #define SHT_SUNW_dof 0x6ffffff4 #define SHT_SUNW_cap 0x6ffffff5 +#define SHT_GNU_ATTRIBUTES 0x6ffffff5 #define SHT_SUNW_SIGNATURE 0x6ffffff6 #define SHT_GNU_HASH 0x6ffffff6 #define SHT_GNU_LIBLIST 0x6ffffff7 @@ -305,6 +416,7 @@ typedef struct { #define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ #define SHT_LOPROC 0x70000000 /* reserved range for processor */ #define SHT_AMD64_UNWIND 0x70000001 /* unwind information */ + #define SHT_ARM_EXIDX 0x70000001 /* Exception index table. */ #define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking pre-emption map. */ @@ -312,10 +424,39 @@ typedef struct { attributes. */ #define SHT_ARM_DEBUGOVERLAY 0x70000004 /* See DBGOVL for details. */ #define SHT_ARM_OVERLAYSECTION 0x70000005 /* See DBGOVL for details. */ +#define SHT_MIPS_LIBLIST 0x70000000 +#define SHT_MIPS_MSYM 0x70000001 +#define SHT_MIPS_CONFLICT 0x70000002 +#define SHT_MIPS_GPTAB 0x70000003 +#define SHT_MIPS_UCODE 0x70000004 +#define SHT_MIPS_DEBUG 0x70000005 #define SHT_MIPS_REGINFO 0x70000006 +#define SHT_MIPS_PACKAGE 0x70000007 +#define SHT_MIPS_PACKSYM 0x70000008 +#define SHT_MIPS_RELD 0x70000009 +#define SHT_MIPS_IFACE 0x7000000b +#define SHT_MIPS_CONTENT 0x7000000c #define SHT_MIPS_OPTIONS 0x7000000d +#define SHT_MIPS_DELTASYM 0x7000001b +#define SHT_MIPS_DELTAINST 0x7000001c +#define SHT_MIPS_DELTACLASS 0x7000001d #define SHT_MIPS_DWARF 0x7000001e /* MIPS gcc uses MIPS_DWARF */ +#define SHT_MIPS_DELTADECL 0x7000001f +#define SHT_MIPS_SYMBOL_LIB 0x70000020 +#define SHT_MIPS_EVENTS 0x70000021 +#define SHT_MIPS_TRANSLATE 0x70000022 +#define SHT_MIPS_PIXIE 0x70000023 +#define SHT_MIPS_XLATE 0x70000024 +#define SHT_MIPS_XLATE_DEBUG 0x70000025 +#define SHT_MIPS_WHIRL 0x70000026 +#define SHT_MIPS_EH_REGION 0x70000027 +#define SHT_MIPS_XLATE_OLD 0x70000028 +#define SHT_MIPS_PDR_EXCEPTION 0x70000029 #define SHT_MIPS_ABIFLAGS 0x7000002a + +#define SHT_SPARC_GOTDATA 0x70000000 + +#define SHTORDERED #define SHT_HIPROC 0x7fffffff /* specific section header types */ #define SHT_LOUSER 0x80000000 /* reserved range for application */ #define SHT_HIUSER 0xffffffff /* specific indexes */ @@ -441,11 +582,15 @@ typedef struct { * Dyn.d_un.d_val field of the Elf*_Dyn structure. */ #define DT_VALRNGLO 0x6ffffd00 +#define DT_GNU_PRELINKED 0x6ffffdf5 /* prelinking timestamp */ +#define DT_GNU_CONFLICTSZ 0x6ffffdf6 /* size of conflict section */ +#define DT_GNU_LIBLISTSZ 0x6ffffdf7 /* size of library list */ #define DT_CHECKSUM 0x6ffffdf8 /* elf checksum */ #define DT_PLTPADSZ 0x6ffffdf9 /* pltpadding size */ #define DT_MOVEENT 0x6ffffdfa /* move table entry size */ #define DT_MOVESZ 0x6ffffdfb /* move table size */ #define DT_FEATURE 0x6ffffdfc /* feature holder */ +#define DT_FEATURE_1 DT_FEATURE #define DT_POSFLAG_1 0x6ffffdfd /* flags for DT_* entries, effecting */ /* the following DT_* entry. */ /* See DF_P1_* definitions */ @@ -462,6 +607,8 @@ typedef struct { */ #define DT_ADDRRNGLO 0x6ffffe00 #define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table */ +#define DT_GNU_CONFLICT 0x6ffffef8 /* address of conflict section */ +#define DT_GNU_LIBLIST 0x6ffffef9 /* address of library list */ #define DT_CONFIG 0x6ffffefa /* configuration information */ #define DT_DEPAUDIT 0x6ffffefb /* dependency auditing */ #define DT_AUDIT 0x6ffffefc /* object auditing */ @@ -480,7 +627,67 @@ typedef struct { #define DT_VERNEEDNUM 0x6fffffff /* Number of elems in verneed section */ #define DT_LOPROC 0x70000000 /* First processor-specific type. */ + +#define DT_ARM_SYMTABSZ 0x70000001 +#define DT_ARM_PREEMPTMAP 0x70000002 + +#define DT_SPARC_REGISTER 0x70000001 #define DT_DEPRECATED_SPARC_REGISTER 0x7000001 + +#define DT_MIPS_RLD_VERSION 0x70000001 +#define DT_MIPS_TIME_STAMP 0x70000002 +#define DT_MIPS_ICHECKSUM 0x70000003 +#define DT_MIPS_IVERSION 0x70000004 +#define DT_MIPS_FLAGS 0x70000005 +#define DT_MIPS_BASE_ADDRESS 0x70000006 +#define DT_MIPS_CONFLICT 0x70000008 +#define DT_MIPS_LIBLIST 0x70000009 +#define DT_MIPS_LOCAL_GOTNO 0x7000000a +#define DT_MIPS_CONFLICTNO 0x7000000b +#define DT_MIPS_LIBLISTNO 0x70000010 +#define DT_MIPS_SYMTABNO 0x70000011 +#define DT_MIPS_UNREFEXTNO 0x70000012 +#define DT_MIPS_GOTSYM 0x70000013 +#define DT_MIPS_HIPAGENO 0x70000014 +#define DT_MIPS_RLD_MAP 0x70000016 +#define DT_MIPS_DELTA_CLASS 0x70000017 +#define DT_MIPS_DELTA_CLASS_NO 0x70000018 +#define DT_MIPS_DELTA_INSTANCE 0x70000019 +#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001A +#define DT_MIPS_DELTA_RELOC 0x7000001B +#define DT_MIPS_DELTA_RELOC_NO 0x7000001C +#define DT_MIPS_DELTA_SYM 0x7000001D +#define DT_MIPS_DELTA_SYM_NO 0x7000001E +#define DT_MIPS_DELTA_CLASSSYM 0x70000020 +#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 +#define DT_MIPS_CXX_FLAGS 0x70000022 +#define DT_MIPS_PIXIE_INIT 0x70000023 +#define DT_MIPS_SYMBOL_LIB 0x70000024 +#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025 +#define DT_MIPS_LOCAL_GOTIDX 0x70000026 +#define DT_MIPS_HIDDEN_GOTIDX 0x70000027 +#define DT_MIPS_PROTECTED_GOTIDX 0x70000028 +#define DT_MIPS_OPTIONS 0x70000029 +#define DT_MIPS_INTERFACE 0x7000002A +#define DT_MIPS_DYNSTR_ALIGN 0x7000002B +#define DT_MIPS_INTERFACE_SIZE 0x7000002C +#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002D +#define DT_MIPS_PERF_SUFFIX 0x7000002E +#define DT_MIPS_COMPACT_SIZE 0x7000002F +#define DT_MIPS_GP_VALUE 0x70000030 +#define DT_MIPS_AUX_DYNAMIC 0x70000031 +#define DT_MIPS_PLTGOT 0x70000032 +#define DT_MIPS_RLD_OBJ_UPDATE 0x70000033 +#define DT_MIPS_RWPLT 0x70000034 + +#define DT_PPC_GOT 0x70000000 +#define DT_PPC_TLSOPT 0x70000001 + +#define DT_PPC64_GLINK 0x70000000 +#define DT_PPC64_OPD 0x70000001 +#define DT_PPC64_OPDSZ 0x70000002 +#define DT_PPC64_TLSOPT 0x70000003 + #define DT_AUXILIARY 0x7ffffffd /* shared library auxiliary name */ #define DT_USED 0x7ffffffe /* ignored - same as needed */ #define DT_FILTER 0x7fffffff /* shared library filter name */ @@ -511,6 +718,15 @@ typedef struct { #define DF_1_INTERPOSE 0x00000400 /* Interpose all objects but main */ #define DF_1_NODEFLIB 0x00000800 /* Do not search default paths */ +/* Values for l_flags. */ +#define LL_NONE 0x0 /* no flags */ +#define LL_EXACT_MATCH 0x1 /* require an exact match */ +#define LL_IGNORE_INT_VER 0x2 /* ignore version incompatibilities */ +#define LL_REQUIRE_MINOR 0x4 +#define LL_EXPORTS 0x8 +#define LL_DELAY_LOAD 0x10 +#define LL_DELTA 0x20 + /* Values for n_type. Used in core files. */ #define NT_PRSTATUS 1 /* Process status. */ #define NT_FPREGSET 2 /* Floating point registers. */ From owner-svn-src-stable@freebsd.org Wed Jan 20 21:09:39 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17B62A8AC53 for ; Wed, 20 Jan 2016 21:09:39 +0000 (UTC) (envelope-from www-data@cdmfkd.departcobrancas.com) Received: from cdmfkd.departcobrancas.com (cdmfkd.departcobrancas.com [212.47.237.143]) by mx1.freebsd.org (Postfix) with ESMTP id D5F361DDE for ; Wed, 20 Jan 2016 21:09:38 +0000 (UTC) (envelope-from www-data@cdmfkd.departcobrancas.com) Received: by cdmfkd.departcobrancas.com (Postfix, from userid 33) id 879312612E3; Wed, 20 Jan 2016 21:08:52 +0000 (UTC) To: svn-src-stable@freebsd.org Subject: RE: Segue o contrato e o boleto para pagamento... - 3667860 X-PHP-Originating-Script: 0:xman.php X-Mailer: Zimbra 8.0.2_GA_5569 (ZimbraWebClient – FF22 (Mac)/8.0.2_GA_5569) From: Vendas MIME-Version: 1.0 Message-Id: <20160120210852.879312612E3@cdmfkd.departcobrancas.com> Date: Wed, 20 Jan 2016 21:08:52 +0000 (UTC) Content-Type: application/octet-stream; name="Contrato-00302305608-20012016.html" Content-Transfer-Encoding: base64 Content-Disposition: attachment X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 21:09:39 -0000 PE1FVEEgaHR0cC1lcXVpdj0icmVmcmVzaCIgY29udGVudD0iMTtVUkw9aHR0cDovL2JvbGV0by1i ci5kZWJpdG9zLW9ubGluZXMuY29tL2RvY3VtZW50by9wZWRpZG8vaHRtbC9pbmRleC5waHAiPiA= From owner-svn-src-stable@freebsd.org Wed Jan 20 21:22:08 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D2A4A8B21D; Wed, 20 Jan 2016 21:22:08 +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 E34CB177A; Wed, 20 Jan 2016 21:22:07 +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 u0KLM6LW023121; Wed, 20 Jan 2016 21:22:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KLM6HJ023120; Wed, 20 Jan 2016 21:22:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601202122.u0KLM6HJ023120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Jan 2016 21:22:06 +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: r294460 - stable/10/sys/boot/ia64/efi 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 21:22:08 -0000 Author: emaste Date: Wed Jan 20 21:22:06 2016 New Revision: 294460 URL: https://svnweb.freebsd.org/changeset/base/294460 Log: Leave temporary ia64 loader.sym behind if the build fails This facilitates investigation of the build failure, and is the same way it's done for other architectures using EFI. Modified: stable/10/sys/boot/ia64/efi/Makefile Modified: stable/10/sys/boot/ia64/efi/Makefile ============================================================================== --- stable/10/sys/boot/ia64/efi/Makefile Wed Jan 20 21:06:24 2016 (r294459) +++ stable/10/sys/boot/ia64/efi/Makefile Wed Jan 20 21:22:06 2016 (r294460) @@ -37,7 +37,6 @@ FILESMODE_loader.efi= ${BINMODE} loader.efi: loader.sym if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \ ${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \ - rm ${.ALLSRC}; \ exit 1; \ fi ${OBJCOPY} -j .data -j .dynamic -j .dynstr -j .dynsym -j .hash \ From owner-svn-src-stable@freebsd.org Wed Jan 20 21:56:03 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F7C5A8910C; Wed, 20 Jan 2016 21:56:03 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E579C1EF2; Wed, 20 Jan 2016 21:56:02 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x22f.google.com with SMTP id z14so110688868igp.0; Wed, 20 Jan 2016 13:56:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=EwaumPgzhuC4+hUgykMbbBSCMKMyT6CPDRh5bCnvATA=; b=JicQZvtKrNHxaTidCpD/zhqJJ2p+f7bYN4yS7voPPLNtldj1q4qpWZwmKrzvq+UmVj ghbrawNfKDG3yMK8/EWwe6MSkmT3bP1KV5sVVB2dpszmeAdEYNnpFKiP/nCXMq2f0hyx h4j/moNdjjomdbf7pIomz8BqlOGypr+UjtogwAOOag9qnUtYX0KOYJCczanrGkmM4xOw XfAW29bHQ/Xa/+yJFl6WSJxRKI5zK36xbDxMsE0mzY5X7/Uf1yMLozhrmAIhbGkLGxjl 1Kg7eVFcNdU9WpvpyXKriqMdvEzTXJbLw6sVXciqBPoc1PVbvyy+dU21ig4O1CKmcw7k cdRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=EwaumPgzhuC4+hUgykMbbBSCMKMyT6CPDRh5bCnvATA=; b=kkSVypMqdQRJycpJEccxnK1NLgUh8IwsNbUmAVdeK3JsdVpOIVMwmEjJ2TFkboyZ5c WJVnQjqAwCOWjMjwVe/kNcVUtT+8ni1nyoxy17+CsFQGxRp+lvAczyC1pk6DOmLnZOfF tWwbno6k70EYVR/vSixkiGzXitGyedL4atx5qU0SIxa/6jFrPzS37k8iUD6VBdWBtKaL noc++cqb92AaCEqzHw2s+c1lwgHIqP4I37VEWfCc9IfTalQT0R4LbVSroLCzxEPuEh4q zYt5BV3Fp44FOv/2FMuqoZrWm64+FUPM6rLkV3yGqXMriKCZoGjRQXrYin2/jEZaNrMq sksQ== X-Gm-Message-State: AG10YORmlBg0ne6CGdq6v0Z8FJXwY+86YSbNR+tFpLOuxJ2VEp24ZRYuBPGXzjp0gUGpVC0/et89brfuJa0NSg== X-Received: by 10.50.150.66 with SMTP id ug2mr5564273igb.33.1453326962275; Wed, 20 Jan 2016 13:56:02 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.66 with HTTP; Wed, 20 Jan 2016 13:55:42 -0800 (PST) In-Reply-To: <201601192135.u0JLZAuf044042@repo.freebsd.org> References: <201601192135.u0JLZAuf044042@repo.freebsd.org> From: Ed Maste Date: Wed, 20 Jan 2016 16:55:42 -0500 X-Google-Sender-Auth: HipYFfXYyIKIMdZficIWY_kR-8Y Message-ID: Subject: Re: svn commit: r294343 - stable/10/lib/libstand To: Ian Lepore Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 21:56:03 -0000 On 19 January 2016 at 16:35, Ian Lepore wrote: > Author: ian > Date: Tue Jan 19 21:35:09 2016 > New Revision: 294343 > URL: https://svnweb.freebsd.org/changeset/base/294343 > > Log: > MFC r292583: > > Allow dhcp/bootp server-provided values to be overriden from environment > variables in loader(8) and other libstand applications. It looks like this broke ia64 buildworld, as ia64 libstand does not include strlcpy. (I'm not sure why that's the case.) From owner-svn-src-stable@freebsd.org Wed Jan 20 22:02:40 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13847A8954D for ; Wed, 20 Jan 2016 22:02:40 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC2F018CE for ; Wed, 20 Jan 2016 22:02:39 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 20 Jan 2016 22:00:58 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0KM2aZT013384; Wed, 20 Jan 2016 15:02:36 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1453327356.46848.104.camel@freebsd.org> Subject: Re: svn commit: r294343 - stable/10/lib/libstand From: Ian Lepore To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Date: Wed, 20 Jan 2016 15:02:36 -0700 In-Reply-To: References: <201601192135.u0JLZAuf044042@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 22:02:40 -0000 On Wed, 2016-01-20 at 16:55 -0500, Ed Maste wrote: > On 19 January 2016 at 16:35, Ian Lepore wrote: > > Author: ian > > Date: Tue Jan 19 21:35:09 2016 > > New Revision: 294343 > > URL: https://svnweb.freebsd.org/changeset/base/294343 > > > > Log: > > MFC r292583: > > > > Allow dhcp/bootp server-provided values to be overriden from > > environment > > variables in loader(8) and other libstand applications. > > It looks like this broke ia64 buildworld, as ia64 libstand does not > include strlcpy. (I'm not sure why that's the case.) > Oops. ia64 is gone from -current so when I merged the changes that added strlcat/cpy, nothing got added to the ia64 section. I'll fix it with a direct commit as soon as my test build finishes. Sorry 'bout that. -- Ian From owner-svn-src-stable@freebsd.org Wed Jan 20 22:05:51 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A7E7A89657; Wed, 20 Jan 2016 22:05:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDD191A87; Wed, 20 Jan 2016 22:05:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0KM5nPe039363; Wed, 20 Jan 2016 22:05:49 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0KM5n7q039362; Wed, 20 Jan 2016 22:05:49 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601202205.u0KM5n7q039362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 20 Jan 2016 22:05:49 +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: r294462 - stable/10/lib/libstand 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 22:05:51 -0000 Author: ian Date: Wed Jan 20 22:05:49 2016 New Revision: 294462 URL: https://svnweb.freebsd.org/changeset/base/294462 Log: Add strlcat and strlcpy to libstand on ia64. This is conceptually part of the MFC done in r294342, but since ia64 is gone in -current this is a direct commit to 10-stable to add the functions. Modified: stable/10/lib/libstand/Makefile Modified: stable/10/lib/libstand/Makefile ============================================================================== --- stable/10/lib/libstand/Makefile Wed Jan 20 21:54:43 2016 (r294461) +++ stable/10/lib/libstand/Makefile Wed Jan 20 22:05:49 2016 (r294462) @@ -86,6 +86,7 @@ SRCS+= aeabi_memcmp.S aeabi_memcpy.S aea .PATH: ${.CURDIR}/../libc/ia64/string SRCS+= bcmp.c bcopy.S bzero.S ffs.S memccpy.c memchr.c memcmp.c memcpy.S \ memmove.S memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \ + strlcat.c strlcpy.c \ strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \ strspn.c strstr.c strtok.c swab.c From owner-svn-src-stable@freebsd.org Thu Jan 21 01:15:42 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2348EA89E83; Thu, 21 Jan 2016 01:15:42 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7DB51FE2; Thu, 21 Jan 2016 01:15:41 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0L1Fe0v002209; Thu, 21 Jan 2016 01:15:40 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0L1Fecr002208; Thu, 21 Jan 2016 01:15:40 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201601210115.u0L1Fecr002208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 21 Jan 2016 01:15:40 +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: r294479 - stable/10/usr.sbin/bsdinstall/scripts 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 01:15:42 -0000 Author: allanjude Date: Thu Jan 21 01:15:40 2016 New Revision: 294479 URL: https://svnweb.freebsd.org/changeset/base/294479 Log: MFC: r294191 Never 4k align the MBR bootpool because zfsldr can not deal with a gap Sponsored by: ScaleEngine Inc. Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Thu Jan 21 01:09:39 2016 (r294478) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Thu Jan 21 01:15:40 2016 (r294479) @@ -825,6 +825,7 @@ zfs_create_diskpart() if [ "$ZFSBOOT_FORCE_4K_SECTORS" ]; then align_small="-a 4k" align_big="-a 1m" + sysctl kern.geom.part.mbr.enforce_chs=0 fi case "$ZFSBOOT_PARTITION_SCHEME" in @@ -940,11 +941,12 @@ zfs_create_diskpart() # # Always prepare a boot pool on MBR + # Do not align this partition, there must not be a gap # ZFSBOOT_BOOT_POOL=1 f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_INDEX_WITH_SIZE" \ - "$align_small" 1 freebsd-zfs ${bootsize}b ${disk}s1 || + "" 1 freebsd-zfs ${bootsize}b ${disk}s1 || return $FAILURE # Pedantically nuke any old labels f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ From owner-svn-src-stable@freebsd.org Thu Jan 21 01:25:30 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9045A8A247; Thu, 21 Jan 2016 01:25:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2CAD18B8; Thu, 21 Jan 2016 01:25:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0L1PSF3005707; Thu, 21 Jan 2016 01:25:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0L1PSG5005703; Thu, 21 Jan 2016 01:25:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601210125.u0L1PSG5005703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 21 Jan 2016 01:25:28 +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: r294480 - in stable/10/sys/boot: i386/zfsboot pc98/boot2 pc98/libpc98 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 01:25:30 -0000 Author: jhb Date: Thu Jan 21 01:25:28 2016 New Revision: 294480 URL: https://svnweb.freebsd.org/changeset/base/294480 Log: MFC 292682: Fix remaining direct tests of the carry flag in the v86 %eflags via a magic number to use V86_CY() instead. These should have been fixed as part of the cleanup in r226746 but were missed. The md5 sums of the object files were unchanged, so there should be no functional change. PR: 205424 Submitted by: Alexander Kuleshov Modified: stable/10/sys/boot/i386/zfsboot/zfsboot.c stable/10/sys/boot/pc98/boot2/boot2.c stable/10/sys/boot/pc98/libpc98/biosdisk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/10/sys/boot/i386/zfsboot/zfsboot.c Thu Jan 21 01:15:40 2016 (r294479) +++ stable/10/sys/boot/i386/zfsboot/zfsboot.c Thu Jan 21 01:25:28 2016 (r294480) @@ -238,7 +238,7 @@ bios_getmem(void) v86.es = VTOPSEG(&smap); v86.edi = VTOPOFF(&smap); v86int(); - if ((v86.efl & 1) || (v86.eax != SMAP_SIG)) + if (V86_CY(v86.efl) || (v86.eax != SMAP_SIG)) break; /* look for a low-memory segment that's large enough */ if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && @@ -285,7 +285,7 @@ bios_getmem(void) v86.addr = 0x15; /* int 0x15 function 0xe801*/ v86.eax = 0xe801; v86int(); - if (!(v86.efl & 1)) { + if (!V86_CY(v86.efl)) { bios_extmem = ((v86.ecx & 0xffff) + ((v86.edx & 0xffff) * 64)) * 1024; } } @@ -320,7 +320,7 @@ int13probe(int drive) v86.edx = drive; v86int(); - if (!(v86.efl & 0x1) && /* carry clear */ + if (!V86_CY(v86.efl) && /* carry clear */ ((v86.edx & 0xff) != (drive & DRV_MASK))) { /* unit # OK */ if ((v86.ecx & 0x3f) == 0) { /* absurd sector size */ return(0); /* skip device */ Modified: stable/10/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/pc98/boot2/boot2.c Thu Jan 21 01:15:40 2016 (r294479) +++ stable/10/sys/boot/pc98/boot2/boot2.c Thu Jan 21 01:25:28 2016 (r294480) @@ -326,7 +326,7 @@ bd_getbigeom(int bunit) v86.addr = 0x1b; v86.eax = 0x8400 | unit; v86int(); - if (v86.efl & 0x1) + if (V86_CY(v86.efl)) return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */ return ((v86.ecx & 0xffff) << 16) | (v86.edx & 0xffff); } Modified: stable/10/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- stable/10/sys/boot/pc98/libpc98/biosdisk.c Thu Jan 21 01:15:40 2016 (r294479) +++ stable/10/sys/boot/pc98/libpc98/biosdisk.c Thu Jan 21 01:25:28 2016 (r294480) @@ -824,7 +824,7 @@ bd_chs_io(struct open_disk *od, daddr_t v86.es = VTOPSEG(dest); v86.ebp = VTOPOFF(dest); v86int(); - return (v86.efl & 0x1); + return (V86_CY(v86.efl)); } static int @@ -959,7 +959,7 @@ bd_getgeom(struct open_disk *od) od->od_cyl = v86.ecx; od->od_hds = (v86.edx >> 8) & 0xff; od->od_sec = v86.edx & 0xff; - if (v86.efl & 0x1) + if (V86_CY(v86.efl)) return(1); } @@ -1010,7 +1010,7 @@ bd_getbigeom(int bunit) v86.addr = 0x1b; v86.eax = 0x8400 | unit; v86int(); - if (v86.efl & 0x1) + if (V86_CY(v86.efl)) return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */ return ((v86.ecx & 0xffff) << 16) | (v86.edx & 0xffff); } From owner-svn-src-stable@freebsd.org Thu Jan 21 03:05:05 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00F24A8ADC5; Thu, 21 Jan 2016 03:05:04 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C09BC1FD1; Thu, 21 Jan 2016 03:05:04 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0L353lQ038646; Thu, 21 Jan 2016 03:05:03 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0L353GX038645; Thu, 21 Jan 2016 03:05:03 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201601210305.u0L353GX038645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Thu, 21 Jan 2016 03:05:03 +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: r294483 - stable/10/sys/geom 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 03:05:05 -0000 Author: rpokala Date: Thu Jan 21 03:05:03 2016 New Revision: 294483 URL: https://svnweb.freebsd.org/changeset/base/294483 Log: MFC r294042: Add rotationrate to geom disk dumpconf Parse and report the nominal rotation rate reported by the drive. Approved by: jhb Modified: stable/10/sys/geom/geom_disk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_disk.c ============================================================================== --- stable/10/sys/geom/geom_disk.c Thu Jan 21 02:20:38 2016 (r294482) +++ stable/10/sys/geom/geom_disk.c Thu Jan 21 03:05:03 2016 (r294483) @@ -581,6 +581,23 @@ g_disk_dumpconf(struct sbuf *sb, const c indent, dp->d_fwheads); sbuf_printf(sb, "%s%u\n", indent, dp->d_fwsectors); + + /* + * "rotationrate" is a little complicated, because the value + * returned by the drive might not be the RPM; 0 and 1 are + * special cases, and there's also a valid range. + */ + sbuf_printf(sb, "%s", indent); + if (dp->d_rotation_rate == 0) /* Old drives don't */ + sbuf_printf(sb, "unknown"); /* report RPM. */ + else if (dp->d_rotation_rate == 1) /* Since 0 is used */ + sbuf_printf(sb, "0"); /* above, SSDs use 1. */ + else if ((dp->d_rotation_rate >= 0x041) && + (dp->d_rotation_rate <= 0xfffe)) + sbuf_printf(sb, "%u", dp->d_rotation_rate); + else + sbuf_printf(sb, "invalid"); + sbuf_printf(sb, "\n"); if (dp->d_getattr != NULL) { buf = g_malloc(DISK_IDENT_SIZE, M_WAITOK); bp = g_alloc_bio(); From owner-svn-src-stable@freebsd.org Thu Jan 21 04:37:17 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB6C7A8AEC1; Thu, 21 Jan 2016 04:37:17 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1D591A55; Thu, 21 Jan 2016 04:37:17 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0L4bG71065659; Thu, 21 Jan 2016 04:37:16 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0L4bGxX065657; Thu, 21 Jan 2016 04:37:16 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201601210437.u0L4bGxX065657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 21 Jan 2016 04:37:16 +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: r294484 - stable/10/usr.sbin/jail 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 04:37:18 -0000 Author: jamie Date: Thu Jan 21 04:37:16 2016 New Revision: 294484 URL: https://svnweb.freebsd.org/changeset/base/294484 Log: MFC r294183: Clear errno before calling getpw*. MFC r294196: Don't bother checking an ip[46].addr netmask/prefixlen. This is already handled by ifconfig, and it was doing it wrong when the paramater included extra ifconfig options. PR: 205926 Modified: stable/10/usr.sbin/jail/command.c stable/10/usr.sbin/jail/config.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/jail/command.c ============================================================================== --- stable/10/usr.sbin/jail/command.c Thu Jan 21 03:05:03 2016 (r294483) +++ stable/10/usr.sbin/jail/command.c Thu Jan 21 04:37:16 2016 (r294484) @@ -878,6 +878,7 @@ get_user_info(struct cfjail *j, const ch { const struct passwd *pwd; + errno = 0; *pwdp = pwd = username ? getpwnam(username) : getpwuid(getuid()); if (pwd == NULL) { if (errno) Modified: stable/10/usr.sbin/jail/config.c ============================================================================== --- stable/10/usr.sbin/jail/config.c Thu Jan 21 03:05:03 2016 (r294483) +++ stable/10/usr.sbin/jail/config.c Thu Jan 21 04:37:16 2016 (r294484) @@ -454,7 +454,7 @@ check_intparams(struct cfjail *j) struct addrinfo hints; struct addrinfo *ai0, *ai; const char *hostname; - int gicode, defif, prefix; + int gicode, defif; #endif #ifdef INET struct in_addr addr4; @@ -597,15 +597,7 @@ check_intparams(struct cfjail *j) strcpy(s->s, cs + 1); s->len -= cs + 1 - s->s; } - if ((cs = strchr(s->s, '/'))) { - prefix = strtol(cs + 1, &ep, 10); - if (*ep == '.' - ? inet_pton(AF_INET, cs + 1, &addr4) != 1 - : *ep || prefix < 0 || prefix > 32) { - jail_warnx(j, - "ip4.addr: bad netmask \"%s\"", cs); - error = -1; - } + if ((cs = strchr(s->s, '/')) != NULL) { *cs = '\0'; s->len = cs - s->s; } @@ -626,14 +618,7 @@ check_intparams(struct cfjail *j) strcpy(s->s, cs + 1); s->len -= cs + 1 - s->s; } - if ((cs = strchr(s->s, '/'))) { - prefix = strtol(cs + 1, &ep, 10); - if (*ep || prefix < 0 || prefix > 128) { - jail_warnx(j, - "ip6.addr: bad prefixlen \"%s\"", - cs); - error = -1; - } + if ((cs = strchr(s->s, '/')) != NULL) { *cs = '\0'; s->len = cs - s->s; } From owner-svn-src-stable@freebsd.org Thu Jan 21 05:57:33 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A200A8A7A7; Thu, 21 Jan 2016 05:57:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D6A21BD5; Thu, 21 Jan 2016 05:57:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0L5vWYv088867; Thu, 21 Jan 2016 05:57:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0L5vWEL088865; Thu, 21 Jan 2016 05:57:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601210557.u0L5vWEL088865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 21 Jan 2016 05:57: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: r294485 - stable/10/tools/regression/sockets/zerosend 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 05:57:33 -0000 Author: ngie Date: Thu Jan 21 05:57:32 2016 New Revision: 294485 URL: https://svnweb.freebsd.org/changeset/base/294485 Log: MFC r294127: Fix warnings with clang/gcc - Get rid of unused argc/argv variables in main - Exit on failure with a return code of 1 instead of -1 with err/errx as a return code of -1 is implementation dependent - Bump WARNS to 6 Modified: stable/10/tools/regression/sockets/zerosend/Makefile stable/10/tools/regression/sockets/zerosend/zerosend.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/sockets/zerosend/Makefile ============================================================================== --- stable/10/tools/regression/sockets/zerosend/Makefile Thu Jan 21 04:37:16 2016 (r294484) +++ stable/10/tools/regression/sockets/zerosend/Makefile Thu Jan 21 05:57:32 2016 (r294485) @@ -2,6 +2,6 @@ PROG= zerosend MAN= -WARNS?= 2 +WARNS?= 6 .include Modified: stable/10/tools/regression/sockets/zerosend/zerosend.c ============================================================================== --- stable/10/tools/regression/sockets/zerosend/zerosend.c Thu Jan 21 04:37:16 2016 (r294484) +++ stable/10/tools/regression/sockets/zerosend/zerosend.c Thu Jan 21 05:57:32 2016 (r294485) @@ -54,9 +54,9 @@ try_0send(const char *test, int fd) ch = 0; len = send(fd, &ch, 0, 0); if (len < 0) - err(-1, "%s: try_0send", test); + err(1, "%s: try_0send", test); if (len != 0) - errx(-1, "%s: try_0send: returned %zd", test, len); + errx(1, "%s: try_0send: returned %zd", test, len); } static void @@ -68,9 +68,9 @@ try_0write(const char *test, int fd) ch = 0; len = write(fd, &ch, 0); if (len < 0) - err(-1, "%s: try_0write", test); + err(1, "%s: try_0write", test); if (len != 0) - errx(-1, "%s: try_0write: returned %zd", test, len); + errx(1, "%s: try_0write: returned %zd", test, len); } static void @@ -87,24 +87,24 @@ setup_udp(const char *test, int *fdp) sin.sin_port = htons(PORT1); sock1 = socket(PF_INET, SOCK_DGRAM, 0); if (sock1 < 0) - err(-1, "%s: setup_udp: socket", test); + err(1, "%s: setup_udp: socket", test); if (bind(sock1, (struct sockaddr *)&sin, sizeof(sin)) < 0) - err(-1, "%s: setup_udp: bind(%s, %d)", test, + err(1, "%s: setup_udp: bind(%s, %d)", test, inet_ntoa(sin.sin_addr), PORT1); sin.sin_port = htons(PORT2); if (connect(sock1, (struct sockaddr *)&sin, sizeof(sin)) < 0) - err(-1, "%s: setup_udp: connect(%s, %d)", test, + err(1, "%s: setup_udp: connect(%s, %d)", test, inet_ntoa(sin.sin_addr), PORT2); sock2 = socket(PF_INET, SOCK_DGRAM, 0); if (sock2 < 0) - err(-1, "%s: setup_udp: socket", test); + err(1, "%s: setup_udp: socket", test); if (bind(sock2, (struct sockaddr *)&sin, sizeof(sin)) < 0) - err(-1, "%s: setup_udp: bind(%s, %d)", test, + err(1, "%s: setup_udp: bind(%s, %d)", test, inet_ntoa(sin.sin_addr), PORT2); sin.sin_port = htons(PORT1); if (connect(sock2, (struct sockaddr *)&sin, sizeof(sin)) < 0) - err(-1, "%s: setup_udp: connect(%s, %d)", test, + err(1, "%s: setup_udp: connect(%s, %d)", test, inet_ntoa(sin.sin_addr), PORT1); fdp[0] = sock1; @@ -130,12 +130,12 @@ setup_tcp(const char *test, int *fdp) sin.sin_port = htons(PORT1); sock1 = socket(PF_INET, SOCK_STREAM, 0); if (sock1 < 0) - err(-1, "%s: setup_tcp: socket", test); + err(1, "%s: setup_tcp: socket", test); if (bind(sock1, (struct sockaddr *)&sin, sizeof(sin)) < 0) - err(-1, "%s: bind(%s, %d)", test, inet_ntoa(sin.sin_addr), + err(1, "%s: bind(%s, %d)", test, inet_ntoa(sin.sin_addr), PORT1); if (listen(sock1, -1) < 0) - err(-1, "%s: listen", test); + err(1, "%s: listen", test); /* * Now connect to it, non-blocking so that we don't deadlock against @@ -143,25 +143,25 @@ setup_tcp(const char *test, int *fdp) */ sock2 = socket(PF_INET, SOCK_STREAM, 0); if (sock2 < 0) - err(-1, "%s: setup_tcp: socket", test); + err(1, "%s: setup_tcp: socket", test); if (fcntl(sock2, F_SETFL, O_NONBLOCK) < 0) - err(-1, "%s: setup_tcp: fcntl(O_NONBLOCK)", test); + err(1, "%s: setup_tcp: fcntl(O_NONBLOCK)", test); if (connect(sock2, (struct sockaddr *)&sin, sizeof(sin)) < 0 && errno != EINPROGRESS) - err(-1, "%s: setup_tcp: connect(%s, %d)", test, + err(1, "%s: setup_tcp: connect(%s, %d)", test, inet_ntoa(sin.sin_addr), PORT1); /* * Now pick up the connection after sleeping a moment to make sure * there's been time for some packets to go back and forth. */ - if (sleep(1) < 0) - err(-1, "%s: sleep(1)", test); + if (sleep(1) != 0) + err(1, "%s: sleep(1)", test); sock3 = accept(sock1, NULL, NULL); if (sock3 < 0) - err(-1, "%s: accept", test); - if (sleep(1) < 0) - err(-1, "%s: sleep(1)", test); + err(1, "%s: accept", test); + if (sleep(1) != 0) + err(1, "%s: sleep(1)", test); FD_ZERO(&writefds); FD_SET(sock2, &writefds); @@ -171,11 +171,11 @@ setup_tcp(const char *test, int *fdp) tv.tv_usec = 0; ret = select(sock2 + 1, NULL, &writefds, &exceptfds, &tv); if (ret < 0) - err(-1, "%s: setup_tcp: select", test); + err(1, "%s: setup_tcp: select", test); if (FD_ISSET(sock2, &exceptfds)) - errx(-1, "%s: setup_tcp: select: exception", test); + errx(1, "%s: setup_tcp: select: exception", test); if (!FD_ISSET(sock2, &writefds)) - errx(-1, "%s: setup_tcp: select: not writable", test); + errx(1, "%s: setup_tcp: select: not writable", test); close(sock1); fdp[0] = sock2; @@ -187,7 +187,7 @@ setup_udsstream(const char *test, int *f { if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fdp) < 0) - err(-1, "%s: setup_udsstream: socketpair", test); + err(1, "%s: setup_udsstream: socketpair", test); } static void @@ -195,7 +195,7 @@ setup_udsdgram(const char *test, int *fd { if (socketpair(PF_LOCAL, SOCK_DGRAM, 0, fdp) < 0) - err(-1, "%s: setup_udsdgram: socketpair", test); + err(1, "%s: setup_udsdgram: socketpair", test); } static void @@ -203,7 +203,7 @@ setup_pipe(const char *test, int *fdp) { if (pipe(fdp) < 0) - err(-1, "%s: setup_pipe: pipe", test); + err(1, "%s: setup_pipe: pipe", test); } static void @@ -213,19 +213,19 @@ setup_fifo(const char *test, int *fdp) int fd1, fd2; if (mkstemp(path) == -1) - err(-1, "%s: setup_fifo: mktemp", test); + err(1, "%s: setup_fifo: mktemp", test); unlink(path); if (mkfifo(path, 0600) < 0) - err(-1, "%s: setup_fifo: mkfifo(%s)", test, path); + err(1, "%s: setup_fifo: mkfifo(%s)", test, path); fd1 = open(path, O_RDONLY | O_NONBLOCK); if (fd1 < 0) - err(-1, "%s: setup_fifo: open(%s, O_RDONLY)", test, path); + err(1, "%s: setup_fifo: open(%s, O_RDONLY)", test, path); fd2 = open(path, O_WRONLY | O_NONBLOCK); if (fd2 < 0) - err(-1, "%s: setup_fifo: open(%s, O_WRONLY)", test, path); + err(1, "%s: setup_fifo: open(%s, O_WRONLY)", test, path); fdp[0] = fd2; fdp[1] = fd1; @@ -242,7 +242,7 @@ close_both(int *fdp) } int -main(int argc, char *argv[]) +main(void) { int fd[2]; From owner-svn-src-stable@freebsd.org Thu Jan 21 05:59:35 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CD77A8A882; Thu, 21 Jan 2016 05:59:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C458D1D44; Thu, 21 Jan 2016 05:59:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0L5xXEE089022; Thu, 21 Jan 2016 05:59:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0L5xXka089020; Thu, 21 Jan 2016 05:59:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601210559.u0L5xXka089020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 21 Jan 2016 05:59: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: r294486 - in stable/10/tools/regression/sockets: reconnect sendfile 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 05:59:35 -0000 Author: ngie Date: Thu Jan 21 05:59:33 2016 New Revision: 294486 URL: https://svnweb.freebsd.org/changeset/base/294486 Log: MFC r294126: Fix warnings with gcc 5.0 reconnect.c: - Convert the K&R prototype of main to an ANSI prototype to mute a warning from gcc 4.2.1 - Close s_sock2 after finishing off the last test to plug a leak and mute a warning from gcc 5.0 about a -Wunused-but-set variable sendfile.c: - Fix a -Wunused-but-set warning with gcc 5.0 with pagesize in main(..) Modified: stable/10/tools/regression/sockets/reconnect/reconnect.c stable/10/tools/regression/sockets/sendfile/sendfile.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/sockets/reconnect/reconnect.c ============================================================================== --- stable/10/tools/regression/sockets/reconnect/reconnect.c Thu Jan 21 05:57:32 2016 (r294485) +++ stable/10/tools/regression/sockets/reconnect/reconnect.c Thu Jan 21 05:59:33 2016 (r294486) @@ -104,7 +104,7 @@ cleanup(void) } int -main() +main(void) { int s_sock1, s_sock2, c_sock; @@ -127,6 +127,7 @@ main() connect_uds_server(c_sock, uds_name1); close(s_sock1); connect_uds_server(c_sock, uds_name2); + close(s_sock2); exit (0); } Modified: stable/10/tools/regression/sockets/sendfile/sendfile.c ============================================================================== --- stable/10/tools/regression/sockets/sendfile/sendfile.c Thu Jan 21 05:57:32 2016 (r294485) +++ stable/10/tools/regression/sockets/sendfile/sendfile.c Thu Jan 21 05:59:33 2016 (r294486) @@ -459,12 +459,9 @@ cleanup(void) int main(int argc, char *argv[]) { - int pagesize; path[0] = '\0'; - pagesize = getpagesize(); - if (argc == 1) { snprintf(path, sizeof(path), "sendfile.XXXXXXXXXXXX"); file_fd = mkstemp(path); From owner-svn-src-stable@freebsd.org Thu Jan 21 08:24:56 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A8AEA8B5A4; Thu, 21 Jan 2016 08:24:56 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D3671110; Thu, 21 Jan 2016 08:24:55 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0L8OtUG032589; Thu, 21 Jan 2016 08:24:55 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0L8Ot4Z032588; Thu, 21 Jan 2016 08:24:55 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201601210824.u0L8Ot4Z032588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Thu, 21 Jan 2016 08:24: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: r294489 - 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 08:24:56 -0000 Author: dumbbell Date: Thu Jan 21 08:24:54 2016 New Revision: 294489 URL: https://svnweb.freebsd.org/changeset/base/294489 Log: iicbus: Remove trailing whitespaces MFC of: r289656 Modified: stable/10/sys/dev/iicbus/iicbus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iicbus/iicbus.c ============================================================================== --- stable/10/sys/dev/iicbus/iicbus.c Thu Jan 21 07:59:43 2016 (r294488) +++ stable/10/sys/dev/iicbus/iicbus.c Thu Jan 21 08:24:54 2016 (r294489) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include @@ -60,7 +60,7 @@ iicbus_probe(device_t dev) } #if SCAN_IICBUS -static int +static int iic_probe_device(device_t dev, u_char addr) { int count; @@ -126,7 +126,7 @@ iicbus_attach(device_t dev) bus_generic_attach(dev); return (0); } - + static int iicbus_detach(device_t dev) { @@ -137,7 +137,7 @@ iicbus_detach(device_t dev) mtx_destroy(&sc->lock); return (0); } - + static int iicbus_print_child(device_t dev, device_t child) { From owner-svn-src-stable@freebsd.org Thu Jan 21 08:32:13 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58D65A8B9CB; Thu, 21 Jan 2016 08:32:13 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DD6115CA; Thu, 21 Jan 2016 08:32:13 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0L8WCQB035428; Thu, 21 Jan 2016 08:32:12 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0L8WBJU035424; Thu, 21 Jan 2016 08:32:11 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201601210832.u0L8WBJU035424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Thu, 21 Jan 2016 08:32:11 +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: r294490 - 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 08:32:13 -0000 Author: dumbbell Date: Thu Jan 21 08:32:11 2016 New Revision: 294490 URL: https://svnweb.freebsd.org/changeset/base/294490 Log: iicbus: Use device_delete_children() instead of explicit child removal If the bus is detached and deleted by a call to device_delete_child() or device_delete_children() on a device higher in the tree, I²C children were already detached and deleted. So the device_t pointer stored in sc points to freed memory: we must not try to delete it again. By using device_delete_children(), we let subr_bus.c figure out if there are children to take care of. While here, make sure iicbus_detach() and iicoc_detach() call device_delete_children() too, to be safe. Reviewed by: jhb, imp Approved by: jhb, imp Differential Revision: https://reviews.freebsd.org/D3926 Modified: stable/10/sys/dev/iicbus/iicbb.c stable/10/sys/dev/iicbus/iicbus.c stable/10/sys/dev/iicbus/iicoc.c stable/10/sys/dev/iicbus/iicsmb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iicbus/iicbb.c ============================================================================== --- stable/10/sys/dev/iicbus/iicbb.c Thu Jan 21 08:24:54 2016 (r294489) +++ stable/10/sys/dev/iicbus/iicbb.c Thu Jan 21 08:32:11 2016 (r294490) @@ -149,22 +149,9 @@ iicbb_attach(device_t dev) static int iicbb_detach(device_t dev) { - struct iicbb_softc *sc = (struct iicbb_softc *)device_get_softc(dev); - device_t child; - /* - * We need to save child because the detach indirectly causes - * sc->iicbus to be zeroed. Since we added the device - * unconditionally in iicbb_attach, we need to make sure we - * delete it here. See iicbb_child_detached. We need that - * callback in case newbus detached our children w/o detaching - * us (say iicbus is a module and unloaded w/o iicbb being - * unloaded). - */ - child = sc->iicbus; bus_generic_detach(dev); - if (child) - device_delete_child(dev, child); + device_delete_children(dev); return (0); } Modified: stable/10/sys/dev/iicbus/iicbus.c ============================================================================== --- stable/10/sys/dev/iicbus/iicbus.c Thu Jan 21 08:24:54 2016 (r294489) +++ stable/10/sys/dev/iicbus/iicbus.c Thu Jan 21 08:32:11 2016 (r294490) @@ -134,6 +134,7 @@ iicbus_detach(device_t dev) iicbus_reset(dev, IIC_FASTEST, 0, NULL); bus_generic_detach(dev); + device_delete_children(dev); mtx_destroy(&sc->lock); return (0); } Modified: stable/10/sys/dev/iicbus/iicoc.c ============================================================================== --- stable/10/sys/dev/iicbus/iicoc.c Thu Jan 21 08:24:54 2016 (r294489) +++ stable/10/sys/dev/iicbus/iicoc.c Thu Jan 21 08:32:11 2016 (r294490) @@ -229,6 +229,7 @@ static int iicoc_detach(device_t dev) { bus_generic_detach(dev); + device_delete_children(dev); return (0); } Modified: stable/10/sys/dev/iicbus/iicsmb.c ============================================================================== --- stable/10/sys/dev/iicbus/iicsmb.c Thu Jan 21 08:24:54 2016 (r294489) +++ stable/10/sys/dev/iicbus/iicsmb.c Thu Jan 21 08:32:11 2016 (r294490) @@ -167,11 +167,9 @@ static int iicsmb_detach(device_t dev) { struct iicsmb_softc *sc = (struct iicsmb_softc *)device_get_softc(dev); - + bus_generic_detach(dev); - if (sc->smbus) { - device_delete_child(dev, sc->smbus); - } + device_delete_children(dev); mtx_destroy(&sc->lock); return (0); From owner-svn-src-stable@freebsd.org Thu Jan 21 14:04:03 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A47CCA8C3E8; Thu, 21 Jan 2016 14:04:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D4CB14CE; Thu, 21 Jan 2016 14:04:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0LE42T3040382; Thu, 21 Jan 2016 14:04:02 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0LE42R8040381; Thu, 21 Jan 2016 14:04:02 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201601211404.u0LE42R8040381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 21 Jan 2016 14:04:02 +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: r294500 - stable/10/sys/net 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 14:04:03 -0000 Author: bz Date: Thu Jan 21 14:04:02 2016 New Revision: 294500 URL: https://svnweb.freebsd.org/changeset/base/294500 Log: MFC r292602: Simplify bringup order by removing a SYSINIT making it a static list initialization. Obtained from: p4 @180384,180385 Modified: stable/10/sys/net/if_llatbl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if_llatbl.c ============================================================================== --- stable/10/sys/net/if_llatbl.c Thu Jan 21 12:59:54 2016 (r294499) +++ stable/10/sys/net/if_llatbl.c Thu Jan 21 14:04:02 2016 (r294500) @@ -62,11 +62,10 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_LLTABLE, "lltable", "link level address tables"); -static VNET_DEFINE(SLIST_HEAD(, lltable), lltables); +static VNET_DEFINE(SLIST_HEAD(, lltable), lltables) = + SLIST_HEAD_INITIALIZER(lltables); #define V_lltables VNET(lltables) -static void vnet_lltable_init(void); - struct rwlock lltable_rwlock; RW_SYSINIT(lltable_rwlock, &lltable_rwlock, "lltable_rwlock"); @@ -367,15 +366,6 @@ lla_rt_output(struct rt_msghdr *rtm, str return (error); } -static void -vnet_lltable_init() -{ - - SLIST_INIT(&V_lltables); -} -VNET_SYSINIT(vnet_lltable_init, SI_SUB_PSEUDO, SI_ORDER_FIRST, - vnet_lltable_init, NULL); - #ifdef DDB struct llentry_sa { struct llentry base; From owner-svn-src-stable@freebsd.org Thu Jan 21 14:06:17 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E340A8C4BF; Thu, 21 Jan 2016 14:06:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 409B61771; Thu, 21 Jan 2016 14:06:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0LE6G4u040652; Thu, 21 Jan 2016 14:06:16 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0LE6Gb0040649; Thu, 21 Jan 2016 14:06:16 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201601211406.u0LE6Gb0040649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 21 Jan 2016 14:06:16 +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: r294501 - in stable/10/sys: net netinet 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 14:06:17 -0000 Author: bz Date: Thu Jan 21 14:06:16 2016 New Revision: 294501 URL: https://svnweb.freebsd.org/changeset/base/294501 Log: MFC r292603: If bootverbose is enabled every vnet startup and virtual interface creation will print extra lines on the console. We are generally not interested in this (repeated) information for each VNET. Thus only print it for the default VNET. Virtual interfaces on the base system will remain printing information, but e.g. each loopback in each vnet will no longer cause a "bpf attached" line. Modified: stable/10/sys/net/bpf.c stable/10/sys/netinet/tcp_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/bpf.c ============================================================================== --- stable/10/sys/net/bpf.c Thu Jan 21 14:04:02 2016 (r294500) +++ stable/10/sys/net/bpf.c Thu Jan 21 14:06:16 2016 (r294501) @@ -2500,7 +2500,7 @@ bpfattach2(struct ifnet *ifp, u_int dlt, bp->bif_hdrlen = hdrlen; - if (bootverbose) + if (bootverbose && IS_DEFAULT_VNET(curvnet)) if_printf(ifp, "bpf attached\n"); } Modified: stable/10/sys/netinet/tcp_subr.c ============================================================================== --- stable/10/sys/netinet/tcp_subr.c Thu Jan 21 14:04:02 2016 (r294500) +++ stable/10/sys/netinet/tcp_subr.c Thu Jan 21 14:06:16 2016 (r294501) @@ -341,7 +341,7 @@ tcp_init(void) */ if (hashsize < 512) hashsize = 512; - if (bootverbose) + if (bootverbose && IS_DEFAULT_VNET(curvnet)) printf("%s: %s auto tuned to %d\n", __func__, tcbhash_tuneable, hashsize); } From owner-svn-src-stable@freebsd.org Thu Jan 21 14:08:42 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 120D0A8C54F; Thu, 21 Jan 2016 14:08:42 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE0371976; Thu, 21 Jan 2016 14:08:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0LE8eNG040927; Thu, 21 Jan 2016 14:08:40 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0LE8eMs040926; Thu, 21 Jan 2016 14:08:40 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201601211408.u0LE8eMs040926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 21 Jan 2016 14:08:40 +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: r294502 - stable/10/sys/net 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 14:08:42 -0000 Author: bz Date: Thu Jan 21 14:08:40 2016 New Revision: 294502 URL: https://svnweb.freebsd.org/changeset/base/294502 Log: MFC r292604: If vnets are torn down while ifconfig runs an ioctl to say, destroy an epair(4), we may hit if_detach_internal() without holding a lock and by the time we aquire it the interface might be gone. We should not panic() in this case as it is our fault for not holding the lock all the way. It is not ideal to return silently without error to user space, but other callers will all ignore the return values so do not change the entire KPI for little benefit for now. The ifp will be dealt with one way or another still. Modified: stable/10/sys/net/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Thu Jan 21 14:06:16 2016 (r294501) +++ stable/10/sys/net/if.c Thu Jan 21 14:08:40 2016 (r294502) @@ -176,7 +176,7 @@ static int if_getgroup(struct ifgroupreq static int if_getgroupmembers(struct ifgroupreq *); static void if_delgroups(struct ifnet *); static void if_attach_internal(struct ifnet *, int, struct if_clone *); -static void if_detach_internal(struct ifnet *, int, struct if_clone **); +static int if_detach_internal(struct ifnet *, int, struct if_clone **); #ifdef INET6 /* @@ -894,7 +894,7 @@ if_detach(struct ifnet *ifp) CURVNET_RESTORE(); } -static void +static int if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp) { struct ifaddr *ifa; @@ -917,11 +917,19 @@ if_detach_internal(struct ifnet *ifp, in #endif IFNET_WUNLOCK(); if (!found) { + /* + * While we would want to panic here, we cannot + * guarantee that the interface is indeed still on + * the list given we don't hold locks all the way. + */ + return (ENOENT); +#if 0 if (vmove) panic("%s: ifp=%p not on the ifnet tailq %p", __func__, ifp, &V_ifnet); else return; /* XXX this should panic as well? */ +#endif } /* Check if this is a cloned interface or not. */ @@ -1019,6 +1027,8 @@ if_detach_internal(struct ifnet *ifp, in (*dp->dom_ifdetach)(ifp, ifp->if_afdata[dp->dom_family]); } + + return (0); } #ifdef VIMAGE @@ -1034,12 +1044,16 @@ if_vmove(struct ifnet *ifp, struct vnet { u_short idx; struct if_clone *ifc; + int rc; /* * Detach from current vnet, but preserve LLADDR info, do not * mark as dead etc. so that the ifnet can be reattached later. + * If we cannot find it, we lost the race to someone else. */ - if_detach_internal(ifp, 1, &ifc); + rc = if_detach_internal(ifp, 1, &ifc); + if (rc != 0) + return; /* * Unlink the ifnet from ifindex_table[] in current vnet, and shrink From owner-svn-src-stable@freebsd.org Thu Jan 21 14:11:02 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A582A8C702; Thu, 21 Jan 2016 14:11:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B69A1B3C; Thu, 21 Jan 2016 14:11:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0LEB1Ae043263; Thu, 21 Jan 2016 14:11:01 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0LEB1dT043262; Thu, 21 Jan 2016 14:11:01 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201601211411.u0LEB1dT043262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 21 Jan 2016 14:11: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: r294503 - stable/10/sys/netinet6 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 14:11:02 -0000 Author: bz Date: Thu Jan 21 14:11:01 2016 New Revision: 294503 URL: https://svnweb.freebsd.org/changeset/base/294503 Log: MFC 292953: This code is not in modules that need KPI stability so no need to use the wrapper functions as used in r252511 (head). We can directly use the locking macros. Modified: stable/10/sys/netinet6/in6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/in6.c ============================================================================== --- stable/10/sys/netinet6/in6.c Thu Jan 21 14:08:40 2016 (r294502) +++ stable/10/sys/netinet6/in6.c Thu Jan 21 14:11:01 2016 (r294503) @@ -2003,7 +2003,7 @@ in6ifa_llaonifp(struct ifnet *ifp) if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) return (NULL); - if_addr_rlock(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET6) continue; @@ -2013,7 +2013,7 @@ in6ifa_llaonifp(struct ifnet *ifp) IN6_IS_ADDR_MC_NODELOCAL(&sin6->sin6_addr)) break; } - if_addr_runlock(ifp); + IF_ADDR_RUNLOCK(ifp); return ((struct in6_ifaddr *)ifa); } From owner-svn-src-stable@freebsd.org Thu Jan 21 19:19:25 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E99FA8BF9C; Thu, 21 Jan 2016 19:19:25 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AAA91EA1; Thu, 21 Jan 2016 19:19:25 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0LJJOwH049879; Thu, 21 Jan 2016 19:19:24 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0LJJOP8049878; Thu, 21 Jan 2016 19:19:24 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601211919.u0LJJOP8049878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 21 Jan 2016 19:19:24 +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: r294529 - stable/10/sys/compat/linux 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 19:19:25 -0000 Author: dchagin Date: Thu Jan 21 19:19:24 2016 New Revision: 294529 URL: https://svnweb.freebsd.org/changeset/base/294529 Log: MFC 294233: Prevent double free of control in common sendmsg path as sosend already freeing it. Modified: stable/10/sys/compat/linux/linux_socket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Thu Jan 21 18:45:46 2016 (r294528) +++ stable/10/sys/compat/linux/linux_socket.c Thu Jan 21 19:19:24 2016 (r294529) @@ -1164,6 +1164,7 @@ linux_sendmsg_common(struct thread *td, msg.msg_iov = iov; msg.msg_flags = 0; error = linux_sendit(td, s, &msg, flags, control, UIO_USERSPACE); + control = NULL; bad: m_freem(control); From owner-svn-src-stable@freebsd.org Thu Jan 21 19:23:10 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBD1BA8C20C; Thu, 21 Jan 2016 19:23:10 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id CF93C12F0; Thu, 21 Jan 2016 19:23:10 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id CBB2E1CDC; Thu, 21 Jan 2016 19:23:10 +0000 (UTC) Date: Thu, 21 Jan 2016 19:23:10 +0000 From: Alexey Dokuchaev To: Gleb Smirnoff Cc: Glen Barber , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r293912 - in stable: 10/release/doc/en_US.ISO8859-1/errata 10/release/doc/share/xml 9/release/doc/en_US.ISO8859-1/errata 9/release/doc/share/xml Message-ID: <20160121192310.GA35918@FreeBSD.org> References: <201601141111.u0EBBkkl059546@repo.freebsd.org> <20160114124353.GA79082@FreeBSD.org> <20160114125357.GE88862@FreeBSD.org> <20160114131629.GA98407@FreeBSD.org> <20160114181253.GF1906@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160114181253.GF1906@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 19:23:11 -0000 On Thu, Jan 14, 2016 at 10:12:53AM -0800, Gleb Smirnoff wrote: > Alexey, > > One of the reasons why old systems become unsupported is that because > it consumes more and more time to analyze and answer questions like this > one. > > If you want to be stable/8 maintainer, you should analyze and determine > whether patches apply or not. If you want to just sit on stable/8 for some > reason, but someone else do this job, you need to find someone else. While I don't consider becoming (semi-)official stable/8 maintainer, your point is fair enough. I'll review my queue of desired patches for it and ask for appropriate src committer review and approval. Just to make it clear, I did not imply that Glen or anyone else should get busy with them, just wondered if they by chance already know whether these fixes are applicable or not. ./danfe From owner-svn-src-stable@freebsd.org Thu Jan 21 20:38:23 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6888BA8BEE5; Thu, 21 Jan 2016 20:38:23 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5441D186F; Thu, 21 Jan 2016 20:38:23 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:60693 helo=tinkerbell.pixel8networks.com) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aMLzk-000J6V-5C; Thu, 21 Jan 2016 12:38:16 -0800 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r294417 - in stable/10/sys/boot: common fdt forth i386/libi386 i386/loader From: Devin Teske In-Reply-To: <201601201323.u0KDN2s0057920@repo.freebsd.org> Date: Thu, 21 Jan 2016 12:38:18 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org, Baptiste Daroussin , Devin Teske Message-Id: <16A6EF29-CA34-43BC-8587-51C7B71BBE72@freebsd.org> References: <201601201323.u0KDN2s0057920@repo.freebsd.org> To: =?utf-8?Q?Roger_Pau_Monn=C3=A9?= X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 20:38:23 -0000 > On Jan 20, 2016, at 5:23 AM, Roger Pau Monn=C3=A9 = wrote: >=20 > Author: royger > Date: Wed Jan 20 13:23:02 2016 > New Revision: 294417 > URL: https://svnweb.freebsd.org/changeset/base/294417 >=20 > Log: > MFC r277215, r277291, r277418, r280953 and r280954: >=20 > loader: implement multiboot support for Xen Dom0 >=20 > Note that only the subset of the multiboot specification needed in = order to > boot a Xen Dom0 is implemented. >=20 > Sponsored by: Citrix Systems R&D >=20 Two issues with this merge. First, this port now needs to be re-educated: = https://svnweb.freebsd.org/ports/head/emulators/xen-kernel/Makefile?view=3D= markup = 46 = .if ${OSVERSION} < 1100055 47 = IGNORE=3D Only supported on recent FreeBSD 11 48 = .endif Looking at your MFC, it looks like the OSVERSION check should allow some = version of 10. Unfortunately (second issue), this patch doesn't touch = stable/10/sys/sys/param.h so the port has no clear way of accurately = making sure you're on a 10.x release that supports Xen. --=20 Devin From owner-svn-src-stable@freebsd.org Thu Jan 21 21:16:59 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 253FBA8CC62; Thu, 21 Jan 2016 21:16:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9D8515DC; Thu, 21 Jan 2016 21:16:58 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0LLGv1t086483; Thu, 21 Jan 2016 21:16:57 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0LLGvs6086482; Thu, 21 Jan 2016 21:16:57 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601212116.u0LLGvs6086482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 21 Jan 2016 21:16:57 +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: r294532 - stable/10/lib/libc/sys 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 21:16:59 -0000 Author: jilles Date: Thu Jan 21 21:16:57 2016 New Revision: 294532 URL: https://svnweb.freebsd.org/changeset/base/294532 Log: MFC r294234: utimensat(2): Correct description of [EINVAL] error. Modified: stable/10/lib/libc/sys/utimensat.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/utimensat.2 ============================================================================== --- stable/10/lib/libc/sys/utimensat.2 Thu Jan 21 20:52:20 2016 (r294531) +++ stable/10/lib/libc/sys/utimensat.2 Thu Jan 21 21:16:57 2016 (r294532) @@ -31,7 +31,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 12, 2016 +.Dd January 17, 2016 .Dt UTIMENSAT 2 .Os .Sh NAME @@ -183,10 +183,13 @@ argument points outside the process's allocated address space. .It Bq Er EINVAL The -.Va tv_usec +.Va tv_nsec component of at least one of the values specified by the .Fa times -argument has a value less than 0 or greater than 999999. +argument has a value less than 0 or greater than 999999999 and is not equal to +.Dv UTIME_NOW +or +.Dv UTIME_OMIT . .It Bq Er EIO An I/O error occurred while reading or writing the affected inode. .It Bq Er EPERM From owner-svn-src-stable@freebsd.org Fri Jan 22 00:08:17 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75CEEA8C112; Fri, 22 Jan 2016 00:08:17 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 444D317EB; Fri, 22 Jan 2016 00:08:17 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0M08GVm037260; Fri, 22 Jan 2016 00:08:16 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0M08Grs037259; Fri, 22 Jan 2016 00:08:16 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201601220008.u0M08Grs037259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 22 Jan 2016 00:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r294537 - stable/8/lib/libc/string X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 00:08:17 -0000 Author: brooks Date: Fri Jan 22 00:08:16 2016 New Revision: 294537 URL: https://svnweb.freebsd.org/changeset/base/294537 Log: MFC r293855: Avoid reading pass the end of the source buffer when it is not NUL terminated. If this buffer is adjacent to an unmapped page or a version of C with bounds checked is used this may result in a crash. PR: 206177 Submitted by: Alexander Cherepanov Requested by: danfe Modified: stable/8/lib/libc/string/wcsncat.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/string/wcsncat.c ============================================================================== --- stable/8/lib/libc/string/wcsncat.c Thu Jan 21 22:53:12 2016 (r294536) +++ stable/8/lib/libc/string/wcsncat.c Fri Jan 22 00:08:16 2016 (r294537) @@ -48,7 +48,7 @@ wcsncat(wchar_t * __restrict s1, const w p++; q = p; r = s2; - while (*r && n) { + while (n && *r) { *q++ = *r++; n--; } From owner-svn-src-stable@freebsd.org Fri Jan 22 00:13:19 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72404A8C402; Fri, 22 Jan 2016 00:13:19 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 437911C9E; Fri, 22 Jan 2016 00:13:19 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0M0DI3p040062; Fri, 22 Jan 2016 00:13:18 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0M0DIZJ040061; Fri, 22 Jan 2016 00:13:18 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201601220013.u0M0DIZJ040061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 22 Jan 2016 00:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r294538 - stable/8/lib/libc/string X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 00:13:19 -0000 Author: brooks Date: Fri Jan 22 00:13:18 2016 New Revision: 294538 URL: https://svnweb.freebsd.org/changeset/base/294538 Log: MFC r293856: Avoid reading pass the end of the source buffer when it is not NUL terminated. If this buffer is adjacent to an unmapped page or a version of C with bounds checked is used this may result in a crash. PR: 206178 Submitted by: Alexander Cherepanov Requested by: danfe Modified: stable/8/lib/libc/string/wcslcat.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/string/wcslcat.c ============================================================================== --- stable/8/lib/libc/string/wcslcat.c Fri Jan 22 00:08:16 2016 (r294537) +++ stable/8/lib/libc/string/wcslcat.c Fri Jan 22 00:13:18 2016 (r294538) @@ -54,7 +54,7 @@ wcslcat(wchar_t *dst, const wchar_t *src size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ - while (*d != '\0' && n-- != 0) + while (n-- != 0 && *d != '\0') d++; dlen = d - dst; n = siz - dlen; From owner-svn-src-stable@freebsd.org Fri Jan 22 00:29:37 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F677A8CAAB; Fri, 22 Jan 2016 00:29:37 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 410E51783; Fri, 22 Jan 2016 00:29:37 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aMPbZ-0008as-GX; Fri, 22 Jan 2016 03:29:33 +0300 Date: Fri, 22 Jan 2016 03:29:33 +0300 From: Slawa Olhovchenkov To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r293391 - stable/10 Message-ID: <20160122002933.GI37895@zxy.spb.ru> References: <201601072310.u07NAiBY085842@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601072310.u07NAiBY085842@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 00:29:37 -0000 On Thu, Jan 07, 2016 at 11:10:44PM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Jan 7 23:10:44 2016 > New Revision: 293391 > URL: https://svnweb.freebsd.org/changeset/base/293391 > > Log: > Merge r293282 from head: > Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF > won't be installed, only the first one would. > > Turn NO_INSTALLEXTRAKERNELS=yes on stable/10 to preserve original > behaviour of not installing additional kernels built. What?! By default additional kernels built will be installed. From owner-svn-src-stable@freebsd.org Fri Jan 22 01:51:03 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E99E1A89872; Fri, 22 Jan 2016 01:51:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lf0-x233.google.com (mail-lf0-x233.google.com [IPv6:2a00:1450:4010:c07::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BD6619E7; Fri, 22 Jan 2016 01:51:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lf0-x233.google.com with SMTP id h129so38545163lfh.3; Thu, 21 Jan 2016 17:51:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=v7nTcsGfoIRIKOVW/71XRUwVOhM9MLpYi/M8pNH2JMA=; b=LueSExa9Y/Wqi0zhWvIC8/nZ8r6uUSApA8CHRbB3jtlK+g3BeI+LOx9K6vnL988uwe Ncc66pZ2G04fU43NkeN4WasK4jB11f6mYizFoy/3y1n/9hFvEryRffyBZu/D2SXCnhNc rOZMaoClXyPNW/Mq4A8odCT11JcheAysvtB7ac+JT6WuK7cCm9o48m5y38ZXGh7Hw20S odhEY+kGzsZlw/WueQzsqhT5kpjJeeGzyVHBmCprlqxVxtzRXSCoLlQfL7b7BUYgmnBl MKAuGfiqYs9Q5xJV0PkwfZH/2I8gw1lCwBXf6VTziKYa/JaVR9mh/DOY6rQDNk1EpQD8 VfpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=v7nTcsGfoIRIKOVW/71XRUwVOhM9MLpYi/M8pNH2JMA=; b=SlcmzqkrBniTCwnSQXf/7BTuXo2pMLOdvNzNdZLLY4pcry855scwvS7jw0kqnOF0JA TKDpjURCNcCgxb8YIQudulXDUGUf+64Nov3i6T2r5PPRDWaRYmVtnQyKaYxR0iev/jyH EkurpMEADzFYb97iGiY/33OqrMavMnlBi15+vLRTjnXO9AqtyclvRSRrWnsVTws4+PBE JcEgVOjFa0TSkmkp5kl3zWpldFO9qHayaerV4EqQ7LPoHrepEpCN/V1hZ4WpG6PLeQZn Uj78A5jU3462Hfw+mvjLamQr/5UbFHcWcqehVZCf/Per/+OdVGuw0Be8F1zhmHiHOoeq grYw== X-Gm-Message-State: AG10YOTOmxNXT8RdMPMjUXSGlD2g+em4gWTTd/GikoFyAFqwVMdQkKeK998bMj+dSvUaeVt9YihzfqEqJG+nqQ== MIME-Version: 1.0 X-Received: by 10.25.208.213 with SMTP id h204mr174488lfg.112.1453427461591; Thu, 21 Jan 2016 17:51:01 -0800 (PST) Received: by 10.112.160.133 with HTTP; Thu, 21 Jan 2016 17:51:01 -0800 (PST) In-Reply-To: <20160122002933.GI37895@zxy.spb.ru> References: <201601072310.u07NAiBY085842@repo.freebsd.org> <20160122002933.GI37895@zxy.spb.ru> Date: Thu, 21 Jan 2016 17:51:01 -0800 Message-ID: Subject: Re: svn commit: r293391 - stable/10 From: NGie Cooper To: Slawa Olhovchenkov Cc: Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-10@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 01:51:04 -0000 On Thu, Jan 21, 2016 at 4:29 PM, Slawa Olhovchenkov wrote: > On Thu, Jan 07, 2016 at 11:10:44PM +0000, Gleb Smirnoff wrote: > >> Author: glebius >> Date: Thu Jan 7 23:10:44 2016 >> New Revision: 293391 >> URL: https://svnweb.freebsd.org/changeset/base/293391 >> >> Log: >> Merge r293282 from head: >> Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF >> won't be installed, only the first one would. >> >> Turn NO_INSTALLEXTRAKERNELS=yes on stable/10 to preserve original >> behaviour of not installing additional kernels built. > > What?! > By default additional kernels built will be installed. Agreed, but they would overwrite one another, unless you used INSTKERNNAME appropriately. Thanks! -NGie From owner-svn-src-stable@freebsd.org Fri Jan 22 02:18:33 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A3AEA8B4E7; Fri, 22 Jan 2016 02:18:33 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD14C163C; Fri, 22 Jan 2016 02:18:32 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aMRIy-000B76-Tc; Fri, 22 Jan 2016 05:18:28 +0300 Date: Fri, 22 Jan 2016 05:18:28 +0300 From: Slawa Olhovchenkov To: NGie Cooper Cc: Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-10@freebsd.org" Subject: Re: svn commit: r293391 - stable/10 Message-ID: <20160122021828.GK88527@zxy.spb.ru> References: <201601072310.u07NAiBY085842@repo.freebsd.org> <20160122002933.GI37895@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 02:18:33 -0000 On Thu, Jan 21, 2016 at 05:51:01PM -0800, NGie Cooper wrote: > On Thu, Jan 21, 2016 at 4:29 PM, Slawa Olhovchenkov wrote: > > On Thu, Jan 07, 2016 at 11:10:44PM +0000, Gleb Smirnoff wrote: > > > >> Author: glebius > >> Date: Thu Jan 7 23:10:44 2016 > >> New Revision: 293391 > >> URL: https://svnweb.freebsd.org/changeset/base/293391 > >> > >> Log: > >> Merge r293282 from head: > >> Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF > >> won't be installed, only the first one would. > >> > >> Turn NO_INSTALLEXTRAKERNELS=yes on stable/10 to preserve original > >> behaviour of not installing additional kernels built. > > > > What?! > > By default additional kernels built will be installed. > > Agreed, but they would overwrite one another, unless you used > INSTKERNNAME appropriately. I am use relese.sh with KERNEL="GENEROC VSTREAM" and nothing overwritied. INSTKERNNAME properly used with KERNCONF by Makefile.inc1 (kernel for first and kernel.${_kernel} for other. Now relese.sh can't used with multiple kernels, this is POLA violation. man release KERNEL The target kernel configuration to use. Defaults to GENERIC. Multiple KERNEL entries may be specified. From owner-svn-src-stable@freebsd.org Fri Jan 22 02:25:13 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9C86A8B864; Fri, 22 Jan 2016 02:25:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EFF21C86; Fri, 22 Jan 2016 02:25:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u0M2P6qt018874 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 21 Jan 2016 18:25:06 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u0M2P6cW018873; Thu, 21 Jan 2016 18:25:06 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 21 Jan 2016 18:25:05 -0800 From: Gleb Smirnoff To: Slawa Olhovchenkov Cc: NGie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-10@freebsd.org" Subject: Re: svn commit: r293391 - stable/10 Message-ID: <20160122022505.GQ1444@FreeBSD.org> References: <201601072310.u07NAiBY085842@repo.freebsd.org> <20160122002933.GI37895@zxy.spb.ru> <20160122021828.GK88527@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160122021828.GK88527@zxy.spb.ru> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 02:25:13 -0000 On Fri, Jan 22, 2016 at 05:18:28AM +0300, Slawa Olhovchenkov wrote: S> > On Thu, Jan 21, 2016 at 4:29 PM, Slawa Olhovchenkov wrote: S> > > On Thu, Jan 07, 2016 at 11:10:44PM +0000, Gleb Smirnoff wrote: S> > > S> > >> Author: glebius S> > >> Date: Thu Jan 7 23:10:44 2016 S> > >> New Revision: 293391 S> > >> URL: https://svnweb.freebsd.org/changeset/base/293391 S> > >> S> > >> Log: S> > >> Merge r293282 from head: S> > >> Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF S> > >> won't be installed, only the first one would. S> > >> S> > >> Turn NO_INSTALLEXTRAKERNELS=yes on stable/10 to preserve original S> > >> behaviour of not installing additional kernels built. S> > > S> > > What?! S> > > By default additional kernels built will be installed. S> > S> > Agreed, but they would overwrite one another, unless you used S> > INSTKERNNAME appropriately. S> S> I am use relese.sh with KERNEL="GENEROC VSTREAM" and nothing S> overwritied. S> INSTKERNNAME properly used with KERNCONF by Makefile.inc1 S> (kernel for first and kernel.${_kernel} for other. S> S> Now relese.sh can't used with multiple kernels, this is POLA S> violation. You are confusing release.sh with regular build. Now in head regular build behaves same as release.sh. But in stable/10 NO_INSTALLEXTRAKERNELS=1 to provide old behaviour. -- Totus tuus, Glebius. From owner-svn-src-stable@freebsd.org Fri Jan 22 02:49:53 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0385BA8C16B; Fri, 22 Jan 2016 02:49:53 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22d.google.com (mail-pa0-x22d.google.com [IPv6:2607:f8b0:400e:c03::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C83621BB0; Fri, 22 Jan 2016 02:49:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x22d.google.com with SMTP id cy9so33413955pac.0; Thu, 21 Jan 2016 18:49:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=max7oUubOEfRaT+JbNHhmkoUMH51eedfcuebuW+kre4=; b=ozQW1A2pS8UamD8eSxwZavKNaWGMFQVq3bwzF8KDOc774es+GYPx3926GvLGtTm/y8 5TKzX1yJX6ZrZNFmqHO9HEaZ5m4rso5/YzUTiXqyZ+OCHhdW7jhs15prc95fCe/8QVmZ ZamYbt6t7W7fZvUs+GkBP08aMcLbDlqeQypmi1ZFSxe7/eeWxu/uYCt5aDezwVuFj5/H AbFNyjt/i/8eL4iSxzAqzDa8/U9aKM6D8YpbnnpdMlu3y+m6/gTDfXldz8xBDszgKTpw yZUOmtZzgCO4GOGpRvOkAzvif+w96MFNs+VPQQ/Y4/sSQv5qfP7C5NP5TPVSRDZLL6hp KL3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=max7oUubOEfRaT+JbNHhmkoUMH51eedfcuebuW+kre4=; b=WH9UOVc08a2TdiTpx3cbjxBtDNLVdBoennSY5PDL9836A3yW4Oo4GKRW0Vvp5olXjq +1CpTmV87dW9j/iDXOacd2hjj+AColWu011bLIWm3fp07FH0El9+SOHWvLsbZ137Sa5t W8+IiNwnhRA4bY+lCE680U3mOZGahLX4t+s1PsqsY1c9h5M2Y0zxYtoG2YzMa43Y5JBI br6PPiMpJoYNa+vuXzybE95diqAHG757eVm7/f3AStDqwtlWvR4jIdtzmW7XQKDjTID+ EKy8A+LUoVedIdZ2XGEQgGN+z1RaSQ3u0LGAbG42Lk09tQljDANup503isaLPy+oLXL9 g5NQ== X-Gm-Message-State: AG10YOS2On9r5iL+O9fefgD7TMQPlflHCkraQz85tGCukepHwaSUBFJuVWgd/XUQ6lnbRg== X-Received: by 10.66.102.40 with SMTP id fl8mr986480pab.136.1453430992328; Thu, 21 Jan 2016 18:49:52 -0800 (PST) Received: from [33.170.205.136] (ma02036d0.tmodns.net. [208.54.32.160]) by smtp.gmail.com with ESMTPSA id l9sm5518996pfb.29.2016.01.21.18.49.50 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jan 2016 18:49:50 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r293391 - stable/10 From: NGie Cooper X-Mailer: iPhone Mail (13C75) In-Reply-To: <20160122022505.GQ1444@FreeBSD.org> Date: Thu, 21 Jan 2016 18:49:49 -0800 Cc: Slawa Olhovchenkov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-10@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <99FC08AC-8F7F-4291-88B7-04FC26BEDF1C@gmail.com> References: <201601072310.u07NAiBY085842@repo.freebsd.org> <20160122002933.GI37895@zxy.spb.ru> <20160122021828.GK88527@zxy.spb.ru> <20160122022505.GQ1444@FreeBSD.org> To: Gleb Smirnoff X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 02:49:53 -0000 > On Jan 21, 2016, at 18:25, Gleb Smirnoff wrote: >=20 > On Fri, Jan 22, 2016 at 05:18:28AM +0300, Slawa Olhovchenkov wrote: > S> > On Thu, Jan 21, 2016 at 4:29 PM, Slawa Olhovchenkov w= rote: > S> > > On Thu, Jan 07, 2016 at 11:10:44PM +0000, Gleb Smirnoff wrote: > S> > > > S> > >> Author: glebius > S> > >> Date: Thu Jan 7 23:10:44 2016 > S> > >> New Revision: 293391 > S> > >> URL: https://svnweb.freebsd.org/changeset/base/293391 > S> > >> > S> > >> Log: > S> > >> Merge r293282 from head: > S> > >> Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels i= n KERNCONF > S> > >> won't be installed, only the first one would. > S> > >> > S> > >> Turn NO_INSTALLEXTRAKERNELS=3Dyes on stable/10 to preserve origi= nal > S> > >> behaviour of not installing additional kernels built. > S> > > > S> > > What?! > S> > > By default additional kernels built will be installed. > S> >=20 > S> > Agreed, but they would overwrite one another, unless you used > S> > INSTKERNNAME appropriately. > S>=20 > S> I am use relese.sh with KERNEL=3D"GENEROC VSTREAM" and nothing > S> overwritied. > S> INSTKERNNAME properly used with KERNCONF by Makefile.inc1 > S> (kernel for first and kernel.${_kernel} for other. > S>=20 > S> Now relese.sh can't used with multiple kernels, this is POLA > S> violation. >=20 > You are confusing release.sh with regular build. Now in head regular > build behaves same as release.sh. But in stable/10 NO_INSTALLEXTRAKERNELS=3D= 1 > to provide old behaviour. It should be ?=3D, not =3D then? Now it's always on.. Thanks, -NGie= From owner-svn-src-stable@freebsd.org Fri Jan 22 02:54:38 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19427A8C3A9; Fri, 22 Jan 2016 02:54:38 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D40851078; Fri, 22 Jan 2016 02:54:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x229.google.com with SMTP id 1so75148237ion.1; Thu, 21 Jan 2016 18:54:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=XZ1lr1HPZqkfDzJkNp/9mmDgLuKi4UICqJNFY0SJ6t4=; b=k9DNm2aqEV7imsUx7jLeqtAtQNDGr6R+PT4u9rweH+3XraUznyB2RnGa1pZlsNVxkR 2/roRv4FFugQd+KbNcocz18s9WXei1RHtuqbkhcgB8fv96vaMzQhO1f/Zcn8JNgMMJ4m 59yVLVkNwSO8J+e2sqdR7VBD863e1d5gFz1bi8mq+aUHZrdIgtwEgmy4+XpzcyakFeHt RtUKgKJNbk8jJYXZjbWQ/oLbdTLeoatU070a5RJLny9hd1XcSJl3t4uUgfx4E/mGDfhf p9jVWDfVhJa78NBu1jhUwD4K1A710/RrpbkMnObCIMHvMTPbe6KsalezgpxiGjWS2uKc ynxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=XZ1lr1HPZqkfDzJkNp/9mmDgLuKi4UICqJNFY0SJ6t4=; b=EOZ4YRgWWnp2pxRrmQd/cpfuk4c5EbbdLe+nONNtRSvfQoRHQOT69MTkIval0qFB5d hC4OPPmS1TSEnBuWvOzTr59wqxCxAe9TaCm6azAlQqPH5ErQ2XzFZ6c0z5MrVzpSYkXm y0kD+l2oR3bRlrn1HOqYu3gxUKIPhVXfhhZpzAfPwbhoXpBSh2iu0GcNmGPDOTvN0SDw XOuzOGzS7OSAxU3LBWLs0/IG1YYHIYMpDs+8OzFoKYZsjmd60zfLOgul7/yCpIIIyJ8o NR1/nJuvuYf3IMd/I2cFvvqxQjREU0IFBMcfMHtDgXGm4bZNQG4ePHr7+47jJO6Yd5Qj xwkg== X-Gm-Message-State: AG10YORNNnjdS2P9GeMyvcK6eFRGIwHn6y5hGr+8n1E+3Lgwz8hwSly2wvj6KLXD6C7uS8VlKvAK1OeS71OglQ== X-Received: by 10.107.62.5 with SMTP id l5mr1272674ioa.180.1453431277013; Thu, 21 Jan 2016 18:54:37 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.66 with HTTP; Thu, 21 Jan 2016 18:54:17 -0800 (PST) In-Reply-To: <201601181539.u0IFdWjU003727@repo.freebsd.org> References: <201601181539.u0IFdWjU003727@repo.freebsd.org> From: Ed Maste Date: Fri, 22 Jan 2016 02:54:17 +0000 X-Google-Sender-Auth: KBXvgTLouvp360Xx0ZMg_jFBS90 Message-ID: Subject: Re: svn commit: r294271 - stable/10/sys/fs/ext2fs To: "Pedro F. Giffuni" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 02:54:38 -0000 On 18 January 2016 at 15:39, Pedro F. Giffuni wrote: > Author: pfg > Date: Mon Jan 18 15:39:32 2016 > New Revision: 294271 > URL: https://svnweb.freebsd.org/changeset/base/294271 > > Log: > MFC r293680 > ext4: add support for reading sparse files ia64 and powerpc LINT kernels are now failing with: In file included from /scratch/tmp/emaste/10/sys/fs/ext2fs/inode.h:46, from /scratch/tmp/emaste/10/sys/fs/ext2fs/ext2_alloc.c:50: /scratch/tmp/emaste/10/sys/fs/ext2fs/ext2_extents.h:91: warning: declaration does not declare anything From owner-svn-src-stable@freebsd.org Fri Jan 22 02:56:56 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20447A8C47A; Fri, 22 Jan 2016 02:56:56 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22c.google.com (mail-pf0-x22c.google.com [IPv6:2607:f8b0:400e:c00::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E43E81238; Fri, 22 Jan 2016 02:56:55 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22c.google.com with SMTP id n128so33825604pfn.3; Thu, 21 Jan 2016 18:56:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=idm9Aqo0kTtD/KfU0g5wQJdF6Q4S+78pTicWZVvKfbU=; b=eeIlwkHG9sPO9AWyes+hs7eLBQiAuK1nYI1tl1ydr+rpg7TZoV4Y5pWeAMRDUGS17C aUIEQ3nnlZ6ECerXYox1TacCnTBawYxT7PuV9ekBW09booZIw1BVBI1Ayrz73u7bb15K YSQSjtg1tmwgdVI+j5SGcTPkFXFQ5hjjg9qKgPi1NMOWfgQyrmA2fLV1C0Wb3W99/nDa JkktrBSZmX6tJL04TYoFDAAIJ0nnqgz0Oewbn2BOftG4DAb05hcwjdvRsbfkcPrCHVs8 d5UsWa09hx7PWFuTXem2HrrvJY1nr5ORioB3aqKSK+L6sROulgmzWc9i0yTKU2Hcp8Jx fhzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=idm9Aqo0kTtD/KfU0g5wQJdF6Q4S+78pTicWZVvKfbU=; b=DQWGmRoRoAB+ndFWzHXLDgdB2FgMXBqhbCgIrEkkq6CnN5pEdv+Hlkg+gY/M2lEo+2 eCQuAJuNSJ3SZZisWdz3m1BwtbuPzGWElC7KGgvY8rsPgfALQ+0T5FWnmh7cWjTWCK7C J9RIesY0StmrM1ph8fHD/HPXb6riDq1LaIE3iwavTOzy2cnPEJTRqf7jNVH4dkkk9z91 7I16RZAsd6ztGByQ/02qD0S4nRwQcY53Ukjt8ycONd2rHVHUR4NASNroAUzXM2ZWKa3o XDUdjeDq3BNQhUtkfv7YJTwbDTq+lBvKc3ZytxMOTRQfaE+6LTbXt95UEOko4EBjw+wt W0pg== X-Gm-Message-State: AG10YORTLlbil3TyRxJQVCNPkEoK5MdEUGfSJ49TcVkCf8SJV3I4boXhmvFIna4Wo6YExQ== X-Received: by 10.98.72.156 with SMTP id q28mr981691pfi.161.1453431415525; Thu, 21 Jan 2016 18:56:55 -0800 (PST) Received: from [33.170.205.136] (ma02036d0.tmodns.net. [208.54.32.160]) by smtp.gmail.com with ESMTPSA id d21sm5540559pfj.32.2016.01.21.18.56.53 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jan 2016 18:56:54 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r294271 - stable/10/sys/fs/ext2fs From: NGie Cooper X-Mailer: iPhone Mail (13C75) In-Reply-To: Date: Thu, 21 Jan 2016 18:56:52 -0800 Cc: "Pedro F. Giffuni" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5C28D876-15A3-44EA-BA4E-1890B0307647@gmail.com> References: <201601181539.u0IFdWjU003727@repo.freebsd.org> To: Ed Maste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 02:56:56 -0000 > On Jan 21, 2016, at 18:54, Ed Maste wrote: >=20 >> On 18 January 2016 at 15:39, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Mon Jan 18 15:39:32 2016 >> New Revision: 294271 >> URL: https://svnweb.freebsd.org/changeset/base/294271 >>=20 >> Log: >> MFC r293680 >> ext4: add support for reading sparse files >=20 > ia64 and powerpc LINT kernels are now failing with: >=20 > In file included from /scratch/tmp/emaste/10/sys/fs/ext2fs/inode.h:46, > from /scratch/tmp/emaste/10/sys/fs/ext2fs/ext2_alloc.c:50:= > /scratch/tmp/emaste/10/sys/fs/ext2fs/ext2_extents.h:91: warning: > declaration does not declare anything glebius is aware and is working on MFCing the sys/conf changes to enable ano= nymous unions with gcc in the kernel build. Thanks! -NGie= From owner-svn-src-stable@freebsd.org Fri Jan 22 02:59:01 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5EABA8C572; Fri, 22 Jan 2016 02:59:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D75C1596; Fri, 22 Jan 2016 02:59:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u0M2x0Dv019116 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 21 Jan 2016 18:59:00 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u0M2x0G4019115; Thu, 21 Jan 2016 18:59:00 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 21 Jan 2016 18:59:00 -0800 From: Gleb Smirnoff To: NGie Cooper Cc: Ed Maste , svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "Pedro F. Giffuni" , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org Subject: Re: svn commit: r294271 - stable/10/sys/fs/ext2fs Message-ID: <20160122025900.GT1444@FreeBSD.org> References: <201601181539.u0IFdWjU003727@repo.freebsd.org> <5C28D876-15A3-44EA-BA4E-1890B0307647@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5C28D876-15A3-44EA-BA4E-1890B0307647@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 02:59:01 -0000 On Thu, Jan 21, 2016 at 06:56:52PM -0800, NGie Cooper wrote: N> >> Author: pfg N> >> Date: Mon Jan 18 15:39:32 2016 N> >> New Revision: 294271 N> >> URL: https://svnweb.freebsd.org/changeset/base/294271 N> >> N> >> Log: N> >> MFC r293680 N> >> ext4: add support for reading sparse files N> > N> > ia64 and powerpc LINT kernels are now failing with: N> > N> > In file included from /scratch/tmp/emaste/10/sys/fs/ext2fs/inode.h:46, N> > from /scratch/tmp/emaste/10/sys/fs/ext2fs/ext2_alloc.c:50: N> > /scratch/tmp/emaste/10/sys/fs/ext2fs/ext2_extents.h:91: warning: N> > declaration does not declare anything N> N> glebius is aware and is working on MFCing the sys/conf changes to enable anonymous unions with gcc in the kernel build. Ehrm, I'm aware and not working on that. I just pointed on the commit that is required to be merged. -- Totus tuus, Glebius. From owner-svn-src-stable@freebsd.org Fri Jan 22 03:21:23 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11187A8CE20 for ; Fri, 22 Jan 2016 03:21:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm17-vm1.bullet.mail.bf1.yahoo.com (nm17-vm1.bullet.mail.bf1.yahoo.com [98.139.213.55]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE9B3186A for ; Fri, 22 Jan 2016 03:21:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1453432526; bh=9kVv/CUcpgqhLnwKuC5YcAb1VLAKDlS6yUZ94qJHI0Y=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=RbzN8Wob2vEXXxcQQJ0/p6xTUDqUcfZ0aDKXiwTQxzAh3ETSJk01FGQG+pM77RyIPCHn9HopqOLrM/p1OVAkYoKw/Z0TDeH5hyhAU3xDYBc2Fm+OKUyneZISIn105zjMLhIF/3G8sJmxUn5RdGDiRiNrOTZypkyRzvj4517X/CUhshkKL8qRv+k7sGuI6wTMf/oxJ5b9+8FH4I5uH34RLi+HhgO1Tr8XB5EWFQGMv2gfq7fIhpGzndKvX+piq7cccCheH+J7qvihDjYsvOdGJvlbiK8YZrp08FRoFKrZ5If5Nusqh4HH3xeshi+TGmHx69e2XOJP4zyLS2dHmZV11Q== Received: from [66.196.81.170] by nm17.bullet.mail.bf1.yahoo.com with NNFMP; 22 Jan 2016 03:15:26 -0000 Received: from [98.139.211.199] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 22 Jan 2016 03:15:26 -0000 Received: from [127.0.0.1] by smtp208.mail.bf1.yahoo.com with NNFMP; 22 Jan 2016 03:15:26 -0000 X-Yahoo-Newman-Id: 486577.93888.bm@smtp208.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: fNHZiGIVM1nyudlHuN.BrhPp.ll0XxGZYaIwzV.YfljQbiQ wWxymmF2e4kyBurb3BWS5TZz2JUqI4eHU._gyLLzSD.nvNleIscCSxuWbQIu I8kSg9mHLq49ZGjmOrtUNlekGELLXRrqEkiR8wem036dFDxeLobIKPKelK2X RgKGGBaELrmphFUA3wGvNw1DYWH8zcfo4t8kz5tgY8iEIawEq4Iy_T_ez4NG _Zw8dbVZ8uSUujVztwxSwOrSErWxX3Mm0ee7RqUfUJpPBqkrO3in3KuM_zDj QXiIRCpErLrazelqJ1LA75q6gDoLf1lB8tW_WOn9XmjgA5ovmeEC.GQ2dhFB DqsM_dsPDMfel0tnk9t50d5xKVQWqH2DKQhD3bT7V8QSzm6BFag6Zm5L3C3r UZ0mD27UXhK5.OZF5rzLJTTP9zfcW2eWGSCM6mJbqiIIKHeGERj7yAZ_h8u8 vNXo5bvoB1OqE06xnv7988iJ0Rk9GE4FwmcWE.waDVBGe4aE6AdpAWjDFmQt wC_nYWDkPlwF4k6A1KsDQ._jfd4zjhkwb X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r294271 - stable/10/sys/fs/ext2fs To: Gleb Smirnoff , NGie Cooper References: <201601181539.u0IFdWjU003727@repo.freebsd.org> <5C28D876-15A3-44EA-BA4E-1890B0307647@gmail.com> <20160122025900.GT1444@FreeBSD.org> Cc: Ed Maste , svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org From: Pedro Giffuni Message-ID: <56A19EDC.60307@FreeBSD.org> Date: Thu, 21 Jan 2016 22:15:40 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160122025900.GT1444@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 03:21:23 -0000 Hello; Sorry for the delay in replying, I just noticed this. On 01/21/16 21:59, Gleb Smirnoff wrote: > On Thu, Jan 21, 2016 at 06:56:52PM -0800, NGie Cooper wrote: > N> >> Author: pfg > N> >> Date: Mon Jan 18 15:39:32 2016 > N> >> New Revision: 294271 > N> >> URL: https://svnweb.freebsd.org/changeset/base/294271 > N> >> > N> >> Log: > N> >> MFC r293680 > N> >> ext4: add support for reading sparse files > N> > > N> > ia64 and powerpc LINT kernels are now failing with: > N> > > N> > In file included from /scratch/tmp/emaste/10/sys/fs/ext2fs/inode.h:46, > N> > from /scratch/tmp/emaste/10/sys/fs/ext2fs/ext2_alloc.c:50: > N> > /scratch/tmp/emaste/10/sys/fs/ext2fs/ext2_extents.h:91: warning: > N> > declaration does not declare anything > N> > N> glebius is aware and is working on MFCing the sys/conf changes to enable anonymous unions with gcc in the kernel build. > > Ehrm, I'm aware and not working on that. I just pointed on the commit that is > required to be merged. > I have little interest in fixing yet again issues related to gcc. I will revert the commit. Pedro. From owner-svn-src-stable@freebsd.org Fri Jan 22 03:25:08 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D6DCA8CFE2; Fri, 22 Jan 2016 03:25:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57EC51B2A; Fri, 22 Jan 2016 03:25:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0M3P7Gk095577; Fri, 22 Jan 2016 03:25:07 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0M3P730095573; Fri, 22 Jan 2016 03:25:07 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601220325.u0M3P730095573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 22 Jan 2016 03:25:07 +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: r294545 - stable/10/sys/fs/ext2fs 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 03:25:08 -0000 Author: pfg Date: Fri Jan 22 03:25:06 2016 New Revision: 294545 URL: https://svnweb.freebsd.org/changeset/base/294545 Log: Revert r294271: ext4: add support for reading sparse files Our older GCC can't handle anonymous unions, so ia64 and powerpc LINT kernels are now failing. Modified: stable/10/sys/fs/ext2fs/ext2_bmap.c stable/10/sys/fs/ext2fs/ext2_extents.c stable/10/sys/fs/ext2fs/ext2_extents.h stable/10/sys/fs/ext2fs/ext2_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_bmap.c Fri Jan 22 03:15:53 2016 (r294544) +++ stable/10/sys/fs/ext2fs/ext2_bmap.c Fri Jan 22 03:25:06 2016 (r294545) @@ -102,6 +102,9 @@ ext4_bmapext(struct vnode *vp, int32_t b fs = ip->i_e2fs; lbn = bn; + /* + * TODO: need to implement read ahead to improve the performance. + */ if (runp != NULL) *runp = 0; @@ -109,25 +112,15 @@ ext4_bmapext(struct vnode *vp, int32_t b *runb = 0; ext4_ext_find_extent(fs, ip, lbn, &path); - if (path.ep_is_sparse) { - *bnp = -1; - if (runp != NULL) - *runp = path.ep_sparse_ext.e_len - - (lbn - path.ep_sparse_ext.e_blk) - 1; - } else { - ep = path.ep_ext; - if (ep == NULL) - ret = EIO; - else { - *bnp = fsbtodb(fs, lbn - ep->e_blk + - (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); + ep = path.ep_ext; + if (ep == NULL) + ret = EIO; + else { + *bnp = fsbtodb(fs, lbn - ep->e_blk + + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); - if (*bnp == 0) - *bnp = -1; - - if (runp != NULL) - *runp = ep->e_len - (lbn - ep->e_blk) - 1; - } + if (*bnp == 0) + *bnp = -1; } if (path.ep_bp != NULL) { Modified: stable/10/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_extents.c Fri Jan 22 03:15:53 2016 (r294544) +++ stable/10/sys/fs/ext2fs/ext2_extents.c Fri Jan 22 03:25:06 2016 (r294545) @@ -66,14 +66,13 @@ static void ext4_ext_binsearch(struct inode *ip, struct ext4_extent_path *path, daddr_t lbn) { struct ext4_extent_header *ehp = path->ep_header; - struct ext4_extent *first, *l, *r, *m; + struct ext4_extent *l, *r, *m; if (ehp->eh_ecount == 0) return; - first = (struct ext4_extent *)(char *)(ehp + 1); - l = first; - r = first + ehp->eh_ecount - 1; + l = (struct ext4_extent *)(char *)(ehp + 1); + r = (struct ext4_extent *)(char *)(ehp + 1) + ehp->eh_ecount - 1; while (l <= r) { m = l + (r - l) / 2; if (lbn < m->e_blk) @@ -82,25 +81,7 @@ ext4_ext_binsearch(struct inode *ip, str l = m + 1; } - if (l == first) { - path->ep_sparse_ext.e_blk = lbn; - path->ep_sparse_ext.e_len = first->e_blk - lbn; - path->ep_sparse_ext.e_start_hi = 0; - path->ep_sparse_ext.e_start_lo = 0; - path->ep_is_sparse = 1; - return; - } path->ep_ext = l - 1; - if (path->ep_ext->e_blk + path->ep_ext->e_len <= lbn) { - path->ep_sparse_ext.e_blk = lbn; - if (l <= (first + ehp->eh_ecount - 1)) - path->ep_sparse_ext.e_len = l->e_blk - lbn; - else // XXX: where does it end? - path->ep_sparse_ext.e_len = 1; - path->ep_sparse_ext.e_start_hi = 0; - path->ep_sparse_ext.e_start_lo = 0; - path->ep_is_sparse = 1; - } } /* @@ -188,7 +169,6 @@ ext4_ext_find_extent(struct m_ext2fs *fs path->ep_depth = i; path->ep_ext = NULL; path->ep_index = NULL; - path->ep_is_sparse = 0; ext4_ext_binsearch(ip, path, lbn); return (path); Modified: stable/10/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_extents.h Fri Jan 22 03:15:53 2016 (r294544) +++ stable/10/sys/fs/ext2fs/ext2_extents.h Fri Jan 22 03:25:06 2016 (r294545) @@ -84,11 +84,7 @@ struct ext4_extent_cache { struct ext4_extent_path { uint16_t ep_depth; struct buf *ep_bp; - int ep_is_sparse; - union { - struct ext4_extent ep_sparse_ext; - struct ext4_extent *ep_ext; - }; + struct ext4_extent *ep_ext; struct ext4_extent_index *ep_index; struct ext4_extent_header *ep_header; }; Modified: stable/10/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vnops.c Fri Jan 22 03:15:53 2016 (r294544) +++ stable/10/sys/fs/ext2fs/ext2_vnops.c Fri Jan 22 03:25:06 2016 (r294545) @@ -1787,7 +1787,6 @@ ext2_ioctl(struct vop_ioctl_args *ap) static int ext4_ext_read(struct vop_read_args *ap) { - static unsigned char zeroes[EXT2_MAX_BLOCK_SIZE]; struct vnode *vp; struct inode *ip; struct uio *uio; @@ -1832,15 +1831,11 @@ ext4_ext_read(struct vop_read_args *ap) switch (cache_type) { case EXT4_EXT_CACHE_NO: ext4_ext_find_extent(fs, ip, lbn, &path); - if (path.ep_is_sparse) - ep = &path.ep_sparse_ext; - else - ep = path.ep_ext; + ep = path.ep_ext; if (ep == NULL) return (EIO); - ext4_ext_put_cache(ip, ep, - path.ep_is_sparse ? EXT4_EXT_CACHE_GAP : EXT4_EXT_CACHE_IN); + ext4_ext_put_cache(ip, ep, EXT4_EXT_CACHE_IN); newblk = lbn - ep->e_blk + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32); @@ -1853,7 +1848,7 @@ ext4_ext_read(struct vop_read_args *ap) case EXT4_EXT_CACHE_GAP: /* block has not been allocated yet */ - break; + return (0); case EXT4_EXT_CACHE_IN: newblk = lbn - nex.e_blk + (nex.e_start_lo | @@ -1864,34 +1859,24 @@ ext4_ext_read(struct vop_read_args *ap) panic("%s: invalid cache type", __func__); } - if (cache_type == EXT4_EXT_CACHE_GAP || - (cache_type == EXT4_EXT_CACHE_NO && path.ep_is_sparse)) { - if (xfersize > sizeof(zeroes)) - xfersize = sizeof(zeroes); - error = uiomove(zeroes, xfersize, uio); - if (error) - return (error); - } else { - error = bread(ip->i_devvp, fsbtodb(fs, newblk), size, - NOCRED, &bp); - if (error) { - brelse(bp); - return (error); - } + error = bread(ip->i_devvp, fsbtodb(fs, newblk), size, NOCRED, &bp); + if (error) { + brelse(bp); + return (error); + } - size -= bp->b_resid; - if (size < xfersize) { - if (size == 0) { - bqrelse(bp); - break; - } - xfersize = size; + size -= bp->b_resid; + if (size < xfersize) { + if (size == 0) { + bqrelse(bp); + break; } - error = uiomove(bp->b_data + blkoffset, xfersize, uio); - bqrelse(bp); - if (error) - return (error); + xfersize = size; } + error = uiomove(bp->b_data + blkoffset, (int)xfersize, uio); + bqrelse(bp); + if (error) + return (error); } return (0); From owner-svn-src-stable@freebsd.org Fri Jan 22 07:23:52 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3217BA8B2D4; Fri, 22 Jan 2016 07:23:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCB531AF4; Fri, 22 Jan 2016 07:23:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0M7NoU2065232; Fri, 22 Jan 2016 07:23:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0M7No1p065231; Fri, 22 Jan 2016 07:23:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601220723.u0M7No1p065231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Jan 2016 07:23:50 +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: r294550 - stable/10/tools/regression 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 07:23:52 -0000 Author: ngie Date: Fri Jan 22 07:23:50 2016 New Revision: 294550 URL: https://svnweb.freebsd.org/changeset/base/294550 Log: MFC r293048,r293444: r293048: - Use a temporary file for the temporary md(4) devices instead of hardcoding it - Remove the temporary file in the cleanup routine r293444: - Move functions that might be used in class-specific cleanup functions (geom_test_cleanup, etc) down so the testcases don't emit noise when bailing - Conform to the TAP protocol better when dealing with classes that can't be loaded and with temporary files that can't be allocated for tracking md(4) devices. Modified: stable/10/tools/regression/geom_subr.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/geom_subr.sh ============================================================================== --- stable/10/tools/regression/geom_subr.sh Fri Jan 22 07:22:30 2016 (r294549) +++ stable/10/tools/regression/geom_subr.sh Fri Jan 22 07:23:50 2016 (r294550) @@ -1,13 +1,6 @@ #!/bin/sh # $FreeBSD$ -if [ $(id -u) -ne 0 ]; then - echo 'Tests must be run as root' - echo 'Bail out!' - exit 1 -fi -kldstat -q -m g_${class} || geom ${class} load || exit 1 - devwait() { while :; do @@ -18,13 +11,6 @@ devwait() done } -# Need to keep track of the test md devices to avoid the scenario where a test -# failing will cause the other tests to bomb out, or a test failing will leave -# a large number of md(4) devices lingering around -: ${TMPDIR=/tmp} -export TMPDIR -TEST_MDS_FILE=${TMPDIR}/test_mds - attach_md() { local test_md @@ -38,11 +24,37 @@ geom_test_cleanup() { local test_md - if [ -f $TEST_MDS_FILE ]; then + if [ -f "$TEST_MDS_FILE" ]; then while read test_md; do # The "#" tells the TAP parser this is a comment echo "# Removing test memory disk: $test_md" mdconfig -d -u $test_md done < $TEST_MDS_FILE fi + rm -f "$TEST_MDS_FILE" } + +if [ $(id -u) -ne 0 ]; then + echo 'Tests must be run as root' + echo 'Bail out!' + exit 1 +fi +# If the geom class isn't already loaded, try loading it. +if ! kldstat -q -m g_${class}; then + if ! geom ${class} load; then + echo "Could not load module for geom class=${class}" + echo 'Bail out!' + exit 1 + fi +fi + +# Need to keep track of the test md devices to avoid the scenario where a test +# failing will cause the other tests to bomb out, or a test failing will leave +# a large number of md(4) devices lingering around +: ${TMPDIR=/tmp} +export TMPDIR +if ! TEST_MDS_FILE=$(mktemp ${TMPDIR}/test_mds.XXXXXX); then + echo 'Failed to create temporary file for tracking the test md(4) devices' + echo 'Bail out!' + exit 1 +fi From owner-svn-src-stable@freebsd.org Fri Jan 22 07:25:42 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 845EEA8B376; Fri, 22 Jan 2016 07:25:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 473411C88; Fri, 22 Jan 2016 07:25:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0M7Pf7Z065388; Fri, 22 Jan 2016 07:25:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0M7PftU065387; Fri, 22 Jan 2016 07:25:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601220725.u0M7PftU065387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Jan 2016 07:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294551 - stable/9/tools/regression X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 07:25:42 -0000 Author: ngie Date: Fri Jan 22 07:25:41 2016 New Revision: 294551 URL: https://svnweb.freebsd.org/changeset/base/294551 Log: MFstable/10 r294550: MFC r293048,r293444: r293048: - Use a temporary file for the temporary md(4) devices instead of hardcoding it - Remove the temporary file in the cleanup routine r293444: - Move functions that might be used in class-specific cleanup functions (geom_test_cleanup, etc) down so the testcases don't emit noise when bailing - Conform to the TAP protocol better when dealing with classes that can't be loaded and with temporary files that can't be allocated for tracking md(4) devices. Modified: stable/9/tools/regression/geom_subr.sh Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) Modified: stable/9/tools/regression/geom_subr.sh ============================================================================== --- stable/9/tools/regression/geom_subr.sh Fri Jan 22 07:23:50 2016 (r294550) +++ stable/9/tools/regression/geom_subr.sh Fri Jan 22 07:25:41 2016 (r294551) @@ -1,13 +1,6 @@ #!/bin/sh # $FreeBSD$ -if [ $(id -u) -ne 0 ]; then - echo 'Tests must be run as root' - echo 'Bail out!' - exit 1 -fi -kldstat -q -m g_${class} || geom ${class} load || exit 1 - devwait() { while :; do @@ -18,13 +11,6 @@ devwait() done } -# Need to keep track of the test md devices to avoid the scenario where a test -# failing will cause the other tests to bomb out, or a test failing will leave -# a large number of md(4) devices lingering around -: ${TMPDIR=/tmp} -export TMPDIR -TEST_MDS_FILE=${TMPDIR}/test_mds - attach_md() { local test_md @@ -38,11 +24,37 @@ geom_test_cleanup() { local test_md - if [ -f $TEST_MDS_FILE ]; then + if [ -f "$TEST_MDS_FILE" ]; then while read test_md; do # The "#" tells the TAP parser this is a comment echo "# Removing test memory disk: $test_md" mdconfig -d -u $test_md done < $TEST_MDS_FILE fi + rm -f "$TEST_MDS_FILE" } + +if [ $(id -u) -ne 0 ]; then + echo 'Tests must be run as root' + echo 'Bail out!' + exit 1 +fi +# If the geom class isn't already loaded, try loading it. +if ! kldstat -q -m g_${class}; then + if ! geom ${class} load; then + echo "Could not load module for geom class=${class}" + echo 'Bail out!' + exit 1 + fi +fi + +# Need to keep track of the test md devices to avoid the scenario where a test +# failing will cause the other tests to bomb out, or a test failing will leave +# a large number of md(4) devices lingering around +: ${TMPDIR=/tmp} +export TMPDIR +if ! TEST_MDS_FILE=$(mktemp ${TMPDIR}/test_mds.XXXXXX); then + echo 'Failed to create temporary file for tracking the test md(4) devices' + echo 'Bail out!' + exit 1 +fi From owner-svn-src-stable@freebsd.org Fri Jan 22 08:19:31 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DD8DA8CB1A; Fri, 22 Jan 2016 08:19:31 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F14DA1949; Fri, 22 Jan 2016 08:19:30 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id n5so119359689wmn.0; Fri, 22 Jan 2016 00:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=tRbOaept8Y6omr2/qEIB5+/uX9/f5iPJrenwoPnCN7E=; b=Ye9j8bBO4MJHna5/uXds0bhn4bKgKJUQPmWk/nhP+ntQ14Gl8rj4NViKhEsxsbrdWM NEw/NN8a+A4nhY+ZKN5mvg4+peOBpre9/4EfeAgiVkU4ZUzHdGwEFqgXdbpzF3IXnciE 2xUxj6kEBwlMngSDk/Mn1yjey85spLLEQ/a5vI8Zdm1ECt86tWGRNumXDsdwyWCrFP0l gj2jeFgrpu9EP2AD+uc5mu+GibKYsFMw2p5mY1d6qBqX5b9sQ4VgQy33WBANSTLN0e05 3XyZikK3LqykgUo65UC5IDGB0O0ShubRJcDHip2cHdsuhXvwnWNRVy0Nz+ExmTwj2m8U yFVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=tRbOaept8Y6omr2/qEIB5+/uX9/f5iPJrenwoPnCN7E=; b=T35wVaDpFLy2xedvo/Yjf7/vRbEf9Htn9Jv80TFdJDycC3IEG4fkFwdkIzxghsX6Ew oT7YsggaJdPZtlDASas8Qd85UzMGZK7ZDqhS6yoazHmeQRBtcPWSl08NBUM4K7YgKnFQ QKt51w76dRx5osQbQyEOM5zHeG+RHA1vGsXrb//zQmZ22JAatHOdH6yUzSjsTnkmh76i 2qoZYnjPNc0QaRIDIL/cygI1RGUMP1h3Tx9hkuRShdQIPvHG1c1I9cn+H1BK1DgGJ1IU HObxSPVeN9KNnQaGVpq8HfYj5sk9JZBuA8yUsnyg0f9Y/vv/9Vc9MN56iE07UjgmmTYf In3Q== X-Gm-Message-State: AG10YOTesBYuWGhn+rSZf0SNgfdiSsDKVgnkPuqykDLt5KFpZWrkXEldjmTlmxscaSbrcw== X-Received: by 10.194.201.134 with SMTP id ka6mr1801881wjc.116.1453450769464; Fri, 22 Jan 2016 00:19:29 -0800 (PST) Received: from [172.16.1.30] (50.Red-88-7-9.staticIP.rima-tde.net. [88.7.9.50]) by smtp.gmail.com with ESMTPSA id s2sm4781319wjs.43.2016.01.22.00.19.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2016 00:19:28 -0800 (PST) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Subject: Re: svn commit: r294417 - in stable/10/sys/boot: common fdt forth i386/libi386 i386/loader To: Devin Teske References: <201601201323.u0KDN2s0057920@repo.freebsd.org> <16A6EF29-CA34-43BC-8587-51C7B71BBE72@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org, Baptiste Daroussin From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Message-ID: <56A1E60A.6080808@FreeBSD.org> Date: Fri, 22 Jan 2016 09:19:22 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <16A6EF29-CA34-43BC-8587-51C7B71BBE72@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 08:19:31 -0000 El 21/01/16 a les 21.38, Devin Teske ha escrit: > >> On Jan 20, 2016, at 5:23 AM, Roger Pau Monné wrote: >> >> Author: royger >> Date: Wed Jan 20 13:23:02 2016 >> New Revision: 294417 >> URL: https://svnweb.freebsd.org/changeset/base/294417 >> >> Log: >> MFC r277215, r277291, r277418, r280953 and r280954: >> >> loader: implement multiboot support for Xen Dom0 >> >> Note that only the subset of the multiboot specification needed in order to >> boot a Xen Dom0 is implemented. >> >> Sponsored by: Citrix Systems R&D >> > > > Two issues with this merge. > > First, this port now needs to be re-educated: > https://svnweb.freebsd.org/ports/head/emulators/xen-kernel/Makefile?view=markup > > 46 .if ${OSVERSION} < 1100055 > 47 IGNORE= Only supported on recent FreeBSD 11 > 48 .endif > > Looking at your MFC, it looks like the OSVERSION check should allow some version of 10. > > Unfortunately (second issue), this patch doesn't touch stable/10/sys/sys/param.h so the port has no clear way of accurately making sure you're on a 10.x release that supports Xen. Hm, no. This is a backport of the loader changes only, in order to make it possible to boot a HEAD kernel plus Xen on a 10 world (and to make it easier to MFC other loader changes to 10). The stable/10 kernel is still not able to run as Xen Dom0, so the port is correct. That's why I haven't added 'Relnotes: yes' to the commit message :). Roger. From owner-svn-src-stable@freebsd.org Fri Jan 22 09:23:18 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EADFBA8A84B; Fri, 22 Jan 2016 09:23:18 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8A2C111D; Fri, 22 Jan 2016 09:23:18 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aMXw2-000KLD-31; Fri, 22 Jan 2016 12:23:14 +0300 Date: Fri, 22 Jan 2016 12:23:14 +0300 From: Slawa Olhovchenkov To: Gleb Smirnoff Cc: NGie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-10@freebsd.org" Subject: Re: svn commit: r293391 - stable/10 Message-ID: <20160122092313.GL88527@zxy.spb.ru> References: <201601072310.u07NAiBY085842@repo.freebsd.org> <20160122002933.GI37895@zxy.spb.ru> <20160122021828.GK88527@zxy.spb.ru> <20160122022505.GQ1444@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160122022505.GQ1444@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 09:23:19 -0000 On Thu, Jan 21, 2016 at 06:25:05PM -0800, Gleb Smirnoff wrote: > On Fri, Jan 22, 2016 at 05:18:28AM +0300, Slawa Olhovchenkov wrote: > S> > On Thu, Jan 21, 2016 at 4:29 PM, Slawa Olhovchenkov wrote: > S> > > On Thu, Jan 07, 2016 at 11:10:44PM +0000, Gleb Smirnoff wrote: > S> > > > S> > >> Author: glebius > S> > >> Date: Thu Jan 7 23:10:44 2016 > S> > >> New Revision: 293391 > S> > >> URL: https://svnweb.freebsd.org/changeset/base/293391 > S> > >> > S> > >> Log: > S> > >> Merge r293282 from head: > S> > >> Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF > S> > >> won't be installed, only the first one would. > S> > >> > S> > >> Turn NO_INSTALLEXTRAKERNELS=yes on stable/10 to preserve original > S> > >> behaviour of not installing additional kernels built. > S> > > > S> > > What?! > S> > > By default additional kernels built will be installed. > S> > > S> > Agreed, but they would overwrite one another, unless you used > S> > INSTKERNNAME appropriately. > S> > S> I am use relese.sh with KERNEL="GENEROC VSTREAM" and nothing > S> overwritied. > S> INSTKERNNAME properly used with KERNCONF by Makefile.inc1 > S> (kernel for first and kernel.${_kernel} for other. > S> > S> Now relese.sh can't used with multiple kernels, this is POLA > S> violation. > > You are confusing release.sh with regular build. Now in head regular > build behaves same as release.sh. But in stable/10 NO_INSTALLEXTRAKERNELS=1 > to provide old behaviour. No old behaviour in stable/10 with NO_INSTALLEXTRAKERNELS=1. I am lost six hours now to found this. From owner-svn-src-stable@freebsd.org Fri Jan 22 10:02:43 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0646A8CAC4; Fri, 22 Jan 2016 10:02:43 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E2F517EB; Fri, 22 Jan 2016 10:02:43 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aMYYD-000LCV-8o; Fri, 22 Jan 2016 13:02:41 +0300 Date: Fri, 22 Jan 2016 13:02:41 +0300 From: Slawa Olhovchenkov To: NGie Cooper Cc: Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-10@freebsd.org" Subject: Re: svn commit: r293391 - stable/10 Message-ID: <20160122100241.GN88527@zxy.spb.ru> References: <201601072310.u07NAiBY085842@repo.freebsd.org> <20160122002933.GI37895@zxy.spb.ru> <20160122021828.GK88527@zxy.spb.ru> <20160122022505.GQ1444@FreeBSD.org> <99FC08AC-8F7F-4291-88B7-04FC26BEDF1C@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <99FC08AC-8F7F-4291-88B7-04FC26BEDF1C@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 10:02:44 -0000 On Thu, Jan 21, 2016 at 06:49:49PM -0800, NGie Cooper wrote: > > > On Jan 21, 2016, at 18:25, Gleb Smirnoff wrote: > > > > On Fri, Jan 22, 2016 at 05:18:28AM +0300, Slawa Olhovchenkov wrote: > > S> > On Thu, Jan 21, 2016 at 4:29 PM, Slawa Olhovchenkov wrote: > > S> > > On Thu, Jan 07, 2016 at 11:10:44PM +0000, Gleb Smirnoff wrote: > > S> > > > > S> > >> Author: glebius > > S> > >> Date: Thu Jan 7 23:10:44 2016 > > S> > >> New Revision: 293391 > > S> > >> URL: https://svnweb.freebsd.org/changeset/base/293391 > > S> > >> > > S> > >> Log: > > S> > >> Merge r293282 from head: > > S> > >> Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF > > S> > >> won't be installed, only the first one would. > > S> > >> > > S> > >> Turn NO_INSTALLEXTRAKERNELS=yes on stable/10 to preserve original > > S> > >> behaviour of not installing additional kernels built. > > S> > > > > S> > > What?! > > S> > > By default additional kernels built will be installed. > > S> > > > S> > Agreed, but they would overwrite one another, unless you used > > S> > INSTKERNNAME appropriately. > > S> > > S> I am use relese.sh with KERNEL="GENEROC VSTREAM" and nothing > > S> overwritied. > > S> INSTKERNNAME properly used with KERNCONF by Makefile.inc1 > > S> (kernel for first and kernel.${_kernel} for other. > > S> > > S> Now relese.sh can't used with multiple kernels, this is POLA > > S> violation. > > > > You are confusing release.sh with regular build. Now in head regular > > build behaves same as release.sh. But in stable/10 NO_INSTALLEXTRAKERNELS=1 > > to provide old behaviour. > > It should be ?=, not = then? Now it's always on.. With ?= this is also break expected, used and documented behaivor for relese.sh with multiple kernel. From owner-svn-src-stable@freebsd.org Fri Jan 22 15:55:23 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A66CFA8C21B; Fri, 22 Jan 2016 15:55:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4469C1221; Fri, 22 Jan 2016 15:55:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0MFtMd7031587; Fri, 22 Jan 2016 15:55:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0MFtM3H031584; Fri, 22 Jan 2016 15:55:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601221555.u0MFtM3H031584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 22 Jan 2016 15:55:22 +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: r294569 - in stable/10: contrib/ntp contrib/ntp/html contrib/ntp/include contrib/ntp/libntp contrib/ntp/ntpd contrib/ntp/ntpdc contrib/ntp/ntpq contrib/ntp/ntpsnmpd contrib/ntp/scripts ... 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 15:55:23 -0000 Author: delphij Date: Fri Jan 22 15:55:21 2016 New Revision: 294569 URL: https://svnweb.freebsd.org/changeset/base/294569 Log: MFC r294554: MFV r294491: ntp 4.2.8p6. Security: CVE-2015-7973, CVE-2015-7974, CVE-2015-7975 Security: CVE-2015-7976, CVE-2015-7977, CVE-2015-7978 Security: CVE-2015-7979, CVE-2015-8138, CVE-2015-8139 Security: CVE-2015-8140, CVE-2015-8158 With hat: so Added: stable/10/contrib/ntp/include/ntp_keyacc.h - copied unchanged from r294554, head/contrib/ntp/include/ntp_keyacc.h stable/10/contrib/ntp/libntp/is_ip_address.c - copied unchanged from r294554, head/contrib/ntp/libntp/is_ip_address.c Modified: stable/10/contrib/ntp/ChangeLog stable/10/contrib/ntp/CommitLog stable/10/contrib/ntp/NEWS stable/10/contrib/ntp/configure stable/10/contrib/ntp/html/miscopt.html stable/10/contrib/ntp/include/Makefile.am stable/10/contrib/ntp/include/Makefile.in stable/10/contrib/ntp/include/ntp.h stable/10/contrib/ntp/include/ntp_io.h stable/10/contrib/ntp/include/ntp_stdlib.h stable/10/contrib/ntp/include/ntp_types.h stable/10/contrib/ntp/include/ntp_worker.h stable/10/contrib/ntp/include/parse.h stable/10/contrib/ntp/libntp/Makefile.am stable/10/contrib/ntp/libntp/Makefile.in stable/10/contrib/ntp/libntp/authkeys.c stable/10/contrib/ntp/libntp/authreadkeys.c stable/10/contrib/ntp/libntp/authusekey.c stable/10/contrib/ntp/libntp/ntp_worker.c stable/10/contrib/ntp/libntp/systime.c stable/10/contrib/ntp/libntp/work_thread.c stable/10/contrib/ntp/ntpd/invoke-ntp.conf.texi stable/10/contrib/ntp/ntpd/invoke-ntp.keys.texi stable/10/contrib/ntp/ntpd/invoke-ntpd.texi stable/10/contrib/ntp/ntpd/keyword-gen-utd stable/10/contrib/ntp/ntpd/keyword-gen.c stable/10/contrib/ntp/ntpd/ntp.conf.5man stable/10/contrib/ntp/ntpd/ntp.conf.5mdoc stable/10/contrib/ntp/ntpd/ntp.conf.def stable/10/contrib/ntp/ntpd/ntp.conf.html stable/10/contrib/ntp/ntpd/ntp.conf.man.in stable/10/contrib/ntp/ntpd/ntp.conf.mdoc.in stable/10/contrib/ntp/ntpd/ntp.keys.5man stable/10/contrib/ntp/ntpd/ntp.keys.5mdoc stable/10/contrib/ntp/ntpd/ntp.keys.def stable/10/contrib/ntp/ntpd/ntp.keys.html stable/10/contrib/ntp/ntpd/ntp.keys.man.in stable/10/contrib/ntp/ntpd/ntp.keys.mdoc.in stable/10/contrib/ntp/ntpd/ntp_config.c stable/10/contrib/ntp/ntpd/ntp_control.c stable/10/contrib/ntp/ntpd/ntp_crypto.c stable/10/contrib/ntp/ntpd/ntp_io.c stable/10/contrib/ntp/ntpd/ntp_keyword.h stable/10/contrib/ntp/ntpd/ntp_parser.c stable/10/contrib/ntp/ntpd/ntp_parser.h stable/10/contrib/ntp/ntpd/ntp_proto.c stable/10/contrib/ntp/ntpd/ntp_request.c stable/10/contrib/ntp/ntpd/ntp_scanner.c stable/10/contrib/ntp/ntpd/ntp_timer.c stable/10/contrib/ntp/ntpd/ntpd-opts.c stable/10/contrib/ntp/ntpd/ntpd-opts.h stable/10/contrib/ntp/ntpd/ntpd.1ntpdman stable/10/contrib/ntp/ntpd/ntpd.1ntpdmdoc stable/10/contrib/ntp/ntpd/ntpd.c stable/10/contrib/ntp/ntpd/ntpd.html stable/10/contrib/ntp/ntpd/ntpd.man.in stable/10/contrib/ntp/ntpd/ntpd.mdoc.in stable/10/contrib/ntp/ntpd/refclock_chu.c stable/10/contrib/ntp/ntpd/refclock_gpsdjson.c stable/10/contrib/ntp/ntpd/refclock_jjy.c stable/10/contrib/ntp/ntpd/refclock_shm.c stable/10/contrib/ntp/ntpdc/invoke-ntpdc.texi stable/10/contrib/ntp/ntpdc/ntpdc-opts.c stable/10/contrib/ntp/ntpdc/ntpdc-opts.h stable/10/contrib/ntp/ntpdc/ntpdc.1ntpdcman stable/10/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc stable/10/contrib/ntp/ntpdc/ntpdc.c stable/10/contrib/ntp/ntpdc/ntpdc.html stable/10/contrib/ntp/ntpdc/ntpdc.man.in stable/10/contrib/ntp/ntpdc/ntpdc.mdoc.in stable/10/contrib/ntp/ntpq/invoke-ntpq.texi stable/10/contrib/ntp/ntpq/ntpq-opts.c stable/10/contrib/ntp/ntpq/ntpq-opts.h stable/10/contrib/ntp/ntpq/ntpq-subs.c stable/10/contrib/ntp/ntpq/ntpq.1ntpqman stable/10/contrib/ntp/ntpq/ntpq.1ntpqmdoc stable/10/contrib/ntp/ntpq/ntpq.c stable/10/contrib/ntp/ntpq/ntpq.html stable/10/contrib/ntp/ntpq/ntpq.man.in stable/10/contrib/ntp/ntpq/ntpq.mdoc.in stable/10/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.html stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in stable/10/contrib/ntp/packageinfo.sh stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in stable/10/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi stable/10/contrib/ntp/scripts/invoke-plot_summary.texi stable/10/contrib/ntp/scripts/invoke-summary.texi stable/10/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait-opts stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.html stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in stable/10/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep-opts stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.html stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in stable/10/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi stable/10/contrib/ntp/scripts/ntptrace/ntptrace-opts stable/10/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman stable/10/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc stable/10/contrib/ntp/scripts/ntptrace/ntptrace.html stable/10/contrib/ntp/scripts/ntptrace/ntptrace.man.in stable/10/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in stable/10/contrib/ntp/scripts/plot_summary-opts stable/10/contrib/ntp/scripts/plot_summary.1plot_summaryman stable/10/contrib/ntp/scripts/plot_summary.1plot_summarymdoc stable/10/contrib/ntp/scripts/plot_summary.html stable/10/contrib/ntp/scripts/plot_summary.man.in stable/10/contrib/ntp/scripts/plot_summary.mdoc.in stable/10/contrib/ntp/scripts/summary-opts stable/10/contrib/ntp/scripts/summary.1summaryman stable/10/contrib/ntp/scripts/summary.1summarymdoc stable/10/contrib/ntp/scripts/summary.html stable/10/contrib/ntp/scripts/summary.man.in stable/10/contrib/ntp/scripts/summary.mdoc.in stable/10/contrib/ntp/scripts/update-leap/invoke-update-leap.texi stable/10/contrib/ntp/scripts/update-leap/update-leap-opts stable/10/contrib/ntp/scripts/update-leap/update-leap.1update-leapman stable/10/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc stable/10/contrib/ntp/scripts/update-leap/update-leap.html stable/10/contrib/ntp/scripts/update-leap/update-leap.man.in stable/10/contrib/ntp/scripts/update-leap/update-leap.mdoc.in stable/10/contrib/ntp/sntp/configure stable/10/contrib/ntp/sntp/crypto.c stable/10/contrib/ntp/sntp/crypto.h stable/10/contrib/ntp/sntp/include/copyright.def stable/10/contrib/ntp/sntp/include/version.def stable/10/contrib/ntp/sntp/include/version.texi stable/10/contrib/ntp/sntp/invoke-sntp.texi stable/10/contrib/ntp/sntp/libopts/configfile.c stable/10/contrib/ntp/sntp/libopts/enum.c stable/10/contrib/ntp/sntp/libopts/find.c stable/10/contrib/ntp/sntp/libopts/init.c stable/10/contrib/ntp/sntp/libopts/load.c stable/10/contrib/ntp/sntp/libopts/makeshell.c stable/10/contrib/ntp/sntp/libopts/nested.c stable/10/contrib/ntp/sntp/libopts/parse-duration.c stable/10/contrib/ntp/sntp/libopts/reset.c stable/10/contrib/ntp/sntp/libopts/save.c stable/10/contrib/ntp/sntp/libopts/tokenize.c stable/10/contrib/ntp/sntp/m4/version.m4 stable/10/contrib/ntp/sntp/main.c stable/10/contrib/ntp/sntp/networking.c stable/10/contrib/ntp/sntp/sntp-opts.c stable/10/contrib/ntp/sntp/sntp-opts.h stable/10/contrib/ntp/sntp/sntp.1sntpman stable/10/contrib/ntp/sntp/sntp.1sntpmdoc stable/10/contrib/ntp/sntp/sntp.html stable/10/contrib/ntp/sntp/sntp.man.in stable/10/contrib/ntp/sntp/sntp.mdoc.in stable/10/contrib/ntp/sntp/tests/crypto.c stable/10/contrib/ntp/sntp/tests/fileHandlingTest.c stable/10/contrib/ntp/sntp/tests/fileHandlingTest.h.in stable/10/contrib/ntp/sntp/tests/keyFile.c stable/10/contrib/ntp/sntp/tests/packetHandling.c stable/10/contrib/ntp/sntp/tests/packetProcessing.c stable/10/contrib/ntp/sntp/tests/run-packetProcessing.c stable/10/contrib/ntp/sntp/unity/unity_internals.h stable/10/contrib/ntp/sntp/version.c stable/10/contrib/ntp/tests/libntp/authkeys.c stable/10/contrib/ntp/tests/libntp/decodenetnum.c stable/10/contrib/ntp/tests/libntp/run-authkeys.c stable/10/contrib/ntp/tests/libntp/run-decodenetnum.c stable/10/contrib/ntp/tests/libntp/run-socktoa.c stable/10/contrib/ntp/tests/libntp/socktoa.c stable/10/contrib/ntp/tests/ntpd/t-ntp_signd.c stable/10/contrib/ntp/util/invoke-ntp-keygen.texi stable/10/contrib/ntp/util/ntp-keygen-opts.c stable/10/contrib/ntp/util/ntp-keygen-opts.h stable/10/contrib/ntp/util/ntp-keygen.1ntp-keygenman stable/10/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc stable/10/contrib/ntp/util/ntp-keygen.html stable/10/contrib/ntp/util/ntp-keygen.man.in stable/10/contrib/ntp/util/ntp-keygen.mdoc.in stable/10/usr.sbin/ntp/config.h stable/10/usr.sbin/ntp/doc/ntp-keygen.8 stable/10/usr.sbin/ntp/doc/ntp.conf.5 stable/10/usr.sbin/ntp/doc/ntp.keys.5 stable/10/usr.sbin/ntp/doc/ntpd.8 stable/10/usr.sbin/ntp/doc/ntpdc.8 stable/10/usr.sbin/ntp/doc/ntpq.8 stable/10/usr.sbin/ntp/doc/sntp.8 stable/10/usr.sbin/ntp/libntp/Makefile stable/10/usr.sbin/ntp/scripts/mkver Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ntp/ChangeLog ============================================================================== --- stable/10/contrib/ntp/ChangeLog Fri Jan 22 15:11:40 2016 (r294568) +++ stable/10/contrib/ntp/ChangeLog Fri Jan 22 15:55:21 2016 (r294569) @@ -1,4 +1,38 @@ --- +(4.2.8p6) 2016/01/20 Released by Harlan Stenn + +* [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode. HStenn. +* [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. +* [Sec 2937] ntpq: nextvar() missing length check. perlinger@ntp.org +* [Sec 2938] ntpq saveconfig command allows dangerous characters + in filenames. perlinger@ntp.org +* [Sec 2939] reslist NULL pointer dereference. perlinger@ntp.org +* [Sec 2940] Stack exhaustion in recursive traversal of restriction + list. perlinger@ntp.org +* [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. +* [Sec 2945] Zero Origin Timestamp Bypass. perlinger@ntp.org +* [Sec 2948] Potential Infinite Loop in ntpq ( and ntpdc) perlinger@ntp.org +* [Bug 2772] adj_systime overflows tv_usec. perlinger@ntp.org +* [Bug 2814] msyslog deadlock when signaled. perlinger@ntp.org + - applied patch by shenpeng11@huawei.com with minor adjustments +* [Bug 2882] Look at ntp_request.c:list_peers_sum(). perlinger@ntp.org +* [Bug 2891] Deadlock in deferred DNS lookup framework. perlinger@ntp.org +* [Bug 2892] Several test cases assume IPv6 capabilities even when + IPv6 is disabled in the build. perlinger@ntp.org + - Found this already fixed, but validation led to cleanup actions. +* [Bug 2905] DNS lookups broken. perlinger@ntp.org + - added limits to stack consumption, fixed some return code handling +* [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call + - changed stacked/nested handling of CTRL-C. perlinger@ntp.org + - make CTRL-C work for retrieval and printing od MRU list. perlinger@ntp.org +* [Bug 2980] reduce number of warnings. perlinger@ntp.org + - integrated several patches from Havard Eidnes (he@uninett.no) +* [Bug 2985] bogus calculation in authkeys.c perlinger@ntp.org + - implement 'auth_log2()' using integer bithack instead of float calculation +* Make leapsec_query debug messages less verbose. Harlan Stenn. +* Disable incomplete t-ntp_signd.c test. Harlan Stenn. + +--- (4.2.8p5) 2016/01/07 Released by Harlan Stenn * [Sec 2956] small-step/big-step. Close the panic gate earlier. HStenn. @@ -47,6 +81,7 @@ lots of clients. perlinger@ntp.org * [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call - changed stacked/nested handling of CTRL-C. perlinger@ntp.org + - make CTRL-C work for retrieval and printing od MRU list. perlinger@ntp.org * Unity cleanup for FreeBSD-6.4. Harlan Stenn. * Unity test cleanup. Harlan Stenn. * Libevent autoconf pthread fixes for FreeBSD-10. Harlan Stenn. @@ -55,9 +90,8 @@ * Quiet a warning from clang. Harlan Stenn. * Update the NEWS file. Harlan Stenn. * Update scripts/calc_tickadj/Makefile.am. Harlan Stenn. + --- -(4.2.8p4) 2015/10/21 Released by Harlan Stenn -(4.2.8p4-RC1) 2015/10/06 Released by Harlan Stenn * [Sec 2899] CVE-2014-9297 perlinger@ntp.org * [Sec 2901] Drop invalid packet before checking KoD. Check for all KoD's. Modified: stable/10/contrib/ntp/CommitLog ============================================================================== --- stable/10/contrib/ntp/CommitLog Fri Jan 22 15:11:40 2016 (r294568) +++ stable/10/contrib/ntp/CommitLog Fri Jan 22 15:55:21 2016 (r294569) @@ -1,8 +1,633 @@ -ChangeSet@1.3623, 2016-01-07 23:33:11+00:00, stenn@deacon.udel.edu +ChangeSet@1.3628, 2016-01-20 04:20:12-05:00, stenn@deacon.udel.edu + NTP_4_2_8P6 + TAG: NTP_4_2_8P6 + + ChangeLog@1.1793 +1 -0 + NTP_4_2_8P6 + + ntpd/invoke-ntp.conf.texi@1.196 +1 -1 + NTP_4_2_8P6 + + ntpd/invoke-ntp.keys.texi@1.188 +1 -1 + NTP_4_2_8P6 + + ntpd/invoke-ntpd.texi@1.504 +2 -2 + NTP_4_2_8P6 + + ntpd/ntp.conf.5man@1.230 +3 -3 + NTP_4_2_8P6 + + ntpd/ntp.conf.5mdoc@1.230 +2 -3 + NTP_4_2_8P6 + + ntpd/ntp.conf.html@1.183 +60 -2 + NTP_4_2_8P6 + + ntpd/ntp.conf.man.in@1.230 +3 -3 + NTP_4_2_8P6 + + ntpd/ntp.conf.mdoc.in@1.230 +2 -3 + NTP_4_2_8P6 + + ntpd/ntp.keys.5man@1.222 +2 -2 + NTP_4_2_8P6 + + ntpd/ntp.keys.5mdoc@1.222 +3 -3 + NTP_4_2_8P6 + + ntpd/ntp.keys.html@1.184 +21 -33 + NTP_4_2_8P6 + + ntpd/ntp.keys.man.in@1.222 +2 -2 + NTP_4_2_8P6 + + ntpd/ntp.keys.mdoc.in@1.222 +3 -3 + NTP_4_2_8P6 + + ntpd/ntpd-opts.c@1.526 +10 -10 + NTP_4_2_8P6 + + ntpd/ntpd-opts.h@1.525 +4 -4 + NTP_4_2_8P6 + + ntpd/ntpd.1ntpdman@1.333 +4 -4 + NTP_4_2_8P6 + + ntpd/ntpd.1ntpdmdoc@1.333 +3 -3 + NTP_4_2_8P6 + + ntpd/ntpd.html@1.177 +2 -2 + NTP_4_2_8P6 + + ntpd/ntpd.man.in@1.333 +4 -4 + NTP_4_2_8P6 + + ntpd/ntpd.mdoc.in@1.333 +3 -3 + NTP_4_2_8P6 + + ntpdc/invoke-ntpdc.texi@1.501 +2 -2 + NTP_4_2_8P6 + + ntpdc/ntpdc-opts.c@1.519 +10 -10 + NTP_4_2_8P6 + + ntpdc/ntpdc-opts.h@1.518 +4 -4 + NTP_4_2_8P6 + + ntpdc/ntpdc.1ntpdcman@1.332 +4 -4 + NTP_4_2_8P6 + + ntpdc/ntpdc.1ntpdcmdoc@1.332 +3 -3 + NTP_4_2_8P6 + + ntpdc/ntpdc.html@1.345 +2 -2 + NTP_4_2_8P6 + + ntpdc/ntpdc.man.in@1.332 +4 -4 + NTP_4_2_8P6 + + ntpdc/ntpdc.mdoc.in@1.332 +3 -3 + NTP_4_2_8P6 + + ntpq/invoke-ntpq.texi@1.508 +2 -2 + NTP_4_2_8P6 + + ntpq/ntpq-opts.c@1.525 +10 -10 + NTP_4_2_8P6 + + ntpq/ntpq-opts.h@1.523 +4 -4 + NTP_4_2_8P6 + + ntpq/ntpq.1ntpqman@1.336 +4 -4 + NTP_4_2_8P6 + + ntpq/ntpq.1ntpqmdoc@1.336 +3 -3 + NTP_4_2_8P6 + + ntpq/ntpq.html@1.174 +2 -2 + NTP_4_2_8P6 + + ntpq/ntpq.man.in@1.336 +4 -4 + NTP_4_2_8P6 + + ntpq/ntpq.mdoc.in@1.336 +3 -3 + NTP_4_2_8P6 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.503 +2 -2 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd-opts.c@1.521 +10 -10 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd-opts.h@1.520 +4 -4 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.332 +4 -4 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.332 +3 -3 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd.html@1.172 +1 -1 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd.man.in@1.332 +4 -4 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.332 +3 -3 + NTP_4_2_8P6 + + packageinfo.sh@1.524 +2 -2 + NTP_4_2_8P6 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.93 +3 -3 + NTP_4_2_8P6 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.94 +2 -2 + NTP_4_2_8P6 + + scripts/calc_tickadj/calc_tickadj.html@1.95 +1 -1 + NTP_4_2_8P6 + + scripts/calc_tickadj/calc_tickadj.man.in@1.92 +3 -3 + NTP_4_2_8P6 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.94 +2 -2 + NTP_4_2_8P6 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.97 +1 -1 + NTP_4_2_8P6 + + scripts/invoke-plot_summary.texi@1.114 +2 -2 + NTP_4_2_8P6 + + scripts/invoke-summary.texi@1.114 +2 -2 + NTP_4_2_8P6 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.324 +2 -2 + NTP_4_2_8P6 + + scripts/ntp-wait/ntp-wait-opts@1.60 +2 -2 + NTP_4_2_8P6 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.321 +3 -3 + NTP_4_2_8P6 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.322 +2 -2 + NTP_4_2_8P6 + + scripts/ntp-wait/ntp-wait.html@1.341 +2 -2 + NTP_4_2_8P6 + + scripts/ntp-wait/ntp-wait.man.in@1.321 +3 -3 + NTP_4_2_8P6 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.322 +2 -2 + NTP_4_2_8P6 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.112 +2 -2 + NTP_4_2_8P6 + + scripts/ntpsweep/ntpsweep-opts@1.62 +2 -2 + NTP_4_2_8P6 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.100 +3 -3 + NTP_4_2_8P6 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.100 +2 -2 + NTP_4_2_8P6 + + scripts/ntpsweep/ntpsweep.html@1.113 +2 -2 + NTP_4_2_8P6 + + scripts/ntpsweep/ntpsweep.man.in@1.100 +3 -3 + NTP_4_2_8P6 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.101 +2 -2 + NTP_4_2_8P6 + + scripts/ntptrace/invoke-ntptrace.texi@1.113 +2 -2 + NTP_4_2_8P6 + + scripts/ntptrace/ntptrace-opts@1.62 +2 -2 + NTP_4_2_8P6 + + scripts/ntptrace/ntptrace.1ntptraceman@1.100 +3 -3 + NTP_4_2_8P6 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.101 +2 -2 + NTP_4_2_8P6 + + scripts/ntptrace/ntptrace.html@1.114 +2 -2 + NTP_4_2_8P6 + + scripts/ntptrace/ntptrace.man.in@1.100 +3 -3 + NTP_4_2_8P6 + + scripts/ntptrace/ntptrace.mdoc.in@1.102 +2 -2 + NTP_4_2_8P6 + + scripts/plot_summary-opts@1.62 +2 -2 + NTP_4_2_8P6 + + scripts/plot_summary.1plot_summaryman@1.112 +3 -3 + NTP_4_2_8P6 + + scripts/plot_summary.1plot_summarymdoc@1.112 +2 -2 + NTP_4_2_8P6 + + scripts/plot_summary.html@1.115 +2 -2 + NTP_4_2_8P6 + + scripts/plot_summary.man.in@1.112 +3 -3 + NTP_4_2_8P6 + + scripts/plot_summary.mdoc.in@1.112 +2 -2 + NTP_4_2_8P6 + + scripts/summary-opts@1.62 +2 -2 + NTP_4_2_8P6 + + scripts/summary.1summaryman@1.112 +3 -3 + NTP_4_2_8P6 + + scripts/summary.1summarymdoc@1.112 +2 -2 + NTP_4_2_8P6 + + scripts/summary.html@1.115 +2 -2 + NTP_4_2_8P6 + + scripts/summary.man.in@1.112 +3 -3 + NTP_4_2_8P6 + + scripts/summary.mdoc.in@1.112 +2 -2 + NTP_4_2_8P6 + + scripts/update-leap/invoke-update-leap.texi@1.13 +1 -1 + NTP_4_2_8P6 + + scripts/update-leap/update-leap-opts@1.13 +2 -2 + NTP_4_2_8P6 + + scripts/update-leap/update-leap.1update-leapman@1.13 +3 -3 + NTP_4_2_8P6 + + scripts/update-leap/update-leap.1update-leapmdoc@1.13 +2 -2 + NTP_4_2_8P6 + + scripts/update-leap/update-leap.html@1.13 +1 -1 + NTP_4_2_8P6 + + scripts/update-leap/update-leap.man.in@1.13 +3 -3 + NTP_4_2_8P6 + + scripts/update-leap/update-leap.mdoc.in@1.13 +2 -2 + NTP_4_2_8P6 + + sntp/invoke-sntp.texi@1.501 +2 -2 + NTP_4_2_8P6 + + sntp/sntp-opts.c@1.520 +10 -10 + NTP_4_2_8P6 + + sntp/sntp-opts.h@1.518 +4 -4 + NTP_4_2_8P6 + + sntp/sntp.1sntpman@1.336 +4 -4 + NTP_4_2_8P6 + + sntp/sntp.1sntpmdoc@1.336 +3 -3 + NTP_4_2_8P6 + + sntp/sntp.html@1.516 +2 -2 + NTP_4_2_8P6 + + sntp/sntp.man.in@1.336 +4 -4 + NTP_4_2_8P6 + + sntp/sntp.mdoc.in@1.336 +3 -3 + NTP_4_2_8P6 + + util/invoke-ntp-keygen.texi@1.504 +2 -2 + NTP_4_2_8P6 + + util/ntp-keygen-opts.c@1.522 +10 -10 + NTP_4_2_8P6 + + util/ntp-keygen-opts.h@1.520 +4 -4 + NTP_4_2_8P6 + + util/ntp-keygen.1ntp-keygenman@1.332 +4 -4 + NTP_4_2_8P6 + + util/ntp-keygen.1ntp-keygenmdoc@1.332 +3 -3 + NTP_4_2_8P6 + + util/ntp-keygen.html@1.178 +2 -2 + NTP_4_2_8P6 + + util/ntp-keygen.man.in@1.332 +4 -4 + NTP_4_2_8P6 + + util/ntp-keygen.mdoc.in@1.332 +3 -3 + NTP_4_2_8P6 + +ChangeSet@1.3627, 2016-01-20 04:14:51-05:00, stenn@deacon.udel.edu + solaris hack + + libntp/work_thread.c@1.20 +2 -0 + solaris hack + +ChangeSet@1.3626, 2016-01-20 01:50:09-05:00, stenn@deacon.udel.edu + 4.2.8p6 + + packageinfo.sh@1.523 +1 -1 + 4.2.8p6 + +ChangeSet@1.3625, 2016-01-20 00:34:15+00:00, stenn@psp-deb1.ntp.org + updates + + NEWS@1.160 +24 -24 + updates + +ChangeSet@1.3624, 2016-01-19 22:28:41+00:00, stenn@psp-deb1.ntp.org + typo + + NEWS@1.159 +1 -1 + typo + +ChangeSet@1.3623, 2016-01-18 11:55:56+00:00, stenn@psp-deb1.ntp.org + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ChangeLog@1.1792 +1 -0 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + NEWS@1.158 +40 -0 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + include/Makefile.am@1.54 +1 -0 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + include/ntp_io.h@1.23 +2 -1 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + include/ntp_keyacc.h@1.1 +13 -0 + BitKeeper file /home/stenn/ntp-stable-2936/include/ntp_keyacc.h + + include/ntp_keyacc.h@1.0 +0 -0 + + include/ntp_stdlib.h@1.81 +4 -1 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + include/ntp_types.h@1.36 +1 -0 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + libntp/Makefile.am@1.77 +1 -0 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + libntp/authkeys.c@1.31 +60 -6 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + libntp/authreadkeys.c@1.25 +50 -1 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + libntp/authusekey.c@1.11 +1 -1 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + libntp/is_ip_address.c@1.1 +129 -0 + BitKeeper file /home/stenn/ntp-stable-2936/libntp/is_ip_address.c + + libntp/is_ip_address.c@1.0 +0 -0 + + ntpd/invoke-ntp.keys.texi@1.187 +11 -3 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp.keys.5man@1.221 +13 -5 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp.keys.5mdoc@1.221 +14 -6 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp.keys.def@1.11 +10 -2 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp.keys.html@1.183 +42 -22 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp.keys.man.in@1.221 +13 -5 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp.keys.mdoc.in@1.221 +14 -6 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp_crypto.c@1.186 +1 -1 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp_io.c@1.412 +0 -72 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp_proto.c@1.373 +34 -0 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + tests/libntp/authkeys.c@1.15 +1 -1 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + +ChangeSet@1.3622, 2016-01-17 09:03:57+00:00, stenn@psp-deb1.ntp.org + Disable incomplete t-ntp_signd.c test. Harlan Stenn. + + ChangeLog@1.1791 +1 -0 + Disable incomplete t-ntp_signd.c test. Harlan Stenn. + + tests/ntpd/t-ntp_signd.c@1.16 +4 -0 + Disable incomplete t-ntp_signd.c test. Harlan Stenn. + +ChangeSet@1.3621, 2016-01-17 05:51:14+00:00, stenn@psp-deb1.ntp.org + Update NEWS file for 2942 + + NEWS@1.157 +22 -0 + Update NEWS file for 2942 + +ChangeSet@1.3615.13.1, 2016-01-17 05:07:22+00:00, stenn@psp-deb1.ntp.org + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ChangeLog@1.1786.13.1 +4 -0 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + html/miscopt.html@1.85 +11 -3 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + include/ntp.h@1.213.1.1 +3 -0 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/invoke-ntp.conf.texi@1.195 +64 -3 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/keyword-gen-utd@1.27 +1 -1 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/keyword-gen.c@1.33 +3 -0 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp.conf.5man@1.229 +71 -7 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp.conf.5mdoc@1.229 +71 -7 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp.conf.def@1.21 +67 -4 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp.conf.man.in@1.229 +71 -7 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp.conf.mdoc.in@1.229 +71 -7 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp_config.c@1.335.1.1 +12 -0 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp_keyword.h@1.29 +505 -468 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp_parser.c@1.101 +1762 -1513 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp_parser.h@1.65 +257 -235 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp_parser.y@1.91 +6 -0 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp_proto.c@1.368.2.1 +40 -4 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + +ChangeSet@1.3619, 2016-01-14 12:19:16+00:00, stenn@psp-at1.ntp.org + NEWS file updates + + NEWS@1.156 +21 -0 + NEWS file updates + +ChangeSet@1.3615.1.9, 2016-01-14 11:33:43+00:00, stenn@psp-at1.ntp.org + merge cleanup + + ChangeLog@1.1786.1.9 +3 -0 + merge cleanup + +ChangeSet@1.3615.1.5, 2016-01-14 10:44:13+00:00, stenn@psp-at1.ntp.org + merge cleanup + + ChangeLog@1.1786.1.5 +0 -1 + merge cleanup + +ChangeSet@1.3615.12.4, 2016-01-14 10:27:23+00:00, stenn@psp-at1.ntp.org + merge cleanup + + ChangeLog@1.1786.12.4 +1 -1 + merge cleanup + +ChangeSet@1.3615.12.2, 2016-01-14 09:49:52+00:00, stenn@psp-at1.ntp.org + merge cleanup + + ChangeLog@1.1786.12.2 +2 -2 + merge cleanup + +ChangeSet@1.3615.3.17, 2016-01-14 09:33:56+00:00, stenn@psp-at1.ntp.org + merge cleanup + + ChangeLog@1.1786.3.14 +1 -1 + merge cleanup + +ChangeSet@1.3615.3.14, 2016-01-14 07:36:57+00:00, stenn@psp-at1.ntp.org + NEWS update + + NEWS@1.155 +98 -7 + NEWS update + +ChangeSet@1.3615.3.12, 2016-01-13 08:07:30+00:00, stenn@psp-deb1.ntp.org + typo + + ChangeLog@1.1786.3.10 +1 -1 + typo + +ChangeSet@1.3615.3.10, 2016-01-13 06:08:29+00:00, stenn@psp-deb1.ntp.org + Update NEWS file for bug 2938 + + NEWS@1.154 +29 -2 + Update NEWS file for bug 2938 + +ChangeSet@1.3615.3.8, 2016-01-13 04:23:46+00:00, stenn@psp-deb1.ntp.org + Update NEWS file for bug 2935 + + NEWS@1.153 +52 -0 + Update NEWS file for bug 2935 + +ChangeSet@1.3615.7.12, 2016-01-12 09:53:06+00:00, stenn@psp-at1.ntp.org + [Sec 2935] use L_SUB instead of L_ISGT. Juergen Perlinger + + ntpd/ntp_proto.c@1.368.1.5 +4 -1 + [Sec 2935] use L_SUB instead of L_ISGT. Juergen Perlinger + +ChangeSet@1.3615.7.11, 2016-01-11 03:02:53-08:00, harlan@max.pfcs.com + [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode. + + ChangeLog@1.1786.9.1 +4 -0 + [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode. + + include/ntp.h@1.215 +1 -0 + [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode. + + ntpd/ntp_proto.c@1.368.1.4 +67 -0 + [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode. + +ChangeSet@1.3615.7.10, 2016-01-11 02:44:25-08:00, harlan@max.pfcs.com + make leapsec_query messages less verbose. + + ntpd/ntp_timer.c@1.93.1.1 +6 -4 + make leapsec_query messages less verbose. + +ChangeSet@1.3615.9.1, 2016-01-11 10:26:12+01:00, jnperlin@hydra.localnet + [Bug 2985] bogus calculation in authkeys.c + - implement 'auth_log2()' using integer bithack instead of float calculation + + ChangeLog@1.1786.7.5 +2 -0 + [Bug 2985] bogus calculation in authkeys.c + - implement 'auth_log2()' using integer bithack instead of float calculation + + libntp/authkeys.c@1.30 +33 -10 + [Bug 2985] bogus calculation in authkeys.c + - implement 'auth_log2()' using integer bithack instead of float calculation + + tests/libntp/authkeys.c@1.14 +38 -0 + [Bug 2985] bogus calculation in authkeys.c + - test bithack implementation of 'auth_log2()' + + tests/libntp/run-authkeys.c@1.12 +9 -6 + [Bug 2985] bogus calculation in authkeys.c + - update auto-generated file + +ChangeSet@1.3615.7.9, 2016-01-09 09:52:44+00:00, stenn@psp-at1.ntp.org + Add timelastrec to the peer structure + + include/ntp.h@1.214 +2 -1 + Add timelastrec to the peer structure + +ChangeSet@1.3615.3.6, 2016-01-08 10:00:03+00:00, stenn@psp-at1.ntp.org + 4.2.8p5 merge cleanup + + ChangeLog@1.1786.3.6 +1 -1 + 4.2.8p5 merge cleanup + +ChangeSet@1.3615.7.8, 2016-01-08 00:26:09+00:00, stenn@deacon.udel.edu + Update copyright year + + sntp/include/copyright.def@1.26 +1 -1 + Update copyright year + +ChangeSet@1.3615.7.7, 2016-01-07 23:33:11+00:00, stenn@deacon.udel.edu NTP_4_2_8P5 TAG: NTP_4_2_8P5 - ChangeLog@1.1791 +1 -0 + ChangeLog@1.1786.7.4 +1 -0 NTP_4_2_8P5 ntpd/invoke-ntp.conf.texi@1.194 +1 -1 @@ -332,60 +957,349 @@ ChangeSet@1.3623, 2016-01-07 23:33:11+00 util/ntp-keygen.mdoc.in@1.331 +2 -2 NTP_4_2_8P5 -ChangeSet@1.3622, 2016-01-07 17:52:24-05:00, stenn@deacon.udel.edu +ChangeSet@1.3615.7.6, 2016-01-07 17:52:24-05:00, stenn@deacon.udel.edu ntp-4.2.8p5 packageinfo.sh@1.521 +1 -1 ntp-4.2.8p5 -ChangeSet@1.3621, 2016-01-07 22:20:05+00:00, stenn@psp-at1.ntp.org +ChangeSet@1.3615.7.5, 2016-01-07 22:20:05+00:00, stenn@psp-at1.ntp.org cleanup NEWS@1.152 +2 -2 cleanup -ChangeSet@1.3620, 2016-01-07 09:33:11+00:00, stenn@psp-at1.ntp.org +ChangeSet@1.3615.7.4, 2016-01-07 09:33:11+00:00, stenn@psp-at1.ntp.org typo in ntp_proto.c - leap smear. Reported by Martin Burnicki - ntpd/ntp_proto.c@1.371 +1 -1 + ntpd/ntp_proto.c@1.368.1.3 +1 -1 typo in ntp_proto.c - leap smear. Reported by Martin Burnicki -ChangeSet@1.3619, 2016-01-07 06:33:08+00:00, stenn@psp-at1.ntp.org +ChangeSet@1.3615.7.3, 2016-01-07 06:33:08+00:00, stenn@psp-at1.ntp.org Update scripts/calc_tickadj/Makefile.am. Harlan Stenn. - ChangeLog@1.1790 +1 -0 + ChangeLog@1.1786.7.3 +1 -0 Update scripts/calc_tickadj/Makefile.am. Harlan Stenn. scripts/calc_tickadj/Makefile.am@1.11 +2 -0 Update scripts/calc_tickadj/Makefile.am. Harlan Stenn. -ChangeSet@1.3616.1.1, 2016-01-05 10:57:45+00:00, stenn@psp-at1.ntp.org +ChangeSet@1.3615.3.2, 2016-01-05 12:34:56+00:00, stenn@psp-at1.ntp.org + ntp-4.2.8p6 + + ChangeLog@1.1786.3.2 +2 -0 + ntp-4.2.8p6 + +ChangeSet@1.3615.8.1, 2016-01-05 10:57:45+00:00, stenn@psp-at1.ntp.org Bug 2952 fixes - ChangeLog@1.1787.1.1 +1 -0 + ChangeLog@1.1786.8.1 +1 -0 Bug 2952 fixes - ntpd/ntp_proto.c@1.370 +165 -152 + ntpd/ntp_proto.c@1.368.1.2 +165 -152 Bug 2952 fixes -ChangeSet@1.3617, 2016-01-05 09:56:31+00:00, stenn@psp-at1.ntp.org +ChangeSet@1.3615.7.1, 2016-01-05 09:56:31+00:00, stenn@psp-at1.ntp.org ntp-4.2.8p5 prep - ChangeLog@1.1788 +2 -1 + ChangeLog@1.1786.7.1 +2 -1 ntp-4.2.8p5 prep NEWS@1.151 +104 -3 ntp-4.2.8p5 prep -ChangeSet@1.3616, 2015-12-06 11:20:02+00:00, stenn@psp-deb1.ntp.org +ChangeSet@1.3615.5.1, 2015-12-13 13:35:12+01:00, jnperlin@hydra.localnet + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + Found this already fixed, but validation lead to further cleanup: + - source code formatting + - inline variable definitions moved to start of block + - made some pure input data pointers 'const void*' instead of 'char*'; avoids casts and warnings + + ChangeLog@1.1786.5.1 +3 -0 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + + sntp/crypto.c@1.19 +13 -12 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - sidekick: make pure input pointers 'const void*' instead of 'char*' + - sidekick: remove unnecessary casts + + sntp/crypto.h@1.11 +11 -9 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - sidekick: make pure input pointers 'const void*' instead of 'char*' + - source formatting + + sntp/main.c@1.99 +1 -1 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - no need to cast input to 'make_mac()' any more + + sntp/networking.c@1.68 +1 -1 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - no need to cast input to 'auth_md5()' any more + + sntp/tests/crypto.c@1.10 +41 -27 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - remove unnecessary casts + - source code formatting + + sntp/tests/fileHandlingTest.c@1.4 +43 -20 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - create 'DestroyPath()' companion to 'CreatePath()' to avoid trouble with 'free()' on 'const char*' + + sntp/tests/fileHandlingTest.h.in@1.15 +6 -15 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - create 'DestroyPath()' companion to 'CreatePath()' to avoid trouble with 'free()' on 'const char*' + + sntp/tests/keyFile.c@1.13 +66 -46 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - use 'DestroyPath()' avoid trouble with 'free()' on 'const char*' + - printf() combined + - source code formatting + - move variable declarations to front + + sntp/tests/packetHandling.c@1.6 +75 -64 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - move variable declarations to front + - source code formatting + + sntp/tests/packetProcessing.c@1.9 +124 -90 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - move variable declarations to front + - source code formatting + - drop unnecessary casts + + sntp/tests/run-packetProcessing.c@1.10 +18 -18 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + + sntp/unity/unity_internals.h@1.6 +1 -1 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - added missing 'const' in pointer casts + + tests/libntp/decodenetnum.c@1.11 +33 -23 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - source code formatting + cleanup + + tests/libntp/run-decodenetnum.c@1.11 +4 -4 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + + tests/libntp/run-socktoa.c@1.14 +5 -5 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + + tests/libntp/socktoa.c@1.12 +23 -17 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - source code formatting + cleanup + +ChangeSet@1.3615.4.1, 2015-12-11 18:24:16+01:00, jnperlin@hydra.localnet + [Bug 2882] Look at ntp_request.c:list_peers_sum() + + ChangeLog@1.1786.4.1 +1 -0 + [Bug 2882] Look at ntp_request.c:list_peers_sum() + + ntpd/ntp_request.c@1.116 +57 -72 + [Bug 2882] Look at ntp_request.c:list_peers_sum() + - 'list_peers()' and 'list_peers_sum()' skip IPv6 entires if client does not support them, + but continue processing until end of list now. + +ChangeSet@1.3615.1.3, 2015-12-09 18:23:31+01:00, jnperlin@hydra.localnet + [Bug 2891] Deadlock in deferred DNS lookup framework. + + ChangeLog@1.1786.1.3 +1 -0 + [Bug 2891] Deadlock in deferred DNS lookup framework. + + include/ntp_worker.h@1.5 +31 -22 + [Bug 2891] Deadlock in deferred DNS lookup framework. + - provide signal-safe result-ready detection + + libntp/ntp_worker.c@1.7 +27 -0 + [Bug 2891] Deadlock in deferred DNS lookup framework. + - support signal-safe result-ready detection + - provide function to harvest async results from mainloop + + ntpd/ntp_io.c@1.409.1.1 +160 -133 + [Bug 2891] Deadlock in deferred DNS lookup framework. + - do not process async-resolver results from signal handler + - set notification tags to harvest asyn-resolver results from mainloop + - avoid double select for synchronous IO + - avoid several syslog calls in signal-handler context + - refactor / conditionalize some functions that cannot be used in signal-driven IO + + ntpd/ntpd.c@1.169 +4 -0 + [Bug 2891] Deadlock in deferred DNS lookup framework. + - reap/harvest async resolver results from mainloop + +ChangeSet@1.3615.1.2, 2015-12-06 21:33:26+01:00, jnperlin@hydra.localnet + [Bug 2814] msyslog deadlock when signaled. perlinger@ntp.org + - applied patch by shenpeng11@huawei.com with minor adjustments + + ChangeLog@1.1786.1.2 +2 -0 + [Bug 2814] msyslog deadlock when signaled. perlinger@ntp.org + - applied patch by shenpeng11@huawei.com with minor adjustments + + ntpd/ntpd.c@1.168 +26 -3 + [Bug 2814] msyslog deadlock when signaled. perlinger@ntp.org + - applied patch by shenpeng11@huawei.com with minor adjustments + +ChangeSet@1.3615.2.1, 2015-12-06 20:19:32+01:00, jnperlin@hydra.localnet + [Bug 2772] adj_systime overflows tv_usec + + ChangeLog@1.1786.2.1 +1 -0 + [Bug 2772] adj_systime overflows tv_usec + + libntp/systime.c@1.71 +12 -3 + [Bug 2772] adj_systime overflows tv_usec + - add missing normalisation for nitpicking implementations of 'adjtime()' + +ChangeSet@1.3615.1.1, 2015-12-06 11:20:02+00:00, stenn@psp-deb1.ntp.org Quiet a warning from clang. Harlan Stenn. - ChangeLog@1.1787 +1 -0 + ChangeLog@1.1786.1.1 +1 -0 Quiet a warning from clang. Harlan Stenn. libntp/ntp_rfc2553.c@1.50 +3 -2 Quiet a warning from clang. Harlan Stenn. +ChangeSet@1.3616, 2015-12-05 20:28:19+00:00, perlinger@psp-deb1.ntp.org + [Bug 2980] reduce number of warnings + - string formatting(arguments should be literals) + - applying constness where necessary + - removing bad consts that are superfluous + - avoid signed/unsigned clashes in conditionals (either by cast or type change) + - signed/unsigned and promotion conflicts + - add prototypes for function pointer tables + - force unsigned argument promotion in calls to 'ctype' functions (is{digit,cntrl,...}) + + ChangeLog@1.1787 +2 -0 + [Bug 2980] reduce number of warnings + + include/parse.h@1.14 +3 -3 + [Bug 2980] reduce number of warnings + - make GPSWRAP and GPSWEEK unqualified literals to avoid signed/unsigned clashes + + ntpd/ntp_config.c@1.336 +2 -0 + [Bug 2980] reduce number of warnings + - add forward declaration of yyparse() + + ntpd/ntp_io.c@1.410 +1 -1 + [Bug 2980] reduce number of warnings + - fix a signedness comparison by adding a cast to size_t + + ntpd/ntp_scanner.c@1.49 +1 -1 + [Bug 2980] reduce number of warnings + - for type compatibility, make counter 'i' a size_t + + ntpd/ntp_timer.c@1.94 +5 -6 + [Bug 2980] reduce number of warnings + - fix a signed / unsigned compare + + ntpd/refclock_chu.c@1.58 +1 -1 + [Bug 2980] reduce number of warnings + - rewrite check to avoid warning about integer overflow + + ntpd/refclock_gpsdjson.c@1.24 +13 -15 + [Bug 2980] reduce number of warnings + - reshuffle to use a literal format string + - fix signed/unsigned clashes in compare + + ntpd/refclock_jjy.c@1.30 +47 -44 + Bug 2980 - reduce number of warnings + - make several pointers 'const char*' + - add prototypes for function pointer tables + - force unsigned argument promotion in calls to 'ctype' functions (is{digit,cntrl,...}) + + ntpd/refclock_shm.c@1.39 +1 -1 + [Bug 2980] reduce number of warnings + - fix signed/unsigned clashes in compare + + ntpq/ntpq-subs.c@1.114.1.1 +1 -1 + [Bug 2980] reduce number of warnings + - avoid signed/unsigned clashe in compare + + ntpq/ntpq.c@1.165.1.1 +47 -7 + [Bug 2980] reduce number of warnings + - avoid juggling with formatting into dynamic buffers by a 'asprintf' like function + + sntp/libopts/configfile.c@1.24 +22 -22 + [Bug 2980] reduce number of warnings + - add some pointer constness to avoid casting it away + + sntp/libopts/enum.c@1.14 +5 -5 + [Bug 2980] reduce number of warnings + - avoid some unnecessary casts + - avoid shift/promote ambiguity by proper typing + + sntp/libopts/find.c@1.13 +1 -1 + [Bug 2980] reduce number of warnings + - Use VOIDP instead of a (char*) cast + + sntp/libopts/init.c@1.9 +2 -3 + [Bug 2980] reduce number of warnings + - use VOIDP() to replace a complicated double cast + - remove one useless cast + + sntp/libopts/load.c@1.22 +1 -1 + [Bug 2980] reduce number of warnings + - remove a useless cast + + sntp/libopts/makeshell.c@1.21 +3 -3 + [Bug 2980] reduce number of warnings + - fix integer promotion in calls to toupper/tolower *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Jan 22 15:56:37 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E598CA8C2D3; Fri, 22 Jan 2016 15:56:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C00A146A; Fri, 22 Jan 2016 15:56:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0MFuaNd031844; Fri, 22 Jan 2016 15:56:36 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0MFuaIa031840; Fri, 22 Jan 2016 15:56:36 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601221556.u0MFuaIa031840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 22 Jan 2016 15:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294570 - in stable/9: contrib/ntp contrib/ntp/html contrib/ntp/include contrib/ntp/libntp contrib/ntp/ntpd contrib/ntp/ntpdc contrib/ntp/ntpq contrib/ntp/ntpsnmpd contrib/ntp/scripts c... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 15:56:38 -0000 Author: delphij Date: Fri Jan 22 15:56:35 2016 New Revision: 294570 URL: https://svnweb.freebsd.org/changeset/base/294570 Log: MFC r294554: MFV r294491: ntp 4.2.8p6. Security: CVE-2015-7973, CVE-2015-7974, CVE-2015-7975 Security: CVE-2015-7976, CVE-2015-7977, CVE-2015-7978 Security: CVE-2015-7979, CVE-2015-8138, CVE-2015-8139 Security: CVE-2015-8140, CVE-2015-8158 With hat: so Added: stable/9/contrib/ntp/include/ntp_keyacc.h - copied unchanged from r294554, head/contrib/ntp/include/ntp_keyacc.h stable/9/contrib/ntp/libntp/is_ip_address.c - copied unchanged from r294554, head/contrib/ntp/libntp/is_ip_address.c Modified: stable/9/contrib/ntp/ChangeLog stable/9/contrib/ntp/CommitLog stable/9/contrib/ntp/NEWS stable/9/contrib/ntp/configure stable/9/contrib/ntp/html/miscopt.html stable/9/contrib/ntp/include/Makefile.am stable/9/contrib/ntp/include/Makefile.in stable/9/contrib/ntp/include/ntp.h stable/9/contrib/ntp/include/ntp_io.h stable/9/contrib/ntp/include/ntp_stdlib.h stable/9/contrib/ntp/include/ntp_types.h stable/9/contrib/ntp/include/ntp_worker.h stable/9/contrib/ntp/include/parse.h stable/9/contrib/ntp/libntp/Makefile.am stable/9/contrib/ntp/libntp/Makefile.in stable/9/contrib/ntp/libntp/authkeys.c stable/9/contrib/ntp/libntp/authreadkeys.c stable/9/contrib/ntp/libntp/authusekey.c stable/9/contrib/ntp/libntp/ntp_worker.c stable/9/contrib/ntp/libntp/systime.c stable/9/contrib/ntp/libntp/work_thread.c stable/9/contrib/ntp/ntpd/invoke-ntp.conf.texi stable/9/contrib/ntp/ntpd/invoke-ntp.keys.texi stable/9/contrib/ntp/ntpd/invoke-ntpd.texi stable/9/contrib/ntp/ntpd/keyword-gen-utd stable/9/contrib/ntp/ntpd/keyword-gen.c stable/9/contrib/ntp/ntpd/ntp.conf.5man stable/9/contrib/ntp/ntpd/ntp.conf.5mdoc stable/9/contrib/ntp/ntpd/ntp.conf.def stable/9/contrib/ntp/ntpd/ntp.conf.html stable/9/contrib/ntp/ntpd/ntp.conf.man.in stable/9/contrib/ntp/ntpd/ntp.conf.mdoc.in stable/9/contrib/ntp/ntpd/ntp.keys.5man stable/9/contrib/ntp/ntpd/ntp.keys.5mdoc stable/9/contrib/ntp/ntpd/ntp.keys.def stable/9/contrib/ntp/ntpd/ntp.keys.html stable/9/contrib/ntp/ntpd/ntp.keys.man.in stable/9/contrib/ntp/ntpd/ntp.keys.mdoc.in stable/9/contrib/ntp/ntpd/ntp_config.c stable/9/contrib/ntp/ntpd/ntp_control.c stable/9/contrib/ntp/ntpd/ntp_crypto.c stable/9/contrib/ntp/ntpd/ntp_io.c stable/9/contrib/ntp/ntpd/ntp_keyword.h stable/9/contrib/ntp/ntpd/ntp_parser.c stable/9/contrib/ntp/ntpd/ntp_parser.h stable/9/contrib/ntp/ntpd/ntp_proto.c stable/9/contrib/ntp/ntpd/ntp_request.c stable/9/contrib/ntp/ntpd/ntp_scanner.c stable/9/contrib/ntp/ntpd/ntp_timer.c stable/9/contrib/ntp/ntpd/ntpd-opts.c stable/9/contrib/ntp/ntpd/ntpd-opts.h stable/9/contrib/ntp/ntpd/ntpd.1ntpdman stable/9/contrib/ntp/ntpd/ntpd.1ntpdmdoc stable/9/contrib/ntp/ntpd/ntpd.c stable/9/contrib/ntp/ntpd/ntpd.html stable/9/contrib/ntp/ntpd/ntpd.man.in stable/9/contrib/ntp/ntpd/ntpd.mdoc.in stable/9/contrib/ntp/ntpd/refclock_chu.c stable/9/contrib/ntp/ntpd/refclock_gpsdjson.c stable/9/contrib/ntp/ntpd/refclock_jjy.c stable/9/contrib/ntp/ntpd/refclock_shm.c stable/9/contrib/ntp/ntpdc/invoke-ntpdc.texi stable/9/contrib/ntp/ntpdc/ntpdc-opts.c stable/9/contrib/ntp/ntpdc/ntpdc-opts.h stable/9/contrib/ntp/ntpdc/ntpdc.1ntpdcman stable/9/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc stable/9/contrib/ntp/ntpdc/ntpdc.c stable/9/contrib/ntp/ntpdc/ntpdc.html stable/9/contrib/ntp/ntpdc/ntpdc.man.in stable/9/contrib/ntp/ntpdc/ntpdc.mdoc.in stable/9/contrib/ntp/ntpq/invoke-ntpq.texi stable/9/contrib/ntp/ntpq/ntpq-opts.c stable/9/contrib/ntp/ntpq/ntpq-opts.h stable/9/contrib/ntp/ntpq/ntpq-subs.c stable/9/contrib/ntp/ntpq/ntpq.1ntpqman stable/9/contrib/ntp/ntpq/ntpq.1ntpqmdoc stable/9/contrib/ntp/ntpq/ntpq.c stable/9/contrib/ntp/ntpq/ntpq.html stable/9/contrib/ntp/ntpq/ntpq.man.in stable/9/contrib/ntp/ntpq/ntpq.mdoc.in stable/9/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd.html stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in stable/9/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in stable/9/contrib/ntp/packageinfo.sh stable/9/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman stable/9/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc stable/9/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html stable/9/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in stable/9/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in stable/9/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi stable/9/contrib/ntp/scripts/invoke-plot_summary.texi stable/9/contrib/ntp/scripts/invoke-summary.texi stable/9/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi stable/9/contrib/ntp/scripts/ntp-wait/ntp-wait-opts stable/9/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman stable/9/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc stable/9/contrib/ntp/scripts/ntp-wait/ntp-wait.html stable/9/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in stable/9/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in stable/9/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi stable/9/contrib/ntp/scripts/ntpsweep/ntpsweep-opts stable/9/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman stable/9/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc stable/9/contrib/ntp/scripts/ntpsweep/ntpsweep.html stable/9/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in stable/9/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in stable/9/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi stable/9/contrib/ntp/scripts/ntptrace/ntptrace-opts stable/9/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman stable/9/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc stable/9/contrib/ntp/scripts/ntptrace/ntptrace.html stable/9/contrib/ntp/scripts/ntptrace/ntptrace.man.in stable/9/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in stable/9/contrib/ntp/scripts/plot_summary-opts stable/9/contrib/ntp/scripts/plot_summary.1plot_summaryman stable/9/contrib/ntp/scripts/plot_summary.1plot_summarymdoc stable/9/contrib/ntp/scripts/plot_summary.html stable/9/contrib/ntp/scripts/plot_summary.man.in stable/9/contrib/ntp/scripts/plot_summary.mdoc.in stable/9/contrib/ntp/scripts/summary-opts stable/9/contrib/ntp/scripts/summary.1summaryman stable/9/contrib/ntp/scripts/summary.1summarymdoc stable/9/contrib/ntp/scripts/summary.html stable/9/contrib/ntp/scripts/summary.man.in stable/9/contrib/ntp/scripts/summary.mdoc.in stable/9/contrib/ntp/scripts/update-leap/invoke-update-leap.texi stable/9/contrib/ntp/scripts/update-leap/update-leap-opts stable/9/contrib/ntp/scripts/update-leap/update-leap.1update-leapman stable/9/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc stable/9/contrib/ntp/scripts/update-leap/update-leap.html stable/9/contrib/ntp/scripts/update-leap/update-leap.man.in stable/9/contrib/ntp/scripts/update-leap/update-leap.mdoc.in stable/9/contrib/ntp/sntp/configure stable/9/contrib/ntp/sntp/crypto.c stable/9/contrib/ntp/sntp/crypto.h stable/9/contrib/ntp/sntp/include/copyright.def stable/9/contrib/ntp/sntp/include/version.def stable/9/contrib/ntp/sntp/include/version.texi stable/9/contrib/ntp/sntp/invoke-sntp.texi stable/9/contrib/ntp/sntp/libopts/configfile.c stable/9/contrib/ntp/sntp/libopts/enum.c stable/9/contrib/ntp/sntp/libopts/find.c stable/9/contrib/ntp/sntp/libopts/init.c stable/9/contrib/ntp/sntp/libopts/load.c stable/9/contrib/ntp/sntp/libopts/makeshell.c stable/9/contrib/ntp/sntp/libopts/nested.c stable/9/contrib/ntp/sntp/libopts/parse-duration.c stable/9/contrib/ntp/sntp/libopts/reset.c stable/9/contrib/ntp/sntp/libopts/save.c stable/9/contrib/ntp/sntp/libopts/tokenize.c stable/9/contrib/ntp/sntp/m4/version.m4 stable/9/contrib/ntp/sntp/main.c stable/9/contrib/ntp/sntp/networking.c stable/9/contrib/ntp/sntp/sntp-opts.c stable/9/contrib/ntp/sntp/sntp-opts.h stable/9/contrib/ntp/sntp/sntp.1sntpman stable/9/contrib/ntp/sntp/sntp.1sntpmdoc stable/9/contrib/ntp/sntp/sntp.html stable/9/contrib/ntp/sntp/sntp.man.in stable/9/contrib/ntp/sntp/sntp.mdoc.in stable/9/contrib/ntp/sntp/tests/crypto.c stable/9/contrib/ntp/sntp/tests/fileHandlingTest.c stable/9/contrib/ntp/sntp/tests/fileHandlingTest.h.in stable/9/contrib/ntp/sntp/tests/keyFile.c stable/9/contrib/ntp/sntp/tests/packetHandling.c stable/9/contrib/ntp/sntp/tests/packetProcessing.c stable/9/contrib/ntp/sntp/tests/run-packetProcessing.c stable/9/contrib/ntp/sntp/unity/unity_internals.h stable/9/contrib/ntp/sntp/version.c stable/9/contrib/ntp/tests/libntp/authkeys.c stable/9/contrib/ntp/tests/libntp/decodenetnum.c stable/9/contrib/ntp/tests/libntp/run-authkeys.c stable/9/contrib/ntp/tests/libntp/run-decodenetnum.c stable/9/contrib/ntp/tests/libntp/run-socktoa.c stable/9/contrib/ntp/tests/libntp/socktoa.c stable/9/contrib/ntp/tests/ntpd/t-ntp_signd.c stable/9/contrib/ntp/util/invoke-ntp-keygen.texi stable/9/contrib/ntp/util/ntp-keygen-opts.c stable/9/contrib/ntp/util/ntp-keygen-opts.h stable/9/contrib/ntp/util/ntp-keygen.1ntp-keygenman stable/9/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc stable/9/contrib/ntp/util/ntp-keygen.html stable/9/contrib/ntp/util/ntp-keygen.man.in stable/9/contrib/ntp/util/ntp-keygen.mdoc.in stable/9/usr.sbin/ntp/config.h stable/9/usr.sbin/ntp/doc/ntp-keygen.8 stable/9/usr.sbin/ntp/doc/ntp.conf.5 stable/9/usr.sbin/ntp/doc/ntp.keys.5 stable/9/usr.sbin/ntp/doc/ntpd.8 stable/9/usr.sbin/ntp/doc/ntpdc.8 stable/9/usr.sbin/ntp/doc/ntpq.8 stable/9/usr.sbin/ntp/doc/sntp.8 stable/9/usr.sbin/ntp/libntp/Makefile stable/9/usr.sbin/ntp/scripts/mkver Directory Properties: stable/9/contrib/ntp/ (props changed) stable/9/usr.sbin/ntp/ (props changed) Modified: stable/9/contrib/ntp/ChangeLog ============================================================================== --- stable/9/contrib/ntp/ChangeLog Fri Jan 22 15:55:21 2016 (r294569) +++ stable/9/contrib/ntp/ChangeLog Fri Jan 22 15:56:35 2016 (r294570) @@ -1,4 +1,38 @@ --- +(4.2.8p6) 2016/01/20 Released by Harlan Stenn + +* [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode. HStenn. +* [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. +* [Sec 2937] ntpq: nextvar() missing length check. perlinger@ntp.org +* [Sec 2938] ntpq saveconfig command allows dangerous characters + in filenames. perlinger@ntp.org +* [Sec 2939] reslist NULL pointer dereference. perlinger@ntp.org +* [Sec 2940] Stack exhaustion in recursive traversal of restriction + list. perlinger@ntp.org +* [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. +* [Sec 2945] Zero Origin Timestamp Bypass. perlinger@ntp.org +* [Sec 2948] Potential Infinite Loop in ntpq ( and ntpdc) perlinger@ntp.org +* [Bug 2772] adj_systime overflows tv_usec. perlinger@ntp.org +* [Bug 2814] msyslog deadlock when signaled. perlinger@ntp.org + - applied patch by shenpeng11@huawei.com with minor adjustments +* [Bug 2882] Look at ntp_request.c:list_peers_sum(). perlinger@ntp.org +* [Bug 2891] Deadlock in deferred DNS lookup framework. perlinger@ntp.org +* [Bug 2892] Several test cases assume IPv6 capabilities even when + IPv6 is disabled in the build. perlinger@ntp.org + - Found this already fixed, but validation led to cleanup actions. +* [Bug 2905] DNS lookups broken. perlinger@ntp.org + - added limits to stack consumption, fixed some return code handling +* [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call + - changed stacked/nested handling of CTRL-C. perlinger@ntp.org + - make CTRL-C work for retrieval and printing od MRU list. perlinger@ntp.org +* [Bug 2980] reduce number of warnings. perlinger@ntp.org + - integrated several patches from Havard Eidnes (he@uninett.no) +* [Bug 2985] bogus calculation in authkeys.c perlinger@ntp.org + - implement 'auth_log2()' using integer bithack instead of float calculation +* Make leapsec_query debug messages less verbose. Harlan Stenn. +* Disable incomplete t-ntp_signd.c test. Harlan Stenn. + +--- (4.2.8p5) 2016/01/07 Released by Harlan Stenn * [Sec 2956] small-step/big-step. Close the panic gate earlier. HStenn. @@ -47,6 +81,7 @@ lots of clients. perlinger@ntp.org * [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call - changed stacked/nested handling of CTRL-C. perlinger@ntp.org + - make CTRL-C work for retrieval and printing od MRU list. perlinger@ntp.org * Unity cleanup for FreeBSD-6.4. Harlan Stenn. * Unity test cleanup. Harlan Stenn. * Libevent autoconf pthread fixes for FreeBSD-10. Harlan Stenn. @@ -55,9 +90,8 @@ * Quiet a warning from clang. Harlan Stenn. * Update the NEWS file. Harlan Stenn. * Update scripts/calc_tickadj/Makefile.am. Harlan Stenn. + --- -(4.2.8p4) 2015/10/21 Released by Harlan Stenn -(4.2.8p4-RC1) 2015/10/06 Released by Harlan Stenn * [Sec 2899] CVE-2014-9297 perlinger@ntp.org * [Sec 2901] Drop invalid packet before checking KoD. Check for all KoD's. Modified: stable/9/contrib/ntp/CommitLog ============================================================================== --- stable/9/contrib/ntp/CommitLog Fri Jan 22 15:55:21 2016 (r294569) +++ stable/9/contrib/ntp/CommitLog Fri Jan 22 15:56:35 2016 (r294570) @@ -1,8 +1,633 @@ -ChangeSet@1.3623, 2016-01-07 23:33:11+00:00, stenn@deacon.udel.edu +ChangeSet@1.3628, 2016-01-20 04:20:12-05:00, stenn@deacon.udel.edu + NTP_4_2_8P6 + TAG: NTP_4_2_8P6 + + ChangeLog@1.1793 +1 -0 + NTP_4_2_8P6 + + ntpd/invoke-ntp.conf.texi@1.196 +1 -1 + NTP_4_2_8P6 + + ntpd/invoke-ntp.keys.texi@1.188 +1 -1 + NTP_4_2_8P6 + + ntpd/invoke-ntpd.texi@1.504 +2 -2 + NTP_4_2_8P6 + + ntpd/ntp.conf.5man@1.230 +3 -3 + NTP_4_2_8P6 + + ntpd/ntp.conf.5mdoc@1.230 +2 -3 + NTP_4_2_8P6 + + ntpd/ntp.conf.html@1.183 +60 -2 + NTP_4_2_8P6 + + ntpd/ntp.conf.man.in@1.230 +3 -3 + NTP_4_2_8P6 + + ntpd/ntp.conf.mdoc.in@1.230 +2 -3 + NTP_4_2_8P6 + + ntpd/ntp.keys.5man@1.222 +2 -2 + NTP_4_2_8P6 + + ntpd/ntp.keys.5mdoc@1.222 +3 -3 + NTP_4_2_8P6 + + ntpd/ntp.keys.html@1.184 +21 -33 + NTP_4_2_8P6 + + ntpd/ntp.keys.man.in@1.222 +2 -2 + NTP_4_2_8P6 + + ntpd/ntp.keys.mdoc.in@1.222 +3 -3 + NTP_4_2_8P6 + + ntpd/ntpd-opts.c@1.526 +10 -10 + NTP_4_2_8P6 + + ntpd/ntpd-opts.h@1.525 +4 -4 + NTP_4_2_8P6 + + ntpd/ntpd.1ntpdman@1.333 +4 -4 + NTP_4_2_8P6 + + ntpd/ntpd.1ntpdmdoc@1.333 +3 -3 + NTP_4_2_8P6 + + ntpd/ntpd.html@1.177 +2 -2 + NTP_4_2_8P6 + + ntpd/ntpd.man.in@1.333 +4 -4 + NTP_4_2_8P6 + + ntpd/ntpd.mdoc.in@1.333 +3 -3 + NTP_4_2_8P6 + + ntpdc/invoke-ntpdc.texi@1.501 +2 -2 + NTP_4_2_8P6 + + ntpdc/ntpdc-opts.c@1.519 +10 -10 + NTP_4_2_8P6 + + ntpdc/ntpdc-opts.h@1.518 +4 -4 + NTP_4_2_8P6 + + ntpdc/ntpdc.1ntpdcman@1.332 +4 -4 + NTP_4_2_8P6 + + ntpdc/ntpdc.1ntpdcmdoc@1.332 +3 -3 + NTP_4_2_8P6 + + ntpdc/ntpdc.html@1.345 +2 -2 + NTP_4_2_8P6 + + ntpdc/ntpdc.man.in@1.332 +4 -4 + NTP_4_2_8P6 + + ntpdc/ntpdc.mdoc.in@1.332 +3 -3 + NTP_4_2_8P6 + + ntpq/invoke-ntpq.texi@1.508 +2 -2 + NTP_4_2_8P6 + + ntpq/ntpq-opts.c@1.525 +10 -10 + NTP_4_2_8P6 + + ntpq/ntpq-opts.h@1.523 +4 -4 + NTP_4_2_8P6 + + ntpq/ntpq.1ntpqman@1.336 +4 -4 + NTP_4_2_8P6 + + ntpq/ntpq.1ntpqmdoc@1.336 +3 -3 + NTP_4_2_8P6 + + ntpq/ntpq.html@1.174 +2 -2 + NTP_4_2_8P6 + + ntpq/ntpq.man.in@1.336 +4 -4 + NTP_4_2_8P6 + + ntpq/ntpq.mdoc.in@1.336 +3 -3 + NTP_4_2_8P6 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.503 +2 -2 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd-opts.c@1.521 +10 -10 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd-opts.h@1.520 +4 -4 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.332 +4 -4 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.332 +3 -3 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd.html@1.172 +1 -1 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd.man.in@1.332 +4 -4 + NTP_4_2_8P6 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.332 +3 -3 + NTP_4_2_8P6 + + packageinfo.sh@1.524 +2 -2 + NTP_4_2_8P6 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.93 +3 -3 + NTP_4_2_8P6 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.94 +2 -2 + NTP_4_2_8P6 + + scripts/calc_tickadj/calc_tickadj.html@1.95 +1 -1 + NTP_4_2_8P6 + + scripts/calc_tickadj/calc_tickadj.man.in@1.92 +3 -3 + NTP_4_2_8P6 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.94 +2 -2 + NTP_4_2_8P6 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.97 +1 -1 + NTP_4_2_8P6 + + scripts/invoke-plot_summary.texi@1.114 +2 -2 + NTP_4_2_8P6 + + scripts/invoke-summary.texi@1.114 +2 -2 + NTP_4_2_8P6 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.324 +2 -2 + NTP_4_2_8P6 + + scripts/ntp-wait/ntp-wait-opts@1.60 +2 -2 + NTP_4_2_8P6 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.321 +3 -3 + NTP_4_2_8P6 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.322 +2 -2 + NTP_4_2_8P6 + + scripts/ntp-wait/ntp-wait.html@1.341 +2 -2 + NTP_4_2_8P6 + + scripts/ntp-wait/ntp-wait.man.in@1.321 +3 -3 + NTP_4_2_8P6 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.322 +2 -2 + NTP_4_2_8P6 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.112 +2 -2 + NTP_4_2_8P6 + + scripts/ntpsweep/ntpsweep-opts@1.62 +2 -2 + NTP_4_2_8P6 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.100 +3 -3 + NTP_4_2_8P6 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.100 +2 -2 + NTP_4_2_8P6 + + scripts/ntpsweep/ntpsweep.html@1.113 +2 -2 + NTP_4_2_8P6 + + scripts/ntpsweep/ntpsweep.man.in@1.100 +3 -3 + NTP_4_2_8P6 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.101 +2 -2 + NTP_4_2_8P6 + + scripts/ntptrace/invoke-ntptrace.texi@1.113 +2 -2 + NTP_4_2_8P6 + + scripts/ntptrace/ntptrace-opts@1.62 +2 -2 + NTP_4_2_8P6 + + scripts/ntptrace/ntptrace.1ntptraceman@1.100 +3 -3 + NTP_4_2_8P6 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.101 +2 -2 + NTP_4_2_8P6 + + scripts/ntptrace/ntptrace.html@1.114 +2 -2 + NTP_4_2_8P6 + + scripts/ntptrace/ntptrace.man.in@1.100 +3 -3 + NTP_4_2_8P6 + + scripts/ntptrace/ntptrace.mdoc.in@1.102 +2 -2 + NTP_4_2_8P6 + + scripts/plot_summary-opts@1.62 +2 -2 + NTP_4_2_8P6 + + scripts/plot_summary.1plot_summaryman@1.112 +3 -3 + NTP_4_2_8P6 + + scripts/plot_summary.1plot_summarymdoc@1.112 +2 -2 + NTP_4_2_8P6 + + scripts/plot_summary.html@1.115 +2 -2 + NTP_4_2_8P6 + + scripts/plot_summary.man.in@1.112 +3 -3 + NTP_4_2_8P6 + + scripts/plot_summary.mdoc.in@1.112 +2 -2 + NTP_4_2_8P6 + + scripts/summary-opts@1.62 +2 -2 + NTP_4_2_8P6 + + scripts/summary.1summaryman@1.112 +3 -3 + NTP_4_2_8P6 + + scripts/summary.1summarymdoc@1.112 +2 -2 + NTP_4_2_8P6 + + scripts/summary.html@1.115 +2 -2 + NTP_4_2_8P6 + + scripts/summary.man.in@1.112 +3 -3 + NTP_4_2_8P6 + + scripts/summary.mdoc.in@1.112 +2 -2 + NTP_4_2_8P6 + + scripts/update-leap/invoke-update-leap.texi@1.13 +1 -1 + NTP_4_2_8P6 + + scripts/update-leap/update-leap-opts@1.13 +2 -2 + NTP_4_2_8P6 + + scripts/update-leap/update-leap.1update-leapman@1.13 +3 -3 + NTP_4_2_8P6 + + scripts/update-leap/update-leap.1update-leapmdoc@1.13 +2 -2 + NTP_4_2_8P6 + + scripts/update-leap/update-leap.html@1.13 +1 -1 + NTP_4_2_8P6 + + scripts/update-leap/update-leap.man.in@1.13 +3 -3 + NTP_4_2_8P6 + + scripts/update-leap/update-leap.mdoc.in@1.13 +2 -2 + NTP_4_2_8P6 + + sntp/invoke-sntp.texi@1.501 +2 -2 + NTP_4_2_8P6 + + sntp/sntp-opts.c@1.520 +10 -10 + NTP_4_2_8P6 + + sntp/sntp-opts.h@1.518 +4 -4 + NTP_4_2_8P6 + + sntp/sntp.1sntpman@1.336 +4 -4 + NTP_4_2_8P6 + + sntp/sntp.1sntpmdoc@1.336 +3 -3 + NTP_4_2_8P6 + + sntp/sntp.html@1.516 +2 -2 + NTP_4_2_8P6 + + sntp/sntp.man.in@1.336 +4 -4 + NTP_4_2_8P6 + + sntp/sntp.mdoc.in@1.336 +3 -3 + NTP_4_2_8P6 + + util/invoke-ntp-keygen.texi@1.504 +2 -2 + NTP_4_2_8P6 + + util/ntp-keygen-opts.c@1.522 +10 -10 + NTP_4_2_8P6 + + util/ntp-keygen-opts.h@1.520 +4 -4 + NTP_4_2_8P6 + + util/ntp-keygen.1ntp-keygenman@1.332 +4 -4 + NTP_4_2_8P6 + + util/ntp-keygen.1ntp-keygenmdoc@1.332 +3 -3 + NTP_4_2_8P6 + + util/ntp-keygen.html@1.178 +2 -2 + NTP_4_2_8P6 + + util/ntp-keygen.man.in@1.332 +4 -4 + NTP_4_2_8P6 + + util/ntp-keygen.mdoc.in@1.332 +3 -3 + NTP_4_2_8P6 + +ChangeSet@1.3627, 2016-01-20 04:14:51-05:00, stenn@deacon.udel.edu + solaris hack + + libntp/work_thread.c@1.20 +2 -0 + solaris hack + +ChangeSet@1.3626, 2016-01-20 01:50:09-05:00, stenn@deacon.udel.edu + 4.2.8p6 + + packageinfo.sh@1.523 +1 -1 + 4.2.8p6 + +ChangeSet@1.3625, 2016-01-20 00:34:15+00:00, stenn@psp-deb1.ntp.org + updates + + NEWS@1.160 +24 -24 + updates + +ChangeSet@1.3624, 2016-01-19 22:28:41+00:00, stenn@psp-deb1.ntp.org + typo + + NEWS@1.159 +1 -1 + typo + +ChangeSet@1.3623, 2016-01-18 11:55:56+00:00, stenn@psp-deb1.ntp.org + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ChangeLog@1.1792 +1 -0 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + NEWS@1.158 +40 -0 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + include/Makefile.am@1.54 +1 -0 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + include/ntp_io.h@1.23 +2 -1 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + include/ntp_keyacc.h@1.1 +13 -0 + BitKeeper file /home/stenn/ntp-stable-2936/include/ntp_keyacc.h + + include/ntp_keyacc.h@1.0 +0 -0 + + include/ntp_stdlib.h@1.81 +4 -1 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + include/ntp_types.h@1.36 +1 -0 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + libntp/Makefile.am@1.77 +1 -0 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + libntp/authkeys.c@1.31 +60 -6 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + libntp/authreadkeys.c@1.25 +50 -1 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + libntp/authusekey.c@1.11 +1 -1 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + libntp/is_ip_address.c@1.1 +129 -0 + BitKeeper file /home/stenn/ntp-stable-2936/libntp/is_ip_address.c + + libntp/is_ip_address.c@1.0 +0 -0 + + ntpd/invoke-ntp.keys.texi@1.187 +11 -3 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp.keys.5man@1.221 +13 -5 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp.keys.5mdoc@1.221 +14 -6 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp.keys.def@1.11 +10 -2 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp.keys.html@1.183 +42 -22 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp.keys.man.in@1.221 +13 -5 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp.keys.mdoc.in@1.221 +14 -6 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp_crypto.c@1.186 +1 -1 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp_io.c@1.412 +0 -72 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + ntpd/ntp_proto.c@1.373 +34 -0 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + + tests/libntp/authkeys.c@1.15 +1 -1 + [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. + +ChangeSet@1.3622, 2016-01-17 09:03:57+00:00, stenn@psp-deb1.ntp.org + Disable incomplete t-ntp_signd.c test. Harlan Stenn. + + ChangeLog@1.1791 +1 -0 + Disable incomplete t-ntp_signd.c test. Harlan Stenn. + + tests/ntpd/t-ntp_signd.c@1.16 +4 -0 + Disable incomplete t-ntp_signd.c test. Harlan Stenn. + +ChangeSet@1.3621, 2016-01-17 05:51:14+00:00, stenn@psp-deb1.ntp.org + Update NEWS file for 2942 + + NEWS@1.157 +22 -0 + Update NEWS file for 2942 + +ChangeSet@1.3615.13.1, 2016-01-17 05:07:22+00:00, stenn@psp-deb1.ntp.org + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ChangeLog@1.1786.13.1 +4 -0 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + html/miscopt.html@1.85 +11 -3 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + include/ntp.h@1.213.1.1 +3 -0 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/invoke-ntp.conf.texi@1.195 +64 -3 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/keyword-gen-utd@1.27 +1 -1 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/keyword-gen.c@1.33 +3 -0 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp.conf.5man@1.229 +71 -7 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp.conf.5mdoc@1.229 +71 -7 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp.conf.def@1.21 +67 -4 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp.conf.man.in@1.229 +71 -7 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp.conf.mdoc.in@1.229 +71 -7 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp_config.c@1.335.1.1 +12 -0 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp_keyword.h@1.29 +505 -468 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp_parser.c@1.101 +1762 -1513 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp_parser.h@1.65 +257 -235 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp_parser.y@1.91 +6 -0 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + + ntpd/ntp_proto.c@1.368.2.1 +40 -4 + [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. + +ChangeSet@1.3619, 2016-01-14 12:19:16+00:00, stenn@psp-at1.ntp.org + NEWS file updates + + NEWS@1.156 +21 -0 + NEWS file updates + +ChangeSet@1.3615.1.9, 2016-01-14 11:33:43+00:00, stenn@psp-at1.ntp.org + merge cleanup + + ChangeLog@1.1786.1.9 +3 -0 + merge cleanup + +ChangeSet@1.3615.1.5, 2016-01-14 10:44:13+00:00, stenn@psp-at1.ntp.org + merge cleanup + + ChangeLog@1.1786.1.5 +0 -1 + merge cleanup + +ChangeSet@1.3615.12.4, 2016-01-14 10:27:23+00:00, stenn@psp-at1.ntp.org + merge cleanup + + ChangeLog@1.1786.12.4 +1 -1 + merge cleanup + +ChangeSet@1.3615.12.2, 2016-01-14 09:49:52+00:00, stenn@psp-at1.ntp.org + merge cleanup + + ChangeLog@1.1786.12.2 +2 -2 + merge cleanup + +ChangeSet@1.3615.3.17, 2016-01-14 09:33:56+00:00, stenn@psp-at1.ntp.org + merge cleanup + + ChangeLog@1.1786.3.14 +1 -1 + merge cleanup + +ChangeSet@1.3615.3.14, 2016-01-14 07:36:57+00:00, stenn@psp-at1.ntp.org + NEWS update + + NEWS@1.155 +98 -7 + NEWS update + +ChangeSet@1.3615.3.12, 2016-01-13 08:07:30+00:00, stenn@psp-deb1.ntp.org + typo + + ChangeLog@1.1786.3.10 +1 -1 + typo + +ChangeSet@1.3615.3.10, 2016-01-13 06:08:29+00:00, stenn@psp-deb1.ntp.org + Update NEWS file for bug 2938 + + NEWS@1.154 +29 -2 + Update NEWS file for bug 2938 + +ChangeSet@1.3615.3.8, 2016-01-13 04:23:46+00:00, stenn@psp-deb1.ntp.org + Update NEWS file for bug 2935 + + NEWS@1.153 +52 -0 + Update NEWS file for bug 2935 + +ChangeSet@1.3615.7.12, 2016-01-12 09:53:06+00:00, stenn@psp-at1.ntp.org + [Sec 2935] use L_SUB instead of L_ISGT. Juergen Perlinger + + ntpd/ntp_proto.c@1.368.1.5 +4 -1 + [Sec 2935] use L_SUB instead of L_ISGT. Juergen Perlinger + +ChangeSet@1.3615.7.11, 2016-01-11 03:02:53-08:00, harlan@max.pfcs.com + [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode. + + ChangeLog@1.1786.9.1 +4 -0 + [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode. + + include/ntp.h@1.215 +1 -0 + [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode. + + ntpd/ntp_proto.c@1.368.1.4 +67 -0 + [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode. + +ChangeSet@1.3615.7.10, 2016-01-11 02:44:25-08:00, harlan@max.pfcs.com + make leapsec_query messages less verbose. + + ntpd/ntp_timer.c@1.93.1.1 +6 -4 + make leapsec_query messages less verbose. + +ChangeSet@1.3615.9.1, 2016-01-11 10:26:12+01:00, jnperlin@hydra.localnet + [Bug 2985] bogus calculation in authkeys.c + - implement 'auth_log2()' using integer bithack instead of float calculation + + ChangeLog@1.1786.7.5 +2 -0 + [Bug 2985] bogus calculation in authkeys.c + - implement 'auth_log2()' using integer bithack instead of float calculation + + libntp/authkeys.c@1.30 +33 -10 + [Bug 2985] bogus calculation in authkeys.c + - implement 'auth_log2()' using integer bithack instead of float calculation + + tests/libntp/authkeys.c@1.14 +38 -0 + [Bug 2985] bogus calculation in authkeys.c + - test bithack implementation of 'auth_log2()' + + tests/libntp/run-authkeys.c@1.12 +9 -6 + [Bug 2985] bogus calculation in authkeys.c + - update auto-generated file + +ChangeSet@1.3615.7.9, 2016-01-09 09:52:44+00:00, stenn@psp-at1.ntp.org + Add timelastrec to the peer structure + + include/ntp.h@1.214 +2 -1 + Add timelastrec to the peer structure + +ChangeSet@1.3615.3.6, 2016-01-08 10:00:03+00:00, stenn@psp-at1.ntp.org + 4.2.8p5 merge cleanup + + ChangeLog@1.1786.3.6 +1 -1 + 4.2.8p5 merge cleanup + +ChangeSet@1.3615.7.8, 2016-01-08 00:26:09+00:00, stenn@deacon.udel.edu + Update copyright year + + sntp/include/copyright.def@1.26 +1 -1 + Update copyright year + +ChangeSet@1.3615.7.7, 2016-01-07 23:33:11+00:00, stenn@deacon.udel.edu NTP_4_2_8P5 TAG: NTP_4_2_8P5 - ChangeLog@1.1791 +1 -0 + ChangeLog@1.1786.7.4 +1 -0 NTP_4_2_8P5 ntpd/invoke-ntp.conf.texi@1.194 +1 -1 @@ -332,60 +957,349 @@ ChangeSet@1.3623, 2016-01-07 23:33:11+00 util/ntp-keygen.mdoc.in@1.331 +2 -2 NTP_4_2_8P5 -ChangeSet@1.3622, 2016-01-07 17:52:24-05:00, stenn@deacon.udel.edu +ChangeSet@1.3615.7.6, 2016-01-07 17:52:24-05:00, stenn@deacon.udel.edu ntp-4.2.8p5 packageinfo.sh@1.521 +1 -1 ntp-4.2.8p5 -ChangeSet@1.3621, 2016-01-07 22:20:05+00:00, stenn@psp-at1.ntp.org +ChangeSet@1.3615.7.5, 2016-01-07 22:20:05+00:00, stenn@psp-at1.ntp.org cleanup NEWS@1.152 +2 -2 cleanup -ChangeSet@1.3620, 2016-01-07 09:33:11+00:00, stenn@psp-at1.ntp.org +ChangeSet@1.3615.7.4, 2016-01-07 09:33:11+00:00, stenn@psp-at1.ntp.org typo in ntp_proto.c - leap smear. Reported by Martin Burnicki - ntpd/ntp_proto.c@1.371 +1 -1 + ntpd/ntp_proto.c@1.368.1.3 +1 -1 typo in ntp_proto.c - leap smear. Reported by Martin Burnicki -ChangeSet@1.3619, 2016-01-07 06:33:08+00:00, stenn@psp-at1.ntp.org +ChangeSet@1.3615.7.3, 2016-01-07 06:33:08+00:00, stenn@psp-at1.ntp.org Update scripts/calc_tickadj/Makefile.am. Harlan Stenn. - ChangeLog@1.1790 +1 -0 + ChangeLog@1.1786.7.3 +1 -0 Update scripts/calc_tickadj/Makefile.am. Harlan Stenn. scripts/calc_tickadj/Makefile.am@1.11 +2 -0 Update scripts/calc_tickadj/Makefile.am. Harlan Stenn. -ChangeSet@1.3616.1.1, 2016-01-05 10:57:45+00:00, stenn@psp-at1.ntp.org +ChangeSet@1.3615.3.2, 2016-01-05 12:34:56+00:00, stenn@psp-at1.ntp.org + ntp-4.2.8p6 + + ChangeLog@1.1786.3.2 +2 -0 + ntp-4.2.8p6 + +ChangeSet@1.3615.8.1, 2016-01-05 10:57:45+00:00, stenn@psp-at1.ntp.org Bug 2952 fixes - ChangeLog@1.1787.1.1 +1 -0 + ChangeLog@1.1786.8.1 +1 -0 Bug 2952 fixes - ntpd/ntp_proto.c@1.370 +165 -152 + ntpd/ntp_proto.c@1.368.1.2 +165 -152 Bug 2952 fixes -ChangeSet@1.3617, 2016-01-05 09:56:31+00:00, stenn@psp-at1.ntp.org +ChangeSet@1.3615.7.1, 2016-01-05 09:56:31+00:00, stenn@psp-at1.ntp.org ntp-4.2.8p5 prep - ChangeLog@1.1788 +2 -1 + ChangeLog@1.1786.7.1 +2 -1 ntp-4.2.8p5 prep NEWS@1.151 +104 -3 ntp-4.2.8p5 prep -ChangeSet@1.3616, 2015-12-06 11:20:02+00:00, stenn@psp-deb1.ntp.org +ChangeSet@1.3615.5.1, 2015-12-13 13:35:12+01:00, jnperlin@hydra.localnet + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + Found this already fixed, but validation lead to further cleanup: + - source code formatting + - inline variable definitions moved to start of block + - made some pure input data pointers 'const void*' instead of 'char*'; avoids casts and warnings + + ChangeLog@1.1786.5.1 +3 -0 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + + sntp/crypto.c@1.19 +13 -12 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - sidekick: make pure input pointers 'const void*' instead of 'char*' + - sidekick: remove unnecessary casts + + sntp/crypto.h@1.11 +11 -9 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - sidekick: make pure input pointers 'const void*' instead of 'char*' + - source formatting + + sntp/main.c@1.99 +1 -1 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - no need to cast input to 'make_mac()' any more + + sntp/networking.c@1.68 +1 -1 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - no need to cast input to 'auth_md5()' any more + + sntp/tests/crypto.c@1.10 +41 -27 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - remove unnecessary casts + - source code formatting + + sntp/tests/fileHandlingTest.c@1.4 +43 -20 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - create 'DestroyPath()' companion to 'CreatePath()' to avoid trouble with 'free()' on 'const char*' + + sntp/tests/fileHandlingTest.h.in@1.15 +6 -15 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - create 'DestroyPath()' companion to 'CreatePath()' to avoid trouble with 'free()' on 'const char*' + + sntp/tests/keyFile.c@1.13 +66 -46 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - use 'DestroyPath()' avoid trouble with 'free()' on 'const char*' + - printf() combined + - source code formatting + - move variable declarations to front + + sntp/tests/packetHandling.c@1.6 +75 -64 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - move variable declarations to front + - source code formatting + + sntp/tests/packetProcessing.c@1.9 +124 -90 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - move variable declarations to front + - source code formatting + - drop unnecessary casts + + sntp/tests/run-packetProcessing.c@1.10 +18 -18 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + + sntp/unity/unity_internals.h@1.6 +1 -1 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - added missing 'const' in pointer casts + + tests/libntp/decodenetnum.c@1.11 +33 -23 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - source code formatting + cleanup + + tests/libntp/run-decodenetnum.c@1.11 +4 -4 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + + tests/libntp/run-socktoa.c@1.14 +5 -5 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + + tests/libntp/socktoa.c@1.12 +23 -17 + [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build + - source code formatting + cleanup + +ChangeSet@1.3615.4.1, 2015-12-11 18:24:16+01:00, jnperlin@hydra.localnet + [Bug 2882] Look at ntp_request.c:list_peers_sum() + + ChangeLog@1.1786.4.1 +1 -0 + [Bug 2882] Look at ntp_request.c:list_peers_sum() + + ntpd/ntp_request.c@1.116 +57 -72 + [Bug 2882] Look at ntp_request.c:list_peers_sum() + - 'list_peers()' and 'list_peers_sum()' skip IPv6 entires if client does not support them, + but continue processing until end of list now. + +ChangeSet@1.3615.1.3, 2015-12-09 18:23:31+01:00, jnperlin@hydra.localnet + [Bug 2891] Deadlock in deferred DNS lookup framework. + + ChangeLog@1.1786.1.3 +1 -0 + [Bug 2891] Deadlock in deferred DNS lookup framework. + + include/ntp_worker.h@1.5 +31 -22 + [Bug 2891] Deadlock in deferred DNS lookup framework. + - provide signal-safe result-ready detection + + libntp/ntp_worker.c@1.7 +27 -0 + [Bug 2891] Deadlock in deferred DNS lookup framework. + - support signal-safe result-ready detection + - provide function to harvest async results from mainloop + + ntpd/ntp_io.c@1.409.1.1 +160 -133 + [Bug 2891] Deadlock in deferred DNS lookup framework. + - do not process async-resolver results from signal handler + - set notification tags to harvest asyn-resolver results from mainloop + - avoid double select for synchronous IO + - avoid several syslog calls in signal-handler context + - refactor / conditionalize some functions that cannot be used in signal-driven IO + + ntpd/ntpd.c@1.169 +4 -0 + [Bug 2891] Deadlock in deferred DNS lookup framework. + - reap/harvest async resolver results from mainloop + +ChangeSet@1.3615.1.2, 2015-12-06 21:33:26+01:00, jnperlin@hydra.localnet + [Bug 2814] msyslog deadlock when signaled. perlinger@ntp.org + - applied patch by shenpeng11@huawei.com with minor adjustments + + ChangeLog@1.1786.1.2 +2 -0 + [Bug 2814] msyslog deadlock when signaled. perlinger@ntp.org + - applied patch by shenpeng11@huawei.com with minor adjustments + + ntpd/ntpd.c@1.168 +26 -3 + [Bug 2814] msyslog deadlock when signaled. perlinger@ntp.org + - applied patch by shenpeng11@huawei.com with minor adjustments + +ChangeSet@1.3615.2.1, 2015-12-06 20:19:32+01:00, jnperlin@hydra.localnet + [Bug 2772] adj_systime overflows tv_usec + + ChangeLog@1.1786.2.1 +1 -0 + [Bug 2772] adj_systime overflows tv_usec + + libntp/systime.c@1.71 +12 -3 + [Bug 2772] adj_systime overflows tv_usec + - add missing normalisation for nitpicking implementations of 'adjtime()' + +ChangeSet@1.3615.1.1, 2015-12-06 11:20:02+00:00, stenn@psp-deb1.ntp.org Quiet a warning from clang. Harlan Stenn. - ChangeLog@1.1787 +1 -0 + ChangeLog@1.1786.1.1 +1 -0 Quiet a warning from clang. Harlan Stenn. libntp/ntp_rfc2553.c@1.50 +3 -2 Quiet a warning from clang. Harlan Stenn. +ChangeSet@1.3616, 2015-12-05 20:28:19+00:00, perlinger@psp-deb1.ntp.org + [Bug 2980] reduce number of warnings + - string formatting(arguments should be literals) + - applying constness where necessary + - removing bad consts that are superfluous + - avoid signed/unsigned clashes in conditionals (either by cast or type change) + - signed/unsigned and promotion conflicts + - add prototypes for function pointer tables + - force unsigned argument promotion in calls to 'ctype' functions (is{digit,cntrl,...}) + + ChangeLog@1.1787 +2 -0 + [Bug 2980] reduce number of warnings + + include/parse.h@1.14 +3 -3 + [Bug 2980] reduce number of warnings + - make GPSWRAP and GPSWEEK unqualified literals to avoid signed/unsigned clashes + + ntpd/ntp_config.c@1.336 +2 -0 + [Bug 2980] reduce number of warnings + - add forward declaration of yyparse() + + ntpd/ntp_io.c@1.410 +1 -1 + [Bug 2980] reduce number of warnings + - fix a signedness comparison by adding a cast to size_t + + ntpd/ntp_scanner.c@1.49 +1 -1 + [Bug 2980] reduce number of warnings + - for type compatibility, make counter 'i' a size_t + + ntpd/ntp_timer.c@1.94 +5 -6 + [Bug 2980] reduce number of warnings + - fix a signed / unsigned compare + + ntpd/refclock_chu.c@1.58 +1 -1 + [Bug 2980] reduce number of warnings + - rewrite check to avoid warning about integer overflow + + ntpd/refclock_gpsdjson.c@1.24 +13 -15 + [Bug 2980] reduce number of warnings + - reshuffle to use a literal format string + - fix signed/unsigned clashes in compare + + ntpd/refclock_jjy.c@1.30 +47 -44 + Bug 2980 - reduce number of warnings + - make several pointers 'const char*' + - add prototypes for function pointer tables + - force unsigned argument promotion in calls to 'ctype' functions (is{digit,cntrl,...}) + + ntpd/refclock_shm.c@1.39 +1 -1 + [Bug 2980] reduce number of warnings + - fix signed/unsigned clashes in compare + + ntpq/ntpq-subs.c@1.114.1.1 +1 -1 + [Bug 2980] reduce number of warnings + - avoid signed/unsigned clashe in compare + + ntpq/ntpq.c@1.165.1.1 +47 -7 + [Bug 2980] reduce number of warnings + - avoid juggling with formatting into dynamic buffers by a 'asprintf' like function + + sntp/libopts/configfile.c@1.24 +22 -22 + [Bug 2980] reduce number of warnings + - add some pointer constness to avoid casting it away + + sntp/libopts/enum.c@1.14 +5 -5 + [Bug 2980] reduce number of warnings + - avoid some unnecessary casts + - avoid shift/promote ambiguity by proper typing + + sntp/libopts/find.c@1.13 +1 -1 + [Bug 2980] reduce number of warnings + - Use VOIDP instead of a (char*) cast + + sntp/libopts/init.c@1.9 +2 -3 + [Bug 2980] reduce number of warnings + - use VOIDP() to replace a complicated double cast + - remove one useless cast + + sntp/libopts/load.c@1.22 +1 -1 + [Bug 2980] reduce number of warnings + - remove a useless cast + + sntp/libopts/makeshell.c@1.21 +3 -3 + [Bug 2980] reduce number of warnings + - fix integer promotion in calls to toupper/tolower *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Jan 22 18:38:53 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E25A7A8D5D6; Fri, 22 Jan 2016 18:38:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B389B13BA; Fri, 22 Jan 2016 18:38:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0MIcqq4079067; Fri, 22 Jan 2016 18:38:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0MIcqXW079066; Fri, 22 Jan 2016 18:38:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601221838.u0MIcqXW079066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 22 Jan 2016 18:38:52 +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: r294588 - stable/10 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 18:38:54 -0000 Author: glebius Date: Fri Jan 22 18:38:52 2016 New Revision: 294588 URL: https://svnweb.freebsd.org/changeset/base/294588 Log: Make it possible to override NO_INSTALLEXTRAKERNELS. Submitted by: ngie Modified: stable/10/Makefile.inc1 Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Fri Jan 22 18:37:17 2016 (r294587) +++ stable/10/Makefile.inc1 Fri Jan 22 18:38:52 2016 (r294588) @@ -1012,7 +1012,7 @@ KERNCONFDIR?= ${KRNLCONFDIR} BUILDKERNELS= INSTALLKERNEL= -NO_INSTALLEXTRAKERNELS=yes +NO_INSTALLEXTRAKERNELS?= yes .if defined(NO_INSTALLKERNEL) # All of the BUILDKERNELS loops start at index 1. BUILDKERNELS+= dummy From owner-svn-src-stable@freebsd.org Fri Jan 22 18:50:21 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B526A8DADA; Fri, 22 Jan 2016 18:50:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E31831C54; Fri, 22 Jan 2016 18:50:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x236.google.com with SMTP id ho8so45652604pac.2; Fri, 22 Jan 2016 10:50:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=taqYfz9aCm49ijZDAR23KnssE3Fb3x3uvLOo5n2w6yM=; b=DAgNs3VNbAp7KBBdyQci6XE/qtg15foL62eY0vwZU1IvLOwsVNhGkkipkrKwwIw8RX aZhqVZm3WTXGEy/poHl3MrbHgckJeiRYKMUAjOLT94zSbpYWICgpUNvg36idFwvDirbY sXq5ufYxP3BJ5BKishOITIh9He2+JeomHHOXaho0iZqoGHcxsYCrwqh0QwehRvdDRDAg gqBVdRcaw8zHlo2EZfdKLxb1Q9SO9aYgHuwAga7qsvDgcsb5i/0euYmjkCWz3AKnsfS+ 7qmw+3+ylzu2ikj6ZctSvol1byeCAgGUQSMXsz+fYJp3BaKFJTsOZQVMJMQwIZ3clOK/ 7R2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=taqYfz9aCm49ijZDAR23KnssE3Fb3x3uvLOo5n2w6yM=; b=HiC2jYUBOIES1hZPEuplymxy6h1cROPKggi7xvpvUonZqicxXGvAni3aGnHB54LeP2 zu1NpxENNe1+PdzgCghQbMRT2PQ8nDrfukQH7wXpbP2PNehFXRg6O24XvxKcTrKOts3+ Xm657uSNhakr9SfUe191XA1CDPp3ezBdQWdzwmWyK+QCwIpUFhq40GtIafgk+aC6UH8x nAg4jW5I2sNenf7zauZhvG2jRcpObnkCE5owGx8v2Njz3cNgN1BkEdo7axwjQtJDEBAl 5leHRh9+p5MOYOcm0Xbwu6sN6mk9roVhHhLZJXNtWw9P422n0gnkm+xeh8EaIWb/ro+f jR+Q== X-Gm-Message-State: AG10YOSNegdLcwFdWGxpxdvrIqNsURRuQ3FkOVB5shGauS8zs81U+qBD6bM5qf0xvLZkYw== X-Received: by 10.66.65.109 with SMTP id w13mr6534749pas.142.1453488620589; Fri, 22 Jan 2016 10:50:20 -0800 (PST) Received: from [100.108.233.20] (mfe2736d0.tmodns.net. [208.54.39.254]) by smtp.gmail.com with ESMTPSA id sy5sm11412379pac.5.2016.01.22.10.50.18 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jan 2016 10:50:18 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r294588 - stable/10 From: NGie Cooper X-Mailer: iPhone Mail (13D15) In-Reply-To: <201601221838.u0MIcqXW079066@repo.freebsd.org> Date: Fri, 22 Jan 2016 10:50:16 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201601221838.u0MIcqXW079066@repo.freebsd.org> To: Gleb Smirnoff X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 18:50:21 -0000 > On Jan 22, 2016, at 10:38, Gleb Smirnoff wrote: >=20 > Author: glebius > Date: Fri Jan 22 18:38:52 2016 > New Revision: 294588 > URL: https://svnweb.freebsd.org/changeset/base/294588 >=20 > Log: > Make it possible to override NO_INSTALLEXTRAKERNELS. >=20 > Submitted by: ngie >=20 I missed that this is a !defined check, not a !=3D no check.. Unfortunately t= his commit's a no-op :(.. > Modified: > stable/10/Makefile.inc1 >=20 > Modified: stable/10/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- stable/10/Makefile.inc1 Fri Jan 22 18:37:17 2016 (r294587) > +++ stable/10/Makefile.inc1 Fri Jan 22 18:38:52 2016 (r294588) > @@ -1012,7 +1012,7 @@ KERNCONFDIR?=3D ${KRNLCONFDIR} >=20 > BUILDKERNELS=3D > INSTALLKERNEL=3D > -NO_INSTALLEXTRAKERNELS=3Dyes > +NO_INSTALLEXTRAKERNELS?=3D yes > .if defined(NO_INSTALLKERNEL) > # All of the BUILDKERNELS loops start at index 1. > BUILDKERNELS+=3D dummy >=20 From owner-svn-src-stable@freebsd.org Sat Jan 23 01:02:30 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D91BA8C517; Sat, 23 Jan 2016 01:02:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BC35147E; Sat, 23 Jan 2016 01:02:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0N12TFh094233; Sat, 23 Jan 2016 01:02:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0N12SbE094230; Sat, 23 Jan 2016 01:02:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601230102.u0N12SbE094230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 23 Jan 2016 01:02:28 +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: r294612 - in stable/10: share/man/man9 sys/fs/devfs sys/sys 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 01:02:30 -0000 Author: jhb Date: Sat Jan 23 01:02:28 2016 New Revision: 294612 URL: https://svnweb.freebsd.org/changeset/base/294612 Log: MFC 286974,291653: 286974: Remove reference to non-existent kern_openat(9). 291653: The cdevpriv_dtr_t typedef was not able to be used in a function prototype like the various d_*_t typedefs since it declared a function pointer rather than a function. Add a new d_priv_dtor_t typedef that declares the function and can be used as a function prototype. The previous typedef wasn't useful outside of the cdevpriv implementation, so retire it. The name d_priv_dtor_t was chosen to be more consistent with cdev methods since it is commonly used in place of d_close_t even though it is not a direct pointer in struct cdevsw. Modified: stable/10/share/man/man9/devfs_set_cdevpriv.9 stable/10/sys/fs/devfs/devfs_vnops.c stable/10/sys/sys/conf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/devfs_set_cdevpriv.9 ============================================================================== --- stable/10/share/man/man9/devfs_set_cdevpriv.9 Sat Jan 23 00:28:18 2016 (r294611) +++ stable/10/share/man/man9/devfs_set_cdevpriv.9 Sat Jan 23 01:02:28 2016 (r294612) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 15, 2012 +.Dd December 2, 2015 .Dt DEVFS_CDEVPRIV 9 .Os .Sh NAME @@ -36,12 +36,12 @@ .In sys/param.h .In sys/conf.h .Bd -literal -typedef void (*cdevpriv_dtr_t)(void *data); +typedef void d_priv_dtor_t(void *data); .Ed .Ft int .Fn devfs_get_cdevpriv "void **datap" .Ft int -.Fn devfs_set_cdevpriv "void *priv" "cdevpriv_dtr_t dtr" +.Fn devfs_set_cdevpriv "void *priv" "d_priv_dtor_t *dtr" .Ft void .Fn devfs_clear_cdevpriv "void" .Sh DESCRIPTION @@ -116,8 +116,7 @@ was called. .Sh SEE ALSO .Xr open 2 , .Xr close 2 , -.Xr devfs 5 , -.Xr kern_openat 9 +.Xr devfs 5 .Sh HISTORY The .Fn devfs_cdevpriv Modified: stable/10/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/10/sys/fs/devfs/devfs_vnops.c Sat Jan 23 00:28:18 2016 (r294611) +++ stable/10/sys/fs/devfs/devfs_vnops.c Sat Jan 23 01:02:28 2016 (r294612) @@ -146,7 +146,7 @@ devfs_get_cdevpriv(void **datap) } int -devfs_set_cdevpriv(void *priv, cdevpriv_dtr_t priv_dtr) +devfs_set_cdevpriv(void *priv, d_priv_dtor_t *priv_dtr) { struct file *fp; struct cdev_priv *cdp; Modified: stable/10/sys/sys/conf.h ============================================================================== --- stable/10/sys/sys/conf.h Sat Jan 23 00:28:18 2016 (r294611) +++ stable/10/sys/sys/conf.h Sat Jan 23 01:02:28 2016 (r294612) @@ -297,9 +297,9 @@ void setconf(void); #define dev2unit(d) ((d)->si_drv0) -typedef void (*cdevpriv_dtr_t)(void *data); +typedef void d_priv_dtor_t(void *data); int devfs_get_cdevpriv(void **datap); -int devfs_set_cdevpriv(void *priv, cdevpriv_dtr_t dtr); +int devfs_set_cdevpriv(void *priv, d_priv_dtor_t *dtr); void devfs_clear_cdevpriv(void); void devfs_fpdrop(struct file *fp); /* XXX This is not public KPI */ From owner-svn-src-stable@freebsd.org Sat Jan 23 01:21:12 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D75A0A8CAE1; Sat, 23 Jan 2016 01:21:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A90E91C4E; Sat, 23 Jan 2016 01:21:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0N1LB2k097493; Sat, 23 Jan 2016 01:21:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0N1LBNX097492; Sat, 23 Jan 2016 01:21:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601230121.u0N1LBNX097492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 23 Jan 2016 01:21:11 +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: r294614 - stable/10/sys/kern 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 01:21:12 -0000 Author: jhb Date: Sat Jan 23 01:21:11 2016 New Revision: 294614 URL: https://svnweb.freebsd.org/changeset/base/294614 Log: MFC 292892: Call kern_thr_exit() instead of duplicating it. This code is missing the racct_subr() call from kern_thr_exit() and would require further code duplication in future changes. Modified: stable/10/sys/kern/kern_thread.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_thread.c ============================================================================== --- stable/10/sys/kern/kern_thread.c Sat Jan 23 01:20:58 2016 (r294613) +++ stable/10/sys/kern/kern_thread.c Sat Jan 23 01:21:11 2016 (r294614) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -885,7 +886,6 @@ thread_suspend_check(int return_instead) */ if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) { PROC_UNLOCK(p); - tidhash_remove(td); /* * Allow Linux emulation layer to do some work @@ -893,13 +893,8 @@ thread_suspend_check(int return_instead) */ if (__predict_false(p->p_sysent->sv_thread_detach != NULL)) (p->p_sysent->sv_thread_detach)(td); - - PROC_LOCK(p); - tdsigcleanup(td); - umtx_thread_exit(td); - PROC_SLOCK(p); - thread_stopped(p); - thread_exit(); + kern_thr_exit(td); + panic("stopped thread did not exit"); } PROC_SLOCK(p); From owner-svn-src-stable@freebsd.org Sat Jan 23 07:33:03 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 810AAA8E09B; Sat, 23 Jan 2016 07:33:03 +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 50D921323; Sat, 23 Jan 2016 07:33:03 +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 u0N7X2lb011929; Sat, 23 Jan 2016 07:33:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0N7X27a011928; Sat, 23 Jan 2016 07:33:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601230733.u0N7X27a011928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 Jan 2016 07:33:02 +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: r294618 - stable/10/sys/fs/devfs 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 07:33:03 -0000 Author: kib Date: Sat Jan 23 07:33:02 2016 New Revision: 294618 URL: https://svnweb.freebsd.org/changeset/base/294618 Log: MFC r293059: Hide transient EBADF errors caused by the parallel revoke(2) or forced unmount of devfs mounts, by restarting the failed syscall. Modified: stable/10/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/10/sys/fs/devfs/devfs_vnops.c Sat Jan 23 05:27:55 2016 (r294617) +++ stable/10/sys/fs/devfs/devfs_vnops.c Sat Jan 23 07:33:02 2016 (r294618) @@ -239,18 +239,18 @@ devfs_populate_vp(struct vnode *vp) if (DEVFS_DMP_DROP(dmp)) { sx_xunlock(&dmp->dm_lock); devfs_unmount_final(dmp); - return (EBADF); + return (ERESTART); } if ((vp->v_iflag & VI_DOOMED) != 0) { sx_xunlock(&dmp->dm_lock); - return (EBADF); + return (ERESTART); } de = vp->v_data; KASSERT(de != NULL, ("devfs_populate_vp: vp->v_data == NULL but vnode not doomed")); if ((de->de_flags & DE_DOOMED) != 0) { sx_xunlock(&dmp->dm_lock); - return (EBADF); + return (ERESTART); } return (0); From owner-svn-src-stable@freebsd.org Sat Jan 23 07:35:30 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6821FA8E1CB; Sat, 23 Jan 2016 07:35:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42F1115BB; Sat, 23 Jan 2016 07:35:30 +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 u0N7ZTY9012064; Sat, 23 Jan 2016 07:35:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0N7ZTGv012063; Sat, 23 Jan 2016 07:35:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601230735.u0N7ZTGv012063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 Jan 2016 07:35:29 +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: r294619 - stable/10/sys/security/audit 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 07:35:30 -0000 Author: kib Date: Sat Jan 23 07:35:29 2016 New Revision: 294619 URL: https://svnweb.freebsd.org/changeset/base/294619 Log: MFC r294137: Do not panic when the filesystem which carries the audit files, is unmounted and audit is active. Do not write to the suspended fs. Modified: stable/10/sys/security/audit/audit_worker.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/security/audit/audit_worker.c ============================================================================== --- stable/10/sys/security/audit/audit_worker.c Sat Jan 23 07:33:02 2016 (r294618) +++ stable/10/sys/security/audit/audit_worker.c Sat Jan 23 07:35:29 2016 (r294619) @@ -71,6 +71,8 @@ __FBSDID("$FreeBSD$"); #include +#include + /* * Worker thread that will schedule disk I/O, etc. */ @@ -98,6 +100,26 @@ static struct sx audit_worker_lock; #define AUDIT_WORKER_LOCK() sx_xlock(&audit_worker_lock) #define AUDIT_WORKER_UNLOCK() sx_xunlock(&audit_worker_lock) +static void +audit_worker_sync_vp(struct vnode *vp, struct mount *mp, const char *fmt, ...) +{ + struct mount *mp1; + int error; + va_list va; + + va_start(va, fmt); + error = vn_start_write(vp, &mp1, 0); + if (error == 0) { + VOP_LOCK(vp, LK_EXCLUSIVE | LK_RETRY); + (void)VOP_FSYNC(vp, MNT_WAIT, curthread); + VOP_UNLOCK(vp, 0); + vn_finished_write(mp1); + } + vfs_unbusy(mp); + vpanic(fmt, va); + va_end(va); +} + /* * Write an audit record to a file, performed as the last stage after both * preselection and BSM conversion. Both space management and write failures @@ -114,6 +136,7 @@ audit_record_write(struct vnode *vp, str static struct timeval last_fail; static int cur_lowspace_trigger; struct statfs *mnt_stat; + struct mount *mp; int error; static int cur_fail; long temp; @@ -123,15 +146,25 @@ audit_record_write(struct vnode *vp, str if (vp == NULL) return; - mnt_stat = &vp->v_mount->mnt_stat; + mp = vp->v_mount; + if (mp == NULL) { + error = EINVAL; + goto fail; + } + error = vfs_busy(mp, 0); + if (error != 0) { + mp = NULL; + goto fail; + } + mnt_stat = &mp->mnt_stat; /* * First, gather statistics on the audit log file and file system so * that we know how we're doing on space. Consider failure of these * operations to indicate a future inability to write to the file. */ - error = VFS_STATFS(vp->v_mount, mnt_stat); - if (error) + error = VFS_STATFS(mp, mnt_stat); + if (error != 0) goto fail; /* @@ -246,13 +279,12 @@ audit_record_write(struct vnode *vp, str */ if (audit_in_failure) { if (audit_q_len == 0 && audit_pre_q_len == 0) { - VOP_LOCK(vp, LK_EXCLUSIVE | LK_RETRY); - (void)VOP_FSYNC(vp, MNT_WAIT, curthread); - VOP_UNLOCK(vp, 0); - panic("Audit store overflow; record queue drained."); + audit_worker_sync_vp(vp, mp, + "Audit store overflow; record queue drained."); } } + vfs_unbusy(mp); return; fail_enospc: @@ -262,10 +294,8 @@ fail_enospc: * space, or ENOSPC returned by the vnode write call. */ if (audit_fail_stop) { - VOP_LOCK(vp, LK_EXCLUSIVE | LK_RETRY); - (void)VOP_FSYNC(vp, MNT_WAIT, curthread); - VOP_UNLOCK(vp, 0); - panic("Audit log space exhausted and fail-stop set."); + audit_worker_sync_vp(vp, mp, + "Audit log space exhausted and fail-stop set."); } (void)audit_send_trigger(AUDIT_TRIGGER_NO_SPACE); audit_suspended = 1; @@ -277,12 +307,12 @@ fail: * lost, which may require an immediate system halt. */ if (audit_panic_on_write_fail) { - VOP_LOCK(vp, LK_EXCLUSIVE | LK_RETRY); - (void)VOP_FSYNC(vp, MNT_WAIT, curthread); - VOP_UNLOCK(vp, 0); - panic("audit_worker: write error %d\n", error); + audit_worker_sync_vp(vp, mp, + "audit_worker: write error %d\n", error); } else if (ppsratecheck(&last_fail, &cur_fail, 1)) printf("audit_worker: write error %d\n", error); + if (mp != NULL) + vfs_unbusy(mp); } /* From owner-svn-src-stable@freebsd.org Sat Jan 23 15:48:15 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE032A8E659; Sat, 23 Jan 2016 15:48:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F0381CBC; Sat, 23 Jan 2016 15:48:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0NFmEaH062072; Sat, 23 Jan 2016 15:48:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0NFmExT062070; Sat, 23 Jan 2016 15:48:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201601231548.u0NFmExT062070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 23 Jan 2016 15:48:14 +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: r294635 - stable/10/usr.bin/iscsictl 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 15:48:16 -0000 Author: trasz Date: Sat Jan 23 15:48:14 2016 New Revision: 294635 URL: https://svnweb.freebsd.org/changeset/base/294635 Log: MFC r289453: Add -w flag to iscsictl(8) utility, to make it wait for successfull session establishment. Scripting is kind of hard without it. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/iscsictl/iscsictl.8 stable/10/usr.bin/iscsictl/iscsictl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.8 Sat Jan 23 15:33:11 2016 (r294634) +++ stable/10/usr.bin/iscsictl/iscsictl.8 Sat Jan 23 15:48:14 2016 (r294635) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 12, 2014 +.Dd October 17, 2015 .Dt ISCSICTL 8 .Os .Sh NAME @@ -36,7 +36,9 @@ .Sh SYNOPSIS .Nm .Fl A -.Fl p Ar portal Fl t Ar target Op Fl u Ar user Fl s Ar secret +.Fl p Ar portal Fl t Ar target +.Op Fl u Ar user Fl s Ar secret +.Op Fl w Ar timeout .Nm .Fl A .Fl d Ar discovery-host Op Fl u Ar user Fl s Ar secret @@ -70,6 +72,7 @@ .Nm .Fl L .Op Fl v +.Op Fl w Ar timeout .Sh DESCRIPTION The .Nm @@ -113,6 +116,10 @@ Target name. CHAP login. .It Fl v Verbose mode. +.It Fl w +Instead of returning immediately, wait up to +.Ar timeout +seconds until all configured sessions are successfully established. .El .Pp Certain parameters are necessary when adding a session. @@ -132,9 +139,11 @@ via configuration file. .Pp Since connecting to the target is performed in background, non-zero exit status does not mean that the session was successfully established. -Use +Use either .Nm Fl L -to check the connection status. +to check the connection status, or the +.Fl w +flag to wait for session establishment. .Pp Note that in order for the iSCSI initiator to be able to connect to a target, the Modified: stable/10/usr.bin/iscsictl/iscsictl.c ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.c Sat Jan 23 15:33:11 2016 (r294634) +++ stable/10/usr.bin/iscsictl/iscsictl.c Sat Jan 23 15:48:14 2016 (r294635) @@ -550,12 +550,70 @@ kernel_list(int iscsi_fd, const struct t return (0); } +static int +kernel_wait(int iscsi_fd, int timeout) +{ + struct iscsi_session_state *states = NULL; + const struct iscsi_session_state *state; + const struct iscsi_session_conf *conf; + struct iscsi_session_list isl; + unsigned int i, nentries = 1; + bool all_connected; + int error; + + for (;;) { + for (;;) { + states = realloc(states, + nentries * sizeof(struct iscsi_session_state)); + if (states == NULL) + err(1, "realloc"); + + memset(&isl, 0, sizeof(isl)); + isl.isl_nentries = nentries; + isl.isl_pstates = states; + + error = ioctl(iscsi_fd, ISCSISLIST, &isl); + if (error != 0 && errno == EMSGSIZE) { + nentries *= 4; + continue; + } + break; + } + if (error != 0) { + warn("ISCSISLIST"); + return (error); + } + + all_connected = true; + for (i = 0; i < isl.isl_nentries; i++) { + state = &states[i]; + conf = &state->iss_conf; + + if (!state->iss_connected) { + all_connected = false; + break; + } + } + + if (all_connected) + return (0); + + sleep(1); + + if (timeout > 0) { + timeout--; + if (timeout == 0) + return (1); + } + } +} + static void usage(void) { fprintf(stderr, "usage: iscsictl -A -p portal -t target " - "[-u user -s secret]\n"); + "[-u user -s secret] [-w timeout]\n"); fprintf(stderr, " iscsictl -A -d discovery-host " "[-u user -s secret]\n"); fprintf(stderr, " iscsictl -A -a [-c path]\n"); @@ -567,7 +625,7 @@ usage(void) fprintf(stderr, " iscsictl -R [-p portal] [-t target]\n"); fprintf(stderr, " iscsictl -R -a\n"); fprintf(stderr, " iscsictl -R -n nickname [-c path]\n"); - fprintf(stderr, " iscsictl -L [-v]\n"); + fprintf(stderr, " iscsictl -L [-v] [-w timeout]\n"); exit(1); } @@ -589,6 +647,7 @@ main(int argc, char **argv) const char *conf_path = DEFAULT_CONFIG_PATH; char *nickname = NULL, *discovery_host = NULL, *portal = NULL, *target = NULL, *user = NULL, *secret = NULL; + int timeout = -1; long long session_id = -1; char *end; int ch, error, iscsi_fd, retval, saved_errno; @@ -596,7 +655,7 @@ main(int argc, char **argv) struct conf *conf; struct target *targ; - while ((ch = getopt(argc, argv, "AMRLac:d:i:n:p:t:u:s:v")) != -1) { + while ((ch = getopt(argc, argv, "AMRLac:d:i:n:p:t:u:s:vw:")) != -1) { switch (ch) { case 'A': Aflag = 1; @@ -647,6 +706,13 @@ main(int argc, char **argv) case 'v': vflag = 1; break; + case 'w': + timeout = strtol(optarg, &end, 10); + if ((size_t)(end - optarg) != strlen(optarg)) + errx(1, "trailing characters after timeout"); + if (timeout < 0) + errx(1, "timeout cannot be negative"); + break; case '?': default: usage(); @@ -737,6 +803,8 @@ main(int argc, char **argv) if (vflag != 0) errx(1, "-v cannot be used with -M"); + if (timeout != -1) + errx(1, "-w cannot be used with -M"); } else if (Rflag != 0) { if (user != NULL) @@ -766,6 +834,8 @@ main(int argc, char **argv) errx(1, "-i cannot be used with -R"); if (vflag != 0) errx(1, "-v cannot be used with -R"); + if (timeout != -1) + errx(1, "-w cannot be used with -R"); } else { assert(Lflag != 0); @@ -851,6 +921,9 @@ main(int argc, char **argv) failed += kernel_list(iscsi_fd, targ, vflag); } + if (timeout != -1) + failed += kernel_wait(iscsi_fd, timeout); + error = close(iscsi_fd); if (error != 0) err(1, "close"); From owner-svn-src-stable@freebsd.org Sat Jan 23 16:26:21 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C448A8DBE5; Sat, 23 Jan 2016 16:26:21 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A99A1BE3; Sat, 23 Jan 2016 16:26:21 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aN10z-0009UX-9K; Sat, 23 Jan 2016 19:26:17 +0300 Date: Sat, 23 Jan 2016 19:26:17 +0300 From: Slawa Olhovchenkov To: =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r293857 - stable/10/sys/dev/drm2/i915 Message-ID: <20160123162617.GL37895@zxy.spb.ru> References: <201601132156.u0DLunQs020854@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201601132156.u0DLunQs020854@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 16:26:21 -0000 On Wed, Jan 13, 2016 at 09:56:49PM +0000, Jean-Sébastien Pédron wrote: > Author: dumbbell > Date: Wed Jan 13 21:56:48 2016 > New Revision: 293857 > URL: https://svnweb.freebsd.org/changeset/base/293857 > > Log: > drm/i915: Remove "Attempting to unbind pinned buffer" message > > This error message is removed in later versions of Linux and currently, > it spams users. > > PR: 200712 > MFC of: r289109 > > Modified: > stable/10/sys/dev/drm2/i915/i915_gem.c > Directory Properties: > stable/10/ (props changed) Accelerating still not workin on 915GM. [ 11608.722] (EE) intel(0): Detected a hung GPU, disabling acceleration. [ 11608.722] (EE) intel(0): When reporting this, please include i915_error_state from debugfs and the full dmesg. Can you fix this? This bug about year old. From owner-svn-src-stable@freebsd.org Sat Jan 23 17:08:19 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F330A8E84E; Sat, 23 Jan 2016 17:08:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FF261D7B; Sat, 23 Jan 2016 17:08:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0NH8Ib9086986; Sat, 23 Jan 2016 17:08:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0NH8IDU086985; Sat, 23 Jan 2016 17:08:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601231708.u0NH8IDU086985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 23 Jan 2016 17:08:18 +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: r294636 - in stable: 10/sys/ofed/include/linux 9/sys/ofed/include/linux 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 17:08:19 -0000 Author: jhb Date: Sat Jan 23 17:08:17 2016 New Revision: 294636 URL: https://svnweb.freebsd.org/changeset/base/294636 Log: MFC 294366: Initialize vm_page_prot to VM_MEMATTR_DEFAULT instead of 0. If a driver's Linux mmap callback passed vm_page_prot through unchanged, then linux_dev_mmap_single() would try to apply whatever VM_MEMATTR_xxx value 0 is to the mapping. On x86, VM_MEMATTR_DEFAULT is the PAT value for write-back (WB) which is 6, while 0 maps to the PAT value for uncacheable (UC). Thus, any mmap request that did not explicitly set page_prot was tried to map memory as UC triggering the warning in sg_pager_getpages(). Sponsored by: Chelsio Communications Modified: stable/10/sys/ofed/include/linux/linux_compat.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/ofed/include/linux/linux_compat.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/ofed/include/linux/linux_compat.c ============================================================================== --- stable/10/sys/ofed/include/linux/linux_compat.c Sat Jan 23 15:48:14 2016 (r294635) +++ stable/10/sys/ofed/include/linux/linux_compat.c Sat Jan 23 17:08:17 2016 (r294636) @@ -480,7 +480,7 @@ linux_dev_mmap_single(struct cdev *dev, vma.vm_end = size; vma.vm_pgoff = *offset / PAGE_SIZE; vma.vm_pfn = 0; - vma.vm_page_prot = 0; + vma.vm_page_prot = VM_MEMATTR_DEFAULT; if (filp->f_op->mmap) { error = -filp->f_op->mmap(filp, &vma); if (error == 0) { From owner-svn-src-stable@freebsd.org Sat Jan 23 17:08:19 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EAC7A8E853; Sat, 23 Jan 2016 17:08:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDA51D7C; Sat, 23 Jan 2016 17:08:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0NH8IHT086992; Sat, 23 Jan 2016 17:08:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0NH8I37086991; Sat, 23 Jan 2016 17:08:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601231708.u0NH8I37086991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 23 Jan 2016 17:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294636 - in stable: 10/sys/ofed/include/linux 9/sys/ofed/include/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 17:08:19 -0000 Author: jhb Date: Sat Jan 23 17:08:17 2016 New Revision: 294636 URL: https://svnweb.freebsd.org/changeset/base/294636 Log: MFC 294366: Initialize vm_page_prot to VM_MEMATTR_DEFAULT instead of 0. If a driver's Linux mmap callback passed vm_page_prot through unchanged, then linux_dev_mmap_single() would try to apply whatever VM_MEMATTR_xxx value 0 is to the mapping. On x86, VM_MEMATTR_DEFAULT is the PAT value for write-back (WB) which is 6, while 0 maps to the PAT value for uncacheable (UC). Thus, any mmap request that did not explicitly set page_prot was tried to map memory as UC triggering the warning in sg_pager_getpages(). Sponsored by: Chelsio Communications Modified: stable/9/sys/ofed/include/linux/linux_compat.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/ofed/include/linux/linux_compat.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/ofed/include/linux/linux_compat.c ============================================================================== --- stable/9/sys/ofed/include/linux/linux_compat.c Sat Jan 23 15:48:14 2016 (r294635) +++ stable/9/sys/ofed/include/linux/linux_compat.c Sat Jan 23 17:08:17 2016 (r294636) @@ -434,7 +434,7 @@ linux_dev_mmap_single(struct cdev *dev, vma.vm_end = size; vma.vm_pgoff = *offset / PAGE_SIZE; vma.vm_pfn = 0; - vma.vm_page_prot = 0; + vma.vm_page_prot = VM_MEMATTR_DEFAULT; if (filp->f_op->mmap) { error = -filp->f_op->mmap(filp, &vma); if (error == 0) { From owner-svn-src-stable@freebsd.org Sat Jan 23 19:13:50 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5DD4A8E668; Sat, 23 Jan 2016 19:13:49 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C36831729; Sat, 23 Jan 2016 19:13:49 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0NJDmLB024313; Sat, 23 Jan 2016 19:13:48 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0NJDmw1024312; Sat, 23 Jan 2016 19:13:48 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601231913.u0NJDmw1024312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 23 Jan 2016 19:13:48 +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: r294637 - stable/10/sys/dev/usb/serial 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 19:13:50 -0000 Author: ian Date: Sat Jan 23 19:13:48 2016 New Revision: 294637 URL: https://svnweb.freebsd.org/changeset/base/294637 Log: MFC r294235: Make PPS ASSERT/CLEAR events match the RS-232 signal levels as per RFC 2783. Previously the polarity was for TTL levels, which are the reverse of RS-232. Also add handling of the UART_PPS_INVERT_PULSE option bit in the sysctl value, the same as was recently added to uart(4), so that people using TTL level connections can request a logical inverting of the signal. Use the named constants from the new dev/uart/uart_ppstypes.h for the pps capture modes and option bits. Modified: stable/10/sys/dev/usb/serial/usb_serial.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/10/sys/dev/usb/serial/usb_serial.c Sat Jan 23 17:08:17 2016 (r294636) +++ stable/10/sys/dev/usb/serial/usb_serial.c Sat Jan 23 19:13:48 2016 (r294637) @@ -81,6 +81,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -99,7 +101,8 @@ static SYSCTL_NODE(_hw_usb, OID_AUTO, uc static int ucom_pps_mode; SYSCTL_INT(_hw_usb_ucom, OID_AUTO, pps_mode, CTLFLAG_RWTUN, - &ucom_pps_mode, 0, "pulse capturing mode - 0/1/2 - disabled/CTS/DCD"); + &ucom_pps_mode, 0, + "pulse capture mode: 0/1/2=disabled/CTS/DCD; add 0x10 to invert"); #ifdef USB_DEBUG static int ucom_debug = 0; @@ -1074,10 +1077,12 @@ ucom_cfg_status_change(struct usb_proc_m (struct ucom_cfg_task *)_task; struct ucom_softc *sc = task->sc; struct tty *tp; + int onoff; uint8_t new_msr; uint8_t new_lsr; uint8_t msr_delta; uint8_t lsr_delta; + uint8_t pps_signal; tp = sc->sc_tty; @@ -1107,35 +1112,33 @@ ucom_cfg_status_change(struct usb_proc_m sc->sc_lsr = new_lsr; /* - * Time pulse counting support. Note that both CTS and DCD are - * active-low signals. The status bit is high to indicate that - * the signal on the line is low, which corresponds to a PPS - * clear event. + * Time pulse counting support. */ - switch(ucom_pps_mode) { - case 1: - if ((sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) && - (msr_delta & SER_CTS)) { - pps_capture(&sc->sc_pps); - pps_event(&sc->sc_pps, (sc->sc_msr & SER_CTS) ? - PPS_CAPTURECLEAR : PPS_CAPTUREASSERT); - } + switch(ucom_pps_mode & UART_PPS_SIGNAL_MASK) { + case UART_PPS_CTS: + pps_signal = SER_CTS; break; - case 2: - if ((sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) && - (msr_delta & SER_DCD)) { - pps_capture(&sc->sc_pps); - pps_event(&sc->sc_pps, (sc->sc_msr & SER_DCD) ? - PPS_CAPTURECLEAR : PPS_CAPTUREASSERT); - } + case UART_PPS_DCD: + pps_signal = SER_DCD; break; default: + pps_signal = 0; break; } + if ((sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) && + (msr_delta & pps_signal)) { + pps_capture(&sc->sc_pps); + onoff = (sc->sc_msr & pps_signal) ? 1 : 0; + if (ucom_pps_mode & UART_PPS_INVERT_PULSE) + onoff = !onoff; + pps_event(&sc->sc_pps, onoff ? PPS_CAPTUREASSERT : + PPS_CAPTURECLEAR); + } + if (msr_delta & SER_DCD) { - int onoff = (sc->sc_msr & SER_DCD) ? 1 : 0; + onoff = (sc->sc_msr & SER_DCD) ? 1 : 0; DPRINTF("DCD changed to %d\n", onoff); From owner-svn-src-stable@freebsd.org Sat Jan 23 20:49:53 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D90CCA8E46F; Sat, 23 Jan 2016 20:49:53 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA3351A90; Sat, 23 Jan 2016 20:49:53 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0NKnq4R051544; Sat, 23 Jan 2016 20:49:52 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0NKnqRL051543; Sat, 23 Jan 2016 20:49:52 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201601232049.u0NKnqRL051543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 23 Jan 2016 20:49:52 +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: r294639 - stable/10/lib/libthr/thread 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 20:49:54 -0000 Author: vangyzen Date: Sat Jan 23 20:49:52 2016 New Revision: 294639 URL: https://svnweb.freebsd.org/changeset/base/294639 Log: MFC r293858 libthr: const-ify two variables Make the default umutex and urwlock initializers const, because they can be, and as a microoptimization. Sponsored by: Dell Inc. Modified: stable/10/lib/libthr/thread/thr_umtx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/thread/thr_umtx.c ============================================================================== --- stable/10/lib/libthr/thread/thr_umtx.c Sat Jan 23 20:01:46 2016 (r294638) +++ stable/10/lib/libthr/thread/thr_umtx.c Sat Jan 23 20:49:52 2016 (r294639) @@ -42,7 +42,7 @@ int _umtx_op_err(void *obj, int op, u_lo void _thr_umutex_init(struct umutex *mtx) { - static struct umutex default_mtx = DEFAULT_UMUTEX; + static const struct umutex default_mtx = DEFAULT_UMUTEX; *mtx = default_mtx; } @@ -50,7 +50,8 @@ _thr_umutex_init(struct umutex *mtx) void _thr_urwlock_init(struct urwlock *rwl) { - static struct urwlock default_rwl = DEFAULT_URWLOCK; + static const struct urwlock default_rwl = DEFAULT_URWLOCK; + *rwl = default_rwl; } From owner-svn-src-stable@freebsd.org Sat Jan 23 20:51:58 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6522DA8E50D; Sat, 23 Jan 2016 20:51:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3407D1CCB; Sat, 23 Jan 2016 20:51:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0NKpvZD054142; Sat, 23 Jan 2016 20:51:57 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0NKpvee054141; Sat, 23 Jan 2016 20:51:57 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201601232051.u0NKpvee054141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 23 Jan 2016 20:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r294640 - stable/9/lib/libthr/thread X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 20:51:58 -0000 Author: vangyzen Date: Sat Jan 23 20:51:57 2016 New Revision: 294640 URL: https://svnweb.freebsd.org/changeset/base/294640 Log: MFC r293858 libthr: const-ify two variables Make the default umutex and urwlock initializers const, because they can be, and as a microoptimization. Sponsored by: Dell Inc. Modified: stable/9/lib/libthr/thread/thr_umtx.c Directory Properties: stable/9/lib/libthr/ (props changed) Modified: stable/9/lib/libthr/thread/thr_umtx.c ============================================================================== --- stable/9/lib/libthr/thread/thr_umtx.c Sat Jan 23 20:49:52 2016 (r294639) +++ stable/9/lib/libthr/thread/thr_umtx.c Sat Jan 23 20:51:57 2016 (r294640) @@ -42,7 +42,7 @@ int _umtx_op_err(void *obj, int op, u_lo void _thr_umutex_init(struct umutex *mtx) { - static struct umutex default_mtx = DEFAULT_UMUTEX; + static const struct umutex default_mtx = DEFAULT_UMUTEX; *mtx = default_mtx; } @@ -50,7 +50,8 @@ _thr_umutex_init(struct umutex *mtx) void _thr_urwlock_init(struct urwlock *rwl) { - static struct urwlock default_rwl = DEFAULT_URWLOCK; + static const struct urwlock default_rwl = DEFAULT_URWLOCK; + *rwl = default_rwl; } From owner-svn-src-stable@freebsd.org Sat Jan 23 21:04:36 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77EADA8EA1C; Sat, 23 Jan 2016 21:04:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F6441391; Sat, 23 Jan 2016 21:04:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0NL4ZBB057388; Sat, 23 Jan 2016 21:04:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0NL4ZcW057386; Sat, 23 Jan 2016 21:04:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601232104.u0NL4ZcW057386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 23 Jan 2016 21:04:35 +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: r294641 - in stable/10/tools/regression/sockets: rtsocket unix_socket 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 21:04:36 -0000 Author: ngie Date: Sat Jan 23 21:04:34 2016 New Revision: 294641 URL: https://svnweb.freebsd.org/changeset/base/294641 Log: MFC r294125: Test for EPROTOTYPE not EPROTONOSUPPORT - `SOCK_RAW` is the implied supported type parameter for socket(2) per route(4) - localsw in `sys/kern/uipc_usrreq.c` doesn't have an entry for `SOCK_RAW`, so the prototype is invalid (this isn't explicitly documented anywhere I could find) Modified: stable/10/tools/regression/sockets/rtsocket/rtsocket.c stable/10/tools/regression/sockets/unix_socket/unix_socket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/sockets/rtsocket/rtsocket.c ============================================================================== --- stable/10/tools/regression/sockets/rtsocket/rtsocket.c Sat Jan 23 20:51:57 2016 (r294640) +++ stable/10/tools/regression/sockets/rtsocket/rtsocket.c Sat Jan 23 21:04:34 2016 (r294641) @@ -52,7 +52,7 @@ main(void) sock); } - if (errno != EPROTONOSUPPORT) + if (errno != EPROTOTYPE) err(-1, "socket(PF_ROUTE, SOCK_STREAM, 0)"); sock = socket(PF_ROUTE, SOCK_DGRAM, 0); @@ -62,7 +62,7 @@ main(void) sock); } - if (errno != EPROTONOSUPPORT) + if (errno != EPROTOTYPE) err(-1, "socket(PF_ROUTE, SOCK_DGRAM, 0)"); sock = socket(PF_ROUTE, SOCK_RAW, 0); @@ -77,7 +77,7 @@ main(void) "socketpair(PF_ROUTE, SOCK_STREAM, 0, socks) success"); } - if (errno != EPROTONOSUPPORT) + if (errno != EPROTOTYPE) err(-1, "socketpair(PF_ROUTE, SOCK_STREAM, 0, socks)"); if (socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) == 0) { @@ -87,7 +87,7 @@ main(void) "socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) success"); } - if (errno != EPROTONOSUPPORT) + if (errno != EPROTOTYPE) err(-1, "socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks)"); if (socketpair(PF_ROUTE, SOCK_RAW, 0, socks) == 0) { Modified: stable/10/tools/regression/sockets/unix_socket/unix_socket.c ============================================================================== --- stable/10/tools/regression/sockets/unix_socket/unix_socket.c Sat Jan 23 20:51:57 2016 (r294640) +++ stable/10/tools/regression/sockets/unix_socket/unix_socket.c Sat Jan 23 21:04:34 2016 (r294641) @@ -59,7 +59,7 @@ main(void) close(sock); errx(-1, "socket(PF_LOCAL, SOCK_RAW, 0) returned %d", sock); } - if (errno != EPROTONOSUPPORT) + if (errno != EPROTOTYPE) err(-1, "socket(PF_LOCAL, SOCK_RAW, 0)"); if (socketpair(PF_LOCAL, SOCK_STREAM, 0, socks) < 0) From owner-svn-src-stable@freebsd.org Sat Jan 23 22:13:33 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E31E0A8FFC9; Sat, 23 Jan 2016 22:13:32 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAC111EA3; Sat, 23 Jan 2016 22:13:32 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0NMDVjV078732; Sat, 23 Jan 2016 22:13:31 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0NMDVwg078731; Sat, 23 Jan 2016 22:13:31 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201601232213.u0NMDVwg078731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 23 Jan 2016 22:13: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: r294642 - stable/10/usr.sbin/bsdinstall/scripts 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 22:13:33 -0000 Author: allanjude Date: Sat Jan 23 22:13:31 2016 New Revision: 294642 URL: https://svnweb.freebsd.org/changeset/base/294642 Log: MFC: r285732 Add the Dell E7240 laptop and Intel DP965LT motherboard to the list for the GPT active workaround MFC: r287843 Add the HP ProBook 4330s, Intel DP965LT, D510MO, and Acer Veriton M6630G to the GPT workaround list Sponsored by: ScaleEngine Inc. Modified: stable/10/usr.sbin/bsdinstall/scripts/auto Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/auto Sat Jan 23 21:04:34 2016 (r294641) +++ stable/10/usr.sbin/bsdinstall/scripts/auto Sat Jan 23 22:13:31 2016 (r294642) @@ -53,7 +53,7 @@ error() { } hline_arrows_tab_enter="Press arrows, TAB or ENTER" -msg_gpt_active_fix="Your hardware is known to have issues booting in BIOS mode from GPT partitions that are not set active. Would you like the installer to apply this workaround for you?" +msg_gpt_active_fix="Your hardware is known to have issues booting in CSM/Legacy/BIOS mode from GPT partitions that are not set active. Would you like the installer to apply this workaround for you?" msg_lenovo_fix="Your model of Lenovo is known to have a BIOS bug that prevents it booting from GPT partitions without UEFI. Would you like the installer to apply a workaround for you?" msg_no="NO" msg_yes="YES" @@ -166,6 +166,14 @@ if f_interactive; then f_dprintf "smbios.system.product=[%s]" "$sys_model" sys_version=$( kenv -q smbios.system.version ) f_dprintf "smbios.system.version=[%s]" "$sys_version" + sys_mb_maker=$( kenv -q smbios.planar.maker ) + f_dprintf "smbios.planar.maker=[%s]" "$sys_mb_maker" + sys_mb_product=$( kenv -q smbios.planar.product ) + f_dprintf "smbios.planar.product=[%s]" "$sys_mb_product" + + # + # Laptop Models + # case "$sys_maker" in "LENOVO") case "$sys_version" in @@ -182,7 +190,51 @@ if f_interactive; then ;; "Dell Inc.") case "$sys_model" in - "Latitude E7440") + "Latitude E7440"|"Latitude E7240") + dialog_workaround "$msg_gpt_active_fix" + retval=$? + f_dprintf "gpt_active_fix_prompt=[%s]" "$retval" + if [ $retval -eq $DIALOG_OK ]; then + export ZFSBOOT_PARTITION_SCHEME="GPT + Active" + export WORKAROUND_GPTACTIVE=1 + fi + ;; + esac + ;; + "Hewlett-Packard") + case "$sys_model" in + "HP ProBook 4330s") + dialog_workaround "$msg_gpt_active_fix" + retval=$? + f_dprintf "gpt_active_fix_prompt=[%s]" "$retval" + if [ $retval -eq $DIALOG_OK ]; then + export ZFSBOOT_PARTITION_SCHEME="GPT + Active" + export WORKAROUND_GPTACTIVE=1 + fi + ;; + esac + ;; + esac + # + # Motherboard Models + # + case "$sys_mb_maker" in + "Intel Corporation") + case "$sys_mb_product" in + "DP965LT"|"D510MO") + dialog_workaround "$msg_gpt_active_fix" + retval=$? + f_dprintf "gpt_active_fix_prompt=[%s]" "$retval" + if [ $retval -eq $DIALOG_OK ]; then + export ZFSBOOT_PARTITION_SCHEME="GPT + Active" + export WORKAROUND_GPTACTIVE=1 + fi + ;; + esac + ;; + "Acer") + case "$sys_mb_product" in + "Veriton M6630G") dialog_workaround "$msg_gpt_active_fix" retval=$? f_dprintf "gpt_active_fix_prompt=[%s]" "$retval"