From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 17:23:45 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 907F9DEC; Sun, 2 Nov 2014 17:23:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7100EC79; Sun, 2 Nov 2014 17:23:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HNj5g027547; Sun, 2 Nov 2014 17:23:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HNjJB027546; Sun, 2 Nov 2014 17:23:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021723.sA2HNjJB027546@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:23:45 +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: r273974 - stable/10/sys/cam/scsi 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.18-1 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, 02 Nov 2014 17:23:45 -0000 Author: mav Date: Sun Nov 2 17:23:44 2014 New Revision: 273974 URL: https://svnweb.freebsd.org/changeset/base/273974 Log: MFC r272401, r272402: Rework the logic of sequential SCSI LUN scanner. Previous logic was not differentiating disconnected LUNs and absent targets. That made it to stop scan if LUN 0 was not found for any reason. That made problematic, for example, using iSCSI targets declaring SPC-2 compliance and having no LUN 0 configured. The new logic continues sequential LUN scan if: -- we have more configured LUNs that need recheck; -- this LUN is connected and its SCSI version allows more LUNs; -- this LUN is disconnected, its SCSI version allows more LUNs and we guess they may be connected (we haven't scanned first 8 LUNs yet or kern.cam.cam_srch_hi sysctl is set to scan more). Modified: stable/10/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_xpt.c Sun Nov 2 16:04:48 2014 (r273973) +++ stable/10/sys/cam/scsi/scsi_xpt.c Sun Nov 2 17:23:44 2014 (r273974) @@ -1138,6 +1138,7 @@ out: u_int8_t periph_qual; path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID; + scsi_find_quirk(path->device); inq_buf = &path->device->inq_data; periph_qual = SID_QUAL(inq_buf); @@ -1166,8 +1167,6 @@ out: goto out; } - scsi_find_quirk(path->device); - scsi_devise_transport(path); if (path->device->lun_id == 0 && @@ -1216,10 +1215,13 @@ out: : SF_RETRY_UA, &softc->saved_ccb) == ERESTART) { goto outr; - } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { - /* Don't wedge the queue */ - xpt_release_devq(done_ccb->ccb_h.path, /*count*/1, - /*run_queue*/TRUE); + } else { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + /* Don't wedge the queue */ + xpt_release_devq(done_ccb->ccb_h.path, + /*count*/1, /*run_queue*/TRUE); + } + path->device->flags &= ~CAM_DEV_INQUIRY_DATA_VALID; } /* * If we get to this point, we got an error status back @@ -1980,7 +1982,7 @@ scsi_scan_bus(struct cam_periph *periph, struct cam_path *path, *oldpath; scsi_scan_bus_info *scan_info; struct cam_et *target; - struct cam_ed *device; + struct cam_ed *device, *nextdev; int next_target; path_id_t path_id; target_id_t target_id; @@ -1989,18 +1991,10 @@ scsi_scan_bus(struct cam_periph *periph, oldpath = request_ccb->ccb_h.path; status = cam_ccb_status(request_ccb); - /* Reuse the same CCB to query if a device was really found */ scan_info = (scsi_scan_bus_info *)request_ccb->ccb_h.ppriv_ptr0; - xpt_setup_ccb(&request_ccb->ccb_h, request_ccb->ccb_h.path, - request_ccb->ccb_h.pinfo.priority); - request_ccb->ccb_h.func_code = XPT_GDEV_TYPE; - - path_id = request_ccb->ccb_h.path_id; target_id = request_ccb->ccb_h.target_id; lun_id = request_ccb->ccb_h.target_lun; - xpt_action(request_ccb); - target = request_ccb->ccb_h.path->target; next_target = 1; @@ -2077,56 +2071,39 @@ scsi_scan_bus(struct cam_periph *periph, } } } else { - mtx_unlock(&target->luns_mtx); - if (request_ccb->ccb_h.status != CAM_REQ_CMP) { - int phl; - - /* - * If we already probed lun 0 successfully, or - * we have additional configured luns on this - * target that might have "gone away", go onto - * the next lun. - */ - /* - * We may touch devices that we don't - * hold references too, so ensure they - * don't disappear out from under us. - * The target above is referenced by the - * path in the request ccb. - */ - phl = 0; - device = TAILQ_FIRST(&target->ed_entries); - if (device != NULL) { - phl = CAN_SRCH_HI_SPARSE(device); - if (device->lun_id == 0) - device = TAILQ_NEXT(device, links); - } - if ((lun_id != 0) || (device != NULL)) { - if (lun_id < (CAM_SCSI2_MAXLUN-1) || phl) { - lun_id++; - next_target = 0; - } - } - if (lun_id == request_ccb->ccb_h.target_lun - || lun_id > scan_info->cpi->max_lun) - next_target = 1; - } else { - + mtx_unlock(&target->luns_mtx); device = request_ccb->ccb_h.path->device; - - if ((SCSI_QUIRK(device)->quirks & - CAM_QUIRK_NOLUNS) == 0) { - /* Try the next lun */ - if (lun_id < (CAM_SCSI2_MAXLUN-1) - || CAN_SRCH_HI_DENSE(device)) { - lun_id++; + /* Continue sequential LUN scan if: */ + /* -- we have more LUNs that need recheck */ + mtx_lock(&target->bus->eb_mtx); + nextdev = device; + while ((nextdev = TAILQ_NEXT(nextdev, links)) != NULL) + if ((nextdev->flags & CAM_DEV_UNCONFIGURED) == 0) + break; + mtx_unlock(&target->bus->eb_mtx); + if (nextdev != NULL) { + next_target = 0; + /* -- stop if CAM_QUIRK_NOLUNS is set. */ + } else if (SCSI_QUIRK(device)->quirks & CAM_QUIRK_NOLUNS) { + next_target = 1; + /* -- this LUN is connected and its SCSI version + * allows more LUNs. */ + } else if ((device->flags & CAM_DEV_UNCONFIGURED) == 0) { + if (lun_id < (CAM_SCSI2_MAXLUN-1) || + CAN_SRCH_HI_DENSE(device)) + next_target = 0; + /* -- this LUN is disconnected, its SCSI version + * allows more LUNs and we guess they may be. */ + } else if ((device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0) { + if (lun_id < (CAM_SCSI2_MAXLUN-1) || + CAN_SRCH_HI_SPARSE(device)) next_target = 0; - } } - if (lun_id == request_ccb->ccb_h.target_lun - || lun_id > scan_info->cpi->max_lun) - next_target = 1; - } + if (next_target == 0) { + lun_id++; + if (lun_id > scan_info->cpi->max_lun) + next_target = 1; + } } /* From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 17:25:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBA66FF9; Sun, 2 Nov 2014 17:25:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D53CC8A; Sun, 2 Nov 2014 17:25:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HP4ZN027898; Sun, 2 Nov 2014 17:25:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HP463027897; Sun, 2 Nov 2014 17:25:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021725.sA2HP463027897@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:25: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: r273975 - stable/10/sys/cam/scsi 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.18-1 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, 02 Nov 2014 17:25:04 -0000 Author: mav Date: Sun Nov 2 17:25:03 2014 New Revision: 273975 URL: https://svnweb.freebsd.org/changeset/base/273975 Log: MFC r272406: Make disconnected LUN 0 don't remain in half-configured state if there are no LUNs on SPC-3 target after we tried REPORT LUNS. Modified: stable/10/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_xpt.c Sun Nov 2 17:23:44 2014 (r273974) +++ stable/10/sys/cam/scsi/scsi_xpt.c Sun Nov 2 17:25:03 2014 (r273975) @@ -1197,12 +1197,6 @@ out: SID_ANSI_REV(inq_buf) > SCSI_REV_SPC2 && (SCSI_QUIRK(path->device)->quirks & CAM_QUIRK_NORPTLUNS) == 0) { - if (path->device->flags & - CAM_DEV_UNCONFIGURED) { - path->device->flags &= - ~CAM_DEV_UNCONFIGURED; - xpt_acquire_device(path->device); - } PROBE_SET_ACTION(softc, PROBE_REPORT_LUNS); periph->path->target->rpl_size = 16; xpt_release_ccb(done_ccb); @@ -1313,14 +1307,6 @@ out: tlun, 8); CAM_DEBUG(path, CAM_DEBUG_PROBE, ("lun 0 in position %u\n", idx)); - } else { - /* - * There is no lun 0 in our list. Destroy - * the validity of the inquiry data so we - * bail here and now. - */ - path->device->flags &= - ~CAM_DEV_INQUIRY_DATA_VALID; } } /* @@ -1333,7 +1319,8 @@ out: probe_purge_old(path, lp, softc->flags); lp = NULL; } - if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) { + if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID && + SID_QUAL(&path->device->inq_data) == SID_QUAL_LU_CONNECTED) { struct scsi_inquiry_data *inq_buf; inq_buf = &path->device->inq_data; if (INQ_DATA_TQ_ENABLED(inq_buf)) @@ -1348,6 +1335,8 @@ out: if (lp) { free(lp, M_CAMXPT); } + PROBE_SET_ACTION(softc, PROBE_INVALID); + xpt_release_ccb(done_ccb); break; } case PROBE_MODE_SENSE: From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 17:26:14 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A20D1F1; Sun, 2 Nov 2014 17:26:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17224C9B; Sun, 2 Nov 2014 17:26:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HQDuF028109; Sun, 2 Nov 2014 17:26:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HQDSE028108; Sun, 2 Nov 2014 17:26:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021726.sA2HQDSE028108@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:26:13 +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: r273976 - stable/10/sys/cam/scsi 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.18-1 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, 02 Nov 2014 17:26:14 -0000 Author: mav Date: Sun Nov 2 17:26:13 2014 New Revision: 273976 URL: https://svnweb.freebsd.org/changeset/base/273976 Log: MFC r272409: Use REPORT LUNS command for SPC-2 devices with LUN 0 disconnected. SPC-2 tells REPORT LUNS shall be supported by devices supporting LUNs other then LUN 0. If we see LUN 0 disconnected, guess there may be others, and so REPORT LUNS shall be supported. Modified: stable/10/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_xpt.c Sun Nov 2 17:25:03 2014 (r273975) +++ stable/10/sys/cam/scsi/scsi_xpt.c Sun Nov 2 17:26:13 2014 (r273976) @@ -1194,7 +1194,7 @@ out: xpt_schedule(periph, priority); goto out; } else if (path->device->lun_id == 0 && - SID_ANSI_REV(inq_buf) > SCSI_REV_SPC2 && + SID_ANSI_REV(inq_buf) >= SCSI_REV_SPC2 && (SCSI_QUIRK(path->device)->quirks & CAM_QUIRK_NORPTLUNS) == 0) { PROBE_SET_ACTION(softc, PROBE_REPORT_LUNS); From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 17:28:10 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92F5936E; Sun, 2 Nov 2014 17:28:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 748A3CB3; Sun, 2 Nov 2014 17:28:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HSAeu028405; Sun, 2 Nov 2014 17:28:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HS9De028401; Sun, 2 Nov 2014 17:28:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021728.sA2HS9De028401@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:28:09 +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: r273977 - in stable/10/sys/cam: ctl scsi 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.18-1 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, 02 Nov 2014 17:28:10 -0000 Author: mav Date: Sun Nov 2 17:28:08 2014 New Revision: 273977 URL: https://svnweb.freebsd.org/changeset/base/273977 Log: MFC r273073: Some groundwork for later Informational Exceptions support. This includes support for: - Read-Write Error Recovery mode page; - Informational Exceptions Control mode page; - Logical Block Provisioning mode page; - LOG SENSE command. No real Informational Exceptions features yet. This is only a placeholder. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:26:13 2014 (r273976) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:28:08 2014 (r273977) @@ -178,6 +178,34 @@ static struct copan_debugconf_subpage de {0xff,0xff}, /* ctl_time_io_secs */ }; +static struct scsi_da_rw_recovery_page rw_er_page_default = { + /*page_code*/SMS_RW_ERROR_RECOVERY_PAGE, + /*page_length*/sizeof(struct scsi_da_rw_recovery_page) - 2, + /*byte3*/SMS_RWER_AWRE|SMS_RWER_ARRE, + /*read_retry_count*/0, + /*correction_span*/0, + /*head_offset_count*/0, + /*data_strobe_offset_cnt*/0, + /*byte8*/0, + /*write_retry_count*/0, + /*reserved2*/0, + /*recovery_time_limit*/{0, 0}, +}; + +static struct scsi_da_rw_recovery_page rw_er_page_changeable = { + /*page_code*/SMS_RW_ERROR_RECOVERY_PAGE, + /*page_length*/sizeof(struct scsi_da_rw_recovery_page) - 2, + /*byte3*/0, + /*read_retry_count*/0, + /*correction_span*/0, + /*head_offset_count*/0, + /*data_strobe_offset_cnt*/0, + /*byte8*/0, + /*write_retry_count*/0, + /*reserved2*/0, + /*recovery_time_limit*/{0, 0}, +}; + static struct scsi_format_page format_page_default = { /*page_code*/SMS_FORMAT_DEVICE_PAGE, /*page_length*/sizeof(struct scsi_format_page) - 2, @@ -300,6 +328,41 @@ static struct scsi_control_page control_ /*extended_selftest_completion_time*/{0, 0} }; +static struct scsi_info_exceptions_page ie_page_default = { + /*page_code*/SMS_INFO_EXCEPTIONS_PAGE, + /*page_length*/sizeof(struct scsi_info_exceptions_page) - 2, + /*info_flags*/SIEP_FLAGS_DEXCPT, + /*mrie*/0, + /*interval_timer*/{0, 0, 0, 0}, + /*report_count*/{0, 0, 0, 0} +}; + +static struct scsi_info_exceptions_page ie_page_changeable = { + /*page_code*/SMS_INFO_EXCEPTIONS_PAGE, + /*page_length*/sizeof(struct scsi_info_exceptions_page) - 2, + /*info_flags*/0, + /*mrie*/0, + /*interval_timer*/{0, 0, 0, 0}, + /*report_count*/{0, 0, 0, 0} +}; + +static struct scsi_logical_block_provisioning_page lbp_page_default = { + /*page_code*/SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, + /*subpage_code*/0x02, + /*page_length*/{0, sizeof(struct scsi_logical_block_provisioning_page) - 4}, + /*flags*/0, + /*reserved*/{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + /*descr*/{} +}; + +static struct scsi_logical_block_provisioning_page lbp_page_changeable = { + /*page_code*/SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, + /*subpage_code*/0x02, + /*page_length*/{0, sizeof(struct scsi_logical_block_provisioning_page) - 4}, + /*flags*/0, + /*reserved*/{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + /*descr*/{} +}; /* * XXX KDM move these into the softc. @@ -4155,14 +4218,11 @@ ctl_init_page_index(struct ctl_lun *lun) { int i; struct ctl_page_index *page_index; - struct ctl_softc *softc; const char *value; memcpy(&lun->mode_pages.index, page_index_template, sizeof(page_index_template)); - softc = lun->ctl_softc; - for (i = 0; i < CTL_NUM_MODE_PAGES; i++) { page_index = &lun->mode_pages.index[i]; @@ -4177,6 +4237,25 @@ ctl_init_page_index(struct ctl_lun *lun) continue; switch (page_index->page_code & SMPH_PC_MASK) { + case SMS_RW_ERROR_RECOVERY_PAGE: { + if (page_index->subpage != SMS_SUBPAGE_PAGE_0) + panic("subpage is incorrect!"); + memcpy(&lun->mode_pages.rw_er_page[CTL_PAGE_CURRENT], + &rw_er_page_default, + sizeof(rw_er_page_default)); + memcpy(&lun->mode_pages.rw_er_page[CTL_PAGE_CHANGEABLE], + &rw_er_page_changeable, + sizeof(rw_er_page_changeable)); + memcpy(&lun->mode_pages.rw_er_page[CTL_PAGE_DEFAULT], + &rw_er_page_default, + sizeof(rw_er_page_default)); + memcpy(&lun->mode_pages.rw_er_page[CTL_PAGE_SAVED], + &rw_er_page_default, + sizeof(rw_er_page_default)); + page_index->page_data = + (uint8_t *)lun->mode_pages.rw_er_page; + break; + } case SMS_FORMAT_DEVICE_PAGE: { struct scsi_format_page *format_page; @@ -4366,6 +4445,42 @@ ctl_init_page_index(struct ctl_lun *lun) break; } + case SMS_INFO_EXCEPTIONS_PAGE: { + switch (page_index->subpage) { + case SMS_SUBPAGE_PAGE_0: + memcpy(&lun->mode_pages.ie_page[CTL_PAGE_CURRENT], + &ie_page_default, + sizeof(ie_page_default)); + memcpy(&lun->mode_pages.ie_page[ + CTL_PAGE_CHANGEABLE], &ie_page_changeable, + sizeof(ie_page_changeable)); + memcpy(&lun->mode_pages.ie_page[CTL_PAGE_DEFAULT], + &ie_page_default, + sizeof(ie_page_default)); + memcpy(&lun->mode_pages.ie_page[CTL_PAGE_SAVED], + &ie_page_default, + sizeof(ie_page_default)); + page_index->page_data = + (uint8_t *)lun->mode_pages.ie_page; + break; + case 0x02: + memcpy(&lun->mode_pages.lbp_page[CTL_PAGE_CURRENT], + &lbp_page_default, + sizeof(lbp_page_default)); + memcpy(&lun->mode_pages.lbp_page[ + CTL_PAGE_CHANGEABLE], &lbp_page_changeable, + sizeof(lbp_page_changeable)); + memcpy(&lun->mode_pages.lbp_page[CTL_PAGE_DEFAULT], + &lbp_page_default, + sizeof(lbp_page_default)); + memcpy(&lun->mode_pages.lbp_page[CTL_PAGE_SAVED], + &lbp_page_default, + sizeof(lbp_page_default)); + page_index->page_data = + (uint8_t *)lun->mode_pages.lbp_page; + } + break; + } case SMS_VENDOR_SPECIFIC_PAGE:{ switch (page_index->subpage) { case PWR_SUBPAGE_CODE: { @@ -4489,6 +4604,45 @@ ctl_init_page_index(struct ctl_lun *lun) return (CTL_RETVAL_COMPLETE); } +static int +ctl_init_log_page_index(struct ctl_lun *lun) +{ + struct ctl_page_index *page_index; + int i, j, prev; + + memcpy(&lun->log_pages.index, log_page_index_template, + sizeof(log_page_index_template)); + + prev = -1; + for (i = 0, j = 0; i < CTL_NUM_LOG_PAGES; i++) { + + page_index = &lun->log_pages.index[i]; + /* + * If this is a disk-only mode page, there's no point in + * setting it up. For some pages, we have to have some + * basic information about the disk in order to calculate the + * mode page data. + */ + if ((lun->be_lun->lun_type != T_DIRECT) + && (page_index->page_flags & CTL_PAGE_FLAG_DISK_ONLY)) + continue; + + if (page_index->page_code != prev) { + lun->log_pages.pages_page[j] = page_index->page_code; + prev = page_index->page_code; + j++; + } + lun->log_pages.subpages_page[i*2] = page_index->page_code; + lun->log_pages.subpages_page[i*2+1] = page_index->subpage; + } + lun->log_pages.index[0].page_data = &lun->log_pages.pages_page[0]; + lun->log_pages.index[0].page_len = j; + lun->log_pages.index[1].page_data = &lun->log_pages.subpages_page[0]; + lun->log_pages.index[1].page_len = i * 2; + + return (CTL_RETVAL_COMPLETE); +} + /* * LUN allocation. * @@ -4684,9 +4838,10 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft ctl_tpc_lun_init(lun); /* - * Initialize the mode page index. + * Initialize the mode and log page index. */ ctl_init_page_index(lun); + ctl_init_log_page_index(lun); /* * Set the poweron UA for all initiators on this LUN only. @@ -7270,6 +7425,91 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) } int +ctl_log_sense(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + int i, pc, page_code, subpage; + int alloc_len, total_len; + struct ctl_page_index *page_index; + struct scsi_log_sense *cdb; + struct scsi_log_header *header; + + CTL_DEBUG_PRINT(("ctl_log_sense\n")); + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + cdb = (struct scsi_log_sense *)ctsio->cdb; + pc = (cdb->page & SLS_PAGE_CTRL_MASK) >> 6; + page_code = cdb->page & SLS_PAGE_CODE; + subpage = cdb->subpage; + alloc_len = scsi_2btoul(cdb->length); + + page_index = NULL; + for (i = 0; i < CTL_NUM_LOG_PAGES; i++) { + page_index = &lun->log_pages.index[i]; + + /* Look for the right page code */ + if ((page_index->page_code & SL_PAGE_CODE) != page_code) + continue; + + /* Look for the right subpage or the subpage wildcard*/ + if (page_index->subpage != subpage) + continue; + + break; + } + if (i >= CTL_NUM_LOG_PAGES) { + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 2, + /*bit_valid*/ 0, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + total_len = sizeof(struct scsi_log_header) + page_index->page_len; + + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); + ctsio->kern_sg_entries = 0; + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + if (total_len < alloc_len) { + ctsio->residual = alloc_len - total_len; + ctsio->kern_data_len = total_len; + ctsio->kern_total_len = total_len; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + + header = (struct scsi_log_header *)ctsio->kern_data_ptr; + header->page = page_index->page_code; + if (page_index->subpage) { + header->page |= SL_SPF; + header->subpage = page_index->subpage; + } + scsi_ulto2b(page_index->page_len, header->datalen); + + /* + * Call the handler, if it exists, to update the + * page to the latest values. + */ + if (page_index->sense_handler != NULL) + page_index->sense_handler(ctsio, page_index, pc); + + memcpy(header + 1, page_index->page_data, page_index->page_len); + + ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); +} + +int ctl_read_capacity(struct ctl_scsiio *ctsio) { struct scsi_read_capacity *cdb; Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Sun Nov 2 17:26:13 2014 (r273976) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Sun Nov 2 17:28:08 2014 (r273977) @@ -850,7 +850,10 @@ const struct ctl_cmd_entry ctl_cmd_table {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 4D LOG SENSE */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_log_sense, CTL_SERIDX_LOG_SNS, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_LUN_PAT_NONE, 10, {0, 0xff, 0xff, 0, 0xff, 0xff, 0xff, 0xff, 0x07} }, /* 4E STOP PLAY/SCAN */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Sun Nov 2 17:26:13 2014 (r273976) +++ stable/10/sys/cam/ctl/ctl_private.h Sun Nov 2 17:28:08 2014 (r273977) @@ -302,6 +302,8 @@ struct ctl_page_index { #define CTL_PAGE_SAVED 0x03 static const struct ctl_page_index page_index_template[] = { + {SMS_RW_ERROR_RECOVERY_PAGE, 0, sizeof(struct scsi_da_rw_recovery_page), NULL, + CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, {SMS_FORMAT_DEVICE_PAGE, 0, sizeof(struct scsi_format_page), NULL, CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, {SMS_RIGID_DISK_PAGE, 0, sizeof(struct scsi_rigid_disk_page), NULL, @@ -310,6 +312,11 @@ static const struct ctl_page_index page_ CTL_PAGE_FLAG_DISK_ONLY, NULL, ctl_caching_sp_handler}, {SMS_CONTROL_MODE_PAGE, 0, sizeof(struct scsi_control_page), NULL, CTL_PAGE_FLAG_NONE, NULL, ctl_control_page_handler}, + {SMS_INFO_EXCEPTIONS_PAGE, 0, sizeof(struct scsi_info_exceptions_page), NULL, + CTL_PAGE_FLAG_NONE, NULL, NULL}, + {SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, 0x02, + sizeof(struct scsi_logical_block_provisioning_page), NULL, + CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, PWR_SUBPAGE_CODE, sizeof(struct copan_power_subpage), NULL, CTL_PAGE_FLAG_NONE, ctl_power_sp_sense_handler, ctl_power_sp_handler}, @@ -325,16 +332,35 @@ static const struct ctl_page_index page_ sizeof(page_index_template[0]) struct ctl_mode_pages { + struct scsi_da_rw_recovery_page rw_er_page[4]; struct scsi_format_page format_page[4]; struct scsi_rigid_disk_page rigid_disk_page[4]; struct scsi_caching_page caching_page[4]; struct scsi_control_page control_page[4]; + struct scsi_info_exceptions_page ie_page[4]; + struct scsi_logical_block_provisioning_page lbp_page[4]; struct copan_power_subpage power_subpage[4]; struct copan_aps_subpage aps_subpage[4]; struct copan_debugconf_subpage debugconf_subpage[4]; struct ctl_page_index index[CTL_NUM_MODE_PAGES]; }; +static const struct ctl_page_index log_page_index_template[] = { + {SLS_SUPPORTED_PAGES_PAGE, 0, 0, NULL, + CTL_PAGE_FLAG_NONE, NULL, NULL}, + {SLS_SUPPORTED_PAGES_PAGE, SLS_SUPPORTED_SUBPAGES_SUBPAGE, 0, NULL, + CTL_PAGE_FLAG_NONE, NULL, NULL}, +}; + +#define CTL_NUM_LOG_PAGES sizeof(log_page_index_template)/ \ + sizeof(log_page_index_template[0]) + +struct ctl_log_pages { + uint8_t pages_page[CTL_NUM_LOG_PAGES]; + uint8_t subpages_page[CTL_NUM_LOG_PAGES * 2]; + struct ctl_page_index index[CTL_NUM_LOG_PAGES]; +}; + struct ctl_lun_delay_info { ctl_delay_type datamove_type; uint32_t datamove_delay; @@ -391,6 +417,7 @@ struct ctl_lun { #endif ctl_ua_type pending_ua[CTL_MAX_INITIATORS]; struct ctl_mode_pages mode_pages; + struct ctl_log_pages log_pages; struct ctl_lun_io_stats stats; uint32_t res_idx; unsigned int PRGeneration; @@ -482,6 +509,7 @@ int ctl_write_same(struct ctl_scsiio *ct int ctl_unmap(struct ctl_scsiio *ctsio); int ctl_mode_select(struct ctl_scsiio *ctsio); int ctl_mode_sense(struct ctl_scsiio *ctsio); +int ctl_log_sense(struct ctl_scsiio *ctsio); int ctl_read_capacity(struct ctl_scsiio *ctsio); int ctl_read_capacity_16(struct ctl_scsiio *ctsio); int ctl_read_defect(struct ctl_scsiio *ctsio); Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Sun Nov 2 17:26:13 2014 (r273976) +++ stable/10/sys/cam/scsi/scsi_all.h Sun Nov 2 17:28:08 2014 (r273977) @@ -551,7 +551,7 @@ struct scsi_log_sense #define SLS_PPC 0x02 u_int8_t page; #define SLS_PAGE_CODE 0x3F -#define SLS_ALL_PAGES_PAGE 0x00 +#define SLS_SUPPORTED_PAGES_PAGE 0x00 #define SLS_OVERRUN_PAGE 0x01 #define SLS_ERROR_WRITE_PAGE 0x02 #define SLS_ERROR_READ_PAGE 0x03 @@ -566,7 +566,9 @@ struct scsi_log_sense #define SLS_PAGE_CTRL_CUMULATIVE 0x40 #define SLS_PAGE_CTRL_THRESH_DEFAULT 0x80 #define SLS_PAGE_CTRL_CUMUL_DEFAULT 0xC0 - u_int8_t reserved[2]; + u_int8_t subpage; +#define SLS_SUPPORTED_SUBPAGES_SUBPAGE 0xff + u_int8_t reserved; u_int8_t paramptr[2]; u_int8_t length[2]; u_int8_t control; @@ -592,7 +594,10 @@ struct scsi_log_select struct scsi_log_header { u_int8_t page; - u_int8_t reserved; +#define SL_PAGE_CODE 0x3F +#define SL_SPF 0x40 +#define SL_DS 0x80 + u_int8_t subpage; u_int8_t datalen[2]; }; @@ -767,6 +772,23 @@ struct scsi_info_exceptions_page { u_int8_t report_count[4]; }; +struct scsi_logical_block_provisioning_page_descr { + uint8_t flags; + uint8_t resource; + uint8_t reserved[2]; + uint8_t count[4]; +}; + +struct scsi_logical_block_provisioning_page { + uint8_t page_code; + uint8_t subpage_code; + uint8_t page_length[2]; + uint8_t flags; +#define SLBPP_SITUA 0x01 + uint8_t reserved[11]; + struct scsi_logical_block_provisioning_page_descr descr[0]; +}; + /* * SCSI protocol identifier values, current as of SPC4r36l. */ From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 17:28:46 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6237D4E2; Sun, 2 Nov 2014 17:28:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CE55CBD; Sun, 2 Nov 2014 17:28:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HSkeD028534; Sun, 2 Nov 2014 17:28:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HSiPm028528; Sun, 2 Nov 2014 17:28:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021728.sA2HSiPm028528@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:28: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: r273978 - in stable/10/sys/cam: ctl scsi 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.18-1 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, 02 Nov 2014 17:28:46 -0000 Author: mav Date: Sun Nov 2 17:28:44 2014 New Revision: 273978 URL: https://svnweb.freebsd.org/changeset/base/273978 Log: MFC r273075: Remove couple Copan's vendor-specific mode pages. Those pages are highly system-/hardware-specific, the code is incomplete, and so they hardly can be useful for anybody else. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_backend.h stable/10/sys/cam/ctl/ctl_io.h stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:28:08 2014 (r273977) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:28:44 2014 (r273978) @@ -109,56 +109,6 @@ struct ctl_softc *control_softc = NULL; * Note that these are default values only. The actual values will be * filled in when the user does a mode sense. */ -static struct copan_power_subpage power_page_default = { - /*page_code*/ PWR_PAGE_CODE | SMPH_SPF, - /*subpage*/ PWR_SUBPAGE_CODE, - /*page_length*/ {(sizeof(struct copan_power_subpage) - 4) & 0xff00, - (sizeof(struct copan_power_subpage) - 4) & 0x00ff}, - /*page_version*/ PWR_VERSION, - /* total_luns */ 26, - /* max_active_luns*/ PWR_DFLT_MAX_LUNS, - /*reserved*/ {0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0} -}; - -static struct copan_power_subpage power_page_changeable = { - /*page_code*/ PWR_PAGE_CODE | SMPH_SPF, - /*subpage*/ PWR_SUBPAGE_CODE, - /*page_length*/ {(sizeof(struct copan_power_subpage) - 4) & 0xff00, - (sizeof(struct copan_power_subpage) - 4) & 0x00ff}, - /*page_version*/ 0, - /* total_luns */ 0, - /* max_active_luns*/ 0, - /*reserved*/ {0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0} -}; - -static struct copan_aps_subpage aps_page_default = { - APS_PAGE_CODE | SMPH_SPF, //page_code - APS_SUBPAGE_CODE, //subpage - {(sizeof(struct copan_aps_subpage) - 4) & 0xff00, - (sizeof(struct copan_aps_subpage) - 4) & 0x00ff}, //page_length - APS_VERSION, //page_version - 0, //lock_active - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0} //reserved -}; - -static struct copan_aps_subpage aps_page_changeable = { - APS_PAGE_CODE | SMPH_SPF, //page_code - APS_SUBPAGE_CODE, //subpage - {(sizeof(struct copan_aps_subpage) - 4) & 0xff00, - (sizeof(struct copan_aps_subpage) - 4) & 0x00ff}, //page_length - 0, //page_version - 0, //lock_active - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0} //reserved -}; - static struct copan_debugconf_subpage debugconf_page_default = { DBGCNF_PAGE_CODE | SMPH_SPF, /* page_code */ DBGCNF_SUBPAGE_CODE, /* subpage */ @@ -371,7 +321,6 @@ static int rcv_sync_msg; static int persis_offset; static uint8_t ctl_pause_rtr; static int ctl_is_single = 1; -static int index_to_aps_page; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); static int worker_threads = -1; @@ -951,26 +900,6 @@ ctl_isc_event_handler(ctl_ha_channel cha case CTL_MSG_SYNC_FE: rcv_sync_msg = 1; break; - case CTL_MSG_APS_LOCK: { - // It's quicker to execute this then to - // queue it. - struct ctl_lun *lun; - struct ctl_page_index *page_index; - struct copan_aps_subpage *current_sp; - uint32_t targ_lun; - - targ_lun = msg_info.hdr.nexus.targ_mapped_lun; - lun = ctl_softc->ctl_luns[targ_lun]; - mtx_lock(&lun->lun_lock); - page_index = &lun->mode_pages.index[index_to_aps_page]; - current_sp = (struct copan_aps_subpage *) - (page_index->page_data + - (page_index->page_len * CTL_PAGE_CURRENT)); - - current_sp->lock_active = msg_info.aps.lock_flag; - mtx_unlock(&lun->lun_lock); - break; - } default: printf("How did I get here?\n"); } @@ -4059,156 +3988,6 @@ ctl_copy_io(union ctl_io *src, union ctl dest->io_hdr.flags |= CTL_FLAG_INT_COPY; } -#ifdef NEEDTOPORT -static void -ctl_update_power_subpage(struct copan_power_subpage *page) -{ - int num_luns, num_partitions, config_type; - struct ctl_softc *softc; - cs_BOOL_t aor_present, shelf_50pct_power; - cs_raidset_personality_t rs_type; - int max_active_luns; - - softc = control_softc; - - /* subtract out the processor LUN */ - num_luns = softc->num_luns - 1; - /* - * Default to 7 LUNs active, which was the only number we allowed - * in the past. - */ - max_active_luns = 7; - - num_partitions = config_GetRsPartitionInfo(); - config_type = config_GetConfigType(); - shelf_50pct_power = config_GetShelfPowerMode(); - aor_present = config_IsAorRsPresent(); - - rs_type = ddb_GetRsRaidType(1); - if ((rs_type != CS_RAIDSET_PERSONALITY_RAID5) - && (rs_type != CS_RAIDSET_PERSONALITY_RAID1)) { - EPRINT(0, "Unsupported RS type %d!", rs_type); - } - - - page->total_luns = num_luns; - - switch (config_type) { - case 40: - /* - * In a 40 drive configuration, it doesn't matter what DC - * cards we have, whether we have AOR enabled or not, - * partitioning or not, or what type of RAIDset we have. - * In that scenario, we can power up every LUN we present - * to the user. - */ - max_active_luns = num_luns; - - break; - case 64: - if (shelf_50pct_power == CS_FALSE) { - /* 25% power */ - if (aor_present == CS_TRUE) { - if (rs_type == - CS_RAIDSET_PERSONALITY_RAID5) { - max_active_luns = 7; - } else if (rs_type == - CS_RAIDSET_PERSONALITY_RAID1){ - max_active_luns = 14; - } else { - /* XXX KDM now what?? */ - } - } else { - if (rs_type == - CS_RAIDSET_PERSONALITY_RAID5) { - max_active_luns = 8; - } else if (rs_type == - CS_RAIDSET_PERSONALITY_RAID1){ - max_active_luns = 16; - } else { - /* XXX KDM now what?? */ - } - } - } else { - /* 50% power */ - /* - * With 50% power in a 64 drive configuration, we - * can power all LUNs we present. - */ - max_active_luns = num_luns; - } - break; - case 112: - if (shelf_50pct_power == CS_FALSE) { - /* 25% power */ - if (aor_present == CS_TRUE) { - if (rs_type == - CS_RAIDSET_PERSONALITY_RAID5) { - max_active_luns = 7; - } else if (rs_type == - CS_RAIDSET_PERSONALITY_RAID1){ - max_active_luns = 14; - } else { - /* XXX KDM now what?? */ - } - } else { - if (rs_type == - CS_RAIDSET_PERSONALITY_RAID5) { - max_active_luns = 8; - } else if (rs_type == - CS_RAIDSET_PERSONALITY_RAID1){ - max_active_luns = 16; - } else { - /* XXX KDM now what?? */ - } - } - } else { - /* 50% power */ - if (aor_present == CS_TRUE) { - if (rs_type == - CS_RAIDSET_PERSONALITY_RAID5) { - max_active_luns = 14; - } else if (rs_type == - CS_RAIDSET_PERSONALITY_RAID1){ - /* - * We're assuming here that disk - * caching is enabled, and so we're - * able to power up half of each - * LUN, and cache all writes. - */ - max_active_luns = num_luns; - } else { - /* XXX KDM now what?? */ - } - } else { - if (rs_type == - CS_RAIDSET_PERSONALITY_RAID5) { - max_active_luns = 15; - } else if (rs_type == - CS_RAIDSET_PERSONALITY_RAID1){ - max_active_luns = 30; - } else { - /* XXX KDM now what?? */ - } - } - } - break; - default: - /* - * In this case, we have an unknown configuration, so we - * just use the default from above. - */ - break; - } - - page->max_active_luns = max_active_luns; -#if 0 - printk("%s: total_luns = %d, max_active_luns = %d\n", __func__, - page->total_luns, page->max_active_luns); -#endif -} -#endif /* NEEDTOPORT */ - /* * This routine could be used in the future to load default and/or saved * mode page parameters for a particuar lun. @@ -4483,77 +4262,6 @@ ctl_init_page_index(struct ctl_lun *lun) } case SMS_VENDOR_SPECIFIC_PAGE:{ switch (page_index->subpage) { - case PWR_SUBPAGE_CODE: { - struct copan_power_subpage *current_page, - *saved_page; - - memcpy(&lun->mode_pages.power_subpage[ - CTL_PAGE_CURRENT], - &power_page_default, - sizeof(power_page_default)); - memcpy(&lun->mode_pages.power_subpage[ - CTL_PAGE_CHANGEABLE], - &power_page_changeable, - sizeof(power_page_changeable)); - memcpy(&lun->mode_pages.power_subpage[ - CTL_PAGE_DEFAULT], - &power_page_default, - sizeof(power_page_default)); - memcpy(&lun->mode_pages.power_subpage[ - CTL_PAGE_SAVED], - &power_page_default, - sizeof(power_page_default)); - page_index->page_data = - (uint8_t *)lun->mode_pages.power_subpage; - - current_page = (struct copan_power_subpage *) - (page_index->page_data + - (page_index->page_len * - CTL_PAGE_CURRENT)); - saved_page = (struct copan_power_subpage *) - (page_index->page_data + - (page_index->page_len * - CTL_PAGE_SAVED)); - break; - } - case APS_SUBPAGE_CODE: { - struct copan_aps_subpage *current_page, - *saved_page; - - // This gets set multiple times but - // it should always be the same. It's - // only done during init so who cares. - index_to_aps_page = i; - - memcpy(&lun->mode_pages.aps_subpage[ - CTL_PAGE_CURRENT], - &aps_page_default, - sizeof(aps_page_default)); - memcpy(&lun->mode_pages.aps_subpage[ - CTL_PAGE_CHANGEABLE], - &aps_page_changeable, - sizeof(aps_page_changeable)); - memcpy(&lun->mode_pages.aps_subpage[ - CTL_PAGE_DEFAULT], - &aps_page_default, - sizeof(aps_page_default)); - memcpy(&lun->mode_pages.aps_subpage[ - CTL_PAGE_SAVED], - &aps_page_default, - sizeof(aps_page_default)); - page_index->page_data = - (uint8_t *)lun->mode_pages.aps_subpage; - - current_page = (struct copan_aps_subpage *) - (page_index->page_data + - (page_index->page_len * - CTL_PAGE_CURRENT)); - saved_page = (struct copan_aps_subpage *) - (page_index->page_data + - (page_index->page_len * - CTL_PAGE_SAVED)); - break; - } case DBGCNF_SUBPAGE_CODE: { struct copan_debugconf_subpage *current_page, *saved_page; @@ -5272,95 +4980,6 @@ ctl_lun_operable(struct ctl_be_lun *be_l return (0); } -int -ctl_lun_power_lock(struct ctl_be_lun *be_lun, struct ctl_nexus *nexus, - int lock) -{ - struct ctl_softc *softc; - struct ctl_lun *lun; - struct copan_aps_subpage *current_sp; - struct ctl_page_index *page_index; - int i; - - softc = control_softc; - - mtx_lock(&softc->ctl_lock); - - lun = (struct ctl_lun *)be_lun->ctl_lun; - mtx_lock(&lun->lun_lock); - - page_index = NULL; - for (i = 0; i < CTL_NUM_MODE_PAGES; i++) { - if ((lun->mode_pages.index[i].page_code & SMPH_PC_MASK) != - APS_PAGE_CODE) - continue; - - if (lun->mode_pages.index[i].subpage != APS_SUBPAGE_CODE) - continue; - page_index = &lun->mode_pages.index[i]; - } - - if (page_index == NULL) { - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - printf("%s: APS subpage not found for lun %ju!\n", __func__, - (uintmax_t)lun->lun); - return (1); - } -#if 0 - if ((softc->aps_locked_lun != 0) - && (softc->aps_locked_lun != lun->lun)) { - printf("%s: attempt to lock LUN %llu when %llu is already " - "locked\n"); - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - return (1); - } -#endif - - current_sp = (struct copan_aps_subpage *)(page_index->page_data + - (page_index->page_len * CTL_PAGE_CURRENT)); - - if (lock != 0) { - current_sp->lock_active = APS_LOCK_ACTIVE; - softc->aps_locked_lun = lun->lun; - } else { - current_sp->lock_active = 0; - softc->aps_locked_lun = 0; - } - - - /* - * If we're in HA mode, try to send the lock message to the other - * side. - */ - if (ctl_is_single == 0) { - int isc_retval; - union ctl_ha_msg lock_msg; - - lock_msg.hdr.nexus = *nexus; - lock_msg.hdr.msg_type = CTL_MSG_APS_LOCK; - if (lock != 0) - lock_msg.aps.lock_flag = 1; - else - lock_msg.aps.lock_flag = 0; - isc_retval = ctl_ha_msg_send(CTL_HA_CHAN_CTL, &lock_msg, - sizeof(lock_msg), 0); - if (isc_retval > CTL_HA_STATUS_SUCCESS) { - printf("%s: APS (lock=%d) error returned from " - "ctl_ha_msg_send: %d\n", __func__, lock, isc_retval); - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - return (1); - } - } - - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - - return (0); -} - void ctl_lun_capacity_changed(struct ctl_be_lun *be_lun) { @@ -6519,121 +6138,6 @@ ctl_caching_sp_handler(struct ctl_scsiio } int -ctl_power_sp_handler(struct ctl_scsiio *ctsio, - struct ctl_page_index *page_index, uint8_t *page_ptr) -{ - return (0); -} - -int -ctl_power_sp_sense_handler(struct ctl_scsiio *ctsio, - struct ctl_page_index *page_index, int pc) -{ - struct copan_power_subpage *page; - - page = (struct copan_power_subpage *)page_index->page_data + - (page_index->page_len * pc); - - switch (pc) { - case SMS_PAGE_CTRL_CHANGEABLE >> 6: - /* - * We don't update the changable bits for this page. - */ - break; - case SMS_PAGE_CTRL_CURRENT >> 6: - case SMS_PAGE_CTRL_DEFAULT >> 6: - case SMS_PAGE_CTRL_SAVED >> 6: -#ifdef NEEDTOPORT - ctl_update_power_subpage(page); -#endif - break; - default: -#ifdef NEEDTOPORT - EPRINT(0, "Invalid PC %d!!", pc); -#endif - break; - } - return (0); -} - - -int -ctl_aps_sp_handler(struct ctl_scsiio *ctsio, - struct ctl_page_index *page_index, uint8_t *page_ptr) -{ - struct copan_aps_subpage *user_sp; - struct copan_aps_subpage *current_sp; - union ctl_modepage_info *modepage_info; - struct ctl_softc *softc; - struct ctl_lun *lun; - int retval; - - retval = CTL_RETVAL_COMPLETE; - current_sp = (struct copan_aps_subpage *)(page_index->page_data + - (page_index->page_len * CTL_PAGE_CURRENT)); - softc = control_softc; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - - user_sp = (struct copan_aps_subpage *)page_ptr; - - modepage_info = (union ctl_modepage_info *) - ctsio->io_hdr.ctl_private[CTL_PRIV_MODEPAGE].bytes; - - modepage_info->header.page_code = page_index->page_code & SMPH_PC_MASK; - modepage_info->header.subpage = page_index->subpage; - modepage_info->aps.lock_active = user_sp->lock_active; - - mtx_lock(&softc->ctl_lock); - - /* - * If there is a request to lock the LUN and another LUN is locked - * this is an error. If the requested LUN is already locked ignore - * the request. If no LUN is locked attempt to lock it. - * if there is a request to unlock the LUN and the LUN is currently - * locked attempt to unlock it. Otherwise ignore the request. i.e. - * if another LUN is locked or no LUN is locked. - */ - if (user_sp->lock_active & APS_LOCK_ACTIVE) { - if (softc->aps_locked_lun == lun->lun) { - /* - * This LUN is already locked, so we're done. - */ - retval = CTL_RETVAL_COMPLETE; - } else if (softc->aps_locked_lun == 0) { - /* - * No one has the lock, pass the request to the - * backend. - */ - retval = lun->backend->config_write( - (union ctl_io *)ctsio); - } else { - /* - * Someone else has the lock, throw out the request. - */ - ctl_set_already_locked(ctsio); - free(ctsio->kern_data_ptr, M_CTL); - ctl_done((union ctl_io *)ctsio); - - /* - * Set the return value so that ctl_do_mode_select() - * won't try to complete the command. We already - * completed it here. - */ - retval = CTL_RETVAL_ERROR; - } - } else if (softc->aps_locked_lun == lun->lun) { - /* - * This LUN is locked, so pass the unlock request to the - * backend. - */ - retval = lun->backend->config_write((union ctl_io *)ctsio); - } - mtx_unlock(&softc->ctl_lock); - - return (retval); -} - -int ctl_debugconf_sp_select_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, uint8_t *page_ptr) Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Sun Nov 2 17:28:08 2014 (r273977) +++ stable/10/sys/cam/ctl/ctl.h Sun Nov 2 17:28:44 2014 (r273978) @@ -172,12 +172,6 @@ int ctl_failover_sp_handler(struct ctl_s struct ctl_page_index *page_index, uint8_t *page_ptr); **/ -int ctl_power_sp_handler(struct ctl_scsiio *ctsio, - struct ctl_page_index *page_index, uint8_t *page_ptr); -int ctl_power_sp_sense_handler(struct ctl_scsiio *ctsio, - struct ctl_page_index *page_index, int pc); -int ctl_aps_sp_handler(struct ctl_scsiio *ctsio, - struct ctl_page_index *page_index, uint8_t *page_ptr); int ctl_debugconf_sp_sense_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, int pc); Modified: stable/10/sys/cam/ctl/ctl_backend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend.h Sun Nov 2 17:28:08 2014 (r273977) +++ stable/10/sys/cam/ctl/ctl_backend.h Sun Nov 2 17:28:44 2014 (r273978) @@ -280,14 +280,6 @@ int ctl_lun_inoperable(struct ctl_be_lun int ctl_lun_operable(struct ctl_be_lun *be_lun); /* - * If a LUN is locked on or unlocked from a power/APS standpoint, call - * ctl_lun_power_lock() to update the current status in CTL's APS subpage. - * Set the lock flag to 1 to lock the LUN, set it to 0 to unlock the LUN. - */ -int ctl_lun_power_lock(struct ctl_be_lun *be_lun, struct ctl_nexus *nexus, - int lock); - -/* * To take a LUN offline, call ctl_lun_offline(). Generally the LUN will * be online again once the user sends a SCSI START STOP UNIT command with * the start and on/offline bits set. The backend can bring the LUN back Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Sun Nov 2 17:28:08 2014 (r273977) +++ stable/10/sys/cam/ctl/ctl_io.h Sun Nov 2 17:28:44 2014 (r273978) @@ -234,7 +234,6 @@ typedef enum { CTL_MSG_MANAGE_TASKS, CTL_MSG_PERS_ACTION, CTL_MSG_SYNC_FE, - CTL_MSG_APS_LOCK, CTL_MSG_DATAMOVE, CTL_MSG_DATAMOVE_DONE } ctl_msg_type; @@ -424,14 +423,6 @@ struct ctl_ha_msg_hdr { #define CTL_HA_MAX_SG_ENTRIES 16 /* - * Used for CTL_MSG_APS_LOCK. - */ -struct ctl_ha_msg_aps { - struct ctl_ha_msg_hdr hdr; - uint8_t lock_flag; -}; - -/* * Used for CTL_MSG_PERS_ACTION. */ struct ctl_ha_msg_pr { @@ -500,7 +491,6 @@ union ctl_ha_msg { struct ctl_ha_msg_scsi scsi; struct ctl_ha_msg_dt dt; struct ctl_ha_msg_pr pr; - struct ctl_ha_msg_aps aps; }; Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Sun Nov 2 17:28:08 2014 (r273977) +++ stable/10/sys/cam/ctl/ctl_private.h Sun Nov 2 17:28:44 2014 (r273978) @@ -317,12 +317,6 @@ static const struct ctl_page_index page_ {SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, 0x02, sizeof(struct scsi_logical_block_provisioning_page), NULL, CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, - {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, PWR_SUBPAGE_CODE, - sizeof(struct copan_power_subpage), NULL, CTL_PAGE_FLAG_NONE, - ctl_power_sp_sense_handler, ctl_power_sp_handler}, - {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, APS_SUBPAGE_CODE, - sizeof(struct copan_aps_subpage), NULL, CTL_PAGE_FLAG_NONE, - NULL, ctl_aps_sp_handler}, {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, DBGCNF_SUBPAGE_CODE, sizeof(struct copan_debugconf_subpage), NULL, CTL_PAGE_FLAG_NONE, ctl_debugconf_sp_sense_handler, ctl_debugconf_sp_select_handler}, @@ -339,8 +333,6 @@ struct ctl_mode_pages { struct scsi_control_page control_page[4]; struct scsi_info_exceptions_page ie_page[4]; struct scsi_logical_block_provisioning_page lbp_page[4]; - struct copan_power_subpage power_subpage[4]; - struct copan_aps_subpage aps_subpage[4]; struct copan_debugconf_subpage debugconf_subpage[4]; struct ctl_page_index index[CTL_NUM_MODE_PAGES]; }; @@ -469,7 +461,6 @@ struct ctl_softc { uint32_t ctl_lun_mask[(CTL_MAX_LUNS + 31) / 32]; struct ctl_lun *ctl_luns[CTL_MAX_LUNS]; uint32_t ctl_port_mask[(CTL_MAX_PORTS + 31) / 32]; - uint64_t aps_locked_lun; STAILQ_HEAD(, ctl_lun) lun_list; STAILQ_HEAD(, ctl_be_lun) pending_lun_queue; uint32_t num_frontends; Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Sun Nov 2 17:28:08 2014 (r273977) +++ stable/10/sys/cam/scsi/scsi_all.h Sun Nov 2 17:28:44 2014 (r273978) @@ -709,40 +709,6 @@ struct scsi_caching_page { /* * XXX KDM move this off to a vendor shim. */ -struct copan_power_subpage { - uint8_t page_code; -#define PWR_PAGE_CODE 0x00 - uint8_t subpage; -#define PWR_SUBPAGE_CODE 0x02 - uint8_t page_length[2]; - uint8_t page_version; -#define PWR_VERSION 0x01 - uint8_t total_luns; - uint8_t max_active_luns; -#define PWR_DFLT_MAX_LUNS 0x07 - uint8_t reserved[25]; -}; - -/* - * XXX KDM move this off to a vendor shim. - */ -struct copan_aps_subpage { - uint8_t page_code; -#define APS_PAGE_CODE 0x00 - uint8_t subpage; -#define APS_SUBPAGE_CODE 0x03 - uint8_t page_length[2]; - uint8_t page_version; -#define APS_VERSION 0x00 - uint8_t lock_active; -#define APS_LOCK_ACTIVE 0x01 -#define APS_LOCK_INACTIVE 0x00 - uint8_t reserved[26]; -}; - -/* - * XXX KDM move this off to a vendor shim. - */ struct copan_debugconf_subpage { uint8_t page_code; #define DBGCNF_PAGE_CODE 0x00 From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 17:29:49 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2405613; Sun, 2 Nov 2014 17:29:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C355FCC2; Sun, 2 Nov 2014 17:29:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HTmbY028724; Sun, 2 Nov 2014 17:29:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HTm02028723; Sun, 2 Nov 2014 17:29:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021729.sA2HTm02028723@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:29: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: r273979 - stable/10/sys/cam/ctl 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.18-1 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, 02 Nov 2014 17:29:49 -0000 Author: mav Date: Sun Nov 2 17:29:48 2014 New Revision: 273979 URL: https://svnweb.freebsd.org/changeset/base/273979 Log: MFC r273640: Add support for 12/16-byte EUI and 16-byte NAA IDs. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:28:44 2014 (r273978) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:29:48 2014 (r273979) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -4351,6 +4352,36 @@ ctl_init_log_page_index(struct ctl_lun * return (CTL_RETVAL_COMPLETE); } +static int +hex2bin(const char *str, uint8_t *buf, int buf_size) +{ + int i; + u_char c; + + memset(buf, 0, buf_size); + while (isspace(str[0])) + str++; + if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) + str += 2; + buf_size *= 2; + for (i = 0; str[i] != 0 && i < buf_size; i++) { + c = str[i]; + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= 16) + break; + if ((i & 1) == 0) + buf[i / 2] |= (c << 4); + else + buf[i / 2] |= c; + } + return ((i + 1) / 2); +} + /* * LUN allocation. * @@ -4416,15 +4447,14 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft } eui = ctl_get_opt(&be_lun->options, "eui"); if (eui != NULL) { - len += sizeof(struct scsi_vpd_id_descriptor) + 8; + len += sizeof(struct scsi_vpd_id_descriptor) + 16; } naa = ctl_get_opt(&be_lun->options, "naa"); if (naa != NULL) { - len += sizeof(struct scsi_vpd_id_descriptor) + 8; + len += sizeof(struct scsi_vpd_id_descriptor) + 16; } lun->lun_devid = malloc(sizeof(struct ctl_devid) + len, M_CTL, M_WAITOK | M_ZERO); - lun->lun_devid->len = len; desc = (struct scsi_vpd_id_descriptor *)lun->lun_devid->data; desc->proto_codeset = SVPD_ID_CODESET_ASCII; desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10; @@ -4454,8 +4484,10 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft desc->proto_codeset = SVPD_ID_CODESET_BINARY; desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_EUI64; - desc->length = 8; - scsi_u64to8b(strtouq(eui, NULL, 0), desc->identifier); + desc->length = hex2bin(eui, desc->identifier, 16); + desc->length = desc->length > 12 ? 16 : + (desc->length > 8 ? 12 : 8); + len -= 16 - desc->length; } if (naa != NULL) { desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + @@ -4463,9 +4495,11 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft desc->proto_codeset = SVPD_ID_CODESET_BINARY; desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_NAA; - desc->length = 8; - scsi_u64to8b(strtouq(naa, NULL, 0), desc->identifier); + desc->length = hex2bin(naa, desc->identifier, 16); + desc->length = desc->length > 8 ? 16 : 8; + len -= 16 - desc->length; } + lun->lun_devid->len = len; mtx_lock(&ctl_softc->ctl_lock); /* From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 17:30:32 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3A5B74B; Sun, 2 Nov 2014 17:30:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C507ACCB; Sun, 2 Nov 2014 17:30:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HUVIg028992; Sun, 2 Nov 2014 17:30:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HUV30028990; Sun, 2 Nov 2014 17:30:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021730.sA2HUV30028990@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:30: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: r273980 - in stable/10: sys/cam/ctl usr.sbin/ctladm 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.18-1 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, 02 Nov 2014 17:30:32 -0000 Author: mav Date: Sun Nov 2 17:30:30 2014 New Revision: 273980 URL: https://svnweb.freebsd.org/changeset/base/273980 Log: MFC r273687: Add "rpm" and "formfactor" LUN options to match istgt functionality. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:29:48 2014 (r273979) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:30:30 2014 (r273980) @@ -10209,6 +10209,8 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * { struct scsi_vpd_block_device_characteristics *bdc_ptr; struct ctl_lun *lun; + const char *value; + u_int i; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -10241,7 +10243,18 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * bdc_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; bdc_ptr->page_code = SVPD_BDC; scsi_ulto2b(sizeof(*bdc_ptr) - 4, bdc_ptr->page_length); - scsi_ulto2b(SVPD_NON_ROTATING, bdc_ptr->medium_rotation_rate); + if (lun != NULL && + (value = ctl_get_opt(&lun->be_lun->options, "rpm")) != NULL) + i = strtol(value, NULL, 0); + else + i = SVPD_NON_ROTATING; + scsi_ulto2b(i, bdc_ptr->medium_rotation_rate); + if (lun != NULL && + (value = ctl_get_opt(&lun->be_lun->options, "formfactor")) != NULL) + i = strtol(value, NULL, 0); + else + i = 0; + bdc_ptr->wab_wac_ff = (i & 0x0f); bdc_ptr->flags = SVPD_FUAB | SVPD_VBULS; ctsio->scsi_status = SCSI_STATUS_OK; Modified: stable/10/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.8 Sun Nov 2 17:29:48 2014 (r273979) +++ stable/10/usr.sbin/ctladm/ctladm.8 Sun Nov 2 17:30:30 2014 (r273980) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd October 12, 2014 +.Dd October 26, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -995,6 +995,12 @@ command sequence order shall be explicit client through the selection of appropriate commands and task attributes. The default value is "restricted". It improves data integrity, but may introduce some additional delays. +.It Va rpm +Specifies medium rotation rate of the device: 0 -- not reported, +1 -- non-rotating (SSD), >1024 -- value in revolutions per minute. +.It Va formfactor +Specifies nominal form factor of the device: 0 -- not reported, 1 -- 5.25", +2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8". .It Va unmap Set to "on", enables UNMAP support for the LUN, if supported by the backend. .It Va writecache From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 17:31:11 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6067C87D; Sun, 2 Nov 2014 17:31:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32815CCE; Sun, 2 Nov 2014 17:31:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HVBRL029603; Sun, 2 Nov 2014 17:31:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HVAqZ029600; Sun, 2 Nov 2014 17:31:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021731.sA2HVAqZ029600@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:31: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: r273981 - stable/10/sys/cam/ctl 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.18-1 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, 02 Nov 2014 17:31:11 -0000 Author: mav Date: Sun Nov 2 17:31:10 2014 New Revision: 273981 URL: https://svnweb.freebsd.org/changeset/base/273981 Log: MFC r273693: Fix printing non-terminated strings in devlist XML. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:30:30 2014 (r273980) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:31:10 2014 (r273981) @@ -2202,13 +2202,14 @@ ctl_copyout_args(int num_args, struct ct * Escape characters that are illegal or not recommended in XML. */ int -ctl_sbuf_printf_esc(struct sbuf *sb, char *str) +ctl_sbuf_printf_esc(struct sbuf *sb, char *str, int size) { + char *end = str + size; int retval; retval = 0; - for (; *str; str++) { + for (; *str && str < end; str++) { switch (*str) { case '&': retval = sbuf_printf(sb, "&"); @@ -3200,7 +3201,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; retval = ctl_sbuf_printf_esc(sb, - lun->be_lun->serial_num); + lun->be_lun->serial_num, + sizeof(lun->be_lun->serial_num)); if (retval != 0) break; @@ -3215,7 +3217,9 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (retval != 0) break; - retval = ctl_sbuf_printf_esc(sb,lun->be_lun->device_id); + retval = ctl_sbuf_printf_esc(sb, + lun->be_lun->device_id, + sizeof(lun->be_lun->device_id)); if (retval != 0) break; Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Sun Nov 2 17:30:30 2014 (r273980) +++ stable/10/sys/cam/ctl/ctl.h Sun Nov 2 17:31:10 2014 (r273981) @@ -156,7 +156,7 @@ int ctl_port_list(struct ctl_port_entry * Put a string into an sbuf, escaping characters that are illegal or not * recommended in XML. Note this doesn't escape everything, just > < and &. */ -int ctl_sbuf_printf_esc(struct sbuf *sb, char *str); +int ctl_sbuf_printf_esc(struct sbuf *sb, char *str, int size); int ctl_ffz(uint32_t *mask, uint32_t size); int ctl_set_mask(uint32_t *mask, uint32_t bit); From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 17:31:45 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED3CB9B0; Sun, 2 Nov 2014 17:31:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D85D3CDA; Sun, 2 Nov 2014 17:31:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HVjko032012; Sun, 2 Nov 2014 17:31:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HVjwn032011; Sun, 2 Nov 2014 17:31:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021731.sA2HVjwn032011@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:31:45 +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: r273982 - stable/10/sys/cam/ctl 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.18-1 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, 02 Nov 2014 17:31:46 -0000 Author: mav Date: Sun Nov 2 17:31:45 2014 New Revision: 273982 URL: https://svnweb.freebsd.org/changeset/base/273982 Log: MFC r273708: Fix support for LUN flat space addressing. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:31:10 2014 (r273981) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:31:45 2014 (r273982) @@ -9405,17 +9405,18 @@ ctl_report_luns(struct ctl_scsiio *ctsio * Flat addressing method. */ lun_data->luns[num_filled].lundata[0] = - RPL_LUNDATA_ATYP_FLAT | - (targ_lun_id & RPL_LUNDATA_FLAT_LUN_MASK); -#ifdef OLDCTLHEADERS - (SRLD_ADDR_FLAT << SRLD_ADDR_SHIFT) | - (targ_lun_id & SRLD_BUS_LUN_MASK); -#endif + RPL_LUNDATA_ATYP_FLAT | (targ_lun_id >> 8); lun_data->luns[num_filled].lundata[1] = -#ifdef OLDCTLHEADERS - targ_lun_id >> SRLD_BUS_LUN_BITS; -#endif - targ_lun_id >> RPL_LUNDATA_FLAT_LUN_BITS; + (targ_lun_id & 0xff); + num_filled++; + } else if (targ_lun_id <= 0xffffff) { + /* + * Extended flat addressing method. + */ + lun_data->luns[num_filled].lundata[0] = + RPL_LUNDATA_ATYP_EXTLUN | 0x12; + scsi_ulto3b(targ_lun_id, + &lun_data->luns[num_filled].lundata[1]); num_filled++; } else { printf("ctl_report_luns: bogus LUN number %jd, " From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 19:09:35 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98366618; Sun, 2 Nov 2014 19:09:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 833AB83C; Sun, 2 Nov 2014 19:09:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2J9ZUZ078008; Sun, 2 Nov 2014 19:09:35 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2J9ZdK078007; Sun, 2 Nov 2014 19:09:35 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411021909.sA2J9ZdK078007@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 2 Nov 2014 19:09: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: r273983 - stable/10/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.18-1 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, 02 Nov 2014 19:09:35 -0000 Author: delphij Date: Sun Nov 2 19:09:34 2014 New Revision: 273983 URL: https://svnweb.freebsd.org/changeset/base/273983 Log: MFC r273267: Add tunable vfs.zfs.space_map_blksz for space map's maximum block size. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Sun Nov 2 17:31:45 2014 (r273982) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Sun Nov 2 19:09:34 2014 (r273983) @@ -37,6 +37,8 @@ #include #include +SYSCTL_DECL(_vfs_zfs); + /* * The data for a given space map can be kept on blocks of any size. * Larger blocks entail fewer i/o operations, but they also cause the @@ -44,6 +46,8 @@ * when only a few blocks have changed since the last transaction group. */ int space_map_blksz = (1 << 12); +SYSCTL_INT(_vfs_zfs, OID_AUTO, space_map_blksz, CTLFLAG_RDTUN, &space_map_blksz, 0, + "Maximum block size for space map. Must be power of 2 and greater than 4096."); /* * Load the space map disk into the specified range tree. Segments of maptype From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 19:16:42 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 633FAB1B; Sun, 2 Nov 2014 19:16:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DF9D912; Sun, 2 Nov 2014 19:16:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2JGg6w082431; Sun, 2 Nov 2014 19:16:42 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2JGgjW082430; Sun, 2 Nov 2014 19:16:42 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411021916.sA2JGgjW082430@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 2 Nov 2014 19:16: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: r273984 - stable/10/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.18-1 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, 02 Nov 2014 19:16:42 -0000 Author: delphij Date: Sun Nov 2 19:16:41 2014 New Revision: 273984 URL: https://svnweb.freebsd.org/changeset/base/273984 Log: MFC r273026: Add a tunable for arc_shrink_shift (vfs.zfs.arc_shrink_shift) that controls how much fraction, 1/2^arc_shrink_shift, should be reclaimed when there is memory pressure. Submitted by: Richard Kojedzinszky Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Nov 2 19:09:34 2014 (r273983) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Nov 2 19:16:41 2014 (r273984) @@ -220,6 +220,7 @@ TUNABLE_QUAD("vfs.zfs.arc_max", &zfs_arc TUNABLE_QUAD("vfs.zfs.arc_min", &zfs_arc_min); TUNABLE_QUAD("vfs.zfs.arc_meta_limit", &zfs_arc_meta_limit); TUNABLE_QUAD("vfs.zfs.arc_average_blocksize", &zfs_arc_average_blocksize); +TUNABLE_INT("vfs.zfs.arc_shrink_shift", &zfs_arc_shrink_shift); SYSCTL_DECL(_vfs_zfs); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RDTUN, &zfs_arc_max, 0, "Maximum ARC size"); @@ -228,6 +229,10 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_min SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_average_blocksize, CTLFLAG_RDTUN, &zfs_arc_average_blocksize, 0, "ARC average blocksize"); +SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_shrink_shift, CTLFLAG_RW, + &arc_shrink_shift, 0, + "log2(fraction of arc to reclaim)"); + /* * We don't have a tunable for arc_free_target due to the dependency on * pagedaemon initialisation. From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 22:41:56 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DA5D1CD; Sun, 2 Nov 2014 22:41:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18EA3EA6; Sun, 2 Nov 2014 22:41:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2Mftq6082175; Sun, 2 Nov 2014 22:41:55 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2MftVO082173; Sun, 2 Nov 2014 22:41:55 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201411022241.sA2MftVO082173@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 2 Nov 2014 22:41: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: r273993 - in stable/10: etc share/man/man8 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.18-1 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, 02 Nov 2014 22:41:56 -0000 Author: hrs Date: Sun Nov 2 22:41:55 2014 New Revision: 273993 URL: https://svnweb.freebsd.org/changeset/base/273993 Log: MFC r272974,272976: Add ${name}_env and ${name}_prepend. ${name}_env is an argument list which will be passed to env(1). ${name}_prepend is simply prepended to the command line for $command. Modified: stable/10/etc/rc.subr stable/10/share/man/man8/rc.subr.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.subr ============================================================================== --- stable/10/etc/rc.subr Sun Nov 2 21:58:31 2014 (r273992) +++ stable/10/etc/rc.subr Sun Nov 2 22:41:55 2014 (r273993) @@ -749,6 +749,8 @@ check_startmsgs() # NOTE: $flags from the parent environment # can be used to override this. # +# ${name}_env n Environment variables to run ${command} with. +# # ${name}_fib n Routing table number to run ${command} with. # # ${name}_nice n Nice level to run ${command} at. @@ -764,6 +766,8 @@ check_startmsgs() # to run the chrooted ${command} with. # Requires /usr to be mounted. # +# ${name}_prepend n Command added before ${command}. +# # ${rc_arg}_cmd n If set, use this as the method when invoked; # Otherwise, use default command (see below) # @@ -937,7 +941,8 @@ run_rc_command() eval _chdir=\$${name}_chdir _chroot=\$${name}_chroot \ _nice=\$${name}_nice _user=\$${name}_user \ _group=\$${name}_group _groups=\$${name}_groups \ - _fib=\$${name}_fib + _fib=\$${name}_fib _env=\$${name}_env \ + _prepend=\$${name}_prepend if [ -n "$_user" ]; then # unset $_user if running as that user if [ "$_user" = "$(eval $IDCMD)" ]; then @@ -1022,12 +1027,14 @@ run_rc_command() _doit="\ ${_nice:+nice -n $_nice }\ ${_fib:+setfib -F $_fib }\ +${_env:+env $_env }\ chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\ $_chroot $command $rc_flags $command_args" else _doit="\ ${_chdir:+cd $_chdir && }\ ${_fib:+setfib -F $_fib }\ +${_env:+env $_env }\ $command $rc_flags $command_args" if [ -n "$_user" ]; then _doit="su -m $_user -c 'sh -c \"$_doit\"'" @@ -1038,6 +1045,9 @@ $command $rc_flags $command_args" fi _doit="nice -n $_nice $_doit" fi + if [ -n "$_prepend" ]; then + _doit="$_prepend $_doit" + fi fi # run the full command @@ -2040,7 +2050,7 @@ check_kern_features() # check_namevarlist var # Return "0" if ${name}_var is reserved in rc.subr. -_rc_namevarlist="program chroot chdir flags fib nice user group groups" +_rc_namevarlist="program chroot chdir env flags fib nice user group groups prepend" check_namevarlist() { local _v Modified: stable/10/share/man/man8/rc.subr.8 ============================================================================== --- stable/10/share/man/man8/rc.subr.8 Sun Nov 2 21:58:31 2014 (r273992) +++ stable/10/share/man/man8/rc.subr.8 Sun Nov 2 22:41:55 2014 (r273993) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2012 +.Dd October 12, 2014 .Dt RC.SUBR 8 .Os .Sh NAME @@ -568,6 +568,22 @@ to before running Only supported after .Pa /usr is mounted. +.It Va ${name}_env +A list of environment variables to run +.Va command +with. +This will be passed as arguments to +.Xr env 1 +utility. +.It Va ${name}_fib +FIB +.Pa Routing Table +number to run +.Va command +with. +See +.Xr setfib 1 +for more details. .It Va ${name}_flags Arguments to call .Va command @@ -622,6 +638,14 @@ as. Comma separated list of supplementary groups to run the chrooted .Va command with. +.It Va ${name}_prepend +Commands to be prepended to +.Va command . +This is a generic version of +.Va ${name}_env , +.Va ${name}_fib , +or +.Va ${name}_nice . .It Ar argument Ns Va _cmd Shell commands which override the default method for .Ar argument . From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 23:22:24 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D250CF3D; Sun, 2 Nov 2014 23:22:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3C6E2A9; Sun, 2 Nov 2014 23:22:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2NMO1s001487; Sun, 2 Nov 2014 23:22:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2NMO0D001484; Sun, 2 Nov 2014 23:22:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411022322.sA2NMO0D001484@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 2 Nov 2014 23:22:24 +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: r273996 - in stable: 10/share/man/man3 8/share/man/man3 9/share/man/man3 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.18-1 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, 02 Nov 2014 23:22:24 -0000 Author: jhb Date: Sun Nov 2 23:22:22 2014 New Revision: 273996 URL: https://svnweb.freebsd.org/changeset/base/273996 Log: MFC 273644,273738: Clarify that pthread_cleanup_push()/pop() are implemented as macros that create a new code block and thus must be balanced at the same lexical scope. (This is also a requirement in POSIX.) PR: 194280 Submitted by: dr2867.business@pacbell.net Modified: stable/8/share/man/man3/pthread_cleanup_pop.3 stable/8/share/man/man3/pthread_cleanup_push.3 Directory Properties: stable/8/share/man/man3/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man3/pthread_cleanup_pop.3 stable/10/share/man/man3/pthread_cleanup_push.3 stable/9/share/man/man3/pthread_cleanup_pop.3 stable/9/share/man/man3/pthread_cleanup_push.3 Directory Properties: stable/10/ (props changed) stable/9/share/man/man3/ (props changed) Modified: stable/8/share/man/man3/pthread_cleanup_pop.3 ============================================================================== --- stable/8/share/man/man3/pthread_cleanup_pop.3 Sun Nov 2 22:58:30 2014 (r273995) +++ stable/8/share/man/man3/pthread_cleanup_pop.3 Sun Nov 2 23:22:22 2014 (r273996) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 1998 +.Dd October 25, 2014 .Dt PTHREAD_CLEANUP_POP 3 .Os .Sh NAME @@ -50,6 +50,14 @@ If there is no cleanup routine then .Fn pthread_cleanup_pop does nothing. +.Pp +The +.Fn pthread_cleanup_pop +function is implemented as a macro that closes a block. +Invocations of this function must appear as standalone statements that are +paired with an earlier call of +.Xr pthread_cleanup_push 3 +in the same lexical scope. .Sh RETURN VALUES The .Fn pthread_cleanup_pop Modified: stable/8/share/man/man3/pthread_cleanup_push.3 ============================================================================== --- stable/8/share/man/man3/pthread_cleanup_push.3 Sun Nov 2 22:58:30 2014 (r273995) +++ stable/8/share/man/man3/pthread_cleanup_push.3 Sun Nov 2 23:22:22 2014 (r273996) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 1998 +.Dd October 25, 2014 .Dt PTHREAD_CLEANUP_PUSH 3 .Os .Sh NAME @@ -52,6 +52,14 @@ When is called, it is passed .Fa arg as its only argument. +.Pp +The +.Fn pthread_cleanup_push +function is implemented as a macro that opens a new block. +Invocations of this function must appear as standalone statements that are +paired with a later call of +.Xr pthread_cleanup_pop 3 +in the same lexical scope. .Sh RETURN VALUES The .Fn pthread_cleanup_push From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 23:22:24 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 211E7F3C; Sun, 2 Nov 2014 23:22:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E71842A6; Sun, 2 Nov 2014 23:22:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2NMNAg001477; Sun, 2 Nov 2014 23:22:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2NMNZe001475; Sun, 2 Nov 2014 23:22:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411022322.sA2NMNZe001475@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 2 Nov 2014 23:22: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: r273996 - in stable: 10/share/man/man3 8/share/man/man3 9/share/man/man3 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.18-1 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, 02 Nov 2014 23:22:24 -0000 Author: jhb Date: Sun Nov 2 23:22:22 2014 New Revision: 273996 URL: https://svnweb.freebsd.org/changeset/base/273996 Log: MFC 273644,273738: Clarify that pthread_cleanup_push()/pop() are implemented as macros that create a new code block and thus must be balanced at the same lexical scope. (This is also a requirement in POSIX.) PR: 194280 Submitted by: dr2867.business@pacbell.net Modified: stable/10/share/man/man3/pthread_cleanup_pop.3 stable/10/share/man/man3/pthread_cleanup_push.3 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/share/man/man3/pthread_cleanup_pop.3 stable/8/share/man/man3/pthread_cleanup_push.3 stable/9/share/man/man3/pthread_cleanup_pop.3 stable/9/share/man/man3/pthread_cleanup_push.3 Directory Properties: stable/8/share/man/man3/ (props changed) stable/9/share/man/man3/ (props changed) Modified: stable/10/share/man/man3/pthread_cleanup_pop.3 ============================================================================== --- stable/10/share/man/man3/pthread_cleanup_pop.3 Sun Nov 2 22:58:30 2014 (r273995) +++ stable/10/share/man/man3/pthread_cleanup_pop.3 Sun Nov 2 23:22:22 2014 (r273996) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 1998 +.Dd October 25, 2014 .Dt PTHREAD_CLEANUP_POP 3 .Os .Sh NAME @@ -50,6 +50,14 @@ If there is no cleanup routine then .Fn pthread_cleanup_pop does nothing. +.Pp +The +.Fn pthread_cleanup_pop +function is implemented as a macro that closes a block. +Invocations of this function must appear as standalone statements that are +paired with an earlier call of +.Xr pthread_cleanup_push 3 +in the same lexical scope. .Sh RETURN VALUES The .Fn pthread_cleanup_pop Modified: stable/10/share/man/man3/pthread_cleanup_push.3 ============================================================================== --- stable/10/share/man/man3/pthread_cleanup_push.3 Sun Nov 2 22:58:30 2014 (r273995) +++ stable/10/share/man/man3/pthread_cleanup_push.3 Sun Nov 2 23:22:22 2014 (r273996) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 1998 +.Dd October 25, 2014 .Dt PTHREAD_CLEANUP_PUSH 3 .Os .Sh NAME @@ -52,6 +52,14 @@ When is called, it is passed .Fa arg as its only argument. +.Pp +The +.Fn pthread_cleanup_push +function is implemented as a macro that opens a new block. +Invocations of this function must appear as standalone statements that are +paired with a later call of +.Xr pthread_cleanup_pop 3 +in the same lexical scope. .Sh RETURN VALUES The .Fn pthread_cleanup_push From owner-svn-src-stable@FreeBSD.ORG Sun Nov 2 23:22:25 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B13D6F3E; Sun, 2 Nov 2014 23:22:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 827C12AA; Sun, 2 Nov 2014 23:22:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2NMPVk001495; Sun, 2 Nov 2014 23:22:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2NMPJQ001492; Sun, 2 Nov 2014 23:22:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411022322.sA2NMPJQ001492@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 2 Nov 2014 23:22:25 +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: r273996 - in stable: 10/share/man/man3 8/share/man/man3 9/share/man/man3 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.18-1 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, 02 Nov 2014 23:22:25 -0000 Author: jhb Date: Sun Nov 2 23:22:22 2014 New Revision: 273996 URL: https://svnweb.freebsd.org/changeset/base/273996 Log: MFC 273644,273738: Clarify that pthread_cleanup_push()/pop() are implemented as macros that create a new code block and thus must be balanced at the same lexical scope. (This is also a requirement in POSIX.) PR: 194280 Submitted by: dr2867.business@pacbell.net Modified: stable/9/share/man/man3/pthread_cleanup_pop.3 stable/9/share/man/man3/pthread_cleanup_push.3 Directory Properties: stable/9/share/man/man3/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man3/pthread_cleanup_pop.3 stable/10/share/man/man3/pthread_cleanup_push.3 stable/8/share/man/man3/pthread_cleanup_pop.3 stable/8/share/man/man3/pthread_cleanup_push.3 Directory Properties: stable/10/ (props changed) stable/8/share/man/man3/ (props changed) Modified: stable/9/share/man/man3/pthread_cleanup_pop.3 ============================================================================== --- stable/9/share/man/man3/pthread_cleanup_pop.3 Sun Nov 2 22:58:30 2014 (r273995) +++ stable/9/share/man/man3/pthread_cleanup_pop.3 Sun Nov 2 23:22:22 2014 (r273996) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 1998 +.Dd October 25, 2014 .Dt PTHREAD_CLEANUP_POP 3 .Os .Sh NAME @@ -50,6 +50,14 @@ If there is no cleanup routine then .Fn pthread_cleanup_pop does nothing. +.Pp +The +.Fn pthread_cleanup_pop +function is implemented as a macro that closes a block. +Invocations of this function must appear as standalone statements that are +paired with an earlier call of +.Xr pthread_cleanup_push 3 +in the same lexical scope. .Sh RETURN VALUES The .Fn pthread_cleanup_pop Modified: stable/9/share/man/man3/pthread_cleanup_push.3 ============================================================================== --- stable/9/share/man/man3/pthread_cleanup_push.3 Sun Nov 2 22:58:30 2014 (r273995) +++ stable/9/share/man/man3/pthread_cleanup_push.3 Sun Nov 2 23:22:22 2014 (r273996) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 1998 +.Dd October 25, 2014 .Dt PTHREAD_CLEANUP_PUSH 3 .Os .Sh NAME @@ -52,6 +52,14 @@ When is called, it is passed .Fa arg as its only argument. +.Pp +The +.Fn pthread_cleanup_push +function is implemented as a macro that opens a new block. +Invocations of this function must appear as standalone statements that are +paired with a later call of +.Xr pthread_cleanup_pop 3 +in the same lexical scope. .Sh RETURN VALUES The .Fn pthread_cleanup_push From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 00:13:21 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A91CEB17; Mon, 3 Nov 2014 00:13:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93EF0934; Mon, 3 Nov 2014 00:13:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA30DLAd026339; Mon, 3 Nov 2014 00:13:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA30DLKL026338; Mon, 3 Nov 2014 00:13:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411030013.sA30DLKL026338@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Nov 2014 00:13:21 +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: r273998 - in stable: 10/usr.sbin/etcupdate 8/usr.sbin/etcupdate 9/usr.sbin/etcupdate 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.18-1 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, 03 Nov 2014 00:13:21 -0000 Author: jhb Date: Mon Nov 3 00:13:20 2014 New Revision: 273998 URL: https://svnweb.freebsd.org/changeset/base/273998 Log: MFC 273834: Rework the EXAMPLES section to be a bit clearer. - Add an example of using etcupdate diff. - Create a subsection on bootstrapping that is below the simple examples. This should make it clearer that 'etcupdate extract' is a one-time operation and not part of the common workflow. It also adds more suggestions on when bootstrapping is needed and additional steps to make future merges simpler. Modified: stable/8/usr.sbin/etcupdate/etcupdate.8 Directory Properties: stable/8/usr.sbin/etcupdate/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/etcupdate/etcupdate.8 stable/9/usr.sbin/etcupdate/etcupdate.8 Directory Properties: stable/10/ (props changed) stable/9/usr.sbin/etcupdate/ (props changed) Modified: stable/8/usr.sbin/etcupdate/etcupdate.8 ============================================================================== --- stable/8/usr.sbin/etcupdate/etcupdate.8 Sun Nov 2 23:30:50 2014 (r273997) +++ stable/8/usr.sbin/etcupdate/etcupdate.8 Mon Nov 3 00:13:20 2014 (r273998) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2013 +.Dd October 29, 2014 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -608,12 +608,11 @@ Default log file. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -If the source tree matches the currently installed world, -then the following can be used to bootstrap -.Nm -so that it can be used for future upgrades: +To compare the files in +.Pa /etc +with the stock versions: .Pp -.Dl "etcupdate extract" +.Dl "etcupdate diff" .Pp To merge changes after an upgrade via the buildworld and installworld process: .Pp @@ -622,6 +621,59 @@ To merge changes after an upgrade via th To resolve any conflicts generated during a merge: .Pp .Dl "etcupdate resolve" +.Ss Bootstrapping +The +.Nm +utility may need to be bootstrapped before it can be used. +The +.Cm diff +command will fail with an error about a missing reference tree if +bootstrapping is needed. +.Pp +Bootstrapping +.Nm +requires a source tree that matches the currently installed world. +The easiest way to ensure this is to bootstrap +.Nm +before updating the source tree to start the next world upgrade cycle. +First, +generate a reference tree: +.Pp +.Dl "etcupdate extract" +.Pp +Second, +use the +.Cm diff +command to compare the reference tree to your current files in +.Pa /etc . +Undesired differences should be removed using an editor, +.Xr patch 1 , +or by copying files from the reference tree +.Po +located at +.Pa /var/db/etcupdate/current +by default +.Pc +. +.Pp +If the tree at +.Pa /usr/src +is already newer than the currently installed world, +a new tree matching the currently installed world can be checked out to +a temporary location. +The reference tree for +.Nm +can then be generated via: +.Pp +.Dl "etcupdate extract -s /path/to/tree" +.Pp +The +.Cm diff +command can be used as above to remove undesired differences. +Afterwards, +the changes in the tree at +.Pa /usr/src +can be merged via a regular merge. .Sh DIAGNOSTICS The following warning messages may be generated during a merge. Note that several of these warnings cover obscure cases that should occur From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 00:13:22 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 609E8B18; Mon, 3 Nov 2014 00:13:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD06935; Mon, 3 Nov 2014 00:13:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA30DMIQ026345; Mon, 3 Nov 2014 00:13:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA30DMpf026344; Mon, 3 Nov 2014 00:13:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411030013.sA30DMpf026344@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Nov 2014 00:13: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: r273998 - in stable: 10/usr.sbin/etcupdate 8/usr.sbin/etcupdate 9/usr.sbin/etcupdate 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.18-1 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, 03 Nov 2014 00:13:22 -0000 Author: jhb Date: Mon Nov 3 00:13:20 2014 New Revision: 273998 URL: https://svnweb.freebsd.org/changeset/base/273998 Log: MFC 273834: Rework the EXAMPLES section to be a bit clearer. - Add an example of using etcupdate diff. - Create a subsection on bootstrapping that is below the simple examples. This should make it clearer that 'etcupdate extract' is a one-time operation and not part of the common workflow. It also adds more suggestions on when bootstrapping is needed and additional steps to make future merges simpler. Modified: stable/9/usr.sbin/etcupdate/etcupdate.8 Directory Properties: stable/9/usr.sbin/etcupdate/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/etcupdate/etcupdate.8 stable/8/usr.sbin/etcupdate/etcupdate.8 Directory Properties: stable/10/ (props changed) stable/8/usr.sbin/etcupdate/ (props changed) Modified: stable/9/usr.sbin/etcupdate/etcupdate.8 ============================================================================== --- stable/9/usr.sbin/etcupdate/etcupdate.8 Sun Nov 2 23:30:50 2014 (r273997) +++ stable/9/usr.sbin/etcupdate/etcupdate.8 Mon Nov 3 00:13:20 2014 (r273998) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2013 +.Dd October 29, 2014 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -608,12 +608,11 @@ Default log file. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -If the source tree matches the currently installed world, -then the following can be used to bootstrap -.Nm -so that it can be used for future upgrades: +To compare the files in +.Pa /etc +with the stock versions: .Pp -.Dl "etcupdate extract" +.Dl "etcupdate diff" .Pp To merge changes after an upgrade via the buildworld and installworld process: .Pp @@ -622,6 +621,59 @@ To merge changes after an upgrade via th To resolve any conflicts generated during a merge: .Pp .Dl "etcupdate resolve" +.Ss Bootstrapping +The +.Nm +utility may need to be bootstrapped before it can be used. +The +.Cm diff +command will fail with an error about a missing reference tree if +bootstrapping is needed. +.Pp +Bootstrapping +.Nm +requires a source tree that matches the currently installed world. +The easiest way to ensure this is to bootstrap +.Nm +before updating the source tree to start the next world upgrade cycle. +First, +generate a reference tree: +.Pp +.Dl "etcupdate extract" +.Pp +Second, +use the +.Cm diff +command to compare the reference tree to your current files in +.Pa /etc . +Undesired differences should be removed using an editor, +.Xr patch 1 , +or by copying files from the reference tree +.Po +located at +.Pa /var/db/etcupdate/current +by default +.Pc +. +.Pp +If the tree at +.Pa /usr/src +is already newer than the currently installed world, +a new tree matching the currently installed world can be checked out to +a temporary location. +The reference tree for +.Nm +can then be generated via: +.Pp +.Dl "etcupdate extract -s /path/to/tree" +.Pp +The +.Cm diff +command can be used as above to remove undesired differences. +Afterwards, +the changes in the tree at +.Pa /usr/src +can be merged via a regular merge. .Sh DIAGNOSTICS The following warning messages may be generated during a merge. Note that several of these warnings cover obscure cases that should occur From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 00:13:21 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1756DB16; Mon, 3 Nov 2014 00:13:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02246933; Mon, 3 Nov 2014 00:13:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA30DKFB026331; Mon, 3 Nov 2014 00:13:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA30DKlD026330; Mon, 3 Nov 2014 00:13:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411030013.sA30DKlD026330@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Nov 2014 00:13: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: r273998 - in stable: 10/usr.sbin/etcupdate 8/usr.sbin/etcupdate 9/usr.sbin/etcupdate 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.18-1 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, 03 Nov 2014 00:13:21 -0000 Author: jhb Date: Mon Nov 3 00:13:20 2014 New Revision: 273998 URL: https://svnweb.freebsd.org/changeset/base/273998 Log: MFC 273834: Rework the EXAMPLES section to be a bit clearer. - Add an example of using etcupdate diff. - Create a subsection on bootstrapping that is below the simple examples. This should make it clearer that 'etcupdate extract' is a one-time operation and not part of the common workflow. It also adds more suggestions on when bootstrapping is needed and additional steps to make future merges simpler. Modified: stable/10/usr.sbin/etcupdate/etcupdate.8 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/usr.sbin/etcupdate/etcupdate.8 stable/9/usr.sbin/etcupdate/etcupdate.8 Directory Properties: stable/8/usr.sbin/etcupdate/ (props changed) stable/9/usr.sbin/etcupdate/ (props changed) Modified: stable/10/usr.sbin/etcupdate/etcupdate.8 ============================================================================== --- stable/10/usr.sbin/etcupdate/etcupdate.8 Sun Nov 2 23:30:50 2014 (r273997) +++ stable/10/usr.sbin/etcupdate/etcupdate.8 Mon Nov 3 00:13:20 2014 (r273998) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2013 +.Dd October 29, 2014 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -608,12 +608,11 @@ Default log file. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -If the source tree matches the currently installed world, -then the following can be used to bootstrap -.Nm -so that it can be used for future upgrades: +To compare the files in +.Pa /etc +with the stock versions: .Pp -.Dl "etcupdate extract" +.Dl "etcupdate diff" .Pp To merge changes after an upgrade via the buildworld and installworld process: .Pp @@ -622,6 +621,59 @@ To merge changes after an upgrade via th To resolve any conflicts generated during a merge: .Pp .Dl "etcupdate resolve" +.Ss Bootstrapping +The +.Nm +utility may need to be bootstrapped before it can be used. +The +.Cm diff +command will fail with an error about a missing reference tree if +bootstrapping is needed. +.Pp +Bootstrapping +.Nm +requires a source tree that matches the currently installed world. +The easiest way to ensure this is to bootstrap +.Nm +before updating the source tree to start the next world upgrade cycle. +First, +generate a reference tree: +.Pp +.Dl "etcupdate extract" +.Pp +Second, +use the +.Cm diff +command to compare the reference tree to your current files in +.Pa /etc . +Undesired differences should be removed using an editor, +.Xr patch 1 , +or by copying files from the reference tree +.Po +located at +.Pa /var/db/etcupdate/current +by default +.Pc +. +.Pp +If the tree at +.Pa /usr/src +is already newer than the currently installed world, +a new tree matching the currently installed world can be checked out to +a temporary location. +The reference tree for +.Nm +can then be generated via: +.Pp +.Dl "etcupdate extract -s /path/to/tree" +.Pp +The +.Cm diff +command can be used as above to remove undesired differences. +Afterwards, +the changes in the tree at +.Pa /usr/src +can be merged via a regular merge. .Sh DIAGNOSTICS The following warning messages may be generated during a merge. Note that several of these warnings cover obscure cases that should occur From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 03:17:59 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAD0272B; Mon, 3 Nov 2014 03:17:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC257B64; Mon, 3 Nov 2014 03:17:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA33HxSQ010786; Mon, 3 Nov 2014 03:17:59 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA33Hxrp010784; Mon, 3 Nov 2014 03:17:59 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201411030317.sA33Hxrp010784@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Mon, 3 Nov 2014 03:17: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: r274001 - in stable/10: include sys/dev/acpica 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.18-1 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, 03 Nov 2014 03:18:00 -0000 Author: rpaulo Date: Mon Nov 3 03:17:58 2014 New Revision: 274001 URL: https://svnweb.freebsd.org/changeset/base/274001 Log: MFC 273598 273602 273607 273613 273647: Userland HPET support. Modified: stable/10/include/Makefile stable/10/sys/dev/acpica/acpi_hpet.c Directory Properties: stable/10/ (props changed) Modified: stable/10/include/Makefile ============================================================================== --- stable/10/include/Makefile Mon Nov 3 03:12:15 2014 (r274000) +++ stable/10/include/Makefile Mon Nov 3 03:17:58 2014 (r274001) @@ -164,6 +164,8 @@ copies: .endfor cd ${.CURDIR}/../sys/dev/acpica; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \ + ${DESTDIR}${INCLUDEDIR}/dev/acpica; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpi_hpet.h \ ${DESTDIR}${INCLUDEDIR}/dev/acpica cd ${.CURDIR}/../sys/dev/agp; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \ @@ -246,7 +248,7 @@ symlinks: done .endfor cd ${.CURDIR}/../sys/dev/acpica; \ - for h in acpiio.h; do \ + for h in acpiio.h acpi_hpet.h; do \ ln -fs ../../../../sys/dev/acpica/$$h \ ${DESTDIR}${INCLUDEDIR}/dev/acpica; \ done Modified: stable/10/sys/dev/acpica/acpi_hpet.c ============================================================================== --- stable/10/sys/dev/acpica/acpi_hpet.c Mon Nov 3 03:12:15 2014 (r274000) +++ stable/10/sys/dev/acpica/acpi_hpet.c Mon Nov 3 03:17:58 2014 (r274001) @@ -35,11 +35,13 @@ __FBSDID("$FreeBSD$"); #include "opt_apic.h" #endif #include +#include #include #include #include #include #include +#include #include #include #include @@ -106,6 +108,19 @@ struct hpet_softc { char name[8]; } t[32]; int num_timers; + struct cdev *pdev; + int mmap_allow; + int mmap_allow_write; +}; + +static d_open_t hpet_open; +static d_mmap_t hpet_mmap; + +static struct cdevsw hpet_cdevsw = { + .d_version = D_VERSION, + .d_name = "hpet", + .d_open = hpet_open, + .d_mmap = hpet_mmap, }; static u_int hpet_get_timecount(struct timecounter *tc); @@ -314,8 +329,37 @@ hpet_find_irq_rid(device_t dev, u_long s } } +static int +hpet_open(struct cdev *cdev, int oflags, int devtype, struct thread *td) +{ + struct hpet_softc *sc; + + sc = cdev->si_drv1; + if (!sc->mmap_allow) + return (EPERM); + else + return (0); +} + +static int +hpet_mmap(struct cdev *cdev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) +{ + struct hpet_softc *sc; + + sc = cdev->si_drv1; + if (offset > rman_get_size(sc->mem_res)) + return (EINVAL); + if (!sc->mmap_allow_write && (nprot & PROT_WRITE)) + return (EPERM); + *paddr = rman_get_start(sc->mem_res) + offset; + *memattr = VM_MEMATTR_UNCACHEABLE; + + return (0); +} + /* Discover the HPET via the ACPI table of the same name. */ -static void +static void hpet_identify(driver_t *driver, device_t parent) { ACPI_TABLE_HPET *hpet; @@ -646,8 +690,8 @@ hpet_attach(device_t dev) #ifdef DEV_APIC if ((t->caps & HPET_TCAP_FSB_INT_DEL) && t->irq >= 0) { uint64_t addr; - uint32_t data; - + uint32_t data; + if (PCIB_MAP_MSI( device_get_parent(device_get_parent(dev)), dev, t->irq, &addr, &data) == 0) { @@ -697,6 +741,31 @@ hpet_attach(device_t dev) maxhpetet++; } } + + sc->pdev = make_dev(&hpet_cdevsw, 0, UID_ROOT, GID_WHEEL, + 0600, "hpet%d", device_get_unit(dev)); + if (sc->pdev) { + sc->pdev->si_drv1 = sc; + sc->mmap_allow = 1; + TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow", + &sc->mmap_allow); + sc->mmap_allow_write = 1; + TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow_write", + &sc->mmap_allow_write); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "mmap_allow", + CTLFLAG_RW, &sc->mmap_allow, 0, + "Allow userland to memory map HPET"); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "mmap_allow_write", + CTLFLAG_RW, &sc->mmap_allow_write, 0, + "Allow userland write to the HPET register space"); + } else + device_printf(dev, "could not create /dev/hpet%d\n", + device_get_unit(dev)); + return (0); } @@ -741,8 +810,8 @@ hpet_resume(device_t dev) #ifdef DEV_APIC if (t->irq >= 0 && (sc->legacy_route == 0 || i >= 2)) { uint64_t addr; - uint32_t data; - + uint32_t data; + if (PCIB_MAP_MSI( device_get_parent(device_get_parent(dev)), dev, t->irq, &addr, &data) == 0) { @@ -813,7 +882,7 @@ hpet_remap_intr(device_t dev, device_t c struct hpet_softc *sc = device_get_softc(dev); struct hpet_timer *t; uint64_t addr; - uint32_t data; + uint32_t data; int error, i; for (i = 0; i < sc->num_timers; i++) { From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 03:43:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BFE3B4B; Mon, 3 Nov 2014 03:43:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75BD6DCD; Mon, 3 Nov 2014 03:43:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA33hh0E024015; Mon, 3 Nov 2014 03:43:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA33hfNX024011; Mon, 3 Nov 2014 03:43:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411030343.sA33hfNX024011@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Nov 2014 03:43: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: r274002 - stable/10/sys/cam/ctl 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.18-1 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, 03 Nov 2014 03:43:43 -0000 Author: mav Date: Mon Nov 3 03:43:40 2014 New Revision: 274002 URL: https://svnweb.freebsd.org/changeset/base/274002 Log: MFC r273711: Allocate buffer for READ BUFFER/WRITE BUFFER commands on demand. These commands are rare, but consume additional 256KB RAM per LUN. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Mon Nov 3 03:17:58 2014 (r274001) +++ stable/10/sys/cam/ctl/ctl.c Mon Nov 3 03:43:40 2014 (r274002) @@ -4737,6 +4737,7 @@ ctl_free_lun(struct ctl_lun *lun) ctl_tpc_lun_shutdown(lun); mtx_destroy(&lun->lun_lock); free(lun->lun_devid, M_CTL); + free(lun->write_buffer, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) free(lun, M_CTL); @@ -5728,7 +5729,7 @@ ctl_read_buffer(struct ctl_scsiio *ctsio len = scsi_3btoul(cdb->length); buffer_offset = scsi_3btoul(cdb->offset); - if (buffer_offset + len > sizeof(lun->write_buffer)) { + if (buffer_offset + len > CTL_WRITE_BUFFER_SIZE) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, @@ -5741,14 +5742,19 @@ ctl_read_buffer(struct ctl_scsiio *ctsio if ((cdb->byte2 & RWB_MODE) == RWB_MODE_DESCR) { descr[0] = 0; - scsi_ulto3b(sizeof(lun->write_buffer), &descr[1]); + scsi_ulto3b(CTL_WRITE_BUFFER_SIZE, &descr[1]); ctsio->kern_data_ptr = descr; len = min(len, sizeof(descr)); } else if ((cdb->byte2 & RWB_MODE) == RWB_MODE_ECHO_DESCR) { ctsio->kern_data_ptr = echo_descr; len = min(len, sizeof(echo_descr)); - } else + } else { + if (lun->write_buffer == NULL) { + lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, + M_CTL, M_WAITOK); + } ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; + } ctsio->kern_data_len = len; ctsio->kern_total_len = len; ctsio->kern_data_resid = 0; @@ -5786,7 +5792,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsi len = scsi_3btoul(cdb->length); buffer_offset = scsi_3btoul(cdb->offset); - if (buffer_offset + len > sizeof(lun->write_buffer)) { + if (buffer_offset + len > CTL_WRITE_BUFFER_SIZE) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, @@ -5802,6 +5808,10 @@ ctl_write_buffer(struct ctl_scsiio *ctsi * malloc it and tell the caller the data buffer is here. */ if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { + if (lun->write_buffer == NULL) { + lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, + M_CTL, M_WAITOK); + } ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; ctsio->kern_data_len = len; ctsio->kern_total_len = len; Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Mon Nov 3 03:17:58 2014 (r274001) +++ stable/10/sys/cam/ctl/ctl_private.h Mon Nov 3 03:43:40 2014 (r274002) @@ -384,6 +384,8 @@ struct ctl_devid { */ #define NUM_TARGET_PORT_GROUPS 2 +#define CTL_WRITE_BUFFER_SIZE 262144 + struct tpc_list; struct ctl_lun { struct mtx lun_lock; @@ -417,7 +419,7 @@ struct ctl_lun { int pr_key_count; uint32_t pr_res_idx; uint8_t res_type; - uint8_t write_buffer[262144]; + uint8_t *write_buffer; struct ctl_devid *lun_devid; TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; }; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 03:45:01 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F0ABC89; Mon, 3 Nov 2014 03:45:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A1B1DD8; Mon, 3 Nov 2014 03:45:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA33j1HT024291; Mon, 3 Nov 2014 03:45:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA33j0p3024271; Mon, 3 Nov 2014 03:45:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411030345.sA33j0p3024271@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Nov 2014 03:45: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: r274003 - stable/10/sys/cam/ctl 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.18-1 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, 03 Nov 2014 03:45:01 -0000 Author: mav Date: Mon Nov 3 03:44:59 2014 New Revision: 274003 URL: https://svnweb.freebsd.org/changeset/base/274003 Log: MFC r273730, r273731: Reduce code duplication around Write Exclusive persistent reservation. While there, allow some more commands to pass persistent reservation. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Mon Nov 3 03:43:40 2014 (r274002) +++ stable/10/sys/cam/ctl/ctl.c Mon Nov 3 03:44:59 2014 (r274003) @@ -5343,8 +5343,7 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi mtx_lock(&lun->lun_lock); if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx != residx)) { - ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; - ctsio->io_hdr.status = CTL_SCSI_ERROR; + ctl_set_reservation_conflict(ctsio); goto bailout; } @@ -5695,24 +5694,6 @@ ctl_read_buffer(struct ctl_scsiio *ctsio lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_read_buffer *)ctsio->cdb; - if (lun->flags & CTL_LUN_PR_RESERVED) { - uint32_t residx; - - /* - * XXX KDM need a lock here. - */ - residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if ((lun->res_type == SPR_TYPE_EX_AC - && residx != lun->pr_res_idx) - || ((lun->res_type == SPR_TYPE_EX_AC_RO - || lun->res_type == SPR_TYPE_EX_AC_AR) - && lun->pr_keys[residx] == 0)) { - ctl_set_reservation_conflict(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - } - if ((cdb->byte2 & RWB_MODE) != RWB_MODE_DATA && (cdb->byte2 & RWB_MODE) != RWB_MODE_ECHO_DESCR && (cdb->byte2 & RWB_MODE) != RWB_MODE_DESCR) { @@ -6644,24 +6625,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) else control_dev = 0; - if (lun->flags & CTL_LUN_PR_RESERVED) { - uint32_t residx; - - /* - * XXX KDM need a lock here. - */ - residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if ((lun->res_type == SPR_TYPE_EX_AC - && residx != lun->pr_res_idx) - || ((lun->res_type == SPR_TYPE_EX_AC_RO - || lun->res_type == SPR_TYPE_EX_AC_AR) - && lun->pr_keys[residx] == 0)) { - ctl_set_reservation_conflict(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - } - switch (ctsio->cdb[0]) { case MODE_SENSE_6: { struct scsi_mode_sense_6 *cdb; @@ -7198,23 +7161,6 @@ ctl_read_defect(struct ctl_scsiio *ctsio CTL_DEBUG_PRINT(("ctl_read_defect\n")); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - if (lun->flags & CTL_LUN_PR_RESERVED) { - uint32_t residx; - - /* - * XXX KDM need a lock here. - */ - residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if ((lun->res_type == SPR_TYPE_EX_AC - && residx != lun->pr_res_idx) - || ((lun->res_type == SPR_TYPE_EX_AC_RO - || lun->res_type == SPR_TYPE_EX_AC_AR) - && lun->pr_keys[residx] == 0)) { - ctl_set_reservation_conflict(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - } if (ctsio->cdb[0] == READ_DEFECT_DATA_10) { ccb10 = (struct scsi_read_defect_data_10 *)&ctsio->cdb; @@ -8908,24 +8854,6 @@ ctl_read_write(struct ctl_scsiio *ctsio) isread = ctsio->cdb[0] == READ_6 || ctsio->cdb[0] == READ_10 || ctsio->cdb[0] == READ_12 || ctsio->cdb[0] == READ_16; - if (lun->flags & CTL_LUN_PR_RESERVED && isread) { - uint32_t residx; - - /* - * XXX KDM need a lock here. - */ - residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if ((lun->res_type == SPR_TYPE_EX_AC - && residx != lun->pr_res_idx) - || ((lun->res_type == SPR_TYPE_EX_AC_RO - || lun->res_type == SPR_TYPE_EX_AC_AR) - && lun->pr_keys[residx] == 0)) { - ctl_set_reservation_conflict(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - } - switch (ctsio->cdb[0]) { case READ_6: case WRITE_6: { @@ -11227,27 +11155,29 @@ ctl_scsiio_lun_check(struct ctl_softc *c if ((lun->flags & CTL_LUN_RESERVED) && ((entry->flags & CTL_CMD_FLAG_ALLOW_ON_RESV) == 0)) { if (lun->res_idx != residx) { - ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; - ctsio->io_hdr.status = CTL_SCSI_ERROR; + ctl_set_reservation_conflict(ctsio); retval = 1; goto bailout; } } - if ((lun->flags & CTL_LUN_PR_RESERVED) - && ((entry->flags & CTL_CMD_FLAG_ALLOW_ON_PR_RESV) == 0)) { + if ((lun->flags & CTL_LUN_PR_RESERVED) == 0 || + (entry->flags & CTL_CMD_FLAG_ALLOW_ON_PR_RESV)) { + /* No reservation or command is allowed. */; + } else if ((entry->flags & CTL_CMD_FLAG_ALLOW_ON_PR_WRESV) && + (lun->res_type == SPR_TYPE_WR_EX || + lun->res_type == SPR_TYPE_WR_EX_RO || + lun->res_type == SPR_TYPE_WR_EX_AR)) { + /* The command is allowed for Write Exclusive resv. */; + } else { /* * if we aren't registered or it's a res holder type * reservation and this isn't the res holder then set a * conflict. - * NOTE: Commands which might be allowed on write exclusive - * type reservations are checked in the particular command - * for a conflict. Read and SSU are the only ones. */ if (lun->pr_keys[residx] == 0 || (residx != lun->pr_res_idx && lun->res_type < 4)) { - ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; - ctsio->io_hdr.status = CTL_SCSI_ERROR; + ctl_set_reservation_conflict(ctsio); retval = 1; goto bailout; } Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Mon Nov 3 03:43:40 2014 (r274002) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Mon Nov 3 03:44:59 2014 (r274003) @@ -259,7 +259,8 @@ const struct ctl_cmd_entry ctl_cmd_table /* 10 POPULATE TOKEN */ {ctl_populate_token, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_SLUN | - CTL_FLAG_DATA_OUT, + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 16, { 0x10, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -347,7 +348,8 @@ const struct ctl_cmd_entry ctl_cmd_table /* 05 RECEIVE COPY STATUS (LID4) */ {ctl_receive_copy_status_lid4, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 16, {0x05, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -357,14 +359,16 @@ const struct ctl_cmd_entry ctl_cmd_table /* 07 RECEIVE ROD TOKEN INFORMATION */ {ctl_receive_rod_token_information, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 16, {0x07, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 08 REPORT ALL ROD TOKENS */ {ctl_report_all_rod_tokens, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 16, {0x08, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, }; @@ -472,7 +476,8 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_INOPERABLE | CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 12, {0x0a, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -510,7 +515,8 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_INOPERABLE | CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 12, {0x0f, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -561,7 +567,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 08 READ(6) */ {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 6, {0x1f, 0xff, 0xff, 0xff, 0x07}}, /* 09 */ @@ -653,7 +659,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_CMD_FLAG_OK_ON_SECONDARY | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 6, {0x08, 0xff, 0xff, 0xff, 0x07}}, /* 1B START STOP UNIT */ @@ -710,7 +716,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 28 READ(10) */ {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 10, {0x1a, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, @@ -739,7 +745,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 2F VERIFY(10) */ {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 10, {0x16, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, @@ -770,7 +776,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 37 READ DEFECT DATA(10) */ {ctl_read_defect, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 10, {0, 0x1f, 0, 0, 0, 0, 0xff, 0xff, 0x07}}, @@ -792,7 +798,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 3C READ BUFFER */ {ctl_read_buffer, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 10, {0x1f, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07}}, @@ -918,7 +924,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_CMD_FLAG_OK_ON_SECONDARY | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 10, {0x18, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0x07} }, /* 5B CLOSE TRACK/SESSION */ @@ -1062,7 +1068,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 88 READ(16) */ {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 16, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -1097,7 +1103,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 8F VERIFY(16) */ {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 16, {0x16, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -1199,7 +1205,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* A8 READ(12) */ {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 12, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -1228,7 +1234,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* AF VERIFY(12) */ {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 12, {0x16, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -1256,7 +1262,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* B7 READ DEFECT DATA(12) */ {ctl_read_defect, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 12, {0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Mon Nov 3 03:43:40 2014 (r274002) +++ stable/10/sys/cam/ctl/ctl_private.h Mon Nov 3 03:44:59 2014 (r274003) @@ -144,6 +144,7 @@ typedef enum { CTL_CMD_FLAG_NO_SENSE = 0x0010, CTL_CMD_FLAG_OK_ON_ALL_LUNS = 0x0020, CTL_CMD_FLAG_ALLOW_ON_RESV = 0x0040, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV = 0x0080, CTL_CMD_FLAG_OK_ON_PROC = 0x0100, CTL_CMD_FLAG_OK_ON_SLUN = 0x0200, CTL_CMD_FLAG_OK_ON_BOTH = 0x0300, From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 03:45:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 793A3DCB; Mon, 3 Nov 2014 03:45:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64CB1DDE; Mon, 3 Nov 2014 03:45:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA33jg8J024446; Mon, 3 Nov 2014 03:45:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA33jf9k024441; Mon, 3 Nov 2014 03:45:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411030345.sA33jf9k024441@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Nov 2014 03:45: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: r274004 - in stable/10/sys/cam: ctl scsi 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.18-1 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, 03 Nov 2014 03:45:43 -0000 Author: mav Date: Mon Nov 3 03:45:41 2014 New Revision: 274004 URL: https://svnweb.freebsd.org/changeset/base/274004 Log: MFC r273809: Implement better handling for ENOSPC error for both CTL and CAM. This makes VMWare VAAI Thin Provisioning Stun primitive activate, pausing the virtual machine, when backing storage (ZFS pool) is getting overflowed. Modified: stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_error.c stable/10/sys/cam/ctl/ctl_error.h stable/10/sys/cam/scsi/scsi_all.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Mon Nov 3 03:44:59 2014 (r274003) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Mon Nov 3 03:45:41 2014 (r274004) @@ -504,6 +504,8 @@ ctl_be_block_biodone(struct bio *bio) if (beio->num_errors > 0) { if (error == EOPNOTSUPP) { ctl_set_invalid_opcode(&io->scsiio); + } else if (error == ENOSPC) { + ctl_set_space_alloc_fail(&io->scsiio); } else if (beio->bio_cmd == BIO_FLUSH) { /* XXX KDM is there is a better error here? */ ctl_set_internal_failure(&io->scsiio, @@ -714,14 +716,12 @@ ctl_be_block_dispatch_file(struct ctl_be char path_str[32]; ctl_scsi_path_string(io, path_str, sizeof(path_str)); - /* - * XXX KDM ZFS returns ENOSPC when the underlying - * filesystem fills up. What kind of SCSI error should we - * return for that? - */ printf("%s%s command returned errno %d\n", path_str, (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", error); - ctl_set_medium_error(&io->scsiio); + if (error == ENOSPC) { + ctl_set_space_alloc_fail(&io->scsiio); + } else + ctl_set_medium_error(&io->scsiio); ctl_complete_beio(beio); return; } @@ -807,7 +807,10 @@ ctl_be_block_dispatch_zvol(struct ctl_be * return the I/O to the user. */ if (error != 0) { - ctl_set_medium_error(&io->scsiio); + if (error == ENOSPC) { + ctl_set_space_alloc_fail(&io->scsiio); + } else + ctl_set_medium_error(&io->scsiio); ctl_complete_beio(beio); return; } Modified: stable/10/sys/cam/ctl/ctl_error.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.c Mon Nov 3 03:44:59 2014 (r274003) +++ stable/10/sys/cam/ctl/ctl_error.c Mon Nov 3 03:45:41 2014 (r274004) @@ -806,6 +806,18 @@ ctl_set_task_aborted(struct ctl_scsiio * } void +ctl_set_space_alloc_fail(struct ctl_scsiio *ctsio) +{ + /* "Space allocation failed write protect" */ + ctl_set_sense(ctsio, + /*current_error*/ 1, + /*sense_key*/ SSD_KEY_DATA_PROTECT, + /*asc*/ 0x27, + /*ascq*/ 0x07, + SSD_ELEM_NONE); +} + +void ctl_set_success(struct ctl_scsiio *ctsio) { struct scsi_sense_data *sense; Modified: stable/10/sys/cam/ctl/ctl_error.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.h Mon Nov 3 03:44:59 2014 (r274003) +++ stable/10/sys/cam/ctl/ctl_error.h Mon Nov 3 03:45:41 2014 (r274004) @@ -81,6 +81,7 @@ void ctl_set_reservation_conflict(struct void ctl_set_queue_full(struct ctl_scsiio *ctsio); void ctl_set_busy(struct ctl_scsiio *ctsio); void ctl_set_task_aborted(struct ctl_scsiio *ctsio); +void ctl_set_space_alloc_fail(struct ctl_scsiio *ctsio); void ctl_set_success(struct ctl_scsiio *ctsio); #endif /* _CTL_ERROR_H_ */ Modified: stable/10/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.c Mon Nov 3 03:44:59 2014 (r274003) +++ stable/10/sys/cam/scsi/scsi_all.c Mon Nov 3 03:45:41 2014 (r274004) @@ -1733,7 +1733,7 @@ static struct asc_table_entry asc_table[ { SST(0x27, 0x06, SS_RDEF, /* XXX TBD */ "Conditional write protect") }, /* D B */ - { SST(0x27, 0x07, SS_RDEF, /* XXX TBD */ + { SST(0x27, 0x07, SS_FATAL | ENOSPC, "Space allocation failed write protect") }, /* DTLPWROMAEBKVF */ { SST(0x28, 0x00, SS_FATAL | ENXIO, From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 05:35:46 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A08D6E91; Mon, 3 Nov 2014 05:35:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8F89A8; Mon, 3 Nov 2014 05:35:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA35Zk8D075300; Mon, 3 Nov 2014 05:35:46 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA35ZkbD075298; Mon, 3 Nov 2014 05:35:46 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411030535.sA35ZkbD075298@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 05: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: r274008 - stable/10/sbin/fdisk_pc98 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.18-1 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, 03 Nov 2014 05:35:46 -0000 Author: nyan Date: Mon Nov 3 05:35:45 2014 New Revision: 274008 URL: https://svnweb.freebsd.org/changeset/base/274008 Log: MFC: r272243 Add missing library dependencies. Modified: stable/10/sbin/fdisk_pc98/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fdisk_pc98/Makefile ============================================================================== --- stable/10/sbin/fdisk_pc98/Makefile Mon Nov 3 05:12:17 2014 (r274007) +++ stable/10/sbin/fdisk_pc98/Makefile Mon Nov 3 05:35:45 2014 (r274008) @@ -7,7 +7,7 @@ MAN= fdisk.8 .PATH: ${.CURDIR}/../../sys/geom -DPADD += ${LIBGEOM} -LDADD += -lgeom +DPADD+= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} +LDADD+= -lgeom -lbsdxml -lsbuf .include From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 05:36:13 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D549FBF; Mon, 3 Nov 2014 05:36:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 892489AE; Mon, 3 Nov 2014 05:36:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA35aDVI075427; Mon, 3 Nov 2014 05:36:13 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA35aDvx075426; Mon, 3 Nov 2014 05:36:13 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411030536.sA35aDvx075426@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 05:36:13 +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: r274009 - stable/9/sbin/fdisk_pc98 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.18-1 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, 03 Nov 2014 05:36:13 -0000 Author: nyan Date: Mon Nov 3 05:36:12 2014 New Revision: 274009 URL: https://svnweb.freebsd.org/changeset/base/274009 Log: MFC: r272243 Add missing library dependencies. Modified: stable/9/sbin/fdisk_pc98/Makefile Directory Properties: stable/9/sbin/fdisk_pc98/ (props changed) Modified: stable/9/sbin/fdisk_pc98/Makefile ============================================================================== --- stable/9/sbin/fdisk_pc98/Makefile Mon Nov 3 05:35:45 2014 (r274008) +++ stable/9/sbin/fdisk_pc98/Makefile Mon Nov 3 05:36:12 2014 (r274009) @@ -7,7 +7,7 @@ MAN= fdisk.8 .PATH: ${.CURDIR}/../../sys/geom -DPADD += ${LIBGEOM} -LDADD += -lgeom +DPADD+= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} +LDADD+= -lgeom -lbsdxml -lsbuf .include From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 05:36:36 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 248E217E; Mon, 3 Nov 2014 05:36:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 106799B7; Mon, 3 Nov 2014 05:36:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA35aZ1n075517; Mon, 3 Nov 2014 05:36:35 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA35aZ7M075515; Mon, 3 Nov 2014 05:36:35 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411030536.sA35aZ7M075515@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 05:36:35 +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: r274010 - stable/8/sbin/fdisk_pc98 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.18-1 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, 03 Nov 2014 05:36:36 -0000 Author: nyan Date: Mon Nov 3 05:36:35 2014 New Revision: 274010 URL: https://svnweb.freebsd.org/changeset/base/274010 Log: MFC: r272243 Add missing library dependencies. Modified: stable/8/sbin/fdisk_pc98/Makefile Directory Properties: stable/8/sbin/fdisk_pc98/ (props changed) Modified: stable/8/sbin/fdisk_pc98/Makefile ============================================================================== --- stable/8/sbin/fdisk_pc98/Makefile Mon Nov 3 05:36:12 2014 (r274009) +++ stable/8/sbin/fdisk_pc98/Makefile Mon Nov 3 05:36:35 2014 (r274010) @@ -7,7 +7,7 @@ MAN= fdisk.8 .PATH: ${.CURDIR}/../../sys/geom -DPADD += ${LIBGEOM} -LDADD += -lgeom +DPADD+= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} +LDADD+= -lgeom -lbsdxml -lsbuf .include From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 06:33:53 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AB64CD3; Mon, 3 Nov 2014 06:33:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 068F2E8E; Mon, 3 Nov 2014 06:33:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA36XqUZ003152; Mon, 3 Nov 2014 06:33:52 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA36XqTv003151; Mon, 3 Nov 2014 06:33:52 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411030633.sA36XqTv003151@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 06:33: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: r274013 - stable/10/rescue/rescue 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.18-1 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, 03 Nov 2014 06:33:53 -0000 Author: nyan Date: Mon Nov 3 06:33:52 2014 New Revision: 274013 URL: https://svnweb.freebsd.org/changeset/base/274013 Log: MFC: r272245 Remove duplicate prog. Modified: stable/10/rescue/rescue/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/rescue/rescue/Makefile ============================================================================== --- stable/10/rescue/rescue/Makefile Mon Nov 3 06:24:43 2014 (r274012) +++ stable/10/rescue/rescue/Makefile Mon Nov 3 06:33:52 2014 (r274013) @@ -140,7 +140,6 @@ CRUNCH_ALIAS_bsdlabel= disklabel .endif .if ${MACHINE} == "pc98" -CRUNCH_PROGS_sbin+= bsdlabel CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98 .endif From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 06:34:09 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 173D3DFE; Mon, 3 Nov 2014 06:34:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0322BE93; Mon, 3 Nov 2014 06:34:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA36Y8iE003260; Mon, 3 Nov 2014 06:34:08 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA36Y8p7003259; Mon, 3 Nov 2014 06:34:08 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411030634.sA36Y8p7003259@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 06:34:08 +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: r274014 - stable/9/rescue/rescue 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.18-1 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, 03 Nov 2014 06:34:09 -0000 Author: nyan Date: Mon Nov 3 06:34:08 2014 New Revision: 274014 URL: https://svnweb.freebsd.org/changeset/base/274014 Log: MFC: r272245 Remove duplicate prog. Modified: stable/9/rescue/rescue/Makefile Directory Properties: stable/9/rescue/ (props changed) stable/9/rescue/rescue/ (props changed) Modified: stable/9/rescue/rescue/Makefile ============================================================================== --- stable/9/rescue/rescue/Makefile Mon Nov 3 06:33:52 2014 (r274013) +++ stable/9/rescue/rescue/Makefile Mon Nov 3 06:34:08 2014 (r274014) @@ -139,7 +139,6 @@ CRUNCH_ALIAS_bsdlabel= disklabel .endif .if ${MACHINE} == "pc98" -CRUNCH_PROGS_sbin+= bsdlabel CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98 .endif From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 06:34:29 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B3CFF5F; Mon, 3 Nov 2014 06:34:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2720DE9B; Mon, 3 Nov 2014 06:34:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA36YTJl003352; Mon, 3 Nov 2014 06:34:29 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA36YTNY003351; Mon, 3 Nov 2014 06:34:29 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411030634.sA36YTNY003351@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 06:34:29 +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: r274015 - stable/8/rescue/rescue 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.18-1 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, 03 Nov 2014 06:34:29 -0000 Author: nyan Date: Mon Nov 3 06:34:28 2014 New Revision: 274015 URL: https://svnweb.freebsd.org/changeset/base/274015 Log: MFC: r272245 Remove duplicate prog. Modified: stable/8/rescue/rescue/Makefile Directory Properties: stable/8/rescue/ (props changed) stable/8/rescue/rescue/ (props changed) Modified: stable/8/rescue/rescue/Makefile ============================================================================== --- stable/8/rescue/rescue/Makefile Mon Nov 3 06:34:08 2014 (r274014) +++ stable/8/rescue/rescue/Makefile Mon Nov 3 06:34:28 2014 (r274015) @@ -157,7 +157,6 @@ CRUNCH_ALIAS_bsdlabel= disklabel .endif .if ${MACHINE} == "pc98" -CRUNCH_PROGS_sbin+= bsdlabel CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98 .endif From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 08:48:49 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E38D6EE; Mon, 3 Nov 2014 08:48:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79BC6DE5; Mon, 3 Nov 2014 08:48:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA38mnsA065501; Mon, 3 Nov 2014 08:48:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA38mnev065500; Mon, 3 Nov 2014 08:48:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411030848.sA38mnev065500@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 3 Nov 2014 08: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: r274018 - stable/10/usr.sbin/pmcstat 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.18-1 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, 03 Nov 2014 08:48:49 -0000 Author: bapt Date: Mon Nov 3 08:48:48 2014 New Revision: 274018 URL: https://svnweb.freebsd.org/changeset/base/274018 Log: MFC r273737, 273739 Clarify the documentation of pmcstat: the -d argument should be passed before -p, -s, -P or -S to be taken in account Differential Revision: https://reviews.freebsd.org/D1011 Reviewed by: adrian, gnn Modified: stable/10/usr.sbin/pmcstat/pmcstat.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcstat.8 Mon Nov 3 07:46:51 2014 (r274017) +++ stable/10/usr.sbin/pmcstat/pmcstat.8 Mon Nov 3 08:48:48 2014 (r274018) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2014 +.Dd Oct 27, 2014 .Dt PMCSTAT 8 .Os .Sh NAME @@ -254,6 +254,12 @@ Toggle between process mode PMCs measuri process' current and future children or only measuring events for the target process. The default is to measure events for the target process alone. +(it has to be passed in the command line prior to +.Fl p , +.Fl s , +.Fl P , +or +.Fl S ) . .It Fl f Ar pluginopt Pass option string to the active plugin. .br From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 10:26:31 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6EE3C96; Mon, 3 Nov 2014 10:26:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2BD2A92; Mon, 3 Nov 2014 10:26:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3AQUXO013861; Mon, 3 Nov 2014 10:26:30 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3AQUvC013857; Mon, 3 Nov 2014 10:26:30 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031026.sA3AQUvC013857@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 10:26: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: r274024 - in stable/10: sys/sys usr.sbin/fdread 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.18-1 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, 03 Nov 2014 10:26:31 -0000 Author: nyan Date: Mon Nov 3 10:26:29 2014 New Revision: 274024 URL: https://svnweb.freebsd.org/changeset/base/274024 Log: MFC: r272248 - Cleanups pc98 code. - Remove unworked formats. Modified: stable/10/sys/sys/fdcio.h stable/10/usr.sbin/fdread/fdutil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/fdcio.h ============================================================================== --- stable/10/sys/sys/fdcio.h Mon Nov 3 10:01:56 2014 (r274023) +++ stable/10/sys/sys/fdcio.h Mon Nov 3 10:26:29 2014 (r274024) @@ -181,27 +181,17 @@ enum fd_drivetype { * XXX: should have been done 20 years ago to make sense. */ #ifdef PC98 -#define FDF_3_1722 21,2,0xFF,0x04,82,0,2,2,0x0C,2,0,FL_MFM -#define FDF_3_1476 18,2,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1440 18,2,0xFF,0x1B,80,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_3_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_3_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_3_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_3_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1480 9,3,0xFF,0x35,82,0,0,2,0x47,1,0,FL_MFM -#define FDF_3_1640 10,3,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_5_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_5_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_5_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_5_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_5_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_5_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM #else /* PC98 */ #define FDF_3_2880 36,2,0xFF,0x1B,80,0,FDC_1MBPS,002,0x4C,1,1,FL_MFM|FL_PERPND #define FDF_3_1722 21,2,0xFF,0x04,82,0,FDC_500KBPS,2,0x0C,2,0,FL_MFM Modified: stable/10/usr.sbin/fdread/fdutil.c ============================================================================== --- stable/10/usr.sbin/fdread/fdutil.c Mon Nov 3 10:01:56 2014 (r274023) +++ stable/10/usr.sbin/fdread/fdutil.c Mon Nov 3 10:26:29 2014 (r274024) @@ -92,6 +92,7 @@ static struct fd_type fd_types_auto[1] = static struct fd_type fd_types_288m[] = { +#ifndef PC98 #if 0 { FDF_3_2880 }, #endif @@ -102,30 +103,18 @@ static struct fd_type fd_types_288m[] = { FDF_3_820 }, { FDF_3_800 }, { FDF_3_720 }, +#endif /* !PC98 */ { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_144m[] = { #ifdef PC98 -#if 0 - { FDF_3_1722 }, - { FDF_3_1476 }, -#endif { FDF_3_1440 }, { FDF_3_1200 }, -#if 0 - { FDF_3_820 }, - { FDF_3_800 }, -#endif { FDF_3_720 }, { FDF_3_360 }, { FDF_3_640 }, { FDF_3_1230 }, -#if 0 - { FDF_3_1280 }, - { FDF_3_1480 }, - { FDF_3_1640 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_3_1722 }, @@ -142,17 +131,10 @@ static struct fd_type fd_types_144m[] = static struct fd_type fd_types_12m[] = { #ifdef PC98 { FDF_5_1200 }, -#if 0 - { FDF_5_820 }, - { FDF_5_800 }, -#endif { FDF_5_720 }, { FDF_5_360 }, { FDF_5_640 }, { FDF_5_1230 }, -#if 0 - { FDF_5_1280 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_5_1200 }, @@ -170,13 +152,17 @@ static struct fd_type fd_types_12m[] = { static struct fd_type fd_types_720k[] = { +#ifndef PC98 { FDF_3_720 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_360k[] = { +#ifndef PC98 { FDF_5_360 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 10:27:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22165DC0; Mon, 3 Nov 2014 10:27:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DC22A96; Mon, 3 Nov 2014 10:27:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3AR3KE013992; Mon, 3 Nov 2014 10:27:03 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3AR32L013990; Mon, 3 Nov 2014 10:27:03 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031027.sA3AR32L013990@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 10:27:03 +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: r274025 - in stable/9: sys/sys usr.sbin/fdread 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.18-1 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, 03 Nov 2014 10:27:04 -0000 Author: nyan Date: Mon Nov 3 10:27:03 2014 New Revision: 274025 URL: https://svnweb.freebsd.org/changeset/base/274025 Log: MFC: r272248 - Cleanups pc98 code. - Remove unworked formats. Modified: stable/9/sys/sys/fdcio.h stable/9/usr.sbin/fdread/fdutil.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) stable/9/usr.sbin/fdread/ (props changed) Modified: stable/9/sys/sys/fdcio.h ============================================================================== --- stable/9/sys/sys/fdcio.h Mon Nov 3 10:26:29 2014 (r274024) +++ stable/9/sys/sys/fdcio.h Mon Nov 3 10:27:03 2014 (r274025) @@ -181,27 +181,17 @@ enum fd_drivetype { * XXX: should have been done 20 years ago to make sense. */ #ifdef PC98 -#define FDF_3_1722 21,2,0xFF,0x04,82,0,2,2,0x0C,2,0,FL_MFM -#define FDF_3_1476 18,2,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1440 18,2,0xFF,0x1B,80,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_3_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_3_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_3_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_3_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1480 9,3,0xFF,0x35,82,0,0,2,0x47,1,0,FL_MFM -#define FDF_3_1640 10,3,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_5_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_5_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_5_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_5_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_5_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_5_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM #else /* PC98 */ #define FDF_3_2880 36,2,0xFF,0x1B,80,0,FDC_1MBPS,002,0x4C,1,1,FL_MFM|FL_PERPND #define FDF_3_1722 21,2,0xFF,0x04,82,0,FDC_500KBPS,2,0x0C,2,0,FL_MFM Modified: stable/9/usr.sbin/fdread/fdutil.c ============================================================================== --- stable/9/usr.sbin/fdread/fdutil.c Mon Nov 3 10:26:29 2014 (r274024) +++ stable/9/usr.sbin/fdread/fdutil.c Mon Nov 3 10:27:03 2014 (r274025) @@ -92,6 +92,7 @@ static struct fd_type fd_types_auto[1] = static struct fd_type fd_types_288m[] = { +#ifndef PC98 #if 0 { FDF_3_2880 }, #endif @@ -102,30 +103,18 @@ static struct fd_type fd_types_288m[] = { FDF_3_820 }, { FDF_3_800 }, { FDF_3_720 }, +#endif /* !PC98 */ { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_144m[] = { #ifdef PC98 -#if 0 - { FDF_3_1722 }, - { FDF_3_1476 }, -#endif { FDF_3_1440 }, { FDF_3_1200 }, -#if 0 - { FDF_3_820 }, - { FDF_3_800 }, -#endif { FDF_3_720 }, { FDF_3_360 }, { FDF_3_640 }, { FDF_3_1230 }, -#if 0 - { FDF_3_1280 }, - { FDF_3_1480 }, - { FDF_3_1640 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_3_1722 }, @@ -142,17 +131,10 @@ static struct fd_type fd_types_144m[] = static struct fd_type fd_types_12m[] = { #ifdef PC98 { FDF_5_1200 }, -#if 0 - { FDF_5_820 }, - { FDF_5_800 }, -#endif { FDF_5_720 }, { FDF_5_360 }, { FDF_5_640 }, { FDF_5_1230 }, -#if 0 - { FDF_5_1280 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_5_1200 }, @@ -170,13 +152,17 @@ static struct fd_type fd_types_12m[] = { static struct fd_type fd_types_720k[] = { +#ifndef PC98 { FDF_3_720 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_360k[] = { +#ifndef PC98 { FDF_5_360 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 10:27:22 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F0C7EF3; Mon, 3 Nov 2014 10:27:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A44AA9A; Mon, 3 Nov 2014 10:27:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3ARMuK014081; Mon, 3 Nov 2014 10:27:22 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3ARMqd014079; Mon, 3 Nov 2014 10:27:22 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031027.sA3ARMqd014079@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 10:27: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: r274026 - in stable/8: sys/sys usr.sbin/fdread 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.18-1 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, 03 Nov 2014 10:27:22 -0000 Author: nyan Date: Mon Nov 3 10:27:21 2014 New Revision: 274026 URL: https://svnweb.freebsd.org/changeset/base/274026 Log: MFC: r272248 - Cleanups pc98 code. - Remove unworked formats. Modified: stable/8/sys/sys/fdcio.h stable/8/usr.sbin/fdread/fdutil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) stable/8/usr.sbin/fdread/ (props changed) Modified: stable/8/sys/sys/fdcio.h ============================================================================== --- stable/8/sys/sys/fdcio.h Mon Nov 3 10:27:03 2014 (r274025) +++ stable/8/sys/sys/fdcio.h Mon Nov 3 10:27:21 2014 (r274026) @@ -181,27 +181,17 @@ enum fd_drivetype { * XXX: should have been done 20 years ago to make sense. */ #ifdef PC98 -#define FDF_3_1722 21,2,0xFF,0x04,82,0,2,2,0x0C,2,0,FL_MFM -#define FDF_3_1476 18,2,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1440 18,2,0xFF,0x1B,80,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_3_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_3_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_3_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_3_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1480 9,3,0xFF,0x35,82,0,0,2,0x47,1,0,FL_MFM -#define FDF_3_1640 10,3,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_5_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_5_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_5_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_5_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_5_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_5_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM #else /* PC98 */ #define FDF_3_2880 36,2,0xFF,0x1B,80,0,FDC_1MBPS,002,0x4C,1,1,FL_MFM|FL_PERPND #define FDF_3_1722 21,2,0xFF,0x04,82,0,FDC_500KBPS,2,0x0C,2,0,FL_MFM Modified: stable/8/usr.sbin/fdread/fdutil.c ============================================================================== --- stable/8/usr.sbin/fdread/fdutil.c Mon Nov 3 10:27:03 2014 (r274025) +++ stable/8/usr.sbin/fdread/fdutil.c Mon Nov 3 10:27:21 2014 (r274026) @@ -92,6 +92,7 @@ static struct fd_type fd_types_auto[1] = static struct fd_type fd_types_288m[] = { +#ifndef PC98 #if 0 { FDF_3_2880 }, #endif @@ -102,30 +103,18 @@ static struct fd_type fd_types_288m[] = { FDF_3_820 }, { FDF_3_800 }, { FDF_3_720 }, +#endif /* !PC98 */ { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_144m[] = { #ifdef PC98 -#if 0 - { FDF_3_1722 }, - { FDF_3_1476 }, -#endif { FDF_3_1440 }, { FDF_3_1200 }, -#if 0 - { FDF_3_820 }, - { FDF_3_800 }, -#endif { FDF_3_720 }, { FDF_3_360 }, { FDF_3_640 }, { FDF_3_1230 }, -#if 0 - { FDF_3_1280 }, - { FDF_3_1480 }, - { FDF_3_1640 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_3_1722 }, @@ -142,17 +131,10 @@ static struct fd_type fd_types_144m[] = static struct fd_type fd_types_12m[] = { #ifdef PC98 { FDF_5_1200 }, -#if 0 - { FDF_5_820 }, - { FDF_5_800 }, -#endif { FDF_5_720 }, { FDF_5_360 }, { FDF_5_640 }, { FDF_5_1230 }, -#if 0 - { FDF_5_1280 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_5_1200 }, @@ -170,13 +152,17 @@ static struct fd_type fd_types_12m[] = { static struct fd_type fd_types_720k[] = { +#ifndef PC98 { FDF_3_720 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_360k[] = { +#ifndef PC98 { FDF_5_360 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 10:30:45 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BAA2D6; Mon, 3 Nov 2014 10:30:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37B38AB4; Mon, 3 Nov 2014 10:30:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3AUjvO015728; Mon, 3 Nov 2014 10:30:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3AUjQA015727; Mon, 3 Nov 2014 10:30:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411031030.sA3AUjQA015727@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Nov 2014 10:30:45 +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: r274027 - stable/10/sys/fs/nfsserver 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.18-1 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, 03 Nov 2014 10:30:45 -0000 Author: kib Date: Mon Nov 3 10:30:44 2014 New Revision: 274027 URL: https://svnweb.freebsd.org/changeset/base/274027 Log: MFC r273727: Original commit message was Allow the vfs.nfsd knobs to be set from loader.conf (or using kenv(8)). This is useful when nfsd is loaded as module. As I understand, automatic fetch from kenv does not work in stable/10. Merge the change still, to reduce code difference. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Mon Nov 3 10:27:21 2014 (r274026) +++ stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Mon Nov 3 10:30:44 2014 (r274027) @@ -88,16 +88,16 @@ SYSCTL_DECL(_vfs_nfsd); SVCPOOL *nfsrvd_pool; static int nfs_privport = 0; -SYSCTL_INT(_vfs_nfsd, OID_AUTO, nfs_privport, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, nfs_privport, CTLFLAG_RWTUN, &nfs_privport, 0, "Only allow clients using a privileged port for NFSv2 and 3"); static int nfs_minvers = NFS_VER2; -SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_min_nfsvers, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_min_nfsvers, CTLFLAG_RWTUN, &nfs_minvers, 0, "The lowest version of NFS handled by the server"); static int nfs_maxvers = NFS_VER4; -SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_max_nfsvers, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_max_nfsvers, CTLFLAG_RWTUN, &nfs_maxvers, 0, "The highest version of NFS handled by the server"); static int nfs_proc(struct nfsrv_descript *, u_int32_t, SVCXPRT *xprt, From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 10:33:02 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59B6F26D; Mon, 3 Nov 2014 10:33:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BAF4B63; Mon, 3 Nov 2014 10:33:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3AX2oo018387; Mon, 3 Nov 2014 10:33:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3AX1DC018384; Mon, 3 Nov 2014 10:33:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411031033.sA3AX1DC018384@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Nov 2014 10:33: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: r274028 - 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.18-1 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, 03 Nov 2014 10:33:02 -0000 Author: kib Date: Mon Nov 3 10:33:01 2014 New Revision: 274028 URL: https://svnweb.freebsd.org/changeset/base/274028 Log: MFC r273728: Add a method to iicbus to request IIC_M_NOSTOP behaviour for multibyte transfers to be default. Modified: stable/10/sys/dev/iicbus/iicbus.h stable/10/sys/dev/iicbus/iiconf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iicbus/iicbus.h ============================================================================== --- stable/10/sys/dev/iicbus/iicbus.h Mon Nov 3 10:30:44 2014 (r274027) +++ stable/10/sys/dev/iicbus/iicbus.h Mon Nov 3 10:33:01 2014 (r274028) @@ -49,16 +49,19 @@ struct iicbus_softc struct iicbus_ivar { uint32_t addr; + bool nostop; }; enum { - IICBUS_IVAR_ADDR /* Address or base address */ + IICBUS_IVAR_ADDR, /* Address or base address */ + IICBUS_IVAR_NOSTOP, /* nostop defaults */ }; #define IICBUS_ACCESSOR(A, B, T) \ __BUS_ACCESSOR(iicbus, A, IICBUS, B, T) IICBUS_ACCESSOR(addr, ADDR, uint32_t) +IICBUS_ACCESSOR(nostop, NOSTOP, bool) #define IICBUS_LOCK(sc) mtx_lock(&(sc)->lock) #define IICBUS_UNLOCK(sc) mtx_unlock(&(sc)->lock) Modified: stable/10/sys/dev/iicbus/iiconf.c ============================================================================== --- stable/10/sys/dev/iicbus/iiconf.c Mon Nov 3 10:30:44 2014 (r274027) +++ stable/10/sys/dev/iicbus/iiconf.c Mon Nov 3 10:33:01 2014 (r274028) @@ -365,6 +365,7 @@ iicbus_transfer_gen(device_t dev, struct { int i, error, lenread, lenwrote, nkid, rpstart, addr; device_t *children, bus; + bool nostop; if ((error = device_get_children(dev, &children, &nkid)) != 0) return (error); @@ -375,6 +376,7 @@ iicbus_transfer_gen(device_t dev, struct bus = children[0]; rpstart = 0; free(children, M_TEMP); + nostop = iicbus_get_nostop(dev); for (i = 0, error = 0; i < nmsgs && error == 0; i++) { addr = msgs[i].slave; if (msgs[i].flags & IIC_M_RD) @@ -399,11 +401,12 @@ iicbus_transfer_gen(device_t dev, struct error = iicbus_write(bus, msgs[i].buf, msgs[i].len, &lenwrote, 0); - if (!(msgs[i].flags & IIC_M_NOSTOP)) { + if ((msgs[i].flags & IIC_M_NOSTOP) != 0 || + (nostop && i + 1 < nmsgs)) { + rpstart = 1; /* Next message gets repeated start */ + } else { rpstart = 0; iicbus_stop(bus); - } else { - rpstart = 1; /* Next message gets repeated start */ } } return (error); From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 10:38:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D50452F; Mon, 3 Nov 2014 10:38:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18A3BB9C; Mon, 3 Nov 2014 10:38:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3Ac3eZ019079; Mon, 3 Nov 2014 10:38:03 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3Ac3ug019078; Mon, 3 Nov 2014 10:38:03 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031038.sA3Ac3ug019078@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 10: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: r274029 - stable/10/sys/boot/pc98/cdboot 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.18-1 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, 03 Nov 2014 10:38:04 -0000 Author: nyan Date: Mon Nov 3 10:38:03 2014 New Revision: 274029 URL: https://svnweb.freebsd.org/changeset/base/274029 Log: MFC: r272252 Drop the 3rd clause from all 3 clause BSD licenses. Modified: stable/10/sys/boot/pc98/cdboot/cdboot.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/pc98/cdboot/cdboot.S ============================================================================== --- stable/10/sys/boot/pc98/cdboot/cdboot.S Mon Nov 3 10:33:01 2014 (r274028) +++ stable/10/sys/boot/pc98/cdboot/cdboot.S Mon Nov 3 10:38:03 2014 (r274029) @@ -11,9 +11,6 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. Neither the name of the author nor the names of any co-contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 10:38:23 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C4AA65B; Mon, 3 Nov 2014 10:38:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBE38BA0; Mon, 3 Nov 2014 10:38:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3AcMHC019165; Mon, 3 Nov 2014 10:38:22 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3AcM5N019164; Mon, 3 Nov 2014 10:38:22 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031038.sA3AcM5N019164@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 10:38: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: r274030 - stable/9/sys/boot/pc98/cdboot 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.18-1 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, 03 Nov 2014 10:38:23 -0000 Author: nyan Date: Mon Nov 3 10:38:22 2014 New Revision: 274030 URL: https://svnweb.freebsd.org/changeset/base/274030 Log: MFC: r272252 Drop the 3rd clause from all 3 clause BSD licenses. Modified: stable/9/sys/boot/pc98/cdboot/cdboot.S Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/cdboot/cdboot.S ============================================================================== --- stable/9/sys/boot/pc98/cdboot/cdboot.S Mon Nov 3 10:38:03 2014 (r274029) +++ stable/9/sys/boot/pc98/cdboot/cdboot.S Mon Nov 3 10:38:22 2014 (r274030) @@ -11,9 +11,6 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. Neither the name of the author nor the names of any co-contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 11:01:13 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75B0BD6B; Mon, 3 Nov 2014 11:01:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61428E14; Mon, 3 Nov 2014 11:01:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3B1DH4031768; Mon, 3 Nov 2014 11:01:13 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3B1D7L031767; Mon, 3 Nov 2014 11:01:13 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031101.sA3B1D7L031767@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 11:01:13 +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: r274032 - stable/10/sys/boot/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.18-1 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, 03 Nov 2014 11:01:13 -0000 Author: nyan Date: Mon Nov 3 11:01:12 2014 New Revision: 274032 URL: https://svnweb.freebsd.org/changeset/base/274032 Log: MFC: r272255 Supress clang warning for FreeBSD printf %b and %D formats. Modified: stable/10/sys/boot/pc98/libpc98/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/10/sys/boot/pc98/libpc98/Makefile Mon Nov 3 10:42:27 2014 (r274031) +++ stable/10/sys/boot/pc98/libpc98/Makefile Mon Nov 3 11:01:12 2014 (r274032) @@ -44,4 +44,7 @@ CFLAGS+= -I${.CURDIR}/../../common \ # the location of libstand CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +# Suppress warning from clang for FreeBSD %b and %D formats +CFLAGS+= -fformat-extensions + .include From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 11:08:01 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 531B22A4; Mon, 3 Nov 2014 11:08:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E3B6E7F; Mon, 3 Nov 2014 11:08:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3B81aJ033773; Mon, 3 Nov 2014 11:08:01 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3B80Bh033767; Mon, 3 Nov 2014 11:08:00 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031108.sA3B80Bh033767@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 11:08: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: r274034 - in stable/10/sys/boot: . pc98/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.18-1 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, 03 Nov 2014 11:08:01 -0000 Author: nyan Date: Mon Nov 3 11:08:00 2014 New Revision: 274034 URL: https://svnweb.freebsd.org/changeset/base/274034 Log: MFC: r272256 Switch from lib/libstand to sys/boot/libstand32. Modified: stable/10/sys/boot/Makefile.pc98 stable/10/sys/boot/pc98/loader/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/Makefile.pc98 ============================================================================== --- stable/10/sys/boot/Makefile.pc98 Mon Nov 3 11:05:23 2014 (r274033) +++ stable/10/sys/boot/Makefile.pc98 Mon Nov 3 11:08:00 2014 (r274034) @@ -1,4 +1,3 @@ # $FreeBSD$ -# Blank, to override Makefile.i386 since Makefile.$MACHINE is included before -# Makefile.$MACHINE_ARCH +SUBDIR+= libstand32 Modified: stable/10/sys/boot/pc98/loader/Makefile ============================================================================== --- stable/10/sys/boot/pc98/loader/Makefile Mon Nov 3 11:05:23 2014 (r274033) +++ stable/10/sys/boot/pc98/loader/Makefile Mon Nov 3 11:08:00 2014 (r274034) @@ -56,6 +56,8 @@ LDFLAGS= -static -Ttext 0x0 LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a CFLAGS+= -I${.CURDIR}/.. +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a + # BTX components CFLAGS+= -I${.CURDIR}/../btx/lib From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 11:21:44 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3900896F; Mon, 3 Nov 2014 11:21:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21EC2F7A; Mon, 3 Nov 2014 11:21:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3BLiNV042890; Mon, 3 Nov 2014 11:21:44 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3BLhff042889; Mon, 3 Nov 2014 11:21:43 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031121.sA3BLhff042889@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 11:21: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: r274037 - stable/10/sys/pc98/conf 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.18-1 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, 03 Nov 2014 11:21:44 -0000 Author: nyan Date: Mon Nov 3 11:21:43 2014 New Revision: 274037 URL: https://svnweb.freebsd.org/changeset/base/274037 Log: MFC: r272258 - Cosmetic changes. - Reduce diffs against i386. MFC: 272259 MFi386: Enable QUOTA, PRINTF_BUFR_SIZE and puc. Modified: stable/10/sys/pc98/conf/GENERIC Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/pc98/conf/GENERIC ============================================================================== --- stable/10/sys/pc98/conf/GENERIC Mon Nov 3 11:15:51 2014 (r274036) +++ stable/10/sys/pc98/conf/GENERIC Mon Nov 3 11:21:43 2014 (r274037) @@ -35,6 +35,7 @@ options SOFTUPDATES # Enable FFS soft options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS options MD_ROOT # MD is a potential root device options NFSCL # New Network Filesystem Client options NFSD # New Network Filesystem Server @@ -60,6 +61,7 @@ options SYSVSHM # SYSV-style shared m options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing @@ -67,9 +69,11 @@ options CAPABILITY_MODE # Capsicum cap options CAPABILITIES # Capsicum capabilities options PROCDESC # Support for process descriptors options MAC # TrustedBSD MAC Framework -options INCLUDE_CONFIG_FILE # Include this file in kernel -options KDB # Kernel debugger related code -options KDB_TRACE # Print a stack trace for a panic +options INCLUDE_CONFIG_FILE # Include this file in kernel + +# Debugging support. Always need this: +options KDB # Enable kernel debugger support. +options KDB_TRACE # Print a stack trace for a panic. # To make an SMP kernel, the next two lines are needed #options SMP # Symmetric MultiProcessor Kernel @@ -82,47 +86,48 @@ device pci device fdc # ATA controllers -device ahci # AHCI-compatible SATA controllers -device ata # Legacy ATA/SATA controllers -options ATA_STATIC_ID # Static device numbering -device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA -device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_STATIC_ID # Static device numbering +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers -device adv # Advansys SCSI adapters -device ahc # AHA2940 and onboard AIC7xxx devices -device esp # AMD Am53C974 (Tekram DC-390(T)) -device isp # Qlogic family -#device ncr # NCR/Symbios Logic -device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') - -device aic # PC-9801-100 -device ct # host adapter using WD33C93[ABC] chip (C bus) - -device ncv # NCR 53C500 -device nsp # Workbit Ninja SCSI-3 -device stg # TMC 18C30/18C50 +device ahc # AHA2940 and onboard AIC7xxx devices +device esp # AMD Am53C974 (Tekram DC-390(T)) +device isp # Qlogic family +#device ncr # NCR/Symbios Logic +device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') + +device adv # Advansys SCSI adapters +device aic # PC-9801-100 +device ct # host adapter using WD33C93[ABC] chip + +device ncv # NCR 53C500 +device nsp # Workbit Ninja SCSI-3 +device stg # TMC 18C30/18C50 # ATA/SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device ch # SCSI media changers -device da # Direct Access (disks) -device sa # Sequential Access (tape etc) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) -device ses # Enclosure Services (SES and SAF-TE) +device scbus # SCSI bus (required for ATA/SCSI) +device ch # SCSI media changers +device da # Direct Access (disks) +device sa # Sequential Access (tape etc) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) +device ses # Enclosure Services (SES and SAF-TE) +#device ctl # CAM Target Layer # keyboard driver -device pckbd # PC98 keyboard +device pckbd # PC98 keyboard -device gdc # GDC screen +device gdc # GDC screen -device splash # Splash screen and screen saver support +device splash # Splash screen and screen saver support # syscons is the default console driver, resembling an SCO console device sc -#device agp # support several AGP chipsets +#device agp # support several AGP chipsets # Power management support (see NOTES for more options) #device apm @@ -134,114 +139,116 @@ device sc # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support -device cbb # cardbus (yenta) bridge -device pccard # PC Card (16-bit) bus -device cardbus # CardBus (32-bit) bus +device cbb # cardbus (yenta) bridge +device pccard # PC Card (16-bit) bus +device cardbus # CardBus (32-bit) bus # Serial (COM) ports #options COM_MULTIPORT -#options COM_ESP # ESP98 -#device sio # 8250, 16[45]50, 8251 based serial ports -device uart # Generic UART driver +#options COM_ESP # ESP98 +#device sio # 8250, 16[45]50, 8251 based serial ports +device uart # Generic UART driver device mse #device joy -# NEW Parallel port +# Parallel port device ppc -device ppbus # Parallel port bus (required) -device lpt # Printer -device ppi # Parallel port interface device -#device vpo # Requires scbus and da +device ppbus # Parallel port bus (required) +device lpt # Printer +device ppi # Parallel port interface device +#device vpo # Requires scbus and da # OLD Parallel port #device olpt +device puc # Multi I/O cards and multi-channel UARTs + # PCI Ethernet NICs. -device de # DEC/Intel DC21x4x (``Tulip'') -#device em # Intel PRO/1000 adapter Gigabit Ethernet Card -device le # AMD Am7900 LANCE and Am79C9xx PCnet -#device ti # Alteon Networks Tigon I/II gigabit Ethernet -device txp # 3Com 3cR990 (``Typhoon'') -device vx # 3Com 3c590, 3c595 (``Vortex'') +device de # DEC/Intel DC21x4x (``Tulip'') +#device em # Intel PRO/1000 Gigabit Ethernet Family +device le # AMD Am7900 LANCE and Am79C9xx PCnet +#device ti # Alteon Networks Tigon I/II gigabit Ethernet +device txp # 3Com 3cR990 (``Typhoon'') +device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! -device miibus # MII bus support -device bfe # Broadcom BCM440x 10/100 Ethernet -#device bge # Broadcom BCM570xx Gigabit Ethernet -device dc # DEC/Intel 21143 and various workalikes -device fxp # Intel EtherExpress PRO/100B (82557, 82558) -#device lge # Level 1 LXT1001 gigabit Ethernet -#device nge # NatSemi DP83820 gigabit Ethernet -device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') -device re # RealTek 8139C+/8169/8169S/8110S -device rl # RealTek 8129/8139 -device sf # Adaptec AIC-6915 (``Starfire'') -device sis # Silicon Integrated Systems SiS 900/SiS 7016 -#device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet -device ste # Sundance ST201 (D-Link DFE-550TX) -device tl # Texas Instruments ThunderLAN -device tx # SMC EtherPower II (83c170 ``EPIC'') -#device vge # VIA VT612x gigabit Ethernet -device vr # VIA Rhine, Rhine II -device wb # Winbond W89C840F -device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') +device miibus # MII bus support +device bfe # Broadcom BCM440x 10/100 Ethernet +#device bge # Broadcom BCM570xx Gigabit Ethernet +device dc # DEC/Intel 21143 and various workalikes +device fxp # Intel EtherExpress PRO/100B (82557, 82558) +#device lge # Level 1 LXT1001 gigabit Ethernet +#device nge # NatSemi DP83820 gigabit Ethernet +device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') +device re # RealTek 8139C+/8169/8169S/8110S +device rl # RealTek 8129/8139 +device sf # Adaptec AIC-6915 (``Starfire'') +device sis # Silicon Integrated Systems SiS 900/SiS 7016 +#device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet +device ste # Sundance ST201 (D-Link DFE-550TX) +device tl # Texas Instruments ThunderLAN +device tx # SMC EtherPower II (83c170 ``EPIC'') +#device vge # VIA VT612x gigabit Ethernet +device vr # VIA Rhine, Rhine II +device wb # Winbond W89C840F +device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. # 'device ed' requires 'device miibus' -device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards -device ep # Etherlink III based cards -device fe # Fujitsu MB8696x based cards -device sn # SMC's 9000 series of Ethernet chips +device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards +device ep # Etherlink III based cards +device fe # Fujitsu MB8696x based cards +device sn # SMC's 9000 series of Ethernet chips device snc -device xe # Xircom pccard Ethernet +device xe # Xircom pccard Ethernet # Wireless NIC cards -#device wlan # 802.11 support -#options IEEE80211_DEBUG # enable debug msgs +#device wlan # 802.11 support +#options IEEE80211_DEBUG # enable debug msgs #options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support -#device wlan_wep # 802.11 WEP support -#device wlan_ccmp # 802.11 CCMP support -#device wlan_tkip # 802.11 TKIP support -#device wlan_amrr # AMRR transmit rate control algorithm -#device an # Aironet 4500/4800 802.11 wireless NICs. -#device ath # Atheros NICs -#device ath_pci # Atheros pci/cardbus glue -#device ath_hal # pci/cardbus chip support +#device wlan_wep # 802.11 WEP support +#device wlan_ccmp # 802.11 CCMP support +#device wlan_tkip # 802.11 TKIP support +#device wlan_amrr # AMRR transmit rate control algorithm +#device an # Aironet 4500/4800 802.11 wireless NICs. +#device ath # Atheros NICs +#device ath_pci # Atheros pci/cardbus glue +#device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -#device ath_rate_sample # SampleRate tx rate control for ath -#device ral # Ralink Technology RT2500 wireless NICs. -#device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. -#device wl # Older non 802.11 Wavelan wireless NIC. +#device ath_rate_sample # SampleRate tx rate control for ath +#device ral # Ralink Technology RT2500 wireless NICs. +#device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. +#device wl # Older non 802.11 Wavelan wireless NIC. # Pseudo devices. -device loop # Network loopback -device random # Entropy device -device ether # Ethernet support -device vlan # 802.1Q VLAN support -device tun # Packet tunnel. -device md # Memory "disks" -device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) -device firmware # firmware assist module +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) +device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. -device bpf # Berkeley packet filter +device bpf # Berkeley packet filter # USB support -#options USB_DEBUG # enable debug msgs -#device uhci # UHCI PCI->USB interface -#device ohci # OHCI PCI->USB interface -#device ehci # EHCI PCI->USB interface (USB 2.0) -#device usb # USB Bus (required) -#device ukbd # Keyboard -#device umass # Disks/Mass storage - Requires scbus and da +#options USB_DEBUG # enable debug msgs +#device uhci # UHCI PCI->USB interface +#device ohci # OHCI PCI->USB interface +#device ehci # EHCI PCI->USB interface (USB 2.0) +#device usb # USB Bus (required) +#device ukbd # Keyboard +#device umass # Disks/Mass storage - Requires scbus and da # Sound support -#device sound # Generic sound driver (required) -#device snd_mss # Microsoft Sound System -#device "snd_sb16" # Sound Blaster 16 -#device snd_sbc # Sound Blaster +#device sound # Generic sound driver (required) +#device snd_mss # Microsoft Sound System +#device "snd_sb16" # Sound Blaster 16 +#device snd_sbc # Sound Blaster From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 11:43:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90B78E2A; Mon, 3 Nov 2014 11:43:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7159525E; Mon, 3 Nov 2014 11:43:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3BheYf052537; Mon, 3 Nov 2014 11:43:40 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3Bhemb052535; Mon, 3 Nov 2014 11:43:40 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031143.sA3Bhemb052535@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 11:43:40 +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: r274039 - stable/9/sys/pc98/conf 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.18-1 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, 03 Nov 2014 11:43:40 -0000 Author: nyan Date: Mon Nov 3 11:43:39 2014 New Revision: 274039 URL: https://svnweb.freebsd.org/changeset/base/274039 Log: MFC: r272258 (partial) - Reduce diffs against i386. MFC: r272259 MFi386: Enable QUOTA, PRINTF_BUFR_SIZE and puc. Modified: stable/9/sys/pc98/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/pc98/conf/GENERIC ============================================================================== --- stable/9/sys/pc98/conf/GENERIC Mon Nov 3 11:29:08 2014 (r274038) +++ stable/9/sys/pc98/conf/GENERIC Mon Nov 3 11:43:39 2014 (r274039) @@ -35,6 +35,7 @@ options SOFTUPDATES # Enable FFS soft options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS options MD_ROOT # MD is a potential root device options NFSCL # New Network Filesystem Client options NFSD # New Network Filesystem Server @@ -60,6 +61,7 @@ options SYSVSHM # SYSV-style shared m options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing @@ -87,13 +89,13 @@ device mvs # Marvell 88SX50XX/88SX60XX device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers -device adv # Advansys SCSI adapters device ahc # AHA2940 and onboard AIC7xxx devices device esp # AMD Am53C974 (Tekram DC-390(T)) device isp # Qlogic family #device ncr # NCR/Symbios Logic device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') +device adv # Advansys SCSI adapters device aic # PC-9801-100 device ct # host adapter using WD33C93[ABC] chip (C bus) @@ -108,7 +110,8 @@ device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) -device ses # SCSI Environmental Services (and SAF-TE) +device ses # Enclosure Services (SES and SAF-TE) +#device ctl # CAM Target Layer # keyboard driver device pckbd # PC98 keyboard @@ -145,7 +148,7 @@ device uart # Generic UART driver device mse #device joy -# NEW Parallel port +# Parallel port device ppc device ppbus # Parallel port bus (required) device lpt # Printer @@ -155,6 +158,8 @@ device ppi # Parallel port interface d # OLD Parallel port #device olpt +device puc # Multi I/O cards and multi-channel UARTs + # PCI Ethernet NICs. device de # DEC/Intel DC21x4x (``Tulip'') #device em # Intel PRO/1000 adapter Gigabit Ethernet Card From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 11:58:33 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B91AB456; Mon, 3 Nov 2014 11:58:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 999223CD; Mon, 3 Nov 2014 11:58:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3BwXMq058116; Mon, 3 Nov 2014 11:58:33 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3BwXLf058114; Mon, 3 Nov 2014 11:58:33 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031158.sA3BwXLf058114@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 11:58: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: r274041 - in stable/10/sys/boot: i386/boot2 pc98/boot2 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.18-1 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, 03 Nov 2014 11:58:33 -0000 Author: nyan Date: Mon Nov 3 11:58:32 2014 New Revision: 274041 URL: https://svnweb.freebsd.org/changeset/base/274041 Log: MFC: r268475 (by imp) Make SERIAL support optional again. Enable it for i386 because a huge percentage of machines has a 16550. Disable it for pc98 since only a tiny fraction of them have one. Modified: stable/10/sys/boot/i386/boot2/boot2.c stable/10/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/i386/boot2/boot2.c Mon Nov 3 11:49:35 2014 (r274040) +++ stable/10/sys/boot/i386/boot2/boot2.c Mon Nov 3 11:58:32 2014 (r274041) @@ -34,9 +34,22 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" +/* Define to 0 to omit serial support */ +#ifndef SERIAL +#define SERIAL 1 +#endif + #define IO_KEYBOARD 1 #define IO_SERIAL 2 +#if SERIAL +#define DO_KBD (ioctrl & IO_KEYBOARD) +#define DO_SIO (ioctrl & IO_SERIAL) +#else +#define DO_KBD (1) +#define DO_SIO (0) +#endif + #define SECOND 18 /* Circa that many ticks in a second. */ #define RBX_ASKNAME 0x0 /* -a */ @@ -131,9 +144,11 @@ static struct dsk { static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; static uint32_t opts; -static int comspeed = SIOSPD; static struct bootinfo bootinfo; +#if SERIAL +static int comspeed = SIOSPD; static uint8_t ioctrl = IO_KEYBOARD; +#endif void exit(int); static void load(void); @@ -276,7 +291,7 @@ main(void) "boot: ", dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, 'a' + dsk.part, kname); - if (ioctrl & IO_SERIAL) + if (DO_SIO) sio_flush(); if (!autoboot || keyhit(3*SECOND)) getstr(); @@ -398,6 +413,7 @@ parse() } printf("Keyboard: %s\n", cp); continue; +#if SERIAL } else if (c == 'S') { j = 0; while ((unsigned int)(i = *arg++ - '0') <= 9) @@ -407,18 +423,21 @@ parse() break; } /* Fall through to error below ('S' not in optstr[]). */ +#endif } for (i = 0; c != optstr[i]; i++) if (i == NOPT - 1) return -1; opts ^= OPT_SET(flags[i]); } +#if SERIAL ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) { + if (DO_SIO) { if (sio_init(115200 / comspeed) != 0) ioctrl &= ~IO_SERIAL; } +#endif } else { for (q = arg--; *q && *q != '('; q++); if (*q) { @@ -626,9 +645,9 @@ keyhit(unsigned ticks) static int xputc(int c) { - if (ioctrl & IO_KEYBOARD) + if (DO_KBD) putc(c); - if (ioctrl & IO_SERIAL) + if (DO_SIO) sio_putc(c); return c; } @@ -648,9 +667,9 @@ xgetc(int fn) if (OPT_CHECK(RBX_NOINTR)) return 0; for (;;) { - if (ioctrl & IO_KEYBOARD && getc(1)) + if (DO_KBD && getc(1)) return fn ? 1 : getc(0); - if (ioctrl & IO_SERIAL && sio_ischar()) + if (DO_SIO && sio_ischar()) return fn ? 1 : sio_getc(); if (fn) return 0; Modified: stable/10/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/pc98/boot2/boot2.c Mon Nov 3 11:49:35 2014 (r274040) +++ stable/10/sys/boot/pc98/boot2/boot2.c Mon Nov 3 11:58:32 2014 (r274041) @@ -36,9 +36,22 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" +/* Define to 0 to omit serial support */ +#ifndef SERIAL +#define SERIAL 0 +#endif + #define IO_KEYBOARD 1 #define IO_SERIAL 2 +#if SERIAL +#define DO_KBD (ioctrl & IO_KEYBOARD) +#define DO_SIO (ioctrl & IO_SERIAL) +#else +#define DO_KBD (1) +#define DO_SIO (0) +#endif + #define SECOND 1 /* Circa that many ticks in a second. */ #define RBX_ASKNAME 0x0 /* -a */ @@ -133,9 +146,11 @@ static struct dsk { static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; static uint32_t opts; -static int comspeed = SIOSPD; static struct bootinfo bootinfo; +#if SERIAL +static int comspeed = SIOSPD; static uint8_t ioctrl = IO_KEYBOARD; +#endif void exit(int); static void load(void); @@ -415,7 +430,7 @@ main(void) "boot: ", dsk.unit, dev_nm[dsk.type], dsk.unit, 'a' + dsk.part, kname); - if (ioctrl & IO_SERIAL) + if (DO_SIO) sio_flush(); if (!autoboot || keyhit(3*SECOND)) getstr(); @@ -537,6 +552,7 @@ parse() } printf("Keyboard: %s\n", cp); continue; +#if SERIAL } else if (c == 'S') { j = 0; while ((unsigned int)(i = *arg++ - '0') <= 9) @@ -546,18 +562,21 @@ parse() break; } /* Fall through to error below ('S' not in optstr[]). */ +#endif } for (i = 0; c != optstr[i]; i++) if (i == NOPT - 1) return -1; opts ^= OPT_SET(flags[i]); } +#if SERIAL ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) { + if (DO_SIO) { if (sio_init(115200 / comspeed) != 0) ioctrl &= ~IO_SERIAL; } +#endif } else { for (q = arg--; *q && *q != '('; q++); if (*q) { @@ -780,9 +799,9 @@ keyhit(unsigned sec) static int xputc(int c) { - if (ioctrl & IO_KEYBOARD) + if (DO_KBD) putc(c); - if (ioctrl & IO_SERIAL) + if (DO_SIO) sio_putc(c); return c; } @@ -805,9 +824,9 @@ xgetc(int fn) if (OPT_CHECK(RBX_NOINTR)) return 0; for (;;) { - if (ioctrl & IO_KEYBOARD && getc(1)) + if (DO_KBD && getc(1)) return fn ? 1 : getc(0); - if (ioctrl & IO_SERIAL && sio_ischar()) + if (DO_SIO && sio_ischar()) return fn ? 1 : sio_getc(); if (fn) return 0; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 12:07:05 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5AFAC8D5; Mon, 3 Nov 2014 12:07:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C0C66E5; Mon, 3 Nov 2014 12:07:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3C75bS062882; Mon, 3 Nov 2014 12:07:05 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3C75uY062881; Mon, 3 Nov 2014 12:07:05 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031207.sA3C75uY062881@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 12:07: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: r274042 - stable/10/sys/boot/pc98/boot2 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.18-1 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, 03 Nov 2014 12:07:05 -0000 Author: nyan Date: Mon Nov 3 12:07:04 2014 New Revision: 274042 URL: https://svnweb.freebsd.org/changeset/base/274042 Log: MFC: r268474 and r268476 (by imp) - Merge the clang support from i386. - Compile boot2 with clang on pc98. MFC: r272250 (by nyan) - Reduce diffs against i386. Modified: stable/10/sys/boot/pc98/boot2/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/pc98/boot2/Makefile ============================================================================== --- stable/10/sys/boot/pc98/boot2/Makefile Mon Nov 3 11:58:32 2014 (r274041) +++ stable/10/sys/boot/pc98/boot2/Makefile Mon Nov 3 12:07:04 2014 (r274042) @@ -2,10 +2,6 @@ .include -# XXX: clang can compile the boot code just fine, but boot2 gets too big -CC:= gcc -COMPILER_TYPE:= gcc - FILES= boot boot1 boot2 NM?= nm @@ -24,10 +20,7 @@ BOOT2_UFS?= UFS1_AND_UFS2 #BOOT2_UFS?= UFS1_ONLY CFLAGS= -Os \ - -fno-guess-branch-probability \ -fomit-frame-pointer \ - -fno-unit-at-a-time \ - -mno-align-long-strings \ -mrtd \ -mregparm=3 \ -D${BOOT2_UFS} \ @@ -42,9 +35,13 @@ CFLAGS= -Os \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline + -Winline \ + ${CLANG_OPT_SMALL} -CFLAGS.gcc+= --param max-inline-insns-single=100 +CFLAGS.gcc+= -fno-guess-branch-probability \ + -fno-unit-at-a-time \ + -mno-align-long-strings \ + --param max-inline-insns-single=100 # Set machine type to PC98_SYSTEM_PARAMETER #CFLAGS+= -DSET_MACHINE_TYPE @@ -110,3 +107,7 @@ boot2.h: boot1.out REL1=`printf "%d" ${REL1}` > ${.TARGET} .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.boot1.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 12:38:34 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CA97FB6; Mon, 3 Nov 2014 12:38:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2565AAA1; Mon, 3 Nov 2014 12:38:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3CcY93077325; Mon, 3 Nov 2014 12:38:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3CcThx077296; Mon, 3 Nov 2014 12:38:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411031238.sA3CcThx077296@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Nov 2014 12:38: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: r274043 - in stable/10/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront kern net netinet ofed/drivers/net/mlx4 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.18-1 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, 03 Nov 2014 12:38:34 -0000 Author: hselasky Date: Mon Nov 3 12:38:29 2014 New Revision: 274043 URL: https://svnweb.freebsd.org/changeset/base/274043 Log: MFC r271946 and r272595: Improve transmit sending offload, TSO, algorithm in general. This change allows all HCAs from Mellanox Technologies to function properly when TSO is enabled. See r271946 and r272595 for more details about this commit. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/oce/oce_if.c stable/10/sys/dev/oce/oce_if.h stable/10/sys/dev/vmware/vmxnet3/if_vmx.c stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h stable/10/sys/dev/xen/netfront/netfront.c stable/10/sys/kern/uipc_sockbuf.c stable/10/sys/net/if.c stable/10/sys/net/if_lagg.c stable/10/sys/net/if_var.h stable/10/sys/net/if_vlan.c stable/10/sys/netinet/tcp_input.c stable/10/sys/netinet/tcp_output.c stable/10/sys/netinet/tcp_subr.c stable/10/sys/netinet/tcp_var.h stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c stable/10/sys/sys/sockbuf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/oce/oce_if.c ============================================================================== --- stable/10/sys/dev/oce/oce_if.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/dev/oce/oce_if.c Mon Nov 3 12:38:29 2014 (r274043) @@ -1735,7 +1735,9 @@ oce_attach_ifp(POCE_SOFTC sc) if_initbaudrate(sc->ifp, IF_Gbps(10)); #if __FreeBSD_version >= 1000000 - sc->ifp->if_hw_tsomax = OCE_MAX_TSO_SIZE; + sc->ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + sc->ifp->if_hw_tsomaxsegcount = OCE_MAX_TX_ELEMENTS; + sc->ifp->if_hw_tsomaxsegsize = 4096; #endif ether_ifattach(sc->ifp, sc->macaddr.mac_addr); Modified: stable/10/sys/dev/oce/oce_if.h ============================================================================== --- stable/10/sys/dev/oce/oce_if.h Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/dev/oce/oce_if.h Mon Nov 3 12:38:29 2014 (r274043) @@ -150,7 +150,6 @@ extern int mp_ncpus; /* system's total #define OCE_MAX_TX_ELEMENTS 29 #define OCE_MAX_TX_DESC 1024 #define OCE_MAX_TX_SIZE 65535 -#define OCE_MAX_TSO_SIZE (65535 - ETHER_HDR_LEN) #define OCE_MAX_RX_SIZE 4096 #define OCE_MAX_RQ_POSTS 255 #define OCE_DEFAULT_PROMISCUOUS 0 Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Mon Nov 3 12:38:29 2014 (r274043) @@ -1720,7 +1720,9 @@ vmxnet3_setup_interface(struct vmxnet3_s ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_init = vmxnet3_init; ifp->if_ioctl = vmxnet3_ioctl; - ifp->if_hw_tsomax = VMXNET3_TSO_MAXSIZE; + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + ifp->if_hw_tsomaxsegcount = VMXNET3_TX_MAXSEGS; + ifp->if_hw_tsomaxsegsize = VMXNET3_TX_MAXSEGSIZE; #ifdef VMXNET3_LEGACY_TX ifp->if_start = vmxnet3_start; Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h ============================================================================== --- stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h Mon Nov 3 12:38:29 2014 (r274043) @@ -277,8 +277,6 @@ struct vmxnet3_softc { */ #define VMXNET3_TX_MAXSEGS 32 #define VMXNET3_TX_MAXSIZE (VMXNET3_TX_MAXSEGS * MCLBYTES) -#define VMXNET3_TSO_MAXSIZE \ - (VMXNET3_TX_MAXSIZE - sizeof(struct ether_vlan_header)) /* * Maximum support Tx segments size. The length field in the Modified: stable/10/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/10/sys/dev/xen/netfront/netfront.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/dev/xen/netfront/netfront.c Mon Nov 3 12:38:29 2014 (r274043) @@ -134,7 +134,6 @@ static const int MODPARM_rx_flip = 0; * to mirror the Linux MAX_SKB_FRAGS constant. */ #define MAX_TX_REQ_FRAGS (65536 / PAGE_SIZE + 2) -#define NF_TSO_MAXBURST ((IP_MAXPACKET / PAGE_SIZE) * MCLBYTES) #define RX_COPY_THRESHOLD 256 @@ -2102,7 +2101,9 @@ create_netdev(device_t dev) ifp->if_hwassist = XN_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM; - ifp->if_hw_tsomax = NF_TSO_MAXBURST; + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + ifp->if_hw_tsomaxsegcount = MAX_TX_REQ_FRAGS; + ifp->if_hw_tsomaxsegsize = PAGE_SIZE; ether_ifattach(ifp, np->mac); callout_init(&np->xn_stat_ch, CALLOUT_MPSAFE); Modified: stable/10/sys/kern/uipc_sockbuf.c ============================================================================== --- stable/10/sys/kern/uipc_sockbuf.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/kern/uipc_sockbuf.c Mon Nov 3 12:38:29 2014 (r274043) @@ -1015,6 +1015,37 @@ sbsndptr(struct sockbuf *sb, u_int off, } /* + * Return the first mbuf and the mbuf data offset for the provided + * send offset without changing the "sb_sndptroff" field. + */ +struct mbuf * +sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff) +{ + struct mbuf *m; + + KASSERT(sb->sb_mb != NULL, ("%s: sb_mb is NULL", __func__)); + + /* + * If the "off" is below the stored offset, which happens on + * retransmits, just use "sb_mb": + */ + if (sb->sb_sndptr == NULL || sb->sb_sndptroff > off) { + m = sb->sb_mb; + } else { + m = sb->sb_sndptr; + off -= sb->sb_sndptroff; + } + while (off > 0 && m != NULL) { + if (off < m->m_len) + break; + off -= m->m_len; + m = m->m_next; + } + *moff = off; + return (m); +} + +/* * Drop a record off the front of a sockbuf and move the next record to the * front. */ Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/net/if.c Mon Nov 3 12:38:29 2014 (r274043) @@ -583,6 +583,57 @@ if_attach(struct ifnet *ifp) if_attach_internal(ifp, 0); } +/* + * Compute the least common TSO limit. + */ +void +if_hw_tsomax_common(struct ifnet *ifp, struct ifnet_hw_tsomax *pmax) +{ + /* + * 1) If there is no limit currently, take the limit from + * the network adapter. + * + * 2) If the network adapter has a limit below the current + * limit, apply it. + */ + if (pmax->tsomaxbytes == 0 || (ifp->if_hw_tsomax != 0 && + ifp->if_hw_tsomax < pmax->tsomaxbytes)) { + pmax->tsomaxbytes = ifp->if_hw_tsomax; + } + if (pmax->tsomaxsegcount == 0 || (ifp->if_hw_tsomaxsegcount != 0 && + ifp->if_hw_tsomaxsegcount < pmax->tsomaxsegcount)) { + pmax->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + } + if (pmax->tsomaxsegsize == 0 || (ifp->if_hw_tsomaxsegsize != 0 && + ifp->if_hw_tsomaxsegsize < pmax->tsomaxsegsize)) { + pmax->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; + } +} + +/* + * Update TSO limit of a network adapter. + * + * Returns zero if no change. Else non-zero. + */ +int +if_hw_tsomax_update(struct ifnet *ifp, struct ifnet_hw_tsomax *pmax) +{ + int retval = 0; + if (ifp->if_hw_tsomax != pmax->tsomaxbytes) { + ifp->if_hw_tsomax = pmax->tsomaxbytes; + retval++; + } + if (ifp->if_hw_tsomaxsegsize != pmax->tsomaxsegsize) { + ifp->if_hw_tsomaxsegsize = pmax->tsomaxsegsize; + retval++; + } + if (ifp->if_hw_tsomaxsegcount != pmax->tsomaxsegcount) { + ifp->if_hw_tsomaxsegcount = pmax->tsomaxsegcount; + retval++; + } + return (retval); +} + static void if_attach_internal(struct ifnet *ifp, int vmove) { @@ -657,13 +708,36 @@ if_attach_internal(struct ifnet *ifp, in ifp->if_broadcastaddr = NULL; #if defined(INET) || defined(INET6) - /* Initialize to max value. */ - if (ifp->if_hw_tsomax == 0) - ifp->if_hw_tsomax = min(IP_MAXPACKET, 32 * MCLBYTES - + /* Use defaults for TSO, if nothing is set */ + if (ifp->if_hw_tsomax == 0 && + ifp->if_hw_tsomaxsegcount == 0 && + ifp->if_hw_tsomaxsegsize == 0) { + /* + * The TSO defaults needs to be such that an + * NFS mbuf list of 35 mbufs totalling just + * below 64K works and that a chain of mbufs + * can be defragged into at most 32 segments: + */ + ifp->if_hw_tsomax = min(IP_MAXPACKET, (32 * MCLBYTES) - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)); - KASSERT(ifp->if_hw_tsomax <= IP_MAXPACKET && - ifp->if_hw_tsomax >= IP_MAXPACKET / 8, - ("%s: tsomax outside of range", __func__)); + ifp->if_hw_tsomaxsegcount = 35; + ifp->if_hw_tsomaxsegsize = 2048; /* 2K */ + + /* XXX some drivers set IFCAP_TSO after ethernet attach */ + if (ifp->if_capabilities & IFCAP_TSO) { + if_printf(ifp, "Using defaults for TSO: %u/%u/%u\n", + ifp->if_hw_tsomax, + ifp->if_hw_tsomaxsegcount, + ifp->if_hw_tsomaxsegsize); + } + } + /* + * If the "if_hw_tsomax" limit is set, check if it is + * too small: + */ + KASSERT(ifp->if_hw_tsomax == 0 || + ifp->if_hw_tsomax >= (IP_MAXPACKET / 8), + ("%s: if_hw_tsomax is outside of range", __func__)); #endif } #ifdef VIMAGE Modified: stable/10/sys/net/if_lagg.c ============================================================================== --- stable/10/sys/net/if_lagg.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/net/if_lagg.c Mon Nov 3 12:38:29 2014 (r274043) @@ -448,23 +448,18 @@ lagg_capabilities(struct lagg_softc *sc) struct lagg_port *lp; int cap = ~0, ena = ~0; u_long hwa = ~0UL; -#if defined(INET) || defined(INET6) - u_int hw_tsomax = IP_MAXPACKET; /* Initialize to the maximum value. */ -#else - u_int hw_tsomax = ~0; /* if_hw_tsomax is only for INET/INET6, but.. */ -#endif + struct ifnet_hw_tsomax hw_tsomax; LAGG_WLOCK_ASSERT(sc); + memset(&hw_tsomax, 0, sizeof(hw_tsomax)); + /* Get capabilities from the lagg ports */ SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { cap &= lp->lp_ifp->if_capabilities; ena &= lp->lp_ifp->if_capenable; hwa &= lp->lp_ifp->if_hwassist; - /* Set to the minimum value of the lagg ports. */ - if (lp->lp_ifp->if_hw_tsomax < hw_tsomax && - lp->lp_ifp->if_hw_tsomax > 0) - hw_tsomax = lp->lp_ifp->if_hw_tsomax; + if_hw_tsomax_common(lp->lp_ifp, &hw_tsomax); } cap = (cap == ~0 ? 0 : cap); ena = (ena == ~0 ? 0 : ena); @@ -473,11 +468,10 @@ lagg_capabilities(struct lagg_softc *sc) if (sc->sc_ifp->if_capabilities != cap || sc->sc_ifp->if_capenable != ena || sc->sc_ifp->if_hwassist != hwa || - sc->sc_ifp->if_hw_tsomax != hw_tsomax) { + if_hw_tsomax_update(sc->sc_ifp, &hw_tsomax) != 0) { sc->sc_ifp->if_capabilities = cap; sc->sc_ifp->if_capenable = ena; sc->sc_ifp->if_hwassist = hwa; - sc->sc_ifp->if_hw_tsomax = hw_tsomax; getmicrotime(&sc->sc_ifp->if_lastchange); if (sc->sc_ifflags & IFF_DEBUG) Modified: stable/10/sys/net/if_var.h ============================================================================== --- stable/10/sys/net/if_var.h Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/net/if_var.h Mon Nov 3 12:38:29 2014 (r274043) @@ -116,6 +116,12 @@ struct ifqueue { struct mtx ifq_mtx; }; +struct ifnet_hw_tsomax { + u_int tsomaxbytes; /* TSO total burst length limit in bytes */ + u_int tsomaxsegcount; /* TSO maximum segment count */ + u_int tsomaxsegsize; /* TSO maximum segment size in bytes */ +}; + /* * Structure defining a network interface. * @@ -204,10 +210,11 @@ struct ifnet { u_int if_fib; /* interface FIB */ u_char if_alloctype; /* if_type at time of allocation */ - u_int if_hw_tsomax; /* tso burst length limit, the minimum - * is (IP_MAXPACKET / 8). - * XXXAO: Have to find a better place - * for it eventually. */ + u_int if_hw_tsomax; /* TSO total burst length + * limit in bytes. A value of + * zero means no limit. Have + * to find a better place for + * it eventually. */ /* * Spare fields are added so that we can modify sensitive data @@ -215,7 +222,14 @@ struct ifnet { * be used with care where binary compatibility is required. */ char if_cspare[3]; - int if_ispare[4]; + int if_ispare[2]; + + /* + * TSO fields for segment limits. If a field is zero below, + * there is no limit: + */ + u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */ + u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */ void *if_pspare[8]; /* 1 netmap, 7 TDB */ }; @@ -967,6 +981,10 @@ int ether_poll_register(poll_handler_ int ether_poll_deregister(struct ifnet *ifp); #endif /* DEVICE_POLLING */ +/* TSO */ +void if_hw_tsomax_common(struct ifnet *, struct ifnet_hw_tsomax *); +int if_hw_tsomax_update(struct ifnet *, struct ifnet_hw_tsomax *); + #endif /* _KERNEL */ #endif /* !_NET_IF_VAR_H_ */ Modified: stable/10/sys/net/if_vlan.c ============================================================================== --- stable/10/sys/net/if_vlan.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/net/if_vlan.c Mon Nov 3 12:38:29 2014 (r274043) @@ -1483,6 +1483,7 @@ vlan_capabilities(struct ifvlan *ifv) { struct ifnet *p = PARENT(ifv); struct ifnet *ifp = ifv->ifv_ifp; + struct ifnet_hw_tsomax hw_tsomax; TRUNK_LOCK_ASSERT(TRUNK(ifv)); @@ -1509,8 +1510,9 @@ vlan_capabilities(struct ifvlan *ifv) * propagate the hardware-assisted flag. TSO on VLANs * does not necessarily require hardware VLAN tagging. */ - if (p->if_hw_tsomax > 0) - ifp->if_hw_tsomax = p->if_hw_tsomax; + memset(&hw_tsomax, 0, sizeof(hw_tsomax)); + if_hw_tsomax_common(p, &hw_tsomax); + if_hw_tsomax_update(ifp, &hw_tsomax); if (p->if_capabilities & IFCAP_VLAN_HWTSO) ifp->if_capabilities |= p->if_capabilities & IFCAP_TSO; if (p->if_capenable & IFCAP_VLAN_HWTSO) { Modified: stable/10/sys/netinet/tcp_input.c ============================================================================== --- stable/10/sys/netinet/tcp_input.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/netinet/tcp_input.c Mon Nov 3 12:38:29 2014 (r274043) @@ -3623,6 +3623,8 @@ tcp_mss(struct tcpcb *tp, int offer) if (cap.ifcap & CSUM_TSO) { tp->t_flags |= TF_TSO; tp->t_tsomax = cap.tsomax; + tp->t_tsomaxsegcount = cap.tsomaxsegcount; + tp->t_tsomaxsegsize = cap.tsomaxsegsize; } } Modified: stable/10/sys/netinet/tcp_output.c ============================================================================== --- stable/10/sys/netinet/tcp_output.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/netinet/tcp_output.c Mon Nov 3 12:38:29 2014 (r274043) @@ -774,28 +774,112 @@ send: flags &= ~TH_FIN; if (tso) { + u_int if_hw_tsomax; + u_int if_hw_tsomaxsegcount; + u_int if_hw_tsomaxsegsize; + struct mbuf *mb; + u_int moff; + int max_len; + + /* extract TSO information */ + if_hw_tsomax = tp->t_tsomax; + if_hw_tsomaxsegcount = tp->t_tsomaxsegcount; + if_hw_tsomaxsegsize = tp->t_tsomaxsegsize; + + /* + * Limit a TSO burst to prevent it from + * overflowing or exceeding the maximum length + * allowed by the network interface: + */ KASSERT(ipoptlen == 0, ("%s: TSO can't do IP options", __func__)); /* - * Limit a burst to t_tsomax minus IP, - * TCP and options length to keep ip->ip_len - * from overflowing or exceeding the maximum - * length allowed by the network interface. + * Check if we should limit by maximum payload + * length: */ - if (len > tp->t_tsomax - hdrlen) { - len = tp->t_tsomax - hdrlen; - sendalot = 1; + if (if_hw_tsomax != 0) { + /* compute maximum TSO length */ + max_len = (if_hw_tsomax - hdrlen); + if (max_len <= 0) { + len = 0; + } else if (len > (u_int)max_len) { + sendalot = 1; + len = (u_int)max_len; + } + } + + /* + * Check if we should limit by maximum segment + * size and count: + */ + if (if_hw_tsomaxsegcount != 0 && + if_hw_tsomaxsegsize != 0) { + max_len = 0; + mb = sbsndmbuf(&so->so_snd, off, &moff); + + while (mb != NULL && (u_int)max_len < len) { + u_int mlen; + u_int frags; + + /* + * Get length of mbuf fragment + * and how many hardware frags, + * rounded up, it would use: + */ + mlen = (mb->m_len - moff); + frags = howmany(mlen, + if_hw_tsomaxsegsize); + + /* Handle special case: Zero Length Mbuf */ + if (frags == 0) + frags = 1; + + /* + * Check if the fragment limit + * will be reached or exceeded: + */ + if (frags >= if_hw_tsomaxsegcount) { + max_len += min(mlen, + if_hw_tsomaxsegcount * + if_hw_tsomaxsegsize); + break; + } + max_len += mlen; + if_hw_tsomaxsegcount -= frags; + moff = 0; + mb = mb->m_next; + } + if (max_len <= 0) { + len = 0; + } else if (len > (u_int)max_len) { + sendalot = 1; + len = (u_int)max_len; + } } /* * Prevent the last segment from being - * fractional unless the send sockbuf can - * be emptied. + * fractional unless the send sockbuf can be + * emptied: + */ + max_len = (tp->t_maxopd - optlen); + if ((off + len) < so->so_snd.sb_cc) { + moff = len % (u_int)max_len; + if (moff != 0) { + len -= moff; + sendalot = 1; + } + } + + /* + * In case there are too many small fragments + * don't use TSO: */ - if (sendalot && off + len < so->so_snd.sb_cc) { - len -= len % (tp->t_maxopd - optlen); + if (len <= (u_int)max_len) { + len = (u_int)max_len; sendalot = 1; + tso = 0; } /* Modified: stable/10/sys/netinet/tcp_subr.c ============================================================================== --- stable/10/sys/netinet/tcp_subr.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/netinet/tcp_subr.c Mon Nov 3 12:38:29 2014 (r274043) @@ -1808,6 +1808,8 @@ tcp_maxmtu(struct in_conninfo *inc, stru ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + cap->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } RTFREE(sro.ro_rt); @@ -1847,6 +1849,8 @@ tcp_maxmtu6(struct in_conninfo *inc, str ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + cap->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } RTFREE(sro6.ro_rt); Modified: stable/10/sys/netinet/tcp_var.h ============================================================================== --- stable/10/sys/netinet/tcp_var.h Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/netinet/tcp_var.h Mon Nov 3 12:38:29 2014 (r274043) @@ -208,13 +208,15 @@ struct tcpcb { u_int t_keepintvl; /* interval between keepalives */ u_int t_keepcnt; /* number of keepalives before close */ - u_int t_tsomax; /* tso burst length limit */ + u_int t_tsomax; /* TSO total burst length limit in bytes */ u_int t_pmtud_saved_maxopd; /* pre-blackhole MSS */ u_int t_flags2; /* More tcpcb flags storage */ uint32_t t_ispare[6]; /* 5 UTO, 1 TBD */ void *t_pspare2[4]; /* 1 TCP_SIGNATURE, 3 TBD */ - uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ + uint64_t _pad[5]; /* 5 TBD (1-2 CC/RTT?) */ + uint32_t t_tsomaxsegcount; /* TSO maximum segment count */ + uint32_t t_tsomaxsegsize; /* TSO maximum segment size in bytes */ }; /* @@ -342,6 +344,8 @@ struct hc_metrics_lite { /* must stay in struct tcp_ifcap { int ifcap; u_int tsomax; + u_int tsomaxsegcount; + u_int tsomaxsegsize; }; #ifndef _NETINET_IN_PCB_H_ Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Nov 3 12:38:29 2014 (r274043) @@ -2106,12 +2106,12 @@ int mlx4_en_init_netdev(struct mlx4_en_d if (mdev->LSO_support) dev->if_capabilities |= IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTSO; -#if 0 + /* set TSO limits so that we don't have to drop TX packets */ dev->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); dev->if_hw_tsomaxsegcount = 16; dev->if_hw_tsomaxsegsize = 65536; /* XXX can do up to 4GByte */ -#endif + dev->if_capenable = dev->if_capabilities; dev->if_hwassist = 0; Modified: stable/10/sys/sys/sockbuf.h ============================================================================== --- stable/10/sys/sys/sockbuf.h Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/sys/sockbuf.h Mon Nov 3 12:38:29 2014 (r274043) @@ -158,6 +158,8 @@ int sbreserve_locked(struct sockbuf *sb, struct thread *td); struct mbuf * sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff); +struct mbuf * + sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff); void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb); int sbwait(struct sockbuf *sb); int sblock(struct sockbuf *sb, int flags); From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 12:38:46 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C5EB167; Mon, 3 Nov 2014 12:38:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6483FAA2; Mon, 3 Nov 2014 12:38:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3CckPL077400; Mon, 3 Nov 2014 12:38:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3Ccgc9077380; Mon, 3 Nov 2014 12:38:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411031238.sA3Ccgc9077380@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Nov 2014 12:38:42 +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: r274044 - in stable/9/sys: dev/oce dev/xen/netfront kern net netinet ofed/drivers/net/mlx4 sys 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.18-1 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, 03 Nov 2014 12:38:46 -0000 Author: hselasky Date: Mon Nov 3 12:38:41 2014 New Revision: 274044 URL: https://svnweb.freebsd.org/changeset/base/274044 Log: MFC r271946 and r272595: Improve transmit sending offload, TSO, algorithm in general. This change allows all HCAs from Mellanox Technologies to function properly when TSO is enabled. See r271946 and r272595 for more details about this commit. Sponsored by: Mellanox Technologies Modified: stable/9/sys/dev/oce/oce_if.c stable/9/sys/dev/oce/oce_if.h stable/9/sys/dev/xen/netfront/netfront.c stable/9/sys/kern/uipc_sockbuf.c stable/9/sys/net/if.c stable/9/sys/net/if_lagg.c stable/9/sys/net/if_var.h stable/9/sys/net/if_vlan.c stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_output.c stable/9/sys/netinet/tcp_subr.c stable/9/sys/netinet/tcp_var.h stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c stable/9/sys/sys/sockbuf.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/dev/oce/oce_if.c ============================================================================== --- stable/9/sys/dev/oce/oce_if.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/dev/oce/oce_if.c Mon Nov 3 12:38:41 2014 (r274044) @@ -1734,7 +1734,9 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_baudrate = IF_Gbps(10UL); #if __FreeBSD_version >= 1000000 - sc->ifp->if_hw_tsomax = OCE_MAX_TSO_SIZE; + sc->ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + sc->ifp->if_hw_tsomaxsegcount = OCE_MAX_TX_ELEMENTS; + sc->ifp->if_hw_tsomaxsegsize = 4096; #endif ether_ifattach(sc->ifp, sc->macaddr.mac_addr); Modified: stable/9/sys/dev/oce/oce_if.h ============================================================================== --- stable/9/sys/dev/oce/oce_if.h Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/dev/oce/oce_if.h Mon Nov 3 12:38:41 2014 (r274044) @@ -150,7 +150,6 @@ extern int mp_ncpus; /* system's total #define OCE_MAX_TX_ELEMENTS 29 #define OCE_MAX_TX_DESC 1024 #define OCE_MAX_TX_SIZE 65535 -#define OCE_MAX_TSO_SIZE (65535 - ETHER_HDR_LEN) #define OCE_MAX_RX_SIZE 4096 #define OCE_MAX_RQ_POSTS 255 #define OCE_DEFAULT_PROMISCUOUS 0 Modified: stable/9/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/9/sys/dev/xen/netfront/netfront.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/dev/xen/netfront/netfront.c Mon Nov 3 12:38:41 2014 (r274044) @@ -135,7 +135,6 @@ static const int MODPARM_rx_flip = 0; * to mirror the Linux MAX_SKB_FRAGS constant. */ #define MAX_TX_REQ_FRAGS (65536 / PAGE_SIZE + 2) -#define NF_TSO_MAXBURST ((IP_MAXPACKET / PAGE_SIZE) * MCLBYTES) #define RX_COPY_THRESHOLD 256 @@ -2103,7 +2102,9 @@ create_netdev(device_t dev) ifp->if_hwassist = XN_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM; - ifp->if_hw_tsomax = NF_TSO_MAXBURST; + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + ifp->if_hw_tsomaxsegcount = MAX_TX_REQ_FRAGS; + ifp->if_hw_tsomaxsegsize = PAGE_SIZE; ether_ifattach(ifp, np->mac); callout_init(&np->xn_stat_ch, CALLOUT_MPSAFE); Modified: stable/9/sys/kern/uipc_sockbuf.c ============================================================================== --- stable/9/sys/kern/uipc_sockbuf.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/kern/uipc_sockbuf.c Mon Nov 3 12:38:41 2014 (r274044) @@ -989,6 +989,37 @@ sbsndptr(struct sockbuf *sb, u_int off, } /* + * Return the first mbuf and the mbuf data offset for the provided + * send offset without changing the "sb_sndptroff" field. + */ +struct mbuf * +sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff) +{ + struct mbuf *m; + + KASSERT(sb->sb_mb != NULL, ("%s: sb_mb is NULL", __func__)); + + /* + * If the "off" is below the stored offset, which happens on + * retransmits, just use "sb_mb": + */ + if (sb->sb_sndptr == NULL || sb->sb_sndptroff > off) { + m = sb->sb_mb; + } else { + m = sb->sb_sndptr; + off -= sb->sb_sndptroff; + } + while (off > 0 && m != NULL) { + if (off < m->m_len) + break; + off -= m->m_len; + m = m->m_next; + } + *moff = off; + return (m); +} + +/* * Drop a record off the front of a sockbuf and move the next record to the * front. */ Modified: stable/9/sys/net/if.c ============================================================================== --- stable/9/sys/net/if.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/net/if.c Mon Nov 3 12:38:41 2014 (r274044) @@ -599,6 +599,57 @@ if_attach(struct ifnet *ifp) if_attach_internal(ifp, 0); } +/* + * Compute the least common TSO limit. + */ +void +if_hw_tsomax_common(struct ifnet *ifp, struct ifnet_hw_tsomax *pmax) +{ + /* + * 1) If there is no limit currently, take the limit from + * the network adapter. + * + * 2) If the network adapter has a limit below the current + * limit, apply it. + */ + if (pmax->tsomaxbytes == 0 || (ifp->if_hw_tsomax != 0 && + ifp->if_hw_tsomax < pmax->tsomaxbytes)) { + pmax->tsomaxbytes = ifp->if_hw_tsomax; + } + if (pmax->tsomaxsegcount == 0 || (ifp->if_hw_tsomaxsegcount != 0 && + ifp->if_hw_tsomaxsegcount < pmax->tsomaxsegcount)) { + pmax->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + } + if (pmax->tsomaxsegsize == 0 || (ifp->if_hw_tsomaxsegsize != 0 && + ifp->if_hw_tsomaxsegsize < pmax->tsomaxsegsize)) { + pmax->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; + } +} + +/* + * Update TSO limit of a network adapter. + * + * Returns zero if no change. Else non-zero. + */ +int +if_hw_tsomax_update(struct ifnet *ifp, struct ifnet_hw_tsomax *pmax) +{ + int retval = 0; + if (ifp->if_hw_tsomax != pmax->tsomaxbytes) { + ifp->if_hw_tsomax = pmax->tsomaxbytes; + retval++; + } + if (ifp->if_hw_tsomaxsegsize != pmax->tsomaxsegsize) { + ifp->if_hw_tsomaxsegsize = pmax->tsomaxsegsize; + retval++; + } + if (ifp->if_hw_tsomaxsegcount != pmax->tsomaxsegcount) { + ifp->if_hw_tsomaxsegcount = pmax->tsomaxsegcount; + retval++; + } + return (retval); +} + static void if_attach_internal(struct ifnet *ifp, int vmove) { @@ -673,13 +724,36 @@ if_attach_internal(struct ifnet *ifp, in ifp->if_broadcastaddr = NULL; #if defined(INET) || defined(INET6) - /* Initialize to max value. */ - if (ifp->if_hw_tsomax == 0) - ifp->if_hw_tsomax = min(IP_MAXPACKET, 32 * MCLBYTES - + /* Use defaults for TSO, if nothing is set */ + if (ifp->if_hw_tsomax == 0 && + ifp->if_hw_tsomaxsegcount == 0 && + ifp->if_hw_tsomaxsegsize == 0) { + /* + * The TSO defaults needs to be such that an + * NFS mbuf list of 35 mbufs totalling just + * below 64K works and that a chain of mbufs + * can be defragged into at most 32 segments: + */ + ifp->if_hw_tsomax = min(IP_MAXPACKET, (32 * MCLBYTES) - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)); - KASSERT(ifp->if_hw_tsomax <= IP_MAXPACKET && - ifp->if_hw_tsomax >= IP_MAXPACKET / 8, - ("%s: tsomax outside of range", __func__)); + ifp->if_hw_tsomaxsegcount = 35; + ifp->if_hw_tsomaxsegsize = 2048; /* 2K */ + + /* XXX some drivers set IFCAP_TSO after ethernet attach */ + if (ifp->if_capabilities & IFCAP_TSO) { + if_printf(ifp, "Using defaults for TSO: %u/%u/%u\n", + ifp->if_hw_tsomax, + ifp->if_hw_tsomaxsegcount, + ifp->if_hw_tsomaxsegsize); + } + } + /* + * If the "if_hw_tsomax" limit is set, check if it is + * too small: + */ + KASSERT(ifp->if_hw_tsomax == 0 || + ifp->if_hw_tsomax >= (IP_MAXPACKET / 8), + ("%s: if_hw_tsomax is outside of range", __func__)); #endif } #ifdef VIMAGE Modified: stable/9/sys/net/if_lagg.c ============================================================================== --- stable/9/sys/net/if_lagg.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/net/if_lagg.c Mon Nov 3 12:38:41 2014 (r274044) @@ -406,23 +406,18 @@ lagg_capabilities(struct lagg_softc *sc) struct lagg_port *lp; int cap = ~0, ena = ~0; u_long hwa = ~0UL; -#if defined(INET) || defined(INET6) - u_int hw_tsomax = IP_MAXPACKET; /* Initialize to the maximum value. */ -#else - u_int hw_tsomax = ~0; /* if_hw_tsomax is only for INET/INET6, but.. */ -#endif + struct ifnet_hw_tsomax hw_tsomax; LAGG_WLOCK_ASSERT(sc); + memset(&hw_tsomax, 0, sizeof(hw_tsomax)); + /* Get capabilities from the lagg ports */ SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { cap &= lp->lp_ifp->if_capabilities; ena &= lp->lp_ifp->if_capenable; hwa &= lp->lp_ifp->if_hwassist; - /* Set to the minimum value of the lagg ports. */ - if (lp->lp_ifp->if_hw_tsomax < hw_tsomax && - lp->lp_ifp->if_hw_tsomax > 0) - hw_tsomax = lp->lp_ifp->if_hw_tsomax; + if_hw_tsomax_common(lp->lp_ifp, &hw_tsomax); } cap = (cap == ~0 ? 0 : cap); ena = (ena == ~0 ? 0 : ena); @@ -431,11 +426,10 @@ lagg_capabilities(struct lagg_softc *sc) if (sc->sc_ifp->if_capabilities != cap || sc->sc_ifp->if_capenable != ena || sc->sc_ifp->if_hwassist != hwa || - sc->sc_ifp->if_hw_tsomax != hw_tsomax) { + if_hw_tsomax_update(sc->sc_ifp, &hw_tsomax) != 0) { sc->sc_ifp->if_capabilities = cap; sc->sc_ifp->if_capenable = ena; sc->sc_ifp->if_hwassist = hwa; - sc->sc_ifp->if_hw_tsomax = hw_tsomax; getmicrotime(&sc->sc_ifp->if_lastchange); if (sc->sc_ifflags & IFF_DEBUG) Modified: stable/9/sys/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/net/if_var.h Mon Nov 3 12:38:41 2014 (r274044) @@ -111,6 +111,12 @@ struct ifqueue { struct mtx ifq_mtx; }; +struct ifnet_hw_tsomax { + u_int tsomaxbytes; /* TSO total burst length limit in bytes */ + u_int tsomaxsegcount; /* TSO maximum segment count */ + u_int tsomaxsegsize; /* TSO maximum segment size in bytes */ +}; + /* * Structure defining a network interface. * @@ -205,11 +211,18 @@ struct ifnet { * be used with care where binary compatibility is required. */ char if_cspare[3]; - u_int if_hw_tsomax; /* tso burst length limit, the minmum - * is (IP_MAXPACKET / 8). - * XXXAO: Have to find a better place - * for it eventually. */ - int if_ispare[3]; + u_int if_hw_tsomax; /* TSO total burst length + * limit in bytes. A value of + * zero means no limit. Have + * to find a better place for + * it eventually. */ + int if_ispare[1]; + /* + * TSO fields for segment limits. If a field is zero below, + * there is no limit: + */ + u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */ + u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */ void *if_pspare[8]; /* 1 netmap, 7 TDB */ }; @@ -966,6 +979,10 @@ int ether_poll_register(poll_handler_ int ether_poll_deregister(struct ifnet *ifp); #endif /* DEVICE_POLLING */ +/* TSO */ +void if_hw_tsomax_common(struct ifnet *, struct ifnet_hw_tsomax *); +int if_hw_tsomax_update(struct ifnet *, struct ifnet_hw_tsomax *); + #endif /* _KERNEL */ #endif /* !_NET_IF_VAR_H_ */ Modified: stable/9/sys/net/if_vlan.c ============================================================================== --- stable/9/sys/net/if_vlan.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/net/if_vlan.c Mon Nov 3 12:38:41 2014 (r274044) @@ -1475,6 +1475,7 @@ vlan_capabilities(struct ifvlan *ifv) { struct ifnet *p = PARENT(ifv); struct ifnet *ifp = ifv->ifv_ifp; + struct ifnet_hw_tsomax hw_tsomax; TRUNK_LOCK_ASSERT(TRUNK(ifv)); @@ -1501,8 +1502,9 @@ vlan_capabilities(struct ifvlan *ifv) * propagate the hardware-assisted flag. TSO on VLANs * does not necessarily require hardware VLAN tagging. */ - if (p->if_hw_tsomax > 0) - ifp->if_hw_tsomax = p->if_hw_tsomax; + memset(&hw_tsomax, 0, sizeof(hw_tsomax)); + if_hw_tsomax_common(p, &hw_tsomax); + if_hw_tsomax_update(ifp, &hw_tsomax); if (p->if_capabilities & IFCAP_VLAN_HWTSO) ifp->if_capabilities |= p->if_capabilities & IFCAP_TSO; if (p->if_capenable & IFCAP_VLAN_HWTSO) { Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/netinet/tcp_input.c Mon Nov 3 12:38:41 2014 (r274044) @@ -3628,6 +3628,8 @@ tcp_mss(struct tcpcb *tp, int offer) if (cap.ifcap & CSUM_TSO) { tp->t_flags |= TF_TSO; tp->t_tsomax = cap.tsomax; + tp->t_tsomaxsegcount = cap.tsomaxsegcount; + tp->t_tsomaxsegsize = cap.tsomaxsegsize; } } Modified: stable/9/sys/netinet/tcp_output.c ============================================================================== --- stable/9/sys/netinet/tcp_output.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/netinet/tcp_output.c Mon Nov 3 12:38:41 2014 (r274044) @@ -765,28 +765,112 @@ send: flags &= ~TH_FIN; if (tso) { + u_int if_hw_tsomax; + u_int if_hw_tsomaxsegcount; + u_int if_hw_tsomaxsegsize; + struct mbuf *mb; + u_int moff; + int max_len; + + /* extract TSO information */ + if_hw_tsomax = tp->t_tsomax; + if_hw_tsomaxsegcount = tp->t_tsomaxsegcount; + if_hw_tsomaxsegsize = tp->t_tsomaxsegsize; + + /* + * Limit a TSO burst to prevent it from + * overflowing or exceeding the maximum length + * allowed by the network interface: + */ KASSERT(ipoptlen == 0, ("%s: TSO can't do IP options", __func__)); /* - * Limit a burst to t_tsomax minus IP, - * TCP and options length to keep ip->ip_len - * from overflowing or exceeding the maximum - * length allowed by the network interface. + * Check if we should limit by maximum payload + * length: */ - if (len > tp->t_tsomax - hdrlen) { - len = tp->t_tsomax - hdrlen; - sendalot = 1; + if (if_hw_tsomax != 0) { + /* compute maximum TSO length */ + max_len = (if_hw_tsomax - hdrlen); + if (max_len <= 0) { + len = 0; + } else if (len > (u_int)max_len) { + sendalot = 1; + len = (u_int)max_len; + } + } + + /* + * Check if we should limit by maximum segment + * size and count: + */ + if (if_hw_tsomaxsegcount != 0 && + if_hw_tsomaxsegsize != 0) { + max_len = 0; + mb = sbsndmbuf(&so->so_snd, off, &moff); + + while (mb != NULL && (u_int)max_len < len) { + u_int mlen; + u_int frags; + + /* + * Get length of mbuf fragment + * and how many hardware frags, + * rounded up, it would use: + */ + mlen = (mb->m_len - moff); + frags = howmany(mlen, + if_hw_tsomaxsegsize); + + /* Handle special case: Zero Length Mbuf */ + if (frags == 0) + frags = 1; + + /* + * Check if the fragment limit + * will be reached or exceeded: + */ + if (frags >= if_hw_tsomaxsegcount) { + max_len += min(mlen, + if_hw_tsomaxsegcount * + if_hw_tsomaxsegsize); + break; + } + max_len += mlen; + if_hw_tsomaxsegcount -= frags; + moff = 0; + mb = mb->m_next; + } + if (max_len <= 0) { + len = 0; + } else if (len > (u_int)max_len) { + sendalot = 1; + len = (u_int)max_len; + } } /* * Prevent the last segment from being - * fractional unless the send sockbuf can - * be emptied. + * fractional unless the send sockbuf can be + * emptied: + */ + max_len = (tp->t_maxopd - optlen); + if ((off + len) < so->so_snd.sb_cc) { + moff = len % (u_int)max_len; + if (moff != 0) { + len -= moff; + sendalot = 1; + } + } + + /* + * In case there are too many small fragments + * don't use TSO: */ - if (sendalot && off + len < so->so_snd.sb_cc) { - len -= len % (tp->t_maxopd - optlen); + if (len <= (u_int)max_len) { + len = (u_int)max_len; sendalot = 1; + tso = 0; } /* Modified: stable/9/sys/netinet/tcp_subr.c ============================================================================== --- stable/9/sys/netinet/tcp_subr.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/netinet/tcp_subr.c Mon Nov 3 12:38:41 2014 (r274044) @@ -1744,6 +1744,8 @@ tcp_maxmtu(struct in_conninfo *inc, stru ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + cap->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } RTFREE(sro.ro_rt); @@ -1783,6 +1785,8 @@ tcp_maxmtu6(struct in_conninfo *inc, str ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + cap->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } RTFREE(sro6.ro_rt); Modified: stable/9/sys/netinet/tcp_var.h ============================================================================== --- stable/9/sys/netinet/tcp_var.h Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/netinet/tcp_var.h Mon Nov 3 12:38:41 2014 (r274044) @@ -212,7 +212,9 @@ struct tcpcb { uint32_t t_ispare[7]; /* 5 UTO, 2 TBD */ void *t_pspare2[4]; /* 4 TBD */ - uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ + uint64_t _pad[5]; /* 5 TBD (1-2 CC/RTT?) */ + uint32_t t_tsomaxsegcount; /* TSO maximum segment count */ + uint32_t t_tsomaxsegsize; /* TSO maximum segment size in bytes */ }; /* @@ -333,6 +335,8 @@ struct hc_metrics_lite { /* must stay in struct tcp_ifcap { int ifcap; u_int tsomax; + u_int tsomaxsegcount; + u_int tsomaxsegsize; }; #ifndef _NETINET_IN_PCB_H_ Modified: stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Nov 3 12:38:41 2014 (r274044) @@ -2106,12 +2106,12 @@ int mlx4_en_init_netdev(struct mlx4_en_d if (mdev->LSO_support) dev->if_capabilities |= IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTSO; -#if 0 + /* set TSO limits so that we don't have to drop TX packets */ dev->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); dev->if_hw_tsomaxsegcount = 16; dev->if_hw_tsomaxsegsize = 65536; /* XXX can do up to 4GByte */ -#endif + dev->if_capenable = dev->if_capabilities; dev->if_hwassist = 0; Modified: stable/9/sys/sys/sockbuf.h ============================================================================== --- stable/9/sys/sys/sockbuf.h Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/sys/sockbuf.h Mon Nov 3 12:38:41 2014 (r274044) @@ -155,6 +155,8 @@ int sbreserve_locked(struct sockbuf *sb, struct thread *td); struct mbuf * sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff); +struct mbuf * + sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff); void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb); int sbwait(struct sockbuf *sb); int sblock(struct sockbuf *sb, int flags); From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 17:37:50 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C97B322D; Mon, 3 Nov 2014 17:37:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5265FBC; Mon, 3 Nov 2014 17:37:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3HboTn019497; Mon, 3 Nov 2014 17:37:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3HboEK019496; Mon, 3 Nov 2014 17:37:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411031737.sA3HboEK019496@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Nov 2014 17:37:50 +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: r274056 - stable/8/sys/compat/linux 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.18-1 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, 03 Nov 2014 17:37:50 -0000 Author: mav Date: Mon Nov 3 17:37:49 2014 New Revision: 274056 URL: https://svnweb.freebsd.org/changeset/base/274056 Log: MFC r272059: Remake Linux' SOUND_MIXER_INFO IOCTL as a wrapper around new FreeBSD's one. Submitted by: Dmitry Luhtionov Modified: stable/8/sys/compat/linux/linux_ioctl.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/compat/ (props changed) Modified: stable/8/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/8/sys/compat/linux/linux_ioctl.c Mon Nov 3 16:57:01 2014 (r274055) +++ stable/8/sys/compat/linux/linux_ioctl.c Mon Nov 3 17:37:49 2014 (r274056) @@ -1658,13 +1658,6 @@ linux_ioctl_vfat(struct thread *td, stru * Sound related ioctls */ -struct linux_mixer_info { - char id[16]; - char name[32]; - int modify_counter; - int fillers[10]; -}; - struct linux_old_mixer_info { char id[16]; char name[32]; @@ -1752,12 +1745,8 @@ linux_ioctl_sound(struct thread *td, str /* Key on encoded length */ switch ((args->cmd >> 16) & 0x1fff) { case 0x005c: { /* SOUND_MIXER_INFO */ - struct linux_mixer_info info; - bzero(&info, sizeof(info)); - strncpy(info.id, "OSS", sizeof(info.id) - 1); - strncpy(info.name, "FreeBSD OSS Mixer", sizeof(info.name) - 1); - copyout(&info, (void *)args->arg, sizeof(info)); - return (0); + args->cmd = SOUND_MIXER_INFO; + return (sys_ioctl(td, (struct ioctl_args *)args)); } case 0x0030: { /* SOUND_OLD_MIXER_INFO */ struct linux_old_mixer_info info; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 3 19:20:11 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56DC8332; Mon, 3 Nov 2014 19:20:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42B4CCE5; Mon, 3 Nov 2014 19:20:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3JKBoB066886; Mon, 3 Nov 2014 19:20:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3JKB6f066885; Mon, 3 Nov 2014 19:20:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411031920.sA3JKB6f066885@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Nov 2014 19:20:11 +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: r274058 - stable/8/sys/compat/linux 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.18-1 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, 03 Nov 2014 19:20:11 -0000 Author: mav Date: Mon Nov 3 19:20:10 2014 New Revision: 274058 URL: https://svnweb.freebsd.org/changeset/base/274058 Log: Fix build breakage of r274056. Modified: stable/8/sys/compat/linux/linux_ioctl.c Modified: stable/8/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/8/sys/compat/linux/linux_ioctl.c Mon Nov 3 19:16:25 2014 (r274057) +++ stable/8/sys/compat/linux/linux_ioctl.c Mon Nov 3 19:20:10 2014 (r274058) @@ -1746,7 +1746,7 @@ linux_ioctl_sound(struct thread *td, str switch ((args->cmd >> 16) & 0x1fff) { case 0x005c: { /* SOUND_MIXER_INFO */ args->cmd = SOUND_MIXER_INFO; - return (sys_ioctl(td, (struct ioctl_args *)args)); + return (ioctl(td, (struct ioctl_args *)args)); } case 0x0030: { /* SOUND_OLD_MIXER_INFO */ struct linux_old_mixer_info info; From owner-svn-src-stable@FreeBSD.ORG Tue Nov 4 07:50:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E1BDD00; Tue, 4 Nov 2014 07:50:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E91AF2D; Tue, 4 Nov 2014 07:50:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA47oorZ027063; Tue, 4 Nov 2014 07:50:50 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA47onOm027052; Tue, 4 Nov 2014 07:50:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411040750.sA47onOm027052@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 4 Nov 2014 07:50: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: r274082 - in stable/10: etc/mtree lib/libutil usr.sbin/pw usr.sbin/pw/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.18-1 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, 04 Nov 2014 07:50:51 -0000 Author: bapt Date: Tue Nov 4 07:50:48 2014 New Revision: 274082 URL: https://svnweb.freebsd.org/changeset/base/274082 Log: MFC: 272445,272578,273772,273779,273782,273786,273787,273791 Add a test for bug 191427 where pw(8) will go into an infinite loop Add some tests for modifying groups When a group is renamed then the group has been invalidated for sure. In that case get the group information using the new name. Fix a regression in pw usermod -G list The user was perperly adding the to different groups from "list" but was not removed from the other groups it could have belong to. Do not delete the group wheel when bad argument is passed to pw groupdel -g Check that the -g argument is actually a number, if not report an error. This argument is converted without checking with atoi(3) later so without this check it converts any alpha entries into 0 meaning it deletes the group wheel Ensure pw userdel -u do not try to remove root Check the uid passed is actually a number as early as possible Fix renaming a group via the gr_copy function Add a regression test to pw(8) because the bug was discovered via using: pw groupmod PR: 193704 [1], 185666 [2], 90114 [3], 187189 [4] Submitted by: Marc de la Gueronniere [4] Reported by: az [1], sub.mesa@gmail.com [2], bkoenig@cs.tu-berlin.de [3], mcdouga9@egr.msu.edu [4] Added: stable/10/usr.sbin/pw/tests/ - copied from r272445, head/usr.sbin/pw/tests/ stable/10/usr.sbin/pw/tests/pw_modify.sh - copied, changed from r272578, head/usr.sbin/pw/tests/pw_modify.sh Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/lib/libutil/gr_util.c stable/10/usr.sbin/pw/Makefile stable/10/usr.sbin/pw/pw_group.c stable/10/usr.sbin/pw/pw_user.c stable/10/usr.sbin/pw/tests/Makefile stable/10/usr.sbin/pw/tests/pw_delete.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Nov 4 07:50:20 2014 (r274081) +++ stable/10/etc/mtree/BSD.tests.dist Tue Nov 4 07:50:48 2014 (r274082) @@ -273,6 +273,8 @@ .. newsyslog .. + pw + .. sa .. .. Modified: stable/10/lib/libutil/gr_util.c ============================================================================== --- stable/10/lib/libutil/gr_util.c Tue Nov 4 07:50:20 2014 (r274081) +++ stable/10/lib/libutil/gr_util.c Tue Nov 4 07:50:48 2014 (r274082) @@ -170,14 +170,21 @@ gr_copy(int ffd, int tfd, const struct g size_t len; int eof, readlen; - sgr = gr; + if (old_gr == NULL && gr == NULL) + return(-1); + + sgr = old_gr; + /* deleting a group */ if (gr == NULL) { line = NULL; - if (old_gr == NULL) + } else { + if ((line = gr_make(gr)) == NULL) return (-1); - sgr = old_gr; - } else if ((line = gr_make(gr)) == NULL) - return (-1); + } + + /* adding a group */ + if (sgr == NULL) + sgr = gr; eof = 0; len = 0; Modified: stable/10/usr.sbin/pw/Makefile ============================================================================== --- stable/10/usr.sbin/pw/Makefile Tue Nov 4 07:50:20 2014 (r274081) +++ stable/10/usr.sbin/pw/Makefile Tue Nov 4 07:50:48 2014 (r274082) @@ -1,14 +1,20 @@ # $FreeBSD$ +.include + PROG= pw MAN= pw.conf.5 pw.8 SRCS= pw.c pw_conf.c pw_user.c pw_group.c pw_log.c pw_nis.c pw_vpw.c \ grupd.c pwupd.c fileupd.c psdate.c \ bitmap.c cpdir.c rm_r.c -WARNS?= 2 +WARNS?= 3 DPADD= ${LIBCRYPT} ${LIBUTIL} LDADD= -lcrypt -lutil +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.sbin/pw/pw_group.c ============================================================================== --- stable/10/usr.sbin/pw/pw_group.c Tue Nov 4 07:50:20 2014 (r274081) +++ stable/10/usr.sbin/pw/pw_group.c Tue Nov 4 07:50:48 2014 (r274082) @@ -51,6 +51,7 @@ int pw_group(struct userconf * cnf, int mode, struct cargs * args) { int rc; + struct carg *a_newname = getarg(args, 'l'); struct carg *a_name = getarg(args, 'n'); struct carg *a_gid = getarg(args, 'g'); struct carg *arg; @@ -66,6 +67,11 @@ pw_group(struct userconf * cnf, int mode NULL }; + if (a_gid != NULL) { + if (strspn(a_gid->val, "0123456789") != strlen(a_gid->val)) + errx(EX_USAGE, "-g expects a number"); + } + if (mode == M_LOCK || mode == M_UNLOCK) errx(EX_USAGE, "'lock' command is not available for groups"); @@ -140,8 +146,8 @@ pw_group(struct userconf * cnf, int mode if (a_gid) grp->gr_gid = (gid_t) atoi(a_gid->val); - if ((arg = getarg(args, 'l')) != NULL) - grp->gr_name = pw_checkname((u_char *)arg->val, 0); + if (a_newname != NULL) + grp->gr_name = pw_checkname((u_char *)a_newname->val, 0); } else { if (a_name == NULL) /* Required */ errx(EX_DATAERR, "group name required"); @@ -270,8 +276,10 @@ pw_group(struct userconf * cnf, int mode warn("group update"); return EX_IOERR; } + + arg = a_newname != NULL ? a_newname : a_name; /* grp may have been invalidated */ - if ((grp = GETGRNAM(a_name->val)) == NULL) + if ((grp = GETGRNAM(arg->val)) == NULL) errx(EX_SOFTWARE, "group disappeared during update"); pw_log(cnf, mode, W_GROUP, "%s(%ld)", grp->gr_name, (long) grp->gr_gid); Modified: stable/10/usr.sbin/pw/pw_user.c ============================================================================== --- stable/10/usr.sbin/pw/pw_user.c Tue Nov 4 07:50:20 2014 (r274081) +++ stable/10/usr.sbin/pw/pw_user.c Tue Nov 4 07:50:48 2014 (r274082) @@ -321,6 +321,9 @@ pw_user(struct userconf * cnf, int mode, (a_uid = a_name)->ch = 'u'; a_name = NULL; } + } else { + if (strspn(a_uid->val, "0123456789") != strlen(a_uid->val)) + errx(EX_USAGE, "-u expects a number"); } /* @@ -751,7 +754,25 @@ pw_user(struct userconf * cnf, int mode, */ if (mode == M_ADD || getarg(args, 'G') != NULL) { - int i; + int i, j; + /* First remove the user from all group */ + SETGRENT(); + while ((grp = GETGRENT()) != NULL) { + char group[MAXLOGNAME]; + if (grp->gr_mem == NULL) + continue; + for (i = 0; grp->gr_mem[i] != NULL; i++) { + if (strcmp(grp->gr_mem[i] , pwd->pw_name) != 0) + continue; + for (j = i; grp->gr_mem[j] != NULL ; j++) + grp->gr_mem[j] = grp->gr_mem[j+1]; + strlcpy(group, grp->gr_name, MAXLOGNAME); + chggrent(group, grp); + } + } + ENDGRENT(); + + /* now add to group where needed */ for (i = 0; cnf->groups[i] != NULL; i++) { grp = GETGRNAM(cnf->groups[i]); grp = gr_add(grp, pwd->pw_name); Modified: stable/10/usr.sbin/pw/tests/Makefile ============================================================================== --- head/usr.sbin/pw/tests/Makefile Thu Oct 2 19:53:37 2014 (r272445) +++ stable/10/usr.sbin/pw/tests/Makefile Tue Nov 4 07:50:48 2014 (r274082) @@ -2,7 +2,7 @@ TESTSDIR= ${TESTSBASE}/usr.sbin/pw -ATF_TESTS_SH= pw_delete +ATF_TESTS_SH= pw_delete pw_modify FILES= group helper_functions.shin master.passwd FILESDIR= ${TESTSDIR} Modified: stable/10/usr.sbin/pw/tests/pw_delete.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_delete.sh Thu Oct 2 19:53:37 2014 (r272445) +++ stable/10/usr.sbin/pw/tests/pw_delete.sh Tue Nov 4 07:50:48 2014 (r274082) @@ -18,7 +18,30 @@ rmuser_seperate_group_body() { pw -V ${HOME} userdel test || atf_fail "delete the user" } +atf_test_case group_do_not_delete_wheel_if_group_unkown +group_do_not_delete_wheel_if_group_unkown_head() { + atf_set "descr" "Make sure we do not consider as gid 0 an unknown group" +} + +group_do_not_delete_wheel_if_group_unkown_body() { + populate_etc_skel + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel + atf_check -e inline:"pw: -g expects a number\n" -s exit:64 -x pw -V ${HOME} groupdel -g I_do_not_exist + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel +} + +atf_test_case user_do_not_try_to_delete_root_if_user_unkown +user_do_not_try_to_delete_root_if_user_unkown_head() { + atf_set "descr" "Make sure not to try to remove root if deleteing an unknown user" +} + +user_do_not_try_to_delete_root_if_user_unkown_body() { + populate_etc_skel + atf_check -e inline:"pw: -u expects a number\n" -s exit:64 -x pw -V ${HOME} userdel -u plop +} atf_init_test_cases() { atf_add_test_case rmuser_seperate_group + atf_add_test_case group_do_not_delete_wheel_if_group_unkown + atf_add_test_case user_do_not_try_to_delete_root_if_user_unkown } Copied and modified: stable/10/usr.sbin/pw/tests/pw_modify.sh (from r272578, head/usr.sbin/pw/tests/pw_modify.sh) ============================================================================== --- head/usr.sbin/pw/tests/pw_modify.sh Mon Oct 6 00:16:23 2014 (r272578, copy source) +++ stable/10/usr.sbin/pw/tests/pw_modify.sh Tue Nov 4 07:50:48 2014 (r274082) @@ -27,8 +27,54 @@ groupmod_invalid_user_body() { atf_check -s exit:0 pw -V ${HOME} groupmod test -d foo } +atf_test_case groupmod_bug_193704 +groupmod_bug_193704_head() { + atf_set "descr" "Regression test for the #193704 bug" +} +groupmod_bug_193704_body() { + populate_etc_skel + atf_check -s exit:0 -x pw -V ${HOME} groupadd test + atf_check -s exit:0 -x pw -V ${HOME} groupmod test -l newgroupname + atf_check -s exit:65 -e match:"^pw: unknown group" -x pw -V ${HOME} groupshow test +} + +atf_test_case usermod_bug_185666 +usermod_bug_185666_head() { + atf_set "descr" "Regression test for the #185666 bug" +} + +usermod_bug_185666_body() { + populate_etc_skel + atf_check -s exit:0 -x pw -V ${HOME} useradd testuser + atf_check -s exit:0 -x pw -V ${HOME} groupadd testgroup + atf_check -s exit:0 -x pw -V ${HOME} groupadd testgroup2 + atf_check -s exit:0 -x pw -V ${HOME} usermod testuser -G testgroup + atf_check -o inline:"testuser:*:1001:\n" -x pw -V${HOME} groupshow testuser + atf_check -o inline:"testgroup:*:1002:testuser\n" -x pw -V ${HOME} groupshow testgroup + atf_check -o inline:"testgroup2:*:1003:\n" -x pw -V${HOME} groupshow testgroup2 + atf_check -s exit:0 -x pw -V ${HOME} usermod testuser -G testgroup2 + atf_check -o inline:"testuser:*:1001:\n" -x pw -V ${HOME} groupshow testuser + atf_check -o inline:"testgroup:*:1002:\n" -x pw -V ${HOME} groupshow testgroup + atf_check -o inline:"testgroup2:*:1003:testuser\n" -x pw -V ${HOME} groupshow testgroup2 +} + +atf_test_case do_not_duplicate_group_on_gid_change +do_not_duplicate_group_on_gid_change_head() { + atf_set "descr" "Do not duplicate group on gid change" +} + +do_not_duplicate_group_on_gid_change_body() { + populate_etc_skel + atf_check -s exit:0 -x pw -V ${HOME} groupadd testgroup + atf_check -s exit:0 -x pw -V ${HOME} groupmod testgroup -g 12345 + # use grep to see if the entry has not be duplicated + atf_check -o inline:"testgroup:*:12345:\n" -s exit:0 -x grep "^testgroup" ${HOME}/group +} atf_init_test_cases() { atf_add_test_case groupmod_user atf_add_test_case groupmod_invalid_user + atf_add_test_case groupmod_bug_193704 + atf_add_test_case usermod_bug_185666 + atf_add_test_case do_not_duplicate_group_on_gid_change } From owner-svn-src-stable@FreeBSD.ORG Tue Nov 4 22:47:53 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39FA3E8D; Tue, 4 Nov 2014 22:47:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24C96C7F; Tue, 4 Nov 2014 22:47:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4MlrsP055017; Tue, 4 Nov 2014 22:47:53 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4MlqCn055012; Tue, 4 Nov 2014 22:47:52 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201411042247.sA4MlqCn055012@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 4 Nov 2014 22:47: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: r274101 - stable/10/contrib/mtree 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.18-1 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, 04 Nov 2014 22:47:53 -0000 Author: brooks Date: Tue Nov 4 22:47:51 2014 New Revision: 274101 URL: https://svnweb.freebsd.org/changeset/base/274101 Log: MFC r273796 Import in latest mtree from NetBSD to fix a bug in parsing group files that jmg fixed upstream. Sponsored by: DARPA, AFRL Modified: stable/10/contrib/mtree/create.c stable/10/contrib/mtree/extern.h stable/10/contrib/mtree/getid.c stable/10/contrib/mtree/mtree.c stable/10/contrib/mtree/spec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/mtree/create.c ============================================================================== --- stable/10/contrib/mtree/create.c Tue Nov 4 19:56:04 2014 (r274100) +++ stable/10/contrib/mtree/create.c Tue Nov 4 22:47:51 2014 (r274101) @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $ */ +/* $NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $"); +__RCSID("$NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $"); #endif #endif /* not lint */ @@ -91,13 +91,14 @@ static u_long flags; #endif static int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *); -static void output(int, int *, const char *, ...) - __attribute__((__format__(__printf__, 3, 4))); -static int statd(FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, u_long *); -static void statf(int, FTSENT *); +static void output(FILE *, int, int *, const char *, ...) + __printflike(4, 5); +static int statd(FILE *, FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, + u_long *); +static void statf(FILE *, int, FTSENT *); void -cwalk(void) +cwalk(FILE *fp) { FTS *t; FTSENT *p; @@ -121,7 +122,7 @@ cwalk(void) } if (!nflag) - printf( + fprintf(fp, "#\t user: %s\n#\tmachine: %s\n#\t tree: %s\n" "#\t date: %s", user, host, fullpath, ctime(&clocktime)); @@ -142,21 +143,21 @@ cwalk(void) switch(p->fts_info) { case FTS_D: if (!bflag) - printf("\n"); + fprintf(fp, "\n"); if (!nflag) - printf("# %s\n", p->fts_path); - statd(t, p, &uid, &gid, &mode, &flags); - statf(indent, p); + fprintf(fp, "# %s\n", p->fts_path); + statd(fp, t, p, &uid, &gid, &mode, &flags); + statf(fp, indent, p); break; case FTS_DP: if (p->fts_level > 0) if (!nflag) - printf("%*s# %s\n", indent, "", + fprintf(fp, "%*s# %s\n", indent, "", p->fts_path); if (p->fts_level > 0 || flavor == F_FREEBSD9) { - printf("%*s..\n", indent, ""); + fprintf(fp, "%*s..\n", indent, ""); if (!bflag) - printf("\n"); + fprintf(fp, "\n"); } break; case FTS_DNR: @@ -167,7 +168,7 @@ cwalk(void) break; default: if (!dflag) - statf(indent, p); + statf(fp, indent, p); break; } @@ -178,7 +179,7 @@ cwalk(void) } static void -statf(int indent, FTSENT *p) +statf(FILE *fp, int indent, FTSENT *p) { u_int32_t len, val; int fd, offset; @@ -187,51 +188,54 @@ statf(int indent, FTSENT *p) char *digestbuf; #endif - offset = printf("%*s%s%s", indent, "", + offset = fprintf(fp, "%*s%s%s", indent, "", S_ISDIR(p->fts_statp->st_mode) ? "" : " ", vispath(p->fts_name)); if (offset > (INDENTNAMELEN + indent)) offset = MAXLINELEN; else - offset += printf("%*s", (INDENTNAMELEN + indent) - offset, ""); + offset += fprintf(fp, "%*s", + (INDENTNAMELEN + indent) - offset, ""); if (!S_ISREG(p->fts_statp->st_mode) && (flavor == F_NETBSD6 || !dflag)) - output(indent, &offset, "type=%s", + output(fp, indent, &offset, "type=%s", inotype(p->fts_statp->st_mode)); if (keys & (F_UID | F_UNAME) && p->fts_statp->st_uid != uid) { if (keys & F_UNAME && (name = user_from_uid(p->fts_statp->st_uid, 1)) != NULL) - output(indent, &offset, "uname=%s", name); + output(fp, indent, &offset, "uname=%s", name); if (keys & F_UID || (keys & F_UNAME && name == NULL)) - output(indent, &offset, "uid=%u", p->fts_statp->st_uid); + output(fp, indent, &offset, "uid=%u", + p->fts_statp->st_uid); } if (keys & (F_GID | F_GNAME) && p->fts_statp->st_gid != gid) { if (keys & F_GNAME && (name = group_from_gid(p->fts_statp->st_gid, 1)) != NULL) - output(indent, &offset, "gname=%s", name); + output(fp, indent, &offset, "gname=%s", name); if (keys & F_GID || (keys & F_GNAME && name == NULL)) - output(indent, &offset, "gid=%u", p->fts_statp->st_gid); + output(fp, indent, &offset, "gid=%u", + p->fts_statp->st_gid); } if (keys & F_MODE && (p->fts_statp->st_mode & MBITS) != mode) - output(indent, &offset, "mode=%#o", + output(fp, indent, &offset, "mode=%#o", p->fts_statp->st_mode & MBITS); if (keys & F_DEV && (S_ISBLK(p->fts_statp->st_mode) || S_ISCHR(p->fts_statp->st_mode))) - output(indent, &offset, "device=%#jx", + output(fp, indent, &offset, "device=%#jx", (uintmax_t)p->fts_statp->st_rdev); if (keys & F_NLINK && p->fts_statp->st_nlink != 1) - output(indent, &offset, "nlink=%u", p->fts_statp->st_nlink); + output(fp, indent, &offset, "nlink=%u", p->fts_statp->st_nlink); if (keys & F_SIZE && (flavor == F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode))) - output(indent, &offset, "size=%ju", + output(fp, indent, &offset, "size=%ju", (uintmax_t)p->fts_statp->st_size); if (keys & F_TIME) #if defined(BSD4_4) && !defined(HAVE_NBTOOL_CONFIG_H) - output(indent, &offset, "time=%jd.%09ld", + output(fp, indent, &offset, "time=%jd.%09ld", (intmax_t)p->fts_statp->st_mtimespec.tv_sec, p->fts_statp->st_mtimespec.tv_nsec); #else - output(indent, &offset, "time=%jd.%09ld", + output(fp, indent, &offset, "time=%jd.%09ld", (intmax_t)p->fts_statp->st_mtime, (long)0); #endif if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { @@ -239,14 +243,14 @@ statf(int indent, FTSENT *p) crc(fd, &val, &len)) mtree_err("%s: %s", p->fts_accpath, strerror(errno)); close(fd); - output(indent, &offset, "cksum=%lu", (long)val); + output(fp, indent, &offset, "cksum=%lu", (long)val); } #ifndef NO_MD5 if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { if ((digestbuf = MD5File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: MD5File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", MD5KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", MD5KEY, digestbuf); free(digestbuf); } #endif /* ! NO_MD5 */ @@ -255,7 +259,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = RMD160File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: RMD160File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", RMD160KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", RMD160KEY, digestbuf); free(digestbuf); } #endif /* ! NO_RMD160 */ @@ -264,7 +268,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA1File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA1File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA1KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA1KEY, digestbuf); free(digestbuf); } #endif /* ! NO_SHA1 */ @@ -273,7 +277,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA256_File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA256_File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA256KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA256KEY, digestbuf); free(digestbuf); } #ifdef SHA384_BLOCK_LENGTH @@ -281,7 +285,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA384_File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA384_File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA384KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA384KEY, digestbuf); free(digestbuf); } #endif @@ -289,18 +293,18 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA512_File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA512_File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA512KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA512KEY, digestbuf); free(digestbuf); } #endif /* ! NO_SHA2 */ if (keys & F_SLINK && (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) - output(indent, &offset, "link=%s", + output(fp, indent, &offset, "link=%s", vispath(rlink(p->fts_accpath))); #if HAVE_STRUCT_STAT_ST_FLAGS if (keys & F_FLAGS && p->fts_statp->st_flags != flags) { char *str = flags_to_string(p->fts_statp->st_flags, "none"); - output(indent, &offset, "flags=%s", str); + output(fp, indent, &offset, "flags=%s", str); free(str); } #endif @@ -324,8 +328,8 @@ statf(int indent, FTSENT *p) #define MTREE_MAXS 16 static int -statd(FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, - u_long *pflags) +statd(FILE *fp, FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, + u_long *pflags) { FTSENT *p; gid_t sgid; @@ -398,33 +402,33 @@ statd(FTS *t, FTSENT *parent, uid_t *pui first) { first = 0; if (flavor != F_NETBSD6 && dflag) - printf("/set type=dir"); + fprintf(fp, "/set type=dir"); else - printf("/set type=file"); + fprintf(fp, "/set type=file"); if (keys & (F_UID | F_UNAME)) { if (keys & F_UNAME && (name = user_from_uid(saveuid, 1)) != NULL) - printf(" uname=%s", name); + fprintf(fp, " uname=%s", name); if (keys & F_UID || (keys & F_UNAME && name == NULL)) - printf(" uid=%lu", (u_long)saveuid); + fprintf(fp, " uid=%lu", (u_long)saveuid); } if (keys & (F_GID | F_GNAME)) { if (keys & F_GNAME && (name = group_from_gid(savegid, 1)) != NULL) - printf(" gname=%s", name); + fprintf(fp, " gname=%s", name); if (keys & F_GID || (keys & F_GNAME && name == NULL)) - printf(" gid=%lu", (u_long)savegid); + fprintf(fp, " gid=%lu", (u_long)savegid); } if (keys & F_MODE) - printf(" mode=%#lo", (u_long)savemode); + fprintf(fp, " mode=%#lo", (u_long)savemode); if (keys & F_NLINK) - printf(" nlink=1"); + fprintf(fp, " nlink=1"); if (keys & F_FLAGS) { char *str = flags_to_string(saveflags, "none"); - printf(" flags=%s", str); + fprintf(fp, " flags=%s", str); free(str); } - printf("\n"); + fprintf(fp, "\n"); *puid = saveuid; *pgid = savegid; *pmode = savemode; @@ -455,7 +459,7 @@ dcmp(const FTSENT *FTS_CONST *a, const F } void -output(int indent, int *offset, const char *fmt, ...) +output(FILE *fp, int indent, int *offset, const char *fmt, ...) { va_list ap; char buf[1024]; @@ -465,8 +469,8 @@ output(int indent, int *offset, const ch va_end(ap); if (*offset + strlen(buf) > MAXLINELEN - 3) { - printf(" \\\n%*s", INDENTNAMELEN + indent, ""); + fprintf(fp, " \\\n%*s", INDENTNAMELEN + indent, ""); *offset = INDENTNAMELEN + indent; } - *offset += printf(" %s", buf) + 1; + *offset += fprintf(fp, " %s", buf) + 1; } Modified: stable/10/contrib/mtree/extern.h ============================================================================== --- stable/10/contrib/mtree/extern.h Tue Nov 4 19:56:04 2014 (r274100) +++ stable/10/contrib/mtree/extern.h Tue Nov 4 22:47:51 2014 (r274101) @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.38 2013/02/03 19:15:17 christos Exp $ */ +/* $NetBSD: extern.h,v 1.39 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -63,8 +63,8 @@ void addtag(slist_t *, char *); int check_excludes(const char *, const char *); int compare(NODE *, FTSENT *); int crc(int, u_int32_t *, u_int32_t *); -void cwalk(void); -void dump_nodes(const char *, NODE *, int); +void cwalk(FILE *); +void dump_nodes(FILE *, const char *, NODE *, int); void init_excludes(void); int matchtags(NODE *); __dead __printflike(1,2) void mtree_err(const char *, ...); Modified: stable/10/contrib/mtree/getid.c ============================================================================== --- stable/10/contrib/mtree/getid.c Tue Nov 4 19:56:04 2014 (r274100) +++ stable/10/contrib/mtree/getid.c Tue Nov 4 22:47:51 2014 (r274101) @@ -1,4 +1,4 @@ -/* $NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $ */ +/* $NetBSD: getid.c,v 1.10 2014/10/27 21:46:45 christos Exp $ */ /* from: NetBSD: getpwent.c,v 1.48 2000/10/03 03:22:26 enami Exp */ /* from: NetBSD: getgrent.c,v 1.41 2002/01/12 23:51:30 lukem Exp */ @@ -65,7 +65,7 @@ #endif #include -__RCSID("$NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $"); +__RCSID("$NetBSD: getid.c,v 1.10 2014/10/27 21:46:45 christos Exp $"); #include @@ -206,7 +206,12 @@ grstart(void) } if (grfile[0] == '\0') /* sanity check */ return 0; - return (_gr_fp = fopen(grfile, "r")) ? 1 : 0; + + _gr_fp = fopen(grfile, "r"); + if (_gr_fp != NULL) + return 1; + warn("Can't open `%s'", grfile); + return 0; } @@ -231,7 +236,7 @@ grscan(int search, gid_t gid, const char continue; } /* skip comments */ - if (pwline[0] == '#') + if (grline[0] == '#') continue; if (grmatchline(search, gid, name)) return 1; @@ -350,7 +355,11 @@ pwstart(void) } if (pwfile[0] == '\0') /* sanity check */ return 0; - return (_pw_fp = fopen(pwfile, "r")) ? 1 : 0; + _pw_fp = fopen(pwfile, "r"); + if (_pw_fp != NULL) + return 1; + warn("Can't open `%s'", pwfile); + return 0; } Modified: stable/10/contrib/mtree/mtree.c ============================================================================== --- stable/10/contrib/mtree/mtree.c Tue Nov 4 19:56:04 2014 (r274100) +++ stable/10/contrib/mtree/mtree.c Tue Nov 4 22:47:51 2014 (r274101) @@ -1,4 +1,4 @@ -/* $NetBSD: mtree.c,v 1.48 2013/04/08 17:39:11 christos Exp $ */ +/* $NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1989, 1990, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19 #if 0 static char sccsid[] = "@(#)mtree.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: mtree.c,v 1.48 2013/04/08 17:39:11 christos Exp $"); +__RCSID("$NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $"); #endif #endif /* not lint */ @@ -296,11 +296,11 @@ main(int argc, char **argv) mtree_err("-l and -u flags are mutually exclusive"); if (cflag) { - cwalk(); + cwalk(stdout); exit(0); } if (Cflag || Dflag) { - dump_nodes("", spec(spec1), Dflag); + dump_nodes(stdout, "", spec(spec1), Dflag); exit(0); } if (spec2 != NULL) Modified: stable/10/contrib/mtree/spec.c ============================================================================== --- stable/10/contrib/mtree/spec.c Tue Nov 4 19:56:04 2014 (r274100) +++ stable/10/contrib/mtree/spec.c Tue Nov 4 22:47:51 2014 (r274101) @@ -1,4 +1,4 @@ -/* $NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $ */ +/* $NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $"); +__RCSID("$NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $"); #endif #endif /* not lint */ @@ -102,7 +102,7 @@ static void set(char *, NODE *); static void unset(char *, NODE *); static void addchild(NODE *, NODE *); static int nodecmp(const NODE *, const NODE *); -static int appendfield(int, const char *, ...) __printflike(2, 3); +static int appendfield(FILE *, int, const char *, ...) __printflike(3, 4); #define REPLACEPTR(x,v) do { if ((x)) free((x)); (x) = (v); } while (0) @@ -290,21 +290,21 @@ free_nodes(NODE *root) /* * appendfield -- - * Like printf(), but output a space either before or after + * Like fprintf(), but output a space either before or after * the regular output, according to the pathlast flag. */ static int -appendfield(int pathlast, const char *fmt, ...) +appendfield(FILE *fp, int pathlast, const char *fmt, ...) { va_list ap; int result; va_start(ap, fmt); if (!pathlast) - printf(" "); + fprintf(fp, " "); result = vprintf(fmt, ap); if (pathlast) - printf(" "); + fprintf(fp, " "); va_end(ap); return result; } @@ -316,7 +316,7 @@ appendfield(int pathlast, const char *fm * it first. */ void -dump_nodes(const char *dir, NODE *root, int pathlast) +dump_nodes(FILE *fp, const char *dir, NODE *root, int pathlast) { NODE *cur; char path[MAXPATHLEN]; @@ -334,70 +334,75 @@ dump_nodes(const char *dir, NODE *root, mtree_err("Pathname too long."); if (!pathlast) - printf("%s", vispath(path)); + fprintf(fp, "%s", vispath(path)); #define MATCHFLAG(f) ((keys & (f)) && (cur->flags & (f))) if (MATCHFLAG(F_TYPE)) - appendfield(pathlast, "type=%s", nodetype(cur->type)); + appendfield(fp, pathlast, "type=%s", + nodetype(cur->type)); if (MATCHFLAG(F_UID | F_UNAME)) { if (keys & F_UNAME && (name = user_from_uid(cur->st_uid, 1)) != NULL) - appendfield(pathlast, "uname=%s", name); + appendfield(fp, pathlast, "uname=%s", name); else - appendfield(pathlast, "uid=%u", cur->st_uid); + appendfield(fp, pathlast, "uid=%u", + cur->st_uid); } if (MATCHFLAG(F_GID | F_GNAME)) { if (keys & F_GNAME && (name = group_from_gid(cur->st_gid, 1)) != NULL) - appendfield(pathlast, "gname=%s", name); + appendfield(fp, pathlast, "gname=%s", name); else - appendfield(pathlast, "gid=%u", cur->st_gid); + appendfield(fp, pathlast, "gid=%u", + cur->st_gid); } if (MATCHFLAG(F_MODE)) - appendfield(pathlast, "mode=%#o", cur->st_mode); + appendfield(fp, pathlast, "mode=%#o", cur->st_mode); if (MATCHFLAG(F_DEV) && (cur->type == F_BLOCK || cur->type == F_CHAR)) - appendfield(pathlast, "device=%#jx", + appendfield(fp, pathlast, "device=%#jx", (uintmax_t)cur->st_rdev); if (MATCHFLAG(F_NLINK)) - appendfield(pathlast, "nlink=%d", cur->st_nlink); + appendfield(fp, pathlast, "nlink=%d", cur->st_nlink); if (MATCHFLAG(F_SLINK)) - appendfield(pathlast, "link=%s", vispath(cur->slink)); + appendfield(fp, pathlast, "link=%s", + vispath(cur->slink)); if (MATCHFLAG(F_SIZE)) - appendfield(pathlast, "size=%ju", + appendfield(fp, pathlast, "size=%ju", (uintmax_t)cur->st_size); if (MATCHFLAG(F_TIME)) - appendfield(pathlast, "time=%jd.%09ld", + appendfield(fp, pathlast, "time=%jd.%09ld", (intmax_t)cur->st_mtimespec.tv_sec, cur->st_mtimespec.tv_nsec); if (MATCHFLAG(F_CKSUM)) - appendfield(pathlast, "cksum=%lu", cur->cksum); + appendfield(fp, pathlast, "cksum=%lu", cur->cksum); if (MATCHFLAG(F_MD5)) - appendfield(pathlast, "%s=%s", MD5KEY, cur->md5digest); + appendfield(fp, pathlast, "%s=%s", MD5KEY, + cur->md5digest); if (MATCHFLAG(F_RMD160)) - appendfield(pathlast, "%s=%s", RMD160KEY, + appendfield(fp, pathlast, "%s=%s", RMD160KEY, cur->rmd160digest); if (MATCHFLAG(F_SHA1)) - appendfield(pathlast, "%s=%s", SHA1KEY, + appendfield(fp, pathlast, "%s=%s", SHA1KEY, cur->sha1digest); if (MATCHFLAG(F_SHA256)) - appendfield(pathlast, "%s=%s", SHA256KEY, + appendfield(fp, pathlast, "%s=%s", SHA256KEY, cur->sha256digest); if (MATCHFLAG(F_SHA384)) - appendfield(pathlast, "%s=%s", SHA384KEY, + appendfield(fp, pathlast, "%s=%s", SHA384KEY, cur->sha384digest); if (MATCHFLAG(F_SHA512)) - appendfield(pathlast, "%s=%s", SHA512KEY, + appendfield(fp, pathlast, "%s=%s", SHA512KEY, cur->sha512digest); if (MATCHFLAG(F_FLAGS)) { str = flags_to_string(cur->st_flags, "none"); - appendfield(pathlast, "flags=%s", str); + appendfield(fp, pathlast, "flags=%s", str); free(str); } if (MATCHFLAG(F_IGN)) - appendfield(pathlast, "ignore"); + appendfield(fp, pathlast, "ignore"); if (MATCHFLAG(F_OPT)) - appendfield(pathlast, "optional"); + appendfield(fp, pathlast, "optional"); if (MATCHFLAG(F_TAGS)) { /* don't output leading or trailing commas */ p = cur->tags; @@ -406,12 +411,12 @@ dump_nodes(const char *dir, NODE *root, q = p + strlen(p); while(q > p && q[-1] == ',') q--; - appendfield(pathlast, "tags=%.*s", (int)(q - p), p); + appendfield(fp, pathlast, "tags=%.*s", (int)(q - p), p); } puts(pathlast ? vispath(path) : ""); if (cur->child) - dump_nodes(path, cur->child, pathlast); + dump_nodes(fp, path, cur->child, pathlast); } } From owner-svn-src-stable@FreeBSD.ORG Tue Nov 4 23:02:17 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CE1918E; Tue, 4 Nov 2014 23:02:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7920EE17; Tue, 4 Nov 2014 23:02:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4N2Hij063812; Tue, 4 Nov 2014 23:02:17 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4N2HUs063811; Tue, 4 Nov 2014 23:02:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411042302.sA4N2HUs063811@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 4 Nov 2014 23:02:17 +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: r274102 - stable/10/release 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.18-1 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, 04 Nov 2014 23:02:17 -0000 Author: gjb Date: Tue Nov 4 23:02:16 2014 New Revision: 274102 URL: https://svnweb.freebsd.org/changeset/base/274102 Log: MFC r274095: Fix VOLUME_LABEL when BRANCH contains '-' and '.' characters, in particular '-' and '.'. Insta-MFC ok: re (hrs) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Tue Nov 4 22:47:51 2014 (r274101) +++ stable/10/release/Makefile Tue Nov 4 23:02:16 2014 (r274102) @@ -56,10 +56,10 @@ ${_V}!= eval $$(awk '/^${_V}=/{print}' $ .for _V in ${TARGET_ARCH} .if !empty(TARGET:M${_V}) OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET} -VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET} +VOLUME_LABEL= ${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET} .else OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} -VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET_ARCH} +VOLUME_LABEL= ${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET_ARCH} .endif .endfor .endif From owner-svn-src-stable@FreeBSD.ORG Tue Nov 4 23:29:58 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1671DED; Tue, 4 Nov 2014 23:29:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACFDE115; Tue, 4 Nov 2014 23:29:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NTwAw074608; Tue, 4 Nov 2014 23:29:58 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NTwvM074606; Tue, 4 Nov 2014 23:29:58 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042329.sA4NTwvM074606@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:29: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: r274107 - in stable/10: contrib/tnftp/src 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.18-1 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, 04 Nov 2014 23:29:58 -0000 Author: des Date: Tue Nov 4 23:29:57 2014 New Revision: 274107 URL: https://svnweb.freebsd.org/changeset/base/274107 Log: [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2). [SA-14:26] Fix remote command execution in ftp(1). Approved by: so (des) Modified: stable/10/contrib/tnftp/src/fetch.c stable/10/sys/kern/kern_prot.c Modified: stable/10/contrib/tnftp/src/fetch.c ============================================================================== --- stable/10/contrib/tnftp/src/fetch.c Tue Nov 4 23:29:29 2014 (r274106) +++ stable/10/contrib/tnftp/src/fetch.c Tue Nov 4 23:29:57 2014 (r274107) @@ -547,7 +547,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = ftp_strdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -571,8 +571,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1098,17 +1097,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't execute `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1318,7 +1325,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(uuser); if (pass != NULL) memset(pass, 0, strlen(pass)); Modified: stable/10/sys/kern/kern_prot.c ============================================================================== --- stable/10/sys/kern/kern_prot.c Tue Nov 4 23:29:29 2014 (r274106) +++ stable/10/sys/kern/kern_prot.c Tue Nov 4 23:29:57 2014 (r274107) @@ -2073,21 +2073,20 @@ struct getlogin_args { int sys_getlogin(struct thread *td, struct getlogin_args *uap) { - int error; char login[MAXLOGNAME]; struct proc *p = td->td_proc; + size_t len; if (uap->namelen > MAXLOGNAME) uap->namelen = MAXLOGNAME; PROC_LOCK(p); SESS_LOCK(p->p_session); - bcopy(p->p_session->s_login, login, uap->namelen); + len = strlcpy(login, p->p_session->s_login, uap->namelen) + 1; SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); - if (strlen(login) + 1 > uap->namelen) + if (len > uap->namelen) return (ERANGE); - error = copyout(login, uap->namebuf, uap->namelen); - return (error); + return (copyout(login, uap->namebuf, len)); } /* @@ -2106,21 +2105,23 @@ sys_setlogin(struct thread *td, struct s int error; char logintmp[MAXLOGNAME]; + CTASSERT(sizeof(p->p_session->s_login) >= sizeof(logintmp)); + error = priv_check(td, PRIV_PROC_SETLOGIN); if (error) return (error); error = copyinstr(uap->namebuf, logintmp, sizeof(logintmp), NULL); - if (error == ENAMETOOLONG) - error = EINVAL; - else if (!error) { - PROC_LOCK(p); - SESS_LOCK(p->p_session); - (void) memcpy(p->p_session->s_login, logintmp, - sizeof(logintmp)); - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); + if (error != 0) { + if (error == ENAMETOOLONG) + error = EINVAL; + return (error); } - return (error); + PROC_LOCK(p); + SESS_LOCK(p->p_session); + strcpy(p->p_session->s_login, logintmp); + SESS_UNLOCK(p->p_session); + PROC_UNLOCK(p); + return (0); } void From owner-svn-src-stable@FreeBSD.ORG Tue Nov 4 23:30:24 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85EFDF70; Tue, 4 Nov 2014 23:30:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6861D120; Tue, 4 Nov 2014 23:30:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NUO3d074844; Tue, 4 Nov 2014 23:30:24 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NUNTw074841; Tue, 4 Nov 2014 23:30:23 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042330.sA4NUNTw074841@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:30:23 +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: r274108 - in stable/8: contrib/lukemftp/src sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/kern 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.18-1 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, 04 Nov 2014 23:30:24 -0000 Author: des Date: Tue Nov 4 23:30:23 2014 New Revision: 274108 URL: https://svnweb.freebsd.org/changeset/base/274108 Log: [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2). [SA-14:26] Fix remote command execution in ftp(1). [EN-14:12] Fix NFSv4 and ZFS cache consistency issue. Approved by: so (des) Modified: stable/8/contrib/lukemftp/src/fetch.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/kern/kern_prot.c Modified: stable/8/contrib/lukemftp/src/fetch.c ============================================================================== --- stable/8/contrib/lukemftp/src/fetch.c Tue Nov 4 23:29:57 2014 (r274107) +++ stable/8/contrib/lukemftp/src/fetch.c Tue Nov 4 23:30:23 2014 (r274108) @@ -540,7 +540,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = xstrdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -566,8 +566,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1085,17 +1084,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't run `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1278,7 +1285,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(user); FREEPTR(pass); FREEPTR(host); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:29:57 2014 (r274107) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:30:23 2014 (r274108) @@ -2836,6 +2836,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i #endif vap->va_seq = zp->z_seq; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ + vap->va_filerev = zp->z_seq; /* * Add in any requested optional attributes and the create time. Modified: stable/8/sys/kern/kern_prot.c ============================================================================== --- stable/8/sys/kern/kern_prot.c Tue Nov 4 23:29:57 2014 (r274107) +++ stable/8/sys/kern/kern_prot.c Tue Nov 4 23:30:23 2014 (r274108) @@ -2054,21 +2054,20 @@ struct getlogin_args { int getlogin(struct thread *td, struct getlogin_args *uap) { - int error; char login[MAXLOGNAME]; struct proc *p = td->td_proc; + size_t len; if (uap->namelen > MAXLOGNAME) uap->namelen = MAXLOGNAME; PROC_LOCK(p); SESS_LOCK(p->p_session); - bcopy(p->p_session->s_login, login, uap->namelen); + len = strlcpy(login, p->p_session->s_login, uap->namelen) + 1; SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); - if (strlen(login) + 1 > uap->namelen) + if (len > uap->namelen) return (ERANGE); - error = copyout(login, uap->namebuf, uap->namelen); - return (error); + return (copyout(login, uap->namebuf, len)); } /* @@ -2087,21 +2086,23 @@ setlogin(struct thread *td, struct setlo int error; char logintmp[MAXLOGNAME]; + CTASSERT(sizeof(p->p_session->s_login) >= sizeof(logintmp)); + error = priv_check(td, PRIV_PROC_SETLOGIN); if (error) return (error); error = copyinstr(uap->namebuf, logintmp, sizeof(logintmp), NULL); - if (error == ENAMETOOLONG) - error = EINVAL; - else if (!error) { - PROC_LOCK(p); - SESS_LOCK(p->p_session); - (void) memcpy(p->p_session->s_login, logintmp, - sizeof(logintmp)); - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); + if (error != 0) { + if (error == ENAMETOOLONG) + error = EINVAL; + return (error); } - return (error); + PROC_LOCK(p); + SESS_LOCK(p->p_session); + strcpy(p->p_session->s_login, logintmp); + SESS_UNLOCK(p->p_session); + PROC_UNLOCK(p); + return (0); } void From owner-svn-src-stable@FreeBSD.ORG Tue Nov 4 23:30:48 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C71A7126; Tue, 4 Nov 2014 23:30:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B28651AF; Tue, 4 Nov 2014 23:30:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NUmqx074955; Tue, 4 Nov 2014 23:30:48 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NUmV3074953; Tue, 4 Nov 2014 23:30:48 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042330.sA4NUmV3074953@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:30:48 +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: r274109 - in stable/9: contrib/tnftp/src sys/kern 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.18-1 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, 04 Nov 2014 23:30:48 -0000 Author: des Date: Tue Nov 4 23:30:47 2014 New Revision: 274109 URL: https://svnweb.freebsd.org/changeset/base/274109 Log: [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2). [SA-14:26] Fix remote command execution in ftp(1). Approved by: so (des) Modified: stable/9/contrib/tnftp/src/fetch.c stable/9/sys/kern/kern_prot.c Modified: stable/9/contrib/tnftp/src/fetch.c ============================================================================== --- stable/9/contrib/tnftp/src/fetch.c Tue Nov 4 23:30:23 2014 (r274108) +++ stable/9/contrib/tnftp/src/fetch.c Tue Nov 4 23:30:47 2014 (r274109) @@ -547,7 +547,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = ftp_strdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -571,8 +571,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1098,17 +1097,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't execute `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1318,7 +1325,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(uuser); if (pass != NULL) memset(pass, 0, strlen(pass)); Modified: stable/9/sys/kern/kern_prot.c ============================================================================== --- stable/9/sys/kern/kern_prot.c Tue Nov 4 23:30:23 2014 (r274108) +++ stable/9/sys/kern/kern_prot.c Tue Nov 4 23:30:47 2014 (r274109) @@ -2073,21 +2073,20 @@ struct getlogin_args { int sys_getlogin(struct thread *td, struct getlogin_args *uap) { - int error; char login[MAXLOGNAME]; struct proc *p = td->td_proc; + size_t len; if (uap->namelen > MAXLOGNAME) uap->namelen = MAXLOGNAME; PROC_LOCK(p); SESS_LOCK(p->p_session); - bcopy(p->p_session->s_login, login, uap->namelen); + len = strlcpy(login, p->p_session->s_login, uap->namelen) + 1; SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); - if (strlen(login) + 1 > uap->namelen) + if (len > uap->namelen) return (ERANGE); - error = copyout(login, uap->namebuf, uap->namelen); - return (error); + return (copyout(login, uap->namebuf, len)); } /* @@ -2106,21 +2105,23 @@ sys_setlogin(struct thread *td, struct s int error; char logintmp[MAXLOGNAME]; + CTASSERT(sizeof(p->p_session->s_login) >= sizeof(logintmp)); + error = priv_check(td, PRIV_PROC_SETLOGIN); if (error) return (error); error = copyinstr(uap->namebuf, logintmp, sizeof(logintmp), NULL); - if (error == ENAMETOOLONG) - error = EINVAL; - else if (!error) { - PROC_LOCK(p); - SESS_LOCK(p->p_session); - (void) memcpy(p->p_session->s_login, logintmp, - sizeof(logintmp)); - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); + if (error != 0) { + if (error == ENAMETOOLONG) + error = EINVAL; + return (error); } - return (error); + PROC_LOCK(p); + SESS_LOCK(p->p_session); + strcpy(p->p_session->s_login, logintmp); + SESS_UNLOCK(p->p_session); + PROC_UNLOCK(p); + return (0); } void From owner-svn-src-stable@FreeBSD.ORG Wed Nov 5 04:25:24 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39850139; Wed, 5 Nov 2014 04:25:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2513A9DB; Wed, 5 Nov 2014 04:25:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA54POWD017434; Wed, 5 Nov 2014 04:25:24 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA54POK7017433; Wed, 5 Nov 2014 04:25:24 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201411050425.sA54POK7017433@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Wed, 5 Nov 2014 04:25: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: r274128 - stable/10/etc 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.18-1 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, 05 Nov 2014 04:25:24 -0000 Author: wblock (doc committer) Date: Wed Nov 5 04:25:23 2014 New Revision: 274128 URL: https://svnweb.freebsd.org/changeset/base/274128 Log: MFC r273985: Add the less-ambiguous freebsd-version command. Modified: stable/10/etc/motd Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/motd ============================================================================== --- stable/10/etc/motd Wed Nov 5 04:18:41 2014 (r274127) +++ stable/10/etc/motd Wed Nov 5 04:25:23 2014 (r274128) @@ -13,7 +13,7 @@ Documents installed with the system are directory, or can be installed later with: pkg install en-freebsd-doc For other languages, replace "en" with a language code like de or fr. -Show the version of FreeBSD installed: uname -a +Show the version of FreeBSD installed: freebsd-version ; uname -a Please include that output and any error messages when posting questions. Introduction to manual pages: man man FreeBSD directory layout: man hier From owner-svn-src-stable@FreeBSD.ORG Wed Nov 5 09:23:32 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E399C5D1; Wed, 5 Nov 2014 09:23:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE3D0AB2; Wed, 5 Nov 2014 09:23:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA59NVsf055678; Wed, 5 Nov 2014 09:23:31 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA59NTjY055666; Wed, 5 Nov 2014 09:23:29 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411050923.sA59NTjY055666@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Nov 2014 09:23: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: r274132 - in stable/10/sys: netinet6 netipsec 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.18-1 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, 05 Nov 2014 09:23:32 -0000 Author: ae Date: Wed Nov 5 09:23:29 2014 New Revision: 274132 URL: https://svnweb.freebsd.org/changeset/base/274132 Log: MFC r266800 by vanhu: IPv4-in-IPv6 and IPv6-in-IPv4 IPsec tunnels. For IPv6-in-IPv4, you may need to do the following command on the tunnel interface if it is configured as IPv4 only: ifconfig inet6 -ifdisabled Code logic inspired from NetBSD. PR: kern/169438 MC r266822 by bz: Use IPv4 statistics in ipsec4_process_packet() rather than the IPv6 version. This also unbreaks the NOINET6 builds after r266800. MFC r268083 by zec: The assumption in ipsec4_process_packet() that the payload may be only IPv4 is wrong, so check the IP version before mangling the payload header. MFC r272394: Do not strip outer header when operating in transport mode. Instead requeue mbuf back to IPv4 protocol handler. If there is one extra IP-IP encapsulation, it will be handled with tunneling interface. And thus proper interface will be exposed into mbuf's rcvif. Also, tcpdump that listens on tunneling interface will see packets in both directions. PR: 194761 Modified: stable/10/sys/netinet6/ip6_forward.c stable/10/sys/netinet6/ip6_ipsec.c stable/10/sys/netinet6/ip6_ipsec.h stable/10/sys/netinet6/ip6_output.c stable/10/sys/netinet6/ip6_var.h stable/10/sys/netipsec/ipsec6.h stable/10/sys/netipsec/ipsec_input.c stable/10/sys/netipsec/ipsec_output.c stable/10/sys/netipsec/xform_ipip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/ip6_forward.c ============================================================================== --- stable/10/sys/netinet6/ip6_forward.c Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netinet6/ip6_forward.c Wed Nov 5 09:23:29 2014 (r274132) @@ -251,7 +251,6 @@ ip6_forward(struct mbuf *m, int srcrt) { struct ipsecrequest *isr = NULL; - struct ipsec_output_state state; /* * when the kernel forwards a packet, it is not proper to apply @@ -284,18 +283,27 @@ ip6_forward(struct mbuf *m, int srcrt) * * IPv6 [ESP|AH] IPv6 [extension headers] payload */ - bzero(&state, sizeof(state)); - state.m = m; - state.ro = NULL; /* update at ipsec6_output_tunnel() */ - state.dst = NULL; /* update at ipsec6_output_tunnel() */ - error = ipsec6_output_tunnel(&state, sp, 0); + /* + * If we need to encapsulate the packet, do it here + * ipsec6_proces_packet will send the packet using ip6_output + */ + error = ipsec6_process_packet(m, sp->req); - m = state.m; KEY_FREESP(&sp); + if (error == EJUSTRETURN) { + /* + * We had a SP with a level of 'use' and no SA. We + * will just continue to process the packet without + * IPsec processing. + */ + error = 0; + goto skip_ipsec; + } + if (error) { - /* mbuf is already reclaimed in ipsec6_output_tunnel. */ + /* mbuf is already reclaimed in ipsec6_process_packet. */ switch (error) { case EHOSTUNREACH: case ENETUNREACH: @@ -318,7 +326,6 @@ ip6_forward(struct mbuf *m, int srcrt) m_freem(mcopy); #endif } - m_freem(m); return; } else { /* @@ -330,25 +337,7 @@ ip6_forward(struct mbuf *m, int srcrt) m = NULL; goto freecopy; } - - if ((m != NULL) && (ip6 != mtod(m, struct ip6_hdr *)) ){ - /* - * now tunnel mode headers are added. we are originating - * packet instead of forwarding the packet. - */ - ip6_output(m, NULL, NULL, IPV6_FORWARDING/*XXX*/, NULL, NULL, - NULL); - goto freecopy; - } - - /* adjust pointer */ - dst = (struct sockaddr_in6 *)state.dst; - rt = state.ro ? state.ro->ro_rt : NULL; - if (dst != NULL && rt != NULL) - ipsecrt = 1; } - if (ipsecrt) - goto skip_routing; skip_ipsec: #endif again: @@ -371,9 +360,6 @@ again2: goto bad; } rt = rin6.ro_rt; -#ifdef IPSEC -skip_routing: -#endif /* * Source scope check: if a packet can't be delivered to its Modified: stable/10/sys/netinet6/ip6_ipsec.c ============================================================================== --- stable/10/sys/netinet6/ip6_ipsec.c Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netinet6/ip6_ipsec.c Wed Nov 5 09:23:29 2014 (r274132) @@ -220,23 +220,22 @@ ip6_ipsec_input(struct mbuf *m, int nxt) int ip6_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error, - struct ifnet **ifp, struct secpolicy **sp) + struct ifnet **ifp) { #ifdef IPSEC + struct secpolicy *sp = NULL; struct tdb_ident *tdbi; struct m_tag *mtag; /* XXX int s; */ - if (sp == NULL) - return 1; mtag = m_tag_find(*m, PACKET_TAG_IPSEC_PENDING_TDB, NULL); if (mtag != NULL) { tdbi = (struct tdb_ident *)(mtag + 1); - *sp = ipsec_getpolicy(tdbi, IPSEC_DIR_OUTBOUND); - if (*sp == NULL) + sp = ipsec_getpolicy(tdbi, IPSEC_DIR_OUTBOUND); + if (sp == NULL) *error = -EINVAL; /* force silent drop */ m_tag_delete(*m, mtag); } else { - *sp = ipsec4_checkpolicy(*m, IPSEC_DIR_OUTBOUND, *flags, + sp = ipsec4_checkpolicy(*m, IPSEC_DIR_OUTBOUND, *flags, error, inp); } @@ -247,9 +246,9 @@ ip6_ipsec_output(struct mbuf **m, struct * sp == NULL, error == -EINVAL discard packet w/o error * sp == NULL, error != 0 discard packet, report error */ - if (*sp != NULL) { + if (sp != NULL) { /* Loop detection, check if ipsec processing already done */ - KASSERT((*sp)->req != NULL, ("ip_output: no ipsec request")); + KASSERT(sp->req != NULL, ("ip_output: no ipsec request")); for (mtag = m_tag_first(*m); mtag != NULL; mtag = m_tag_next(*m, mtag)) { if (mtag->m_tag_cookie != MTAG_ABI_COMPAT) @@ -263,12 +262,12 @@ ip6_ipsec_output(struct mbuf **m, struct * an SA; e.g. on first reference. If it occurs, * then we let ipsec4_process_packet do its thing. */ - if ((*sp)->req->sav == NULL) + if (sp->req->sav == NULL) break; tdbi = (struct tdb_ident *)(mtag + 1); - if (tdbi->spi == (*sp)->req->sav->spi && - tdbi->proto == (*sp)->req->sav->sah->saidx.proto && - bcmp(&tdbi->dst, &(*sp)->req->sav->sah->saidx.dst, + if (tdbi->spi == sp->req->sav->spi && + tdbi->proto == sp->req->sav->sah->saidx.proto && + bcmp(&tdbi->dst, &sp->req->sav->sah->saidx.dst, sizeof (union sockaddr_union)) == 0) { /* * No IPsec processing is needed, free @@ -277,7 +276,7 @@ ip6_ipsec_output(struct mbuf **m, struct * NB: null pointer to avoid free at * done: below. */ - KEY_FREESP(sp), *sp = NULL; + KEY_FREESP(&sp), sp = NULL; goto done; } } @@ -285,16 +284,37 @@ ip6_ipsec_output(struct mbuf **m, struct /* * Do delayed checksums now because we send before * this is done in the normal processing path. - * For IPv6 we do delayed checksums in ip6_output.c. */ #ifdef INET if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { - ipseclog((LOG_DEBUG, - "%s: we do not support IPv4 over IPv6", __func__)); in_delayed_cksum(*m); (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } #endif + if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { + in6_delayed_cksum(*m, (*m)->m_pkthdr.len - sizeof(struct ip6_hdr), + sizeof(struct ip6_hdr)); + (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; + } +#ifdef SCTP + if ((*m)->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { + sctp_delayed_cksum(*m, sizeof(struct ip6_hdr)); + (*m)->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; + } +#endif + + /* NB: callee frees mbuf */ + *error = ipsec6_process_packet(*m, sp->req); + + if (*error == EJUSTRETURN) { + /* + * We had a SP with a level of 'use' and no SA. We + * will just continue to process the packet without + * IPsec processing. + */ + *error = 0; + goto done; + } /* * Preserve KAME behaviour: ENOENT can be returned @@ -305,7 +325,7 @@ ip6_ipsec_output(struct mbuf **m, struct */ if (*error == ENOENT) *error = 0; - goto do_ipsec; + goto reinjected; } else { /* sp == NULL */ if (*error != 0) { /* @@ -322,10 +342,16 @@ ip6_ipsec_output(struct mbuf **m, struct } } done: + if (sp != NULL) + KEY_FREESP(&sp); return 0; -do_ipsec: +reinjected: + if (sp != NULL) + KEY_FREESP(&sp); return -1; bad: + if (sp != NULL) + KEY_FREESP(&sp); return 1; #endif /* IPSEC */ return 0; Modified: stable/10/sys/netinet6/ip6_ipsec.h ============================================================================== --- stable/10/sys/netinet6/ip6_ipsec.h Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netinet6/ip6_ipsec.h Wed Nov 5 09:23:29 2014 (r274132) @@ -36,7 +36,7 @@ int ip6_ipsec_filtertunnel(struct mbuf * int ip6_ipsec_fwd(struct mbuf *); int ip6_ipsec_input(struct mbuf *, int); int ip6_ipsec_output(struct mbuf **, struct inpcb *, int *, int *, - struct ifnet **, struct secpolicy **sp); + struct ifnet **); #if 0 int ip6_ipsec_mtu(struct mbuf *); #endif Modified: stable/10/sys/netinet6/ip6_output.c ============================================================================== --- stable/10/sys/netinet6/ip6_output.c Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netinet6/ip6_output.c Wed Nov 5 09:23:29 2014 (r274132) @@ -184,7 +184,7 @@ static int copypktopts(struct ip6_pktopt }\ } while (/*CONSTCOND*/ 0) -static void +void in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset) { u_short csum; @@ -248,15 +248,7 @@ ip6_output(struct mbuf *m0, struct ip6_p u_int32_t zone; struct route_in6 *ro_pmtu = NULL; int hdrsplit = 0; - int needipsec = 0; int sw_csum, tso; -#ifdef IPSEC - struct ipsec_output_state state; - struct ip6_rthdr *rh = NULL; - int needipsectun = 0; - int segleft_org = 0; - struct secpolicy *sp = NULL; -#endif /* IPSEC */ struct m_tag *fwd_tag = NULL; ip6 = mtod(m, struct ip6_hdr *); @@ -298,26 +290,12 @@ ip6_output(struct mbuf *m0, struct ip6_p * IPSec checking which handles several cases. * FAST IPSEC: We re-injected the packet. */ - switch(ip6_ipsec_output(&m, inp, &flags, &error, &ifp, &sp)) + switch(ip6_ipsec_output(&m, inp, &flags, &error, &ifp)) { case 1: /* Bad packet */ goto freehdrs; - case -1: /* Do IPSec */ - needipsec = 1; - /* - * Do delayed checksums now, as we may send before returning. - */ - if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { - plen = m->m_pkthdr.len - sizeof(*ip6); - in6_delayed_cksum(m, plen, sizeof(struct ip6_hdr)); - m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; - } -#ifdef SCTP - if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { - sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); - m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; - } -#endif + case -1: /* IPSec done */ + goto done; case 0: /* No IPSec */ default: break; @@ -337,15 +315,15 @@ ip6_output(struct mbuf *m0, struct ip6_p optlen += exthdrs.ip6e_rthdr->m_len; unfragpartlen = optlen + sizeof(struct ip6_hdr); - /* NOTE: we don't add AH/ESP length here. do that later. */ + /* NOTE: we don't add AH/ESP length here (done in ip6_ipsec_output) */ if (exthdrs.ip6e_dest2) optlen += exthdrs.ip6e_dest2->m_len; /* - * If we need IPsec, or there is at least one extension header, + * If there is at least one extension header, * separate IP6 header from the payload. */ - if ((needipsec || optlen) && !hdrsplit) { + if (optlen && !hdrsplit) { if ((error = ip6_splithdr(m, &exthdrs)) != 0) { m = NULL; goto freehdrs; @@ -420,72 +398,6 @@ ip6_output(struct mbuf *m0, struct ip6_p MAKE_CHAIN(exthdrs.ip6e_rthdr, mprev, nexthdrp, IPPROTO_ROUTING); -#ifdef IPSEC - if (!needipsec) - goto skip_ipsec2; - - /* - * pointers after IPsec headers are not valid any more. - * other pointers need a great care too. - * (IPsec routines should not mangle mbufs prior to AH/ESP) - */ - exthdrs.ip6e_dest2 = NULL; - - if (exthdrs.ip6e_rthdr) { - rh = mtod(exthdrs.ip6e_rthdr, struct ip6_rthdr *); - segleft_org = rh->ip6r_segleft; - rh->ip6r_segleft = 0; - } - - bzero(&state, sizeof(state)); - state.m = m; - error = ipsec6_output_trans(&state, nexthdrp, mprev, sp, flags, - &needipsectun); - m = state.m; - if (error == EJUSTRETURN) { - /* - * We had a SP with a level of 'use' and no SA. We - * will just continue to process the packet without - * IPsec processing. - */ - ; - } else if (error) { - /* mbuf is already reclaimed in ipsec6_output_trans. */ - m = NULL; - switch (error) { - case EHOSTUNREACH: - case ENETUNREACH: - case EMSGSIZE: - case ENOBUFS: - case ENOMEM: - break; - default: - printf("[%s:%d] (ipsec): error code %d\n", - __func__, __LINE__, error); - /* FALLTHROUGH */ - case ENOENT: - /* don't show these error codes to the user */ - error = 0; - break; - } - goto bad; - } else if (!needipsectun) { - /* - * In the FAST IPSec case we have already - * re-injected the packet and it has been freed - * by the ipsec_done() function. So, just clean - * up after ourselves. - */ - m = NULL; - goto done; - } - if (exthdrs.ip6e_rthdr) { - /* ah6_output doesn't modify mbuf chain */ - rh->ip6r_segleft = segleft_org; - } -skip_ipsec2:; -#endif /* IPSEC */ - /* * If there is a routing header, discard the packet. */ @@ -551,77 +463,6 @@ again: ip6->ip6_hlim = V_ip6_defmcasthlim; } -#ifdef IPSEC - /* - * We may re-inject packets into the stack here. - */ - if (needipsec && needipsectun) { - struct ipsec_output_state state; - - /* - * All the extension headers will become inaccessible - * (since they can be encrypted). - * Don't panic, we need no more updates to extension headers - * on inner IPv6 packet (since they are now encapsulated). - * - * IPv6 [ESP|AH] IPv6 [extension headers] payload - */ - bzero(&exthdrs, sizeof(exthdrs)); - exthdrs.ip6e_ip6 = m; - - bzero(&state, sizeof(state)); - state.m = m; - state.ro = (struct route *)ro; - state.dst = (struct sockaddr *)dst; - - error = ipsec6_output_tunnel(&state, sp, flags); - - m = state.m; - ro = (struct route_in6 *)state.ro; - dst = (struct sockaddr_in6 *)state.dst; - if (error == EJUSTRETURN) { - /* - * We had a SP with a level of 'use' and no SA. We - * will just continue to process the packet without - * IPsec processing. - */ - ; - } else if (error) { - /* mbuf is already reclaimed in ipsec6_output_tunnel. */ - m0 = m = NULL; - m = NULL; - switch (error) { - case EHOSTUNREACH: - case ENETUNREACH: - case EMSGSIZE: - case ENOBUFS: - case ENOMEM: - break; - default: - printf("[%s:%d] (ipsec): error code %d\n", - __func__, __LINE__, error); - /* FALLTHROUGH */ - case ENOENT: - /* don't show these error codes to the user */ - error = 0; - break; - } - goto bad; - } else { - /* - * In the FAST IPSec case we have already - * re-injected the packet and it has been freed - * by the ipsec_done() function. So, just clean - * up after ourselves. - */ - m = NULL; - goto done; - } - - exthdrs.ip6e_ip6 = m; - } -#endif /* IPSEC */ - /* adjust pointer */ ip6 = mtod(m, struct ip6_hdr *); @@ -1182,11 +1023,6 @@ done: RO_RTFREE(ro); if (ro_pmtu == &ip6route) RO_RTFREE(ro_pmtu); -#ifdef IPSEC - if (sp != NULL) - KEY_FREESP(&sp); -#endif - return (error); freehdrs: Modified: stable/10/sys/netinet6/ip6_var.h ============================================================================== --- stable/10/sys/netinet6/ip6_var.h Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netinet6/ip6_var.h Wed Nov 5 09:23:29 2014 (r274132) @@ -456,6 +456,7 @@ int in6_selectroute_fib(struct sockaddr_ struct rtentry **, u_int); u_int32_t ip6_randomid(void); u_int32_t ip6_randomflowlabel(void); +void in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset); #endif /* _KERNEL */ #endif /* !_NETINET6_IP6_VAR_H_ */ Modified: stable/10/sys/netipsec/ipsec6.h ============================================================================== --- stable/10/sys/netipsec/ipsec6.h Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netipsec/ipsec6.h Wed Nov 5 09:23:29 2014 (r274132) @@ -76,6 +76,7 @@ extern int ipsec6_output_trans __P((stru struct mbuf *, struct secpolicy *, int, int *)); extern int ipsec6_output_tunnel __P((struct ipsec_output_state *, struct secpolicy *, int)); +extern int ipsec6_process_packet(struct mbuf *, struct ipsecrequest *); #endif /*_KERNEL*/ #endif /*_NETIPSEC_IPSEC6_H_*/ Modified: stable/10/sys/netipsec/ipsec_input.c ============================================================================== --- stable/10/sys/netipsec/ipsec_input.c Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netipsec/ipsec_input.c Wed Nov 5 09:23:29 2014 (r274132) @@ -295,7 +295,7 @@ int ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int protoff, struct m_tag *mt) { - int prot, af, sproto; + int prot, af, sproto, isr_prot; struct ip *ip; struct m_tag *mtag; struct tdb_ident *tdbi; @@ -349,20 +349,34 @@ ipsec4_common_input_cb(struct mbuf *m, s } prot = ip->ip_p; -#ifdef notyet +#ifdef DEV_ENC + encif->if_ipackets++; + encif->if_ibytes += m->m_pkthdr.len; + + /* + * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP + * packet later after it has been decapsulated. + */ + ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_BEFORE); + + if (prot != IPPROTO_IPIP) + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) + return (error); +#endif /* DEV_ENC */ + /* IP-in-IP encapsulation */ - if (prot == IPPROTO_IPIP) { - struct ip ipn; + if (prot == IPPROTO_IPIP && + saidx->mode != IPSEC_MODE_TRANSPORT) { if (m->m_pkthdr.len - skip < sizeof(struct ip)) { IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } - /* ipn will now contain the inner IPv4 header */ - m_copydata(m, ip->ip_hl << 2, sizeof(struct ip), - (caddr_t) &ipn); + /* enc0: strip outer IPv4 header */ + m_striphdr(m, 0, ip->ip_hl << 2); +#ifdef notyet /* XXX PROXY address isn't recorded in SAH */ /* * Check that the inner source address is the same as @@ -388,21 +402,21 @@ ipsec4_common_input_cb(struct mbuf *m, s error = EACCES; goto bad; } +#endif /* notyet */ } #ifdef INET6 /* IPv6-in-IP encapsulation. */ - if (prot == IPPROTO_IPV6) { - struct ip6_hdr ip6n; + if (prot == IPPROTO_IPV6 && + saidx->mode != IPSEC_MODE_TRANSPORT) { if (m->m_pkthdr.len - skip < sizeof(struct ip6_hdr)) { IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } - /* ip6n will now contain the inner IPv6 header. */ - m_copydata(m, ip->ip_hl << 2, sizeof(struct ip6_hdr), - (caddr_t) &ip6n); - + /* enc0: strip IPv4 header, keep IPv6 header only */ + m_striphdr(m, 0, ip->ip_hl << 2); +#ifdef notyet /* * Check that the inner source address is the same as * the proxy address, if available. @@ -426,9 +440,9 @@ ipsec4_common_input_cb(struct mbuf *m, s error = EACCES; goto bad; } +#endif /* notyet */ } #endif /* INET6 */ -#endif /*XXX*/ /* * Record what we've done to the packet (under what SA it was @@ -464,25 +478,50 @@ ipsec4_common_input_cb(struct mbuf *m, s key_sa_recordxfer(sav, m); /* record data transfer */ + /* + * In transport mode requeue decrypted mbuf back to IPv4 protocol + * handler. This is necessary to correctly expose rcvif. + */ + if (saidx->mode == IPSEC_MODE_TRANSPORT) + prot = IPPROTO_IPIP; #ifdef DEV_ENC - encif->if_ipackets++; - encif->if_ibytes += m->m_pkthdr.len; - /* - * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP - * packet later after it has been decapsulated. + * Pass the mbuf to enc0 for bpf and pfil. */ - ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_BEFORE); - - if (prot != IPPROTO_IPIP) - if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) - return (error); + if (prot == IPPROTO_IPIP) + ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_AFTER); +#ifdef INET6 + if (prot == IPPROTO_IPV6) + ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_AFTER); #endif + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_AFTER)) != 0) + return (error); +#endif /* DEV_ENC */ + /* * Re-dispatch via software interrupt. */ - if ((error = netisr_queue_src(NETISR_IP, (uintptr_t)sav->spi, m))) { + + switch (prot) { + case IPPROTO_IPIP: + isr_prot = NETISR_IP; + break; +#ifdef INET6 + case IPPROTO_IPV6: + isr_prot = NETISR_IPV6; + break; +#endif + default: + DPRINTF(("%s: cannot handle inner ip proto %d\n", + __func__, prot)); + IPSEC_ISTAT(sproto, nopf); + error = EPFNOSUPPORT; + goto bad; + } + + error = netisr_queue_src(isr_prot, (uintptr_t)sav->spi, m); + if (error) { IPSEC_ISTAT(sproto, qfull); DPRINTF(("%s: queue full; proto %u packet dropped\n", __func__, sproto)); @@ -605,20 +644,34 @@ ipsec6_common_input_cb(struct mbuf *m, s prot = 0; m_copydata(m, protoff, 1, (unsigned char *) &prot); -#ifdef notyet +#ifdef DEV_ENC + encif->if_ipackets++; + encif->if_ibytes += m->m_pkthdr.len; + + /* + * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP + * packet later after it has been decapsulated. + */ + ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_BEFORE); + + /* XXX-BZ does not make sense. */ + if (prot != IPPROTO_IPIP) + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) + return (error); +#endif /* DEV_ENC */ + #ifdef INET /* IP-in-IP encapsulation */ if (prot == IPPROTO_IPIP) { - struct ip ipn; - if (m->m_pkthdr.len - skip < sizeof(struct ip)) { IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } /* ipn will now contain the inner IPv4 header */ - m_copydata(m, skip, sizeof(struct ip), (caddr_t) &ipn); - + m_striphdr(m, 0, skip); + skip = 0; +#ifdef notyet /* * Check that the inner source address is the same as * the proxy address, if available. @@ -641,22 +694,20 @@ ipsec6_common_input_cb(struct mbuf *m, s error = EACCES; goto bad; } +#endif /* notyet */ } #endif /* INET */ - /* IPv6-in-IP encapsulation */ if (prot == IPPROTO_IPV6) { - struct ip6_hdr ip6n; - if (m->m_pkthdr.len - skip < sizeof(struct ip6_hdr)) { IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } /* ip6n will now contain the inner IPv6 header. */ - m_copydata(m, skip, sizeof(struct ip6_hdr), - (caddr_t) &ip6n); - + m_striphdr(m, 0, skip); + skip = 0; +#ifdef notyet /* * Check that the inner source address is the same as * the proxy address, if available. @@ -680,8 +731,8 @@ ipsec6_common_input_cb(struct mbuf *m, s error = EACCES; goto bad; } +#endif /* notyet */ } -#endif /*XXX*/ /* * Record what we've done to the packet (under what SA it was @@ -719,23 +770,22 @@ ipsec6_common_input_cb(struct mbuf *m, s key_sa_recordxfer(sav, m); #ifdef DEV_ENC - encif->if_ipackets++; - encif->if_ibytes += m->m_pkthdr.len; - /* - * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP - * packet later after it has been decapsulated. + * Pass the mbuf to enc0 for bpf and pfil. */ - ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_BEFORE); - - /* XXX-BZ does not make sense. */ - if (prot != IPPROTO_IPIP) - if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) - return (error); +#ifdef INET + if (prot == IPPROTO_IPIP) + ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_AFTER); #endif + if (prot == IPPROTO_IPV6) + ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_AFTER); + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_AFTER)) != 0) + return (error); +#endif /* DEV_ENC */ /* Retrieve new protocol */ - m_copydata(m, protoff, sizeof(u_int8_t), (caddr_t) &nxt8); + /* We have stripped the IP6 header from the mbuf, we have to use the backuped proto value instead */ + nxt8 = prot; /* * See the end of ip6_input for this logic. Modified: stable/10/sys/netipsec/ipsec_output.c ============================================================================== --- stable/10/sys/netipsec/ipsec_output.c Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netipsec/ipsec_output.c Wed Nov 5 09:23:29 2014 (r274132) @@ -176,8 +176,7 @@ ipsec_process_done(struct mbuf *m, struc #ifdef INET6 case AF_INET6: /* XXX */ - ipsec6_output_trans() - ipsec6_output_tunnel() + return ipsec6_process_packet(m, isr->next); /* NOTREACHED */ #endif /* INET6 */ #endif @@ -498,9 +497,11 @@ ipsec4_process_packet( goto bad; } ip = mtod(m, struct ip *); - ip->ip_len = htons(m->m_pkthdr.len); - ip->ip_sum = 0; - ip->ip_sum = in_cksum(m, ip->ip_hl << 2); + if (ip->ip_v == IPVERSION) { + ip->ip_len = htons(m->m_pkthdr.len); + ip->ip_sum = 0; + ip->ip_sum = in_cksum(m, ip->ip_hl << 2); + } /* Encapsulate the packet */ error = ipip_output(m, isr, &mp, 0, 0); @@ -542,7 +543,7 @@ ipsec4_process_packet( #ifdef DEV_ENC /* pass the mbuf to enc0 for bpf processing */ - ipsec_bpf(m, sav, AF_INET, ENC_OUT|ENC_AFTER); + ipsec_bpf(m, sav, sav->sah->saidx.dst.sa.sa_family, ENC_OUT|ENC_AFTER); /* pass the mbuf to enc0 for packet filtering */ if ((error = ipsec_filter(&m, PFIL_OUT, ENC_OUT|ENC_AFTER)) != 0) goto bad; @@ -559,9 +560,26 @@ ipsec4_process_packet( * for reclaiming their resources. */ if (sav->tdb_xform->xf_type != XF_IP4) { - ip = mtod(m, struct ip *); - i = ip->ip_hl << 2; - off = offsetof(struct ip, ip_p); + union sockaddr_union *dst = &sav->sah->saidx.dst; + switch(dst->sa.sa_family) { + case AF_INET: + ip = mtod(m, struct ip *); + i = ip->ip_hl << 2; + off = offsetof(struct ip, ip_p); + break; +#ifdef INET6 + case AF_INET6: + i = sizeof(struct ip6_hdr); + off = offsetof(struct ip6_hdr, ip6_nxt); + break; +#endif /* INET6 */ + default: + DPRINTF(("%s: unsupported protocol family %u\n", + __func__, dst->sa.sa_family)); + error = EPFNOSUPPORT; + IPSECSTAT_INC(ips_out_inval); + goto bad; + } error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off); } else { error = ipsec_process_done(m, isr); @@ -577,224 +595,50 @@ bad: } #endif -#ifdef INET6 -/* - * Chop IP6 header from the payload. - */ -static struct mbuf * -ipsec6_splithdr(struct mbuf *m) -{ - struct mbuf *mh; - struct ip6_hdr *ip6; - int hlen; - - IPSEC_ASSERT(m->m_len >= sizeof (struct ip6_hdr), - ("first mbuf too short, len %u", m->m_len)); - ip6 = mtod(m, struct ip6_hdr *); - hlen = sizeof(struct ip6_hdr); - if (m->m_len > hlen) { - MGETHDR(mh, M_NOWAIT, MT_DATA); - if (!mh) { - m_freem(m); - return NULL; - } - M_MOVE_PKTHDR(mh, m); - MH_ALIGN(mh, hlen); - m->m_len -= hlen; - m->m_data += hlen; - mh->m_next = m; - m = mh; - m->m_len = hlen; - bcopy((caddr_t)ip6, mtod(m, caddr_t), hlen); - } else if (m->m_len < hlen) { - m = m_pullup(m, hlen); - if (!m) - return NULL; - } - return m; -} - -/* - * IPsec output logic for IPv6, transport mode. - */ -int -ipsec6_output_trans( - struct ipsec_output_state *state, - u_char *nexthdrp, - struct mbuf *mprev, - struct secpolicy *sp, - int flags, - int *tun) -{ - struct ipsecrequest *isr; - struct secasindex saidx; - int error = 0; - struct mbuf *m; - - IPSEC_ASSERT(state != NULL, ("null state")); - IPSEC_ASSERT(state->m != NULL, ("null m")); - IPSEC_ASSERT(nexthdrp != NULL, ("null nexthdrp")); - IPSEC_ASSERT(mprev != NULL, ("null mprev")); - IPSEC_ASSERT(sp != NULL, ("null sp")); - IPSEC_ASSERT(tun != NULL, ("null tun")); - - KEYDEBUG(KEYDEBUG_IPSEC_DATA, - printf("%s: applied SP\n", __func__); - kdebug_secpolicy(sp)); - - isr = sp->req; - if (isr->saidx.mode == IPSEC_MODE_TUNNEL) { - /* the rest will be handled by ipsec6_output_tunnel() */ - *tun = 1; /* need tunnel-mode processing */ - return 0; - } - - *tun = 0; - m = state->m; - - IPSECREQUEST_LOCK(isr); /* insure SA contents don't change */ - isr = ipsec_nextisr(m, isr, AF_INET6, &saidx, &error); - if (isr == NULL) { - if (error != 0) { -#ifdef notdef - /* XXX should notification be done for all errors ? */ - /* - * Notify the fact that the packet is discarded - * to ourselves. I believe this is better than - * just silently discarding. (jinmei@kame.net) - * XXX: should we restrict the error to TCP packets? - * XXX: should we directly notify sockets via - * pfctlinputs? - */ - icmp6_error(m, ICMP6_DST_UNREACH, - ICMP6_DST_UNREACH_ADMIN, 0); - m = NULL; /* NB: icmp6_error frees mbuf */ -#endif - goto bad; - } - return EJUSTRETURN; - } - - error = (*isr->sav->tdb_xform->xf_output)(m, isr, NULL, - sizeof (struct ip6_hdr), - offsetof(struct ip6_hdr, - ip6_nxt)); - IPSECREQUEST_UNLOCK(isr); - return error; -bad: - if (isr) - IPSECREQUEST_UNLOCK(isr); - if (m) - m_freem(m); - state->m = NULL; - return error; -} +#ifdef INET6 static int -ipsec6_encapsulate(struct mbuf *m, struct secasvar *sav) +in6_sa_equal_addrwithscope(const struct sockaddr_in6 *sa, const struct in6_addr *ia) { - struct ip6_hdr *oip6; - struct ip6_hdr *ip6; - size_t plen; + struct in6_addr ia2; - /* can't tunnel between different AFs */ - if (sav->sah->saidx.src.sa.sa_family != AF_INET6 || - sav->sah->saidx.dst.sa.sa_family != AF_INET6) { - m_freem(m); - return EINVAL; - } - IPSEC_ASSERT(m->m_len == sizeof (struct ip6_hdr), - ("mbuf wrong size; len %u", m->m_len)); - - - /* - * grow the mbuf to accomodate the new IPv6 header. - */ - plen = m->m_pkthdr.len; - if (M_LEADINGSPACE(m->m_next) < sizeof(struct ip6_hdr)) { - struct mbuf *n; - MGET(n, M_NOWAIT, MT_DATA); - if (!n) { - m_freem(m); - return ENOBUFS; - } - n->m_len = sizeof(struct ip6_hdr); - n->m_next = m->m_next; - m->m_next = n; - m->m_pkthdr.len += sizeof(struct ip6_hdr); - oip6 = mtod(n, struct ip6_hdr *); - } else { - m->m_next->m_len += sizeof(struct ip6_hdr); - m->m_next->m_data -= sizeof(struct ip6_hdr); - m->m_pkthdr.len += sizeof(struct ip6_hdr); - oip6 = mtod(m->m_next, struct ip6_hdr *); - } - ip6 = mtod(m, struct ip6_hdr *); - bcopy((caddr_t)ip6, (caddr_t)oip6, sizeof(struct ip6_hdr)); - - /* Fake link-local scope-class addresses */ - if (IN6_IS_SCOPE_LINKLOCAL(&oip6->ip6_src)) - oip6->ip6_src.s6_addr16[1] = 0; - if (IN6_IS_SCOPE_LINKLOCAL(&oip6->ip6_dst)) - oip6->ip6_dst.s6_addr16[1] = 0; - - /* construct new IPv6 header. see RFC 2401 5.1.2.2 */ - /* ECN consideration. */ - ip6_ecn_ingress(V_ip6_ipsec_ecn, &ip6->ip6_flow, &oip6->ip6_flow); - if (plen < IPV6_MAXPACKET - sizeof(struct ip6_hdr)) - ip6->ip6_plen = htons(plen); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Wed Nov 5 09:33:03 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CACB3BE9; Wed, 5 Nov 2014 09:33:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6E8CBD3; Wed, 5 Nov 2014 09:33:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA59X36B060514; Wed, 5 Nov 2014 09:33:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA59X3oq060510; Wed, 5 Nov 2014 09:33:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411050933.sA59X3oq060510@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Nov 2014 09:33:03 +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: r274133 - in stable/9/sys: net netinet 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.18-1 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, 05 Nov 2014 09:33:03 -0000 Author: ae Date: Wed Nov 5 09:33:02 2014 New Revision: 274133 URL: https://svnweb.freebsd.org/changeset/base/274133 Log: Revert r273860. It breaks IPSEC in tunnel mode and needs more revisions to be merged before it will work as expected. Modified: stable/9/sys/net/if_gif.c stable/9/sys/netinet/ip_gre.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/if_gif.c ============================================================================== --- stable/9/sys/net/if_gif.c Wed Nov 5 09:23:29 2014 (r274132) +++ stable/9/sys/net/if_gif.c Wed Nov 5 09:33:02 2014 (r274133) @@ -500,7 +500,6 @@ gif_input(m, af, ifp) } sc = ifp->if_softc; m->m_pkthdr.rcvif = ifp; - m->m_flags &= ~(M_PROTOFLAGS); #ifdef MAC mac_ifnet_create_mbuf(ifp, m); Modified: stable/9/sys/netinet/ip_gre.c ============================================================================== --- stable/9/sys/netinet/ip_gre.c Wed Nov 5 09:23:29 2014 (r274132) +++ stable/9/sys/netinet/ip_gre.c Wed Nov 5 09:33:02 2014 (r274133) @@ -211,7 +211,7 @@ gre_input2(struct mbuf *m ,int hlen, u_c } m->m_pkthdr.rcvif = GRE2IFP(sc); - m->m_flags &= ~(M_PROTOFLAGS); + netisr_queue(isr, m); /* Packet is done, no further processing needed. */ From owner-svn-src-stable@FreeBSD.ORG Wed Nov 5 16:24:58 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAD91822; Wed, 5 Nov 2014 16:24:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95CF6282; Wed, 5 Nov 2014 16:24:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5GOwb0059676; Wed, 5 Nov 2014 16:24:58 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5GOvW5059672; Wed, 5 Nov 2014 16:24:57 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201411051624.sA5GOvW5059672@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 5 Nov 2014 16:24: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: r274139 - in stable/10: . share/man/man9 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.18-1 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, 05 Nov 2014 16:24:58 -0000 Author: lwhsu (ports committer) Date: Wed Nov 5 16:24:57 2014 New Revision: 274139 URL: https://svnweb.freebsd.org/changeset/base/274139 Log: MFC r271992 Reflect the chanages in sleepqueue.h and subr_sleepqueue.c - Priority argument is introduced to sleepq_*wait* in r177085 - sleepq_calc_signal_retval is removed from implementation - sleepq_catch_signals is internal now MFC r272475 - Bump .Dd Approved by: kevlo Modified: stable/10/ObsoleteFiles.inc stable/10/share/man/man9/Makefile stable/10/share/man/man9/sleepqueue.9 stable/10/sys/sys/sleepqueue.h Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Wed Nov 5 16:13:42 2014 (r274138) +++ stable/10/ObsoleteFiles.inc Wed Nov 5 16:24:57 2014 (r274139) @@ -42,6 +42,9 @@ OLD_FILES+=usr/share/openssl/man/man3/CMS_sign_add1_signer.3.gz # 20141010: rc.d/kerberos removed OLD_FILES+=etc/rc.d/kerberos +# 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed +OLD_FILES+=usr/share/man/man9/sleepq_calc_signal_retval.9.gz +OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz # 20140917: hv_kvpd rc.d script removed in favor of devd configuration OLD_FILES+=etc/rc.d/hv_kvpd # 20140814: libopie version bump Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Wed Nov 5 16:13:42 2014 (r274138) +++ stable/10/share/man/man9/Makefile Wed Nov 5 16:24:57 2014 (r274139) @@ -1238,8 +1238,6 @@ MLINKS+=sleepqueue.9 init_sleepqueues.9 sleepqueue.9 sleepq_add.9 \ sleepqueue.9 sleepq_alloc.9 \ sleepqueue.9 sleepq_broadcast.9 \ - sleepqueue.9 sleepq_calc_signal_retval.9 \ - sleepqueue.9 sleepq_catch_signals.9 \ sleepqueue.9 sleepq_free.9 \ sleepqueue.9 sleepq_lookup.9 \ sleepqueue.9 sleepq_release.9 \ Modified: stable/10/share/man/man9/sleepqueue.9 ============================================================================== --- stable/10/share/man/man9/sleepqueue.9 Wed Nov 5 16:13:42 2014 (r274138) +++ stable/10/share/man/man9/sleepqueue.9 Wed Nov 5 16:24:57 2014 (r274139) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2013 +.Dd September 22, 2014 .Dt SLEEPQUEUE 9 .Os .Sh NAME @@ -32,8 +32,6 @@ .Nm sleepq_add , .Nm sleepq_alloc , .Nm sleepq_broadcast , -.Nm sleepq_calc_signal_retval , -.Nm sleepq_catch_signals , .Nm sleepq_free , .Nm sleepq_lock , .Nm sleepq_lookup , @@ -62,10 +60,6 @@ .Fn sleepq_alloc "void" .Ft int .Fn sleepq_broadcast "void *wchan" "int flags" "int pri" "int queue" -.Ft int -.Fn sleepq_calc_signal_retval "int sig" -.Ft int -.Fn sleepq_catch_signals "void *wchan" .Ft void .Fn sleepq_free "struct sleepqueue *sq" .Ft struct sleepqueue * @@ -86,15 +80,15 @@ .Ft u_int .Fn sleepq_sleepcnt "void *wchan" "int queue" .Ft int -.Fn sleepq_timedwait "void *wchan" +.Fn sleepq_timedwait "void *wchan" "int pri" .Ft int -.Fn sleepq_timedwait_sig "void *wchan" "int signal_caught" +.Fn sleepq_timedwait_sig "void *wchan" "int pri" .Ft int .Fn sleepq_type "void *wchan" .Ft void -.Fn sleepq_wait "void *wchan" +.Fn sleepq_wait "void *wchan" "int pri" .Ft int -.Fn sleepq_wait_sig "void *wchan" +.Fn sleepq_wait_sig "void *wchan" "int pri" .Sh DESCRIPTION Sleep queues provide a mechanism for suspending execution of a thread until some condition is met. @@ -252,17 +246,6 @@ allows to pass additional .Fn callout_reset_sbt flags. .Pp -The current thread may be marked interruptible by calling -.Fn sleepq_catch_signals -with -.Fa wchan -set to the wait channel. -This function returns a signal number if there are any pending signals for -the current thread and 0 if there is not a pending signal. -The sleep queue chain associated with argument -.Fa wchan -should have been locked by a prior call to -.Fn sleepq_lock . .Pp Once the thread is ready to suspend, one of the wait functions is called to put the current thread to sleep @@ -289,12 +272,9 @@ The sleep queue chain associated with ar needs to have been locked with a prior call to .Fn sleepq_lock . The -.Fa signal_caught -parameter to -.Fn sleepq_timedwait_sig -specifies if a previous call to -.Fn sleepq_catch_signals -found a pending signal. +.Fa pri +argument is used to set the priority of the thread when it is awakened. +If it is set to zero, the thread's priority is left alone. .Pp When the thread is resumed, the wait functions return a non-zero value if the thread was awakened due to @@ -304,20 +284,6 @@ If the sleep timed out, then is returned. If the sleep was interrupted by something other than a signal, then some other return value will be returned. -If zero is returned after resuming from an interruptible sleep, -then -.Fn sleepq_calc_signal_retval -should be called to determine if the sleep was interrupted by a signal. -If so, -.Fn sleepq_calc_signal_retval -returns -.Er ERESTART -if the interrupting signal is restartable and -.Er EINTR -otherwise. -If the sleep was not interrupted by a signal, -.Fn sleepq_calc_signal_retval -will return 0. .Pp A sleeping thread is normally resumed by the .Fn sleepq_broadcast Modified: stable/10/sys/sys/sleepqueue.h ============================================================================== --- stable/10/sys/sys/sleepqueue.h Wed Nov 5 16:13:42 2014 (r274138) +++ stable/10/sys/sys/sleepqueue.h Wed Nov 5 16:24:57 2014 (r274139) @@ -46,13 +46,6 @@ * call sleepq_set_timeout() after sleepq_add() to setup a timeout. It * should then use one of the sleepq_timedwait() functions to block. * - * If the thread wants the sleep to be interruptible by signals, it can - * call sleepq_catch_signals() after sleepq_add(). It should then use - * one of the sleepq_wait_sig() functions to block. After the thread has - * been resumed, it should call sleepq_calc_signal_retval() to determine - * if it should return EINTR or ERESTART passing in the value returned from - * the earlier call to sleepq_catch_signals(). - * * A thread is normally resumed from a sleep queue by either the * sleepq_signal() or sleepq_broadcast() functions. Sleepq_signal() wakes * the thread with the highest priority that is sleeping on the specified From owner-svn-src-stable@FreeBSD.ORG Wed Nov 5 16:26:25 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70D72961; Wed, 5 Nov 2014 16:26:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B53328D; Wed, 5 Nov 2014 16:26:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5GQPlj059963; Wed, 5 Nov 2014 16:26:25 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5GQOFo059959; Wed, 5 Nov 2014 16:26:24 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201411051626.sA5GQOFo059959@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 5 Nov 2014 16:26: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: r274140 - in stable/9: . share/man/man9 sys/sys 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.18-1 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, 05 Nov 2014 16:26:25 -0000 Author: lwhsu (ports committer) Date: Wed Nov 5 16:26:23 2014 New Revision: 274140 URL: https://svnweb.freebsd.org/changeset/base/274140 Log: MFC r271992 Reflect the chanages in sleepqueue.h and subr_sleepqueue.c - Priority argument is introduced to sleepq_*wait* in r177085 - sleepq_calc_signal_retval is removed from implementation - sleepq_catch_signals is internal now MFC r272475 - Bump .Dd Approved by: kevlo Modified: stable/9/ObsoleteFiles.inc (contents, props changed) stable/9/share/man/man9/Makefile stable/9/share/man/man9/sleepqueue.9 stable/9/sys/sys/sleepqueue.h Directory Properties: stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Wed Nov 5 16:24:57 2014 (r274139) +++ stable/9/ObsoleteFiles.inc Wed Nov 5 16:26:23 2014 (r274140) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed +OLD_FILES+=usr/share/man/man9/sleepq_calc_signal_retval.9.gz +OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz # 20140728: Remove an obsolete man page OLD_FILES+=usr/share/man/man9/VOP_GETVOBJECT.9.gz OLD_FILES+=usr/share/man/man9/VOP_CREATEVOBJECT.9.gz Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Wed Nov 5 16:24:57 2014 (r274139) +++ stable/9/share/man/man9/Makefile Wed Nov 5 16:26:23 2014 (r274140) @@ -1205,8 +1205,6 @@ MLINKS+=sleepqueue.9 init_sleepqueues.9 sleepqueue.9 sleepq_add.9 \ sleepqueue.9 sleepq_alloc.9 \ sleepqueue.9 sleepq_broadcast.9 \ - sleepqueue.9 sleepq_calc_signal_retval.9 \ - sleepqueue.9 sleepq_catch_signals.9 \ sleepqueue.9 sleepq_free.9 \ sleepqueue.9 sleepq_lookup.9 \ sleepqueue.9 sleepq_release.9 \ Modified: stable/9/share/man/man9/sleepqueue.9 ============================================================================== --- stable/9/share/man/man9/sleepqueue.9 Wed Nov 5 16:24:57 2014 (r274139) +++ stable/9/share/man/man9/sleepqueue.9 Wed Nov 5 16:26:23 2014 (r274140) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2010 +.Dd September 22, 2014 .Dt SLEEPQUEUE 9 .Os .Sh NAME @@ -32,8 +32,6 @@ .Nm sleepq_add , .Nm sleepq_alloc , .Nm sleepq_broadcast , -.Nm sleepq_calc_signal_retval , -.Nm sleepq_catch_signals , .Nm sleepq_free , .Nm sleepq_lock , .Nm sleepq_lookup , @@ -61,10 +59,6 @@ .Fn sleepq_alloc "void" .Ft int .Fn sleepq_broadcast "void *wchan" "int flags" "int pri" "int queue" -.Ft int -.Fn sleepq_calc_signal_retval "int sig" -.Ft int -.Fn sleepq_catch_signals "void *wchan" .Ft void .Fn sleepq_free "struct sleepqueue *sq" .Ft struct sleepqueue * @@ -82,15 +76,15 @@ .Ft u_int .Fn sleepq_sleepcnt "void *wchan" "int queue" .Ft int -.Fn sleepq_timedwait "void *wchan" +.Fn sleepq_timedwait "void *wchan" "int pri" .Ft int -.Fn sleepq_timedwait_sig "void *wchan" "int signal_caught" +.Fn sleepq_timedwait_sig "void *wchan" "int pri" .Ft int .Fn sleepq_type "void *wchan" .Ft void -.Fn sleepq_wait "void *wchan" +.Fn sleepq_wait "void *wchan" "int pri" .Ft int -.Fn sleepq_wait_sig "void *wchan" +.Fn sleepq_wait_sig "void *wchan" "int pri" .Sh DESCRIPTION Sleep queues provide a mechanism for suspending execution of a thread until some condition is met. @@ -231,17 +225,6 @@ The .Fa timo parameter should specify the timeout value in ticks. .Pp -The current thread may be marked interruptible by calling -.Fn sleepq_catch_signals -with -.Fa wchan -set to the wait channel. -This function returns a signal number if there are any pending signals for -the current thread and 0 if there is not a pending signal. -The sleep queue chain associated with argument -.Fa wchan -should have been locked by a prior call to -.Fn sleepq_lock . .Pp Once the thread is ready to suspend, one of the wait functions is called to put the current thread to sleep @@ -268,12 +251,9 @@ The sleep queue chain associated with ar needs to have been locked with a prior call to .Fn sleepq_lock . The -.Fa signal_caught -parameter to -.Fn sleepq_timedwait_sig -specifies if a previous call to -.Fn sleepq_catch_signals -found a pending signal. +.Fa pri +argument is used to set the priority of the thread when it is awakened. +If it is set to zero, the thread's priority is left alone. .Pp When the thread is resumed, the wait functions return a non-zero value if the thread was awakened due to @@ -283,20 +263,6 @@ If the sleep timed out, then is returned. If the sleep was interrupted by something other than a signal, then some other return value will be returned. -If zero is returned after resuming from an interruptible sleep, -then -.Fn sleepq_calc_signal_retval -should be called to determine if the sleep was interrupted by a signal. -If so, -.Fn sleepq_calc_signal_retval -returns -.Er ERESTART -if the interrupting signal is restartable and -.Er EINTR -otherwise. -If the sleep was not interrupted by a signal, -.Fn sleepq_calc_signal_retval -will return 0. .Pp A sleeping thread is normally resumed by the .Fn sleepq_broadcast Modified: stable/9/sys/sys/sleepqueue.h ============================================================================== --- stable/9/sys/sys/sleepqueue.h Wed Nov 5 16:24:57 2014 (r274139) +++ stable/9/sys/sys/sleepqueue.h Wed Nov 5 16:26:23 2014 (r274140) @@ -46,13 +46,6 @@ * call sleepq_set_timeout() after sleepq_add() to setup a timeout. It * should then use one of the sleepq_timedwait() functions to block. * - * If the thread wants the sleep to be interruptible by signals, it can - * call sleepq_catch_signals() after sleepq_add(). It should then use - * one of the sleepq_wait_sig() functions to block. After the thread has - * been resumed, it should call sleepq_calc_signal_retval() to determine - * if it should return EINTR or ERESTART passing in the value returned from - * the earlier call to sleepq_catch_signals(). - * * A thread is normally resumed from a sleep queue by either the * sleepq_signal() or sleepq_broadcast() functions. Sleepq_signal() wakes * the thread with the highest priority that is sleeping on the specified From owner-svn-src-stable@FreeBSD.ORG Wed Nov 5 16:27:29 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90175AB1; Wed, 5 Nov 2014 16:27:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B1E22C1; Wed, 5 Nov 2014 16:27:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5GRTSo060161; Wed, 5 Nov 2014 16:27:29 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5GRSOh060157; Wed, 5 Nov 2014 16:27:28 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201411051627.sA5GRSOh060157@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 5 Nov 2014 16:27:28 +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: r274141 - in stable/8: . share/man/man9 sys/sys 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.18-1 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, 05 Nov 2014 16:27:29 -0000 Author: lwhsu (ports committer) Date: Wed Nov 5 16:27:27 2014 New Revision: 274141 URL: https://svnweb.freebsd.org/changeset/base/274141 Log: MFC r271992 Reflect the chanages in sleepqueue.h and subr_sleepqueue.c - Priority argument is introduced to sleepq_*wait* in r177085 - sleepq_calc_signal_retval is removed from implementation - sleepq_catch_signals is internal now MFC r272475 - Bump .Dd Approved by: kevlo Modified: stable/8/ObsoleteFiles.inc (contents, props changed) stable/8/share/man/man9/Makefile stable/8/share/man/man9/sleepqueue.9 stable/8/sys/sys/sleepqueue.h Directory Properties: stable/8/share/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Wed Nov 5 16:26:23 2014 (r274140) +++ stable/8/ObsoleteFiles.inc Wed Nov 5 16:27:27 2014 (r274141) @@ -14,6 +14,9 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed +OLD_FILES+=usr/share/man/man9/sleepq_calc_signal_retval.9.gz +OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz # 20130701: vfs_mount.9 removed OLD_FILES+=usr/share/man/man9/vfs_mount.9.gz # 20110915: rename congestion control manpages Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Wed Nov 5 16:26:23 2014 (r274140) +++ stable/8/share/man/man9/Makefile Wed Nov 5 16:27:27 2014 (r274141) @@ -1161,8 +1161,6 @@ MLINKS+=sleepqueue.9 init_sleepqueues.9 sleepqueue.9 sleepq_add.9 \ sleepqueue.9 sleepq_alloc.9 \ sleepqueue.9 sleepq_broadcast.9 \ - sleepqueue.9 sleepq_calc_signal_retval.9 \ - sleepqueue.9 sleepq_catch_signals.9 \ sleepqueue.9 sleepq_free.9 \ sleepqueue.9 sleepq_lookup.9 \ sleepqueue.9 sleepq_release.9 \ Modified: stable/8/share/man/man9/sleepqueue.9 ============================================================================== --- stable/8/share/man/man9/sleepqueue.9 Wed Nov 5 16:26:23 2014 (r274140) +++ stable/8/share/man/man9/sleepqueue.9 Wed Nov 5 16:27:27 2014 (r274141) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2010 +.Dd September 22, 2014 .Dt SLEEPQUEUE 9 .Os .Sh NAME @@ -32,8 +32,6 @@ .Nm sleepq_add , .Nm sleepq_alloc , .Nm sleepq_broadcast , -.Nm sleepq_calc_signal_retval , -.Nm sleepq_catch_signals , .Nm sleepq_free , .Nm sleepq_lock , .Nm sleepq_lookup , @@ -61,10 +59,6 @@ .Fn sleepq_alloc "void" .Ft int .Fn sleepq_broadcast "void *wchan" "int flags" "int pri" "int queue" -.Ft int -.Fn sleepq_calc_signal_retval "int sig" -.Ft int -.Fn sleepq_catch_signals "void *wchan" .Ft void .Fn sleepq_free "struct sleepqueue *sq" .Ft struct sleepqueue * @@ -82,15 +76,15 @@ .Ft u_int .Fn sleepq_sleepcnt "void *wchan" "int queue" .Ft int -.Fn sleepq_timedwait "void *wchan" +.Fn sleepq_timedwait "void *wchan" "int pri" .Ft int -.Fn sleepq_timedwait_sig "void *wchan" "int signal_caught" +.Fn sleepq_timedwait_sig "void *wchan" "int pri" .Ft int .Fn sleepq_type "void *wchan" .Ft void -.Fn sleepq_wait "void *wchan" +.Fn sleepq_wait "void *wchan" "int pri" .Ft int -.Fn sleepq_wait_sig "void *wchan" +.Fn sleepq_wait_sig "void *wchan" "int pri" .Sh DESCRIPTION Sleep queues provide a mechanism for suspending execution of a thread until some condition is met. @@ -231,17 +225,6 @@ The .Fa timo parameter should specify the timeout value in ticks. .Pp -The current thread may be marked interruptible by calling -.Fn sleepq_catch_signals -with -.Fa wchan -set to the wait channel. -This function returns a signal number if there are any pending signals for -the current thread and 0 if there is not a pending signal. -The sleep queue chain associated with argument -.Fa wchan -should have been locked by a prior call to -.Fn sleepq_lock . .Pp Once the thread is ready to suspend, one of the wait functions is called to put the current thread to sleep @@ -268,12 +251,9 @@ The sleep queue chain associated with ar needs to have been locked with a prior call to .Fn sleepq_lock . The -.Fa signal_caught -parameter to -.Fn sleepq_timedwait_sig -specifies if a previous call to -.Fn sleepq_catch_signals -found a pending signal. +.Fa pri +argument is used to set the priority of the thread when it is awakened. +If it is set to zero, the thread's priority is left alone. .Pp When the thread is resumed, the wait functions return a non-zero value if the thread was awakened due to @@ -283,20 +263,6 @@ If the sleep timed out, then is returned. If the sleep was interrupted by something other than a signal, then some other return value will be returned. -If zero is returned after resuming from an interruptible sleep, -then -.Fn sleepq_calc_signal_retval -should be called to determine if the sleep was interrupted by a signal. -If so, -.Fn sleepq_calc_signal_retval -returns -.Er ERESTART -if the interrupting signal is restartable and -.Er EINTR -otherwise. -If the sleep was not interrupted by a signal, -.Fn sleepq_calc_signal_retval -will return 0. .Pp A sleeping thread is normally resumed by the .Fn sleepq_broadcast Modified: stable/8/sys/sys/sleepqueue.h ============================================================================== --- stable/8/sys/sys/sleepqueue.h Wed Nov 5 16:26:23 2014 (r274140) +++ stable/8/sys/sys/sleepqueue.h Wed Nov 5 16:27:27 2014 (r274141) @@ -49,13 +49,6 @@ * call sleepq_set_timeout() after sleepq_add() to setup a timeout. It * should then use one of the sleepq_timedwait() functions to block. * - * If the thread wants to the sleep to be interruptible by signals, it can - * call sleepq_catch_signals() after sleepq_add(). It should then use - * one of the sleepq_wait_sig() functions to block. After the thread has - * been resumed, it should call sleepq_calc_signal_retval() to determine - * if it should return EINTR or ERESTART passing in the value returned from - * the earlier call to sleepq_catch_signals(). - * * A thread is normally resumed from a sleep queue by either the * sleepq_signal() or sleepq_broadcast() functions. Sleepq_signal() wakes * the thread with the highest priority that is sleeping on the specified From owner-svn-src-stable@FreeBSD.ORG Wed Nov 5 23:12:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA2AB765; Wed, 5 Nov 2014 23:12:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B95A85B; Wed, 5 Nov 2014 23:12:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5NCeoS053383; Wed, 5 Nov 2014 23:12:40 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5NCeTK053382; Wed, 5 Nov 2014 23:12:40 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201411052312.sA5NCeTK053382@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 5 Nov 2014 23:12: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: r274150 - stable/10/sys/fs/nfsclient 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.18-1 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, 05 Nov 2014 23:12:40 -0000 Author: rmacklem Date: Wed Nov 5 23:12:39 2014 New Revision: 274150 URL: https://svnweb.freebsd.org/changeset/base/274150 Log: MFC: r273486 Clip the settings for the NFS rsize, wsize mount options to a power of 2. For non-power of 2 settings, intermittent page faults have been reported. Although the bug that causes these page faults/crashes has not been identified, it does not appear to occur when rsize, wsize is a power of 2. Modified: stable/10/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvfsops.c Wed Nov 5 22:50:33 2014 (r274149) +++ stable/10/sys/fs/nfsclient/nfs_clvfsops.c Wed Nov 5 23:12:39 2014 (r274150) @@ -621,17 +621,27 @@ nfs_decode_args(struct mount *mp, struct if ((argp->flags & NFSMNT_WSIZE) && argp->wsize > 0) { nmp->nm_wsize = argp->wsize; - /* Round down to multiple of blocksize */ - nmp->nm_wsize &= ~(NFS_FABLKSIZE - 1); - if (nmp->nm_wsize <= 0) + /* + * Clip at the power of 2 below the size. There is an + * issue (not isolated) that causes intermittent page + * faults if this is not done. + */ + if (nmp->nm_wsize > NFS_FABLKSIZE) + nmp->nm_wsize = 1 << (fls(nmp->nm_wsize) - 1); + else nmp->nm_wsize = NFS_FABLKSIZE; } if ((argp->flags & NFSMNT_RSIZE) && argp->rsize > 0) { nmp->nm_rsize = argp->rsize; - /* Round down to multiple of blocksize */ - nmp->nm_rsize &= ~(NFS_FABLKSIZE - 1); - if (nmp->nm_rsize <= 0) + /* + * Clip at the power of 2 below the size. There is an + * issue (not isolated) that causes intermittent page + * faults if this is not done. + */ + if (nmp->nm_rsize > NFS_FABLKSIZE) + nmp->nm_rsize = 1 << (fls(nmp->nm_rsize) - 1); + else nmp->nm_rsize = NFS_FABLKSIZE; } From owner-svn-src-stable@FreeBSD.ORG Wed Nov 5 23:57:34 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E3726C0; Wed, 5 Nov 2014 23:57:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FBC0CB3; Wed, 5 Nov 2014 23:57:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5NvYCN072816; Wed, 5 Nov 2014 23:57:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5NvYjw072815; Wed, 5 Nov 2014 23:57:34 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201411052357.sA5NvYjw072815@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 5 Nov 2014 23:57:34 +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: r274152 - stable/9/sys/fs/nfsclient 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.18-1 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, 05 Nov 2014 23:57:34 -0000 Author: rmacklem Date: Wed Nov 5 23:57:33 2014 New Revision: 274152 URL: https://svnweb.freebsd.org/changeset/base/274152 Log: MFC: r273486 Clip the settings for the NFS rsize, wsize mount options to a power of 2. For non-power of 2 settings, intermittent page faults have been reported. Although the bug that causes these page faults/crashes has not been identified, it does not appear to occur when rsize, wsize is a power of 2. Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Wed Nov 5 23:54:33 2014 (r274151) +++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Wed Nov 5 23:57:33 2014 (r274152) @@ -615,17 +615,27 @@ nfs_decode_args(struct mount *mp, struct if ((argp->flags & NFSMNT_WSIZE) && argp->wsize > 0) { nmp->nm_wsize = argp->wsize; - /* Round down to multiple of blocksize */ - nmp->nm_wsize &= ~(NFS_FABLKSIZE - 1); - if (nmp->nm_wsize <= 0) + /* + * Clip at the power of 2 below the size. There is an + * issue (not isolated) that causes intermittent page + * faults if this is not done. + */ + if (nmp->nm_wsize > NFS_FABLKSIZE) + nmp->nm_wsize = 1 << (fls(nmp->nm_wsize) - 1); + else nmp->nm_wsize = NFS_FABLKSIZE; } if ((argp->flags & NFSMNT_RSIZE) && argp->rsize > 0) { nmp->nm_rsize = argp->rsize; - /* Round down to multiple of blocksize */ - nmp->nm_rsize &= ~(NFS_FABLKSIZE - 1); - if (nmp->nm_rsize <= 0) + /* + * Clip at the power of 2 below the size. There is an + * issue (not isolated) that causes intermittent page + * faults if this is not done. + */ + if (nmp->nm_rsize > NFS_FABLKSIZE) + nmp->nm_rsize = 1 << (fls(nmp->nm_rsize) - 1); + else nmp->nm_rsize = NFS_FABLKSIZE; } From owner-svn-src-stable@FreeBSD.ORG Thu Nov 6 01:30:14 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F9F0AB; Thu, 6 Nov 2014 01:30:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B68C8B8; Thu, 6 Nov 2014 01:30:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA61UEh9016670; Thu, 6 Nov 2014 01:30:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA61UEbL016669; Thu, 6 Nov 2014 01:30:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411060130.sA61UEbL016669@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Nov 2014 01:30: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: r274155 - stable/10/sys/dev/hwpmc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 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, 06 Nov 2014 01:30:14 -0000 Author: markj Date: Thu Nov 6 01:30:13 2014 New Revision: 274155 URL: https://svnweb.freebsd.org/changeset/base/274155 Log: MFC r273236: Use pmc_destroy_pmc_descriptor() to actually free the pmc, which is consistent with pmc_destroy_owner_descriptor(). Also be sure to destroy PMCs if a process exits or execs without explicitly releasing them. Modified: stable/10/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_mod.c Thu Nov 6 00:48:36 2014 (r274154) +++ stable/10/sys/dev/hwpmc/hwpmc_mod.c Thu Nov 6 01:30:13 2014 (r274155) @@ -192,6 +192,7 @@ static int pmc_detach_process(struct pro static int pmc_detach_one_process(struct proc *p, struct pmc *pm, int flags); static void pmc_destroy_owner_descriptor(struct pmc_owner *po); +static void pmc_destroy_pmc_descriptor(struct pmc *pm); static struct pmc_owner *pmc_find_owner_descriptor(struct proc *p); static int pmc_find_pmc(pmc_id_t pmcid, struct pmc **pm); static struct pmc *pmc_find_pmc_descriptor_in_process(struct pmc_owner *po, @@ -753,6 +754,7 @@ pmc_remove_owner(struct pmc_owner *po) ("[pmc,%d] owner %p != po %p", __LINE__, pm->pm_owner, po)); pmc_release_pmc_descriptor(pm); /* will unlink from the list */ + pmc_destroy_pmc_descriptor(pm); } KASSERT(po->po_sscount == 0, @@ -2165,9 +2167,7 @@ pmc_allocate_pmc_descriptor(void) static void pmc_destroy_pmc_descriptor(struct pmc *pm) { - (void) pm; -#ifdef DEBUG KASSERT(pm->pm_state == PMC_STATE_DELETED || pm->pm_state == PMC_STATE_FREE, ("[pmc,%d] destroying non-deleted PMC", __LINE__)); @@ -2178,7 +2178,8 @@ pmc_destroy_pmc_descriptor(struct pmc *p KASSERT(pm->pm_runcount == 0, ("[pmc,%d] pmc has non-zero run count %d", __LINE__, pm->pm_runcount)); -#endif + + free(pm, M_PMC); } static void @@ -2211,10 +2212,10 @@ pmc_wait_for_pmc_idle(struct pmc *pm) * - detaches the PMC from hardware * - unlinks all target threads that were attached to it * - removes the PMC from its owner's list - * - destroy's the PMC private mutex + * - destroys the PMC private mutex * - * Once this function completes, the given pmc pointer can be safely - * FREE'd by the caller. + * Once this function completes, the given pmc pointer can be freed by + * calling pmc_destroy_pmc_descriptor(). */ static void @@ -2364,8 +2365,6 @@ pmc_release_pmc_descriptor(struct pmc *p LIST_REMOVE(pm, pm_next); pm->pm_owner = NULL; } - - pmc_destroy_pmc_descriptor(pm); } /* @@ -3372,7 +3371,6 @@ pmc_syscall_handler(struct thread *td, v if (n == (int) md->pmd_npmc) { pmc_destroy_pmc_descriptor(pmc); - free(pmc, M_PMC); pmc = NULL; error = EINVAL; break; @@ -3408,7 +3406,6 @@ pmc_syscall_handler(struct thread *td, v (error = pcd->pcd_config_pmc(cpu, adjri, pmc)) != 0) { (void) pcd->pcd_release_pmc(cpu, adjri, pmc); pmc_destroy_pmc_descriptor(pmc); - free(pmc, M_PMC); pmc = NULL; pmc_restore_cpu_binding(&pb); error = EPERM; @@ -3436,7 +3433,7 @@ pmc_syscall_handler(struct thread *td, v if ((error = pmc_register_owner(curthread->td_proc, pmc)) != 0) { pmc_release_pmc_descriptor(pmc); - free(pmc, M_PMC); + pmc_destroy_pmc_descriptor(pmc); pmc = NULL; break; } @@ -3679,8 +3676,7 @@ pmc_syscall_handler(struct thread *td, v po = pm->pm_owner; pmc_release_pmc_descriptor(pm); pmc_maybe_remove_owner(po); - - free(pm, M_PMC); + pmc_destroy_pmc_descriptor(pm); } break; From owner-svn-src-stable@FreeBSD.ORG Thu Nov 6 01:30:16 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A27E911A; Thu, 6 Nov 2014 01:30:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A6648BA; Thu, 6 Nov 2014 01:30:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA61UGWX016724; Thu, 6 Nov 2014 01:30:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA61UG68016723; Thu, 6 Nov 2014 01:30:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411060130.sA61UG68016723@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Nov 2014 01:30:16 +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: r274156 - stable/9/sys/dev/hwpmc 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.18-1 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, 06 Nov 2014 01:30:17 -0000 Author: markj Date: Thu Nov 6 01:30:15 2014 New Revision: 274156 URL: https://svnweb.freebsd.org/changeset/base/274156 Log: MFC r273236: Use pmc_destroy_pmc_descriptor() to actually free the pmc, which is consistent with pmc_destroy_owner_descriptor(). Also be sure to destroy PMCs if a process exits or execs without explicitly releasing them. Modified: stable/9/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_mod.c Thu Nov 6 01:30:13 2014 (r274155) +++ stable/9/sys/dev/hwpmc/hwpmc_mod.c Thu Nov 6 01:30:15 2014 (r274156) @@ -191,6 +191,7 @@ static int pmc_detach_process(struct pro static int pmc_detach_one_process(struct proc *p, struct pmc *pm, int flags); static void pmc_destroy_owner_descriptor(struct pmc_owner *po); +static void pmc_destroy_pmc_descriptor(struct pmc *pm); static struct pmc_owner *pmc_find_owner_descriptor(struct proc *p); static int pmc_find_pmc(pmc_id_t pmcid, struct pmc **pm); static struct pmc *pmc_find_pmc_descriptor_in_process(struct pmc_owner *po, @@ -752,6 +753,7 @@ pmc_remove_owner(struct pmc_owner *po) ("[pmc,%d] owner %p != po %p", __LINE__, pm->pm_owner, po)); pmc_release_pmc_descriptor(pm); /* will unlink from the list */ + pmc_destroy_pmc_descriptor(pm); } KASSERT(po->po_sscount == 0, @@ -2176,9 +2178,7 @@ pmc_allocate_pmc_descriptor(void) static void pmc_destroy_pmc_descriptor(struct pmc *pm) { - (void) pm; -#ifdef DEBUG KASSERT(pm->pm_state == PMC_STATE_DELETED || pm->pm_state == PMC_STATE_FREE, ("[pmc,%d] destroying non-deleted PMC", __LINE__)); @@ -2189,7 +2189,8 @@ pmc_destroy_pmc_descriptor(struct pmc *p KASSERT(pm->pm_runcount == 0, ("[pmc,%d] pmc has non-zero run count %d", __LINE__, pm->pm_runcount)); -#endif + + free(pm, M_PMC); } static void @@ -2222,10 +2223,10 @@ pmc_wait_for_pmc_idle(struct pmc *pm) * - detaches the PMC from hardware * - unlinks all target threads that were attached to it * - removes the PMC from its owner's list - * - destroy's the PMC private mutex + * - destroys the PMC private mutex * - * Once this function completes, the given pmc pointer can be safely - * FREE'd by the caller. + * Once this function completes, the given pmc pointer can be freed by + * calling pmc_destroy_pmc_descriptor(). */ static void @@ -2375,8 +2376,6 @@ pmc_release_pmc_descriptor(struct pmc *p LIST_REMOVE(pm, pm_next); pm->pm_owner = NULL; } - - pmc_destroy_pmc_descriptor(pm); } /* @@ -3383,7 +3382,6 @@ pmc_syscall_handler(struct thread *td, v if (n == (int) md->pmd_npmc) { pmc_destroy_pmc_descriptor(pmc); - free(pmc, M_PMC); pmc = NULL; error = EINVAL; break; @@ -3419,7 +3417,6 @@ pmc_syscall_handler(struct thread *td, v (error = pcd->pcd_config_pmc(cpu, adjri, pmc)) != 0) { (void) pcd->pcd_release_pmc(cpu, adjri, pmc); pmc_destroy_pmc_descriptor(pmc); - free(pmc, M_PMC); pmc = NULL; pmc_restore_cpu_binding(&pb); error = EPERM; @@ -3447,7 +3444,7 @@ pmc_syscall_handler(struct thread *td, v if ((error = pmc_register_owner(curthread->td_proc, pmc)) != 0) { pmc_release_pmc_descriptor(pmc); - free(pmc, M_PMC); + pmc_destroy_pmc_descriptor(pmc); pmc = NULL; break; } @@ -3690,8 +3687,7 @@ pmc_syscall_handler(struct thread *td, v po = pm->pm_owner; pmc_release_pmc_descriptor(pm); pmc_maybe_remove_owner(po); - - free(pm, M_PMC); + pmc_destroy_pmc_descriptor(pm); } break; From owner-svn-src-stable@FreeBSD.ORG Thu Nov 6 01:34:44 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F14336C; Thu, 6 Nov 2014 01:34:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF81397B; Thu, 6 Nov 2014 01:34:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA61Yh9B020706; Thu, 6 Nov 2014 01:34:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA61YhQH020705; Thu, 6 Nov 2014 01:34:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411060134.sA61YhQH020705@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Nov 2014 01:34: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: r274157 - 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.18-1 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, 06 Nov 2014 01:34:44 -0000 Author: markj Date: Thu Nov 6 01:34:43 2014 New Revision: 274157 URL: https://svnweb.freebsd.org/changeset/base/274157 Log: MFC r273342: Fix a typo from r189544, which replaced unp_global_rwlock with unp_list_lock and unp_link_rwlock. Modified: stable/10/sys/kern/subr_witness.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_witness.c ============================================================================== --- stable/10/sys/kern/subr_witness.c Thu Nov 6 01:30:15 2014 (r274156) +++ stable/10/sys/kern/subr_witness.c Thu Nov 6 01:34:43 2014 (r274157) @@ -527,7 +527,7 @@ static struct witness_order_list_entry o /* * UNIX Domain Sockets */ - { "unp_global_rwlock", &lock_class_rw }, + { "unp_link_rwlock", &lock_class_rw }, { "unp_list_lock", &lock_class_mtx_sleep }, { "unp", &lock_class_mtx_sleep }, { "so_snd", &lock_class_mtx_sleep }, From owner-svn-src-stable@FreeBSD.ORG Thu Nov 6 01:34:45 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5974036D; Thu, 6 Nov 2014 01:34:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45C2097C; Thu, 6 Nov 2014 01:34:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA61YjMr020750; Thu, 6 Nov 2014 01:34:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA61YjMQ020749; Thu, 6 Nov 2014 01:34:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411060134.sA61YjMQ020749@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Nov 2014 01:34: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: r274158 - stable/9/sys/kern 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.18-1 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, 06 Nov 2014 01:34:45 -0000 Author: markj Date: Thu Nov 6 01:34:44 2014 New Revision: 274158 URL: https://svnweb.freebsd.org/changeset/base/274158 Log: MFC r273342: Fix a typo from r189544, which replaced unp_global_rwlock with unp_list_lock and unp_link_rwlock. Modified: stable/9/sys/kern/subr_witness.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_witness.c ============================================================================== --- stable/9/sys/kern/subr_witness.c Thu Nov 6 01:34:43 2014 (r274157) +++ stable/9/sys/kern/subr_witness.c Thu Nov 6 01:34:44 2014 (r274158) @@ -527,7 +527,7 @@ static struct witness_order_list_entry o /* * UNIX Domain Sockets */ - { "unp_global_rwlock", &lock_class_rw }, + { "unp_link_rwlock", &lock_class_rw }, { "unp_list_lock", &lock_class_mtx_sleep }, { "unp", &lock_class_mtx_sleep }, { "so_snd", &lock_class_mtx_sleep }, From owner-svn-src-stable@FreeBSD.ORG Thu Nov 6 02:23:02 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF82BD3C; Thu, 6 Nov 2014 02:23:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB80AE1B; Thu, 6 Nov 2014 02:23:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA62N1Wx043848; Thu, 6 Nov 2014 02:23:01 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA62N16n043847; Thu, 6 Nov 2014 02:23:01 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411060223.sA62N16n043847@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Nov 2014 02:23: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: r274160 - stable/9/release/doc/en_US.ISO8859-1/errata 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.18-1 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, 06 Nov 2014 02:23:02 -0000 Author: gjb Date: Thu Nov 6 02:23:01 2014 New Revision: 274160 URL: https://svnweb.freebsd.org/changeset/base/274160 Log: Document SA-14:25, SA-14:26 Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Thu Nov 6 01:46:33 2014 (r274159) +++ stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Thu Nov 6 02:23:01 2014 (r274160) @@ -139,6 +139,18 @@ 21 October 2014 Multiple vulerabilities. + + + SA-14:25.setlogin + 04 November 2014 + Kernel stack disclosure. + + + + SA-14:26.ftp + 04 November 2014 + Remote code execution. + From owner-svn-src-stable@FreeBSD.ORG Thu Nov 6 02:41:39 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F35F3BB; Thu, 6 Nov 2014 02:41:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5BBFE9; Thu, 6 Nov 2014 02:41:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA62fdU1053061; Thu, 6 Nov 2014 02:41:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA62fdkZ053060; Thu, 6 Nov 2014 02:41:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411060241.sA62fdkZ053060@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Nov 2014 02:41:39 +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: r274162 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/sys/sys 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.18-1 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, 06 Nov 2014 02:41:39 -0000 Author: gjb Date: Thu Nov 6 02:41:38 2014 New Revision: 274162 URL: https://svnweb.freebsd.org/changeset/base/274162 Log: Bump __FreeBSD_version after SA-14:23, SA-14:24, SA-14:25. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/8/sys/sys/param.h Changes in other areas also in this revision: Modified: head/sys/sys/param.h stable/10/sys/sys/param.h stable/9/sys/sys/param.h Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Thu Nov 6 02:28:08 2014 (r274161) +++ stable/8/sys/sys/param.h Thu Nov 6 02:41:38 2014 (r274162) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 804506 /* Master, propagated to newvers */ +#define __FreeBSD_version 804507 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@FreeBSD.ORG Thu Nov 6 02:41:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0332F3BC; Thu, 6 Nov 2014 02:41:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2A84FEA; Thu, 6 Nov 2014 02:41:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA62fdTG053067; Thu, 6 Nov 2014 02:41:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA62fdix053066; Thu, 6 Nov 2014 02:41:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411060241.sA62fdix053066@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Nov 2014 02:41: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: r274162 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/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.18-1 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, 06 Nov 2014 02:41:40 -0000 Author: gjb Date: Thu Nov 6 02:41:38 2014 New Revision: 274162 URL: https://svnweb.freebsd.org/changeset/base/274162 Log: Bump __FreeBSD_version after SA-14:23, SA-14:24, SA-14:25. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/sys/param.h Changes in other areas also in this revision: Modified: head/sys/sys/param.h stable/8/sys/sys/param.h stable/9/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Thu Nov 6 02:28:08 2014 (r274161) +++ stable/10/sys/sys/param.h Thu Nov 6 02:41:38 2014 (r274162) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1001501 /* Master, propagated to newvers */ +#define __FreeBSD_version 1001502 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@FreeBSD.ORG Thu Nov 6 02:41:41 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16A333C0; Thu, 6 Nov 2014 02:41:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02B81FED; Thu, 6 Nov 2014 02:41:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA62feha053083; Thu, 6 Nov 2014 02:41:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA62feas053082; Thu, 6 Nov 2014 02:41:40 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411060241.sA62feas053082@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Nov 2014 02:41:40 +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: r274162 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/sys/sys 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.18-1 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, 06 Nov 2014 02:41:41 -0000 Author: gjb Date: Thu Nov 6 02:41:38 2014 New Revision: 274162 URL: https://svnweb.freebsd.org/changeset/base/274162 Log: Bump __FreeBSD_version after SA-14:23, SA-14:24, SA-14:25. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/9/sys/sys/param.h Changes in other areas also in this revision: Modified: head/sys/sys/param.h stable/10/sys/sys/param.h stable/8/sys/sys/param.h Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Thu Nov 6 02:28:08 2014 (r274161) +++ stable/9/sys/sys/param.h Thu Nov 6 02:41:38 2014 (r274162) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 903505 /* Master, propagated to newvers */ +#define __FreeBSD_version 903506 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@FreeBSD.ORG Thu Nov 6 09:16:53 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E432D84; Thu, 6 Nov 2014 09:16:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A4D3E0A; Thu, 6 Nov 2014 09:16:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA69Grkk035526; Thu, 6 Nov 2014 09:16:53 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA69Gr2V035525; Thu, 6 Nov 2014 09:16:53 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411060916.sA69Gr2V035525@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 6 Nov 2014 09:16: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: r274168 - 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.18-1 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, 06 Nov 2014 09:16:53 -0000 Author: ae Date: Thu Nov 6 09:16:52 2014 New Revision: 274168 URL: https://svnweb.freebsd.org/changeset/base/274168 Log: MFC r273855: Fix mbuf leak in IPv6 multicast code. When multicast capable interface goes away, it leaves multicast groups, this leads to generate MLD reports, but MLD code does deffered send and MLD reports are queued in the in6_multi's in6m_scq ifq. The problem is that in6_multi structures are freed when interface leaves multicast groups and thread that does deffered send will not take these queued packets. PR: 194577 MFC r273857: Move ifq drain into in6m_purge(). Suggested by: bms Sponsored by: Yandex LLC Modified: stable/10/sys/netinet6/in6_mcast.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/in6_mcast.c ============================================================================== --- stable/10/sys/netinet6/in6_mcast.c Thu Nov 6 08:12:34 2014 (r274167) +++ stable/10/sys/netinet6/in6_mcast.c Thu Nov 6 09:16:52 2014 (r274168) @@ -1075,6 +1075,8 @@ in6m_purge(struct in6_multi *inm) free(ims, M_IP6MSOURCE); inm->in6m_nsrc--; } + /* Free state-change requests that might be queued. */ + _IF_DRAIN(&inm->in6m_scq); } /* From owner-svn-src-stable@FreeBSD.ORG Thu Nov 6 16:31:49 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5B7362B; Thu, 6 Nov 2014 16:31:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1B9C765; Thu, 6 Nov 2014 16:31:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6GVnTH041002; Thu, 6 Nov 2014 16:31:49 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6GVnVB041001; Thu, 6 Nov 2014 16:31:49 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411061631.sA6GVnVB041001@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 6 Nov 2014 16:31:49 +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: r274181 - stable/9/sys/netinet6 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.18-1 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, 06 Nov 2014 16:31:49 -0000 Author: ae Date: Thu Nov 6 16:31:48 2014 New Revision: 274181 URL: https://svnweb.freebsd.org/changeset/base/274181 Log: MFC r273855: Fix mbuf leak in IPv6 multicast code. When multicast capable interface goes away, it leaves multicast groups, this leads to generate MLD reports, but MLD code does deffered send and MLD reports are queued in the in6_multi's in6m_scq ifq. The problem is that in6_multi structures are freed when interface leaves multicast groups and thread that does deffered send will not take these queued packets. PR: 194577 MFC r273857: Move ifq drain into in6m_purge(). Suggested by: bms Sponsored by: Yandex LLC Modified: stable/9/sys/netinet6/in6_mcast.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6_mcast.c ============================================================================== --- stable/9/sys/netinet6/in6_mcast.c Thu Nov 6 16:19:21 2014 (r274180) +++ stable/9/sys/netinet6/in6_mcast.c Thu Nov 6 16:31:48 2014 (r274181) @@ -1075,6 +1075,8 @@ in6m_purge(struct in6_multi *inm) free(ims, M_IP6MSOURCE); inm->in6m_nsrc--; } + /* Free state-change requests that might be queued. */ + _IF_DRAIN(&inm->in6m_scq); } /* From owner-svn-src-stable@FreeBSD.ORG Thu Nov 6 16:32:01 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D53E75E; Thu, 6 Nov 2014 16:32:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ED1E769; Thu, 6 Nov 2014 16:32:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6GW1v6042162; Thu, 6 Nov 2014 16:32:01 GMT (envelope-from emax@FreeBSD.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6GW0T5042045; Thu, 6 Nov 2014 16:32:00 GMT (envelope-from emax@FreeBSD.org) Message-Id: <201411061632.sA6GW0T5042045@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emax set sender to emax@FreeBSD.org using -f From: Maksim Yevmenkin Date: Thu, 6 Nov 2014 16:32: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: r274182 - stable/10/usr.bin/bluetooth/rfcomm_sppd 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.18-1 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, 06 Nov 2014 16:32:01 -0000 Author: emax Date: Thu Nov 6 16:32:00 2014 New Revision: 274182 URL: https://svnweb.freebsd.org/changeset/base/274182 Log: MFC r273548 Change the code to use the openpty(3) API which uses the pts(4) driver instead of the pty(4) driver. PR: 184597 Submitted by: tobias.rehbein Modified: stable/10/usr.bin/bluetooth/rfcomm_sppd/Makefile stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1 stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bluetooth/rfcomm_sppd/Makefile ============================================================================== --- stable/10/usr.bin/bluetooth/rfcomm_sppd/Makefile Thu Nov 6 16:31:48 2014 (r274181) +++ stable/10/usr.bin/bluetooth/rfcomm_sppd/Makefile Thu Nov 6 16:32:00 2014 (r274182) @@ -6,6 +6,6 @@ SRCS= rfcomm_sppd.c rfcomm_sdp.c WARNS?= 2 DPADD= ${LIBBLUETOOTH} ${LIBSDP} -LDADD= -lbluetooth -lsdp +LDADD= -lbluetooth -lsdp -lutil .include Modified: stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1 ============================================================================== --- stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1 Thu Nov 6 16:31:48 2014 (r274181) +++ stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1 Thu Nov 6 16:32:00 2014 (r274182) @@ -33,10 +33,9 @@ .Nd RFCOMM Serial Port Profile daemon .Sh SYNOPSIS .Nm -.Op Fl bhS +.Op Fl bhtS .Fl a Ar address .Fl c Ar channel -.Op Fl t Ar tty .Sh DESCRIPTION The .Nm @@ -53,7 +52,7 @@ Once connection is established, the .Nm utility provides access to the server's remote serial port via stdin/stdout or via -.Xr pty 4 +.Xr pts 4 interface if .Fl t option was specified. @@ -72,8 +71,7 @@ daemon. If .Fl t options was specified, -the server side of the virtual serial port is attached to the pseudo-terminal -.Ar tty . +the server side of the virtual serial port is attached to a pseudo-terminal. Otherwise the virtual serial port is attached to the stdin/stdout. .Nm should be run as root in order to communicate with @@ -146,24 +144,22 @@ Display usage message and exit. .It Fl S Server mode; see .Sx DESCRIPTION . -.It Fl t Ar tty -Slave pseudo tty name. +.It Fl t +Use slave pseudo tty. If not set stdin/stdout will be used. This option is required if .Fl b option was specified. .El .Sh FILES -.Bl -tag -width ".Pa /dev/tty[p-sP-S][0-9a-v]" -compact -.It Pa /dev/pty[p-sP-S][0-9a-v] -master pseudo terminals -.It Pa /dev/tty[p-sP-S][0-9a-v] +.Bl -tag -width ".Pa /dev/pts/[num]" -compact +.It Pa /dev/pts/[num] slave pseudo terminals .El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -.Dl "rfcomm_sppd -a 00:01:02:03:04:05 -c 1 -t /dev/ttyp1" +.Dl "rfcomm_sppd -a 00:01:02:03:04:05 -c 1 -t" .Pp Will start the .Nm @@ -171,13 +167,17 @@ utility and open RFCOMM connection to th .Li 00:01:02:03:04:05 and channel .Li 1 . -Once the connection has been established, -.Pa /dev/ttyp1 +Once the connection has been established, a +.Xr pts 4 can be used to talk to the remote serial port on the server. +.Nm +prints the name of the +.Xr pts 4 +to use on stdout. .Sh SEE ALSO .Xr bluetooth 3 , .Xr ng_btsocket 4 , -.Xr pty 4 , +.Xr pts 4 , .Xr rfcomm_pppd 8 , .Xr sdpd 8 .Sh AUTHORS Modified: stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c ============================================================================== --- stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c Thu Nov 6 16:31:48 2014 (r274181) +++ stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c Thu Nov 6 16:32:00 2014 (r274182) @@ -32,6 +32,7 @@ */ #include +#include #include #include #include @@ -49,6 +50,7 @@ #include #include #include +#include #define SPPD_IDENT "rfcomm_sppd" #define SPPD_BUFFER_SIZE 1024 @@ -58,7 +60,7 @@ int rfcomm_channel_lookup (bdaddr_t con bdaddr_t const *remote, int service, int *channel, int *error); -static int sppd_ttys_open (char const *tty, int *amaster, int *aslave); +static int sppd_ttys_open (char **tty, int *amaster, int *aslave); static int sppd_read (int fd, char *buffer, int size); static int sppd_write (int fd, char *buffer, int size); static void sppd_sighandler (int s); @@ -74,7 +76,8 @@ main(int argc, char *argv[]) struct sockaddr_rfcomm ra; bdaddr_t addr; int n, background, channel, service, - s, amaster, aslave, fd, doserver; + s, amaster, aslave, fd, doserver, + dopty; fd_set rfd; char *tty = NULL, *ep = NULL, buf[SPPD_BUFFER_SIZE]; @@ -82,9 +85,10 @@ main(int argc, char *argv[]) background = channel = 0; service = SDP_SERVICE_CLASS_SERIAL_PORT; doserver = 0; + dopty = 0; /* Parse command line options */ - while ((n = getopt(argc, argv, "a:bc:t:hS")) != -1) { + while ((n = getopt(argc, argv, "a:bc:thS")) != -1) { switch (n) { case 'a': /* BDADDR */ if (!bt_aton(optarg, &addr)) { @@ -130,11 +134,8 @@ main(int argc, char *argv[]) background = 1; break; - case 't': /* Slave TTY name */ - if (optarg[0] != '/') - asprintf(&tty, "%s%s", _PATH_DEV, optarg); - else - tty = optarg; + case 't': /* Open pseudo TTY */ + dopty = 1; break; case 'S': @@ -173,18 +174,18 @@ main(int argc, char *argv[]) err(1, "Could not sigaction(SIGCHLD)"); /* Open TTYs */ - if (tty == NULL) { + if (dopty) { + if (sppd_ttys_open(&tty, &amaster, &aslave) < 0) + exit(1); + + fd = amaster; + } else { if (background) usage(); amaster = STDIN_FILENO; fd = STDOUT_FILENO; - } else { - if (sppd_ttys_open(tty, &amaster, &aslave) < 0) - exit(1); - - fd = amaster; - } + } /* Open RFCOMM connection */ @@ -287,6 +288,10 @@ main(int argc, char *argv[]) openlog(SPPD_IDENT, LOG_NDELAY|LOG_PERROR|LOG_PID, LOG_DAEMON); syslog(LOG_INFO, "Starting on %s...", (tty != NULL)? tty : "stdin/stdout"); + /* Print used tty on stdout for wrappers to pick up */ + if (!background) + fprintf(stdout, "%s\n", tty); + for (done = 0; !done; ) { FD_ZERO(&rfd); FD_SET(amaster, &rfd); @@ -359,70 +364,20 @@ main(int argc, char *argv[]) /* Open TTYs */ static int -sppd_ttys_open(char const *tty, int *amaster, int *aslave) +sppd_ttys_open(char **tty, int *amaster, int *aslave) { - char pty[PATH_MAX], *slash; - struct group *gr = NULL; - gid_t ttygid; + char pty[PATH_MAX]; struct termios tio; - /* - * Construct master PTY name. The slave tty name must be less then - * PATH_MAX characters in length, must contain '/' character and - * must not end with '/'. - */ - - if (strlen(tty) >= sizeof(pty)) { - syslog(LOG_ERR, "Slave tty name is too long"); - return (-1); - } - - strlcpy(pty, tty, sizeof(pty)); - slash = strrchr(pty, '/'); - if (slash == NULL || slash[1] == '\0') { - syslog(LOG_ERR, "Invalid slave tty name (%s)", tty); - return (-1); - } - - slash[1] = 'p'; - - if (strcmp(pty, tty) == 0) { - syslog(LOG_ERR, "Master and slave tty are the same (%s)", tty); - return (-1); - } - - if ((*amaster = open(pty, O_RDWR, 0)) < 0) { - syslog(LOG_ERR, "Could not open(%s). %s", pty, strerror(errno)); - return (-1); - } - - /* - * Slave TTY - */ - - if ((gr = getgrnam("tty")) != NULL) - ttygid = gr->gr_gid; - else - ttygid = -1; - - (void) chown(tty, getuid(), ttygid); - (void) chmod(tty, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); - (void) revoke(tty); + cfmakeraw(&tio); - if ((*aslave = open(tty, O_RDWR, 0)) < 0) { - syslog(LOG_ERR, "Could not open(%s). %s", tty, strerror(errno)); - close(*amaster); + if (openpty(amaster, aslave, pty, &tio, NULL) == -1) { + syslog(LOG_ERR, "Could not openpty(). %s", strerror(errno)); return (-1); } - /* - * Make slave TTY raw - */ - - cfmakeraw(&tio); - - if (tcsetattr(*aslave, TCSANOW, &tio) < 0) { - syslog(LOG_ERR, "Could not tcsetattr(). %s", strerror(errno)); + if ((*tty = strdup(pty)) == NULL) { + syslog(LOG_ERR, "Could not strdup(). %s", strerror(errno)); close(*aslave); close(*amaster); return (-1); @@ -496,7 +451,7 @@ usage(void) "\t-a address Peer address (required in client mode)\n" \ "\t-b Run in background\n" \ "\t-c channel RFCOMM channel to connect to or listen on\n" \ -"\t-t tty TTY name (required in background mode)\n" \ +"\t-t use slave pseudo tty (required in background mode)\n" \ "\t-S Server mode\n" \ "\t-h Display this message\n", SPPD_IDENT); exit(255); From owner-svn-src-stable@FreeBSD.ORG Fri Nov 7 04:11:44 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23E729CD; Fri, 7 Nov 2014 04:11:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E89E1C4; Fri, 7 Nov 2014 04:11:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA74Bhtl075417; Fri, 7 Nov 2014 04:11:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA74Bh95075416; Fri, 7 Nov 2014 04:11:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201411070411.sA74Bh95075416@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 7 Nov 2014 04:11: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: r274216 - stable/10/usr.sbin/bsdinstall 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.18-1 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, 07 Nov 2014 04:11:44 -0000 Author: nwhitehorn Date: Fri Nov 7 04:11:43 2014 New Revision: 274216 URL: https://svnweb.freebsd.org/changeset/base/274216 Log: MFC r273922: Rewrite some of the disk setup documentation to be clearer and contain less obsolete information. Also move the entropy command down the list -- the list is ordered by likelihood of use rather than alphabetically. Modified: stable/10/usr.sbin/bsdinstall/bsdinstall.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- stable/10/usr.sbin/bsdinstall/bsdinstall.8 Fri Nov 7 03:36:28 2014 (r274215) +++ stable/10/usr.sbin/bsdinstall/bsdinstall.8 Fri Nov 7 04:11:43 2014 (r274216) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 15, 2013 +.Dd October 31, 2014 .Dt BSDINSTALL 8 .Os .Sh NAME @@ -73,10 +73,6 @@ targets. .Bl -tag -width ".Cm jail Ar destination" .It Cm auto Run the standard interactive installation, including disk partitioning. -.It Cm entropy -Reads a small amount of data from -.Pa /dev/random -and stores it in a file in the new system's root directory. .It Cm jail Ar destination Sets up a new chroot system at .Pa destination , @@ -119,32 +115,28 @@ If is set, also configures the network interfaces of the current system to match. .It Cm autopart Provides the installer's interactive guided disk partitioner for single-disk -installations. Partitions disks, runs -.Xr newfs 8 , -and writes the new system's -.Pa fstab . +installations. Defaults to UFS. .It Cm zfsboot -Provides the installer's -.Pq experimental -interactive/scriptable ZFS partitioner for multi-disk installations. +Provides an alternative ZFS-only automatic interactive disk partitioner. Creates a single .Ic zpool -with datasets and writes to the new system's -.Pa rc.conf , -.Pa loader.conf , +with separate datasets for +.Pa /tmp , +.Pa /usr , +.Pa /usr/home , +.Pa /usr/ports , +.Pa /usr/src , and -.Pa fstab . -Supports -.Xr geli 8 , -.Xr gnop 8 , -and many other features. +.Pa /var . +Optionally can set up +.Xr geli 8 +to encrypt the disk. .It Cm partedit -Provides the installer's interactive manual disk partitioner, with support -for multi disk setups, non-UFS file systems, and manual selection of -partition schemes. Partitions disks, runs -.Xr newfs 8 , -and writes the new system's -.Pa fstab . +Provides the installer's interactive manual disk partitioner with an interface +identical to +.Xr sade 8 . +Supports multiple disks as well as UFS, ZFS, and FAT file systems. ZFS +is set up with one pool and dataset per partition. .It Cm scriptedpart Ar parameters Sets up disks like .Cm autopart @@ -190,13 +182,19 @@ keyword causes the partition to take all .Ar type option chooses the .Xr gpart 8 -filesystem type (e.g. freebsd-ufs or freebsd-swap). +filesystem type (e.g. freebsd-ufs, freebsd-zfs, or freebsd-swap). The optional .Ar mount point argument sets where the created partition is to be mounted in the installed system. As an example, a typical invocation looks like: .Pp bsdinstall scriptedpart ada0 { 20G freebsd-ufs /, 4G freebsd-swap, 20G freebsd-ufs /var, auto freebsd-ufs /usr } +.Pp +A shorter invocation to use the default partitioning (as +.Cm autopart +would have used) on the same disk: +.Pp +bsdinstall scriptedpart ada0 .It Cm mount Mounts the file systems previously configured by .Cm autopart , @@ -235,6 +233,10 @@ Interactively sets the time, date, and t Queries the user for the system daemons to begin at system startup, writing the result into the new system's .Pa rc.conf . +.It Cm entropy +Reads a small amount of data from +.Pa /dev/random +and stores it in a file in the new system's root directory. .It Cm config Installs the configuration files destined for the new system (e.g. rc.conf fragments generated by @@ -346,14 +348,14 @@ which is passed to the .Cm scriptedpart target to control disk setup. Alternatively, +to use +.Cm zfsboot instead of -.Ev PARTITIONS , +.Cm partedit , the preamble can contain the variable .Ev ZFSBOOT_DATASETS -which is parsed by the -.Pq experimental -.Cm zfsboot -target to control ZFS datasets/options of the boot pool setup. +instead of +.Ev PARTITIONS . .Ss SETUP SCRIPT Following the preamble is an optional shell script, beginning with a #! declaration. This script will be run at the end of the installation process From owner-svn-src-stable@FreeBSD.ORG Fri Nov 7 15:40:36 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32531F20; Fri, 7 Nov 2014 15:40:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D4B6666; Fri, 7 Nov 2014 15:40:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7FeZ8S097346; Fri, 7 Nov 2014 15:40:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7FeZiX097267; Fri, 7 Nov 2014 15:40:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071540.sA7FeZiX097267@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:40: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: r274232 - stable/10/sys/fs/autofs 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.18-1 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, 07 Nov 2014 15:40:36 -0000 Author: trasz Date: Fri Nov 7 15:40:34 2014 New Revision: 274232 URL: https://svnweb.freebsd.org/changeset/base/274232 Log: MFC r272403: Make autofs timeout handling use timeout task instead of callout; that's because the handler can sleep on sx lock. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.c stable/10/sys/fs/autofs/autofs.h stable/10/sys/fs/autofs/autofs_vfsops.c stable/10/sys/fs/autofs/autofs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.c ============================================================================== --- stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:14:10 2014 (r274231) +++ stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:40:34 2014 (r274232) @@ -76,6 +76,7 @@ #include #include #include +#include #include #include #include @@ -260,7 +261,7 @@ autofs_path(struct autofs_node *anp) } static void -autofs_callout(void *context) +autofs_task(void *context, int pending) { struct autofs_request *ar; @@ -414,9 +415,14 @@ autofs_trigger_one(struct autofs_node *a strlcpy(ar->ar_options, amp->am_options, sizeof(ar->ar_options)); - callout_init(&ar->ar_callout, 1); - callout_reset(&ar->ar_callout, - autofs_timeout * hz, autofs_callout, ar); + TIMEOUT_TASK_INIT(taskqueue_thread, &ar->ar_task, 0, + autofs_task, ar); + error = taskqueue_enqueue_timeout(taskqueue_thread, + &ar->ar_task, autofs_timeout * hz); + if (error != 0) { + AUTOFS_WARN("taskqueue_enqueue_timeout() failed " + "with error %d", error); + } refcount_init(&ar->ar_refcount, 1); TAILQ_INSERT_TAIL(&autofs_softc->sc_requests, ar, ar_next); } @@ -456,7 +462,8 @@ autofs_trigger_one(struct autofs_node *a * XXX: Is it safe? */ sx_xunlock(&autofs_softc->sc_lock); - callout_drain(&ar->ar_callout); + taskqueue_cancel_timeout(taskqueue_thread, &ar->ar_task, NULL); + taskqueue_drain_timeout(taskqueue_thread, &ar->ar_task); sx_xlock(&autofs_softc->sc_lock); uma_zfree(autofs_request_zone, ar); } Modified: stable/10/sys/fs/autofs/autofs.h ============================================================================== --- stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:14:10 2014 (r274231) +++ stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:40:34 2014 (r274232) @@ -97,7 +97,7 @@ struct autofs_request { char ar_prefix[MAXPATHLEN]; char ar_key[MAXPATHLEN]; char ar_options[MAXPATHLEN]; - struct callout ar_callout; + struct timeout_task ar_task; volatile u_int ar_refcount; }; Modified: stable/10/sys/fs/autofs/autofs_vfsops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vfsops.c Fri Nov 7 15:14:10 2014 (r274231) +++ stable/10/sys/fs/autofs/autofs_vfsops.c Fri Nov 7 15:40:34 2014 (r274232) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include Modified: stable/10/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:14:10 2014 (r274231) +++ stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:40:34 2014 (r274232) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-stable@FreeBSD.ORG Fri Nov 7 15:42:12 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 799791D3; Fri, 7 Nov 2014 15:42:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6510D765; Fri, 7 Nov 2014 15:42:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7FgCOX001030; Fri, 7 Nov 2014 15:42:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7FgCqU001029; Fri, 7 Nov 2014 15:42:12 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071542.sA7FgCqU001029@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274233 - stable/10/sys/fs/autofs 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.18-1 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, 07 Nov 2014 15:42:12 -0000 Author: trasz Date: Fri Nov 7 15:42:11 2014 New Revision: 274233 URL: https://svnweb.freebsd.org/changeset/base/274233 Log: MFC r272405: Call uma_zfree() outside of lock, and improve comment. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.c ============================================================================== --- stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:40:34 2014 (r274232) +++ stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:42:11 2014 (r274233) @@ -459,13 +459,13 @@ autofs_trigger_one(struct autofs_node *a if (last) { TAILQ_REMOVE(&autofs_softc->sc_requests, ar, ar_next); /* - * XXX: Is it safe? + * Unlock the sc_lock, so that autofs_task() can complete. */ sx_xunlock(&autofs_softc->sc_lock); taskqueue_cancel_timeout(taskqueue_thread, &ar->ar_task, NULL); taskqueue_drain_timeout(taskqueue_thread, &ar->ar_task); - sx_xlock(&autofs_softc->sc_lock); uma_zfree(autofs_request_zone, ar); + sx_xlock(&autofs_softc->sc_lock); } /* From owner-svn-src-stable@FreeBSD.ORG Fri Nov 7 15:44:05 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 327AD37B; Fri, 7 Nov 2014 15:44:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1400F782; Fri, 7 Nov 2014 15:44:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7Fi4mf001351; Fri, 7 Nov 2014 15:44:04 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7Fi4d6001345; Fri, 7 Nov 2014 15:44:04 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071544.sA7Fi4d6001345@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:44: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: r274234 - stable/10/sys/fs/autofs 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.18-1 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, 07 Nov 2014 15:44:05 -0000 Author: trasz Date: Fri Nov 7 15:44:03 2014 New Revision: 274234 URL: https://svnweb.freebsd.org/changeset/base/274234 Log: MFC r272470: Make autofs(4) use shared lock for lookups, instead of exclusive one. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.c stable/10/sys/fs/autofs/autofs.h stable/10/sys/fs/autofs/autofs_vfsops.c stable/10/sys/fs/autofs/autofs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.c ============================================================================== --- stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:42:11 2014 (r274233) +++ stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:44:03 2014 (r274234) @@ -297,9 +297,9 @@ autofs_cached(struct autofs_node *anp, c * is necessary for wildcard indirect map keys to work. */ if (anp->an_parent == NULL && componentlen != 0) { - AUTOFS_LOCK(amp); + AUTOFS_SLOCK(amp); error = autofs_node_find(anp, component, componentlen, NULL); - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); if (error != 0) return (false); } Modified: stable/10/sys/fs/autofs/autofs.h ============================================================================== --- stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:42:11 2014 (r274233) +++ stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:44:03 2014 (r274234) @@ -53,9 +53,12 @@ extern int autofs_mount_on_stat; __func__, ## __VA_ARGS__); \ } while (0) -#define AUTOFS_LOCK(X) sx_xlock(&X->am_lock) -#define AUTOFS_UNLOCK(X) sx_xunlock(&X->am_lock) -#define AUTOFS_ASSERT_LOCKED(X) sx_assert(&X->am_lock, SA_XLOCKED) +#define AUTOFS_SLOCK(X) sx_slock(&X->am_lock) +#define AUTOFS_XLOCK(X) sx_xlock(&X->am_lock) +#define AUTOFS_SUNLOCK(X) sx_sunlock(&X->am_lock) +#define AUTOFS_XUNLOCK(X) sx_xunlock(&X->am_lock) +#define AUTOFS_ASSERT_LOCKED(X) sx_assert(&X->am_lock, SA_LOCKED) +#define AUTOFS_ASSERT_XLOCKED(X) sx_assert(&X->am_lock, SA_XLOCKED) #define AUTOFS_ASSERT_UNLOCKED(X) sx_assert(&X->am_lock, SA_UNLOCKED) struct autofs_node { Modified: stable/10/sys/fs/autofs/autofs_vfsops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vfsops.c Fri Nov 7 15:42:11 2014 (r274233) +++ stable/10/sys/fs/autofs/autofs_vfsops.c Fri Nov 7 15:44:03 2014 (r274234) @@ -88,14 +88,14 @@ autofs_mount(struct mount *mp) vfs_getnewfsid(mp); - AUTOFS_LOCK(amp); + AUTOFS_XLOCK(amp); error = autofs_node_new(NULL, amp, ".", -1, &->am_root); if (error != 0) { - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); free(amp, M_AUTOFS); return (error); } - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); vfs_mountedfrom(mp, from); @@ -146,7 +146,7 @@ autofs_unmount(struct mount *mp, int mnt pause("autofs_umount", 1); } - AUTOFS_LOCK(amp); + AUTOFS_XLOCK(amp); /* * Not terribly efficient, but at least not recursive. @@ -160,7 +160,7 @@ autofs_unmount(struct mount *mp, int mnt autofs_node_delete(amp->am_root); mp->mnt_data = NULL; - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); sx_destroy(&->am_lock); Modified: stable/10/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:42:11 2014 (r274233) +++ stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:44:03 2014 (r274234) @@ -277,22 +277,22 @@ autofs_lookup(struct vop_lookup_args *ap } } - AUTOFS_LOCK(amp); + AUTOFS_SLOCK(amp); error = autofs_node_find(anp, cnp->cn_nameptr, cnp->cn_namelen, &child); if (error != 0) { if ((cnp->cn_flags & ISLASTCN) && cnp->cn_nameiop == CREATE) { - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); return (EJUSTRETURN); } - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); return (ENOENT); } /* * XXX: Dropping the node here is ok, because we never remove nodes. */ - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); error = autofs_node_vn(child, mp, vpp); if (error != 0) { @@ -325,14 +325,14 @@ autofs_mkdir(struct vop_mkdir_args *ap) if (autofs_ignore_thread(curthread) == false) return (EPERM); - AUTOFS_LOCK(amp); + AUTOFS_XLOCK(amp); error = autofs_node_new(anp, amp, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen, &child); if (error != 0) { - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); return (error); } - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); error = autofs_node_vn(child, vp->v_mount, ap->a_vpp); @@ -427,7 +427,7 @@ autofs_readdir(struct vop_readdir_args * } i = 2; /* Account for "." and "..". */ - AUTOFS_LOCK(amp); + AUTOFS_SLOCK(amp); TAILQ_FOREACH(child, &anp->an_children, an_next) { if (resid < AUTOFS_DELEN) { if (ap->a_eofflag != NULL) @@ -445,14 +445,14 @@ autofs_readdir(struct vop_readdir_args * error = autofs_readdir_one(uio, child->an_name, child->an_fileno); if (error != 0) { - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); return (error); } offset += AUTOFS_DELEN; resid -= AUTOFS_DELEN; } - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); return (0); } @@ -505,7 +505,7 @@ autofs_node_new(struct autofs_node *pare struct autofs_node *anp; if (parent != NULL) - AUTOFS_ASSERT_LOCKED(parent->an_mount); + AUTOFS_ASSERT_XLOCKED(parent->an_mount); anp = uma_zalloc(autofs_node_zone, M_WAITOK | M_ZERO); if (namelen >= 0) @@ -567,7 +567,7 @@ autofs_node_delete(struct autofs_node *a { struct autofs_node *parent; - AUTOFS_ASSERT_LOCKED(anp->an_mount); + AUTOFS_ASSERT_XLOCKED(anp->an_mount); KASSERT(TAILQ_EMPTY(&anp->an_children), ("have children")); callout_drain(&anp->an_callout); From owner-svn-src-stable@FreeBSD.ORG Fri Nov 7 15:45:35 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1D344F5; Fri, 7 Nov 2014 15:45:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD79078F; Fri, 7 Nov 2014 15:45:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7FjZM8001637; Fri, 7 Nov 2014 15:45:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7FjZtc001636; Fri, 7 Nov 2014 15:45:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071545.sA7FjZtc001636@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:45: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: r274235 - stable/10/sys/fs/autofs 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.18-1 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, 07 Nov 2014 15:45:35 -0000 Author: trasz Date: Fri Nov 7 15:45:34 2014 New Revision: 274235 URL: https://svnweb.freebsd.org/changeset/base/274235 Log: MFC r272471: Fix autofs debug macros. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.h ============================================================================== --- stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:44:03 2014 (r274234) +++ stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:45:34 2014 (r274235) @@ -42,15 +42,18 @@ extern uma_zone_t autofs_node_zone; extern int autofs_debug; extern int autofs_mount_on_stat; -#define AUTOFS_DEBUG(X, ...) \ - if (autofs_debug > 1) { \ - printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ +#define AUTOFS_DEBUG(X, ...) \ + do { \ + if (autofs_debug > 1) \ + printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ } while (0) -#define AUTOFS_WARN(X, ...) \ - if (autofs_debug > 0) { \ - printf("WARNING: %s: " X "\n", \ - __func__, ## __VA_ARGS__); \ +#define AUTOFS_WARN(X, ...) \ + do { \ + if (autofs_debug > 0) { \ + printf("WARNING: %s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ } while (0) #define AUTOFS_SLOCK(X) sx_slock(&X->am_lock) From owner-svn-src-stable@FreeBSD.ORG Fri Nov 7 15:47:23 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92DE264D; Fri, 7 Nov 2014 15:47:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DC167A8; Fri, 7 Nov 2014 15:47:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7FlNgY001921; Fri, 7 Nov 2014 15:47:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7FlM2r001918; Fri, 7 Nov 2014 15:47:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071547.sA7FlM2r001918@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:47: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: r274236 - stable/10/sys/fs/autofs 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.18-1 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, 07 Nov 2014 15:47:23 -0000 Author: trasz Date: Fri Nov 7 15:47:22 2014 New Revision: 274236 URL: https://svnweb.freebsd.org/changeset/base/274236 Log: MFC r272512: Make autofs use shared vnode locks. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.h stable/10/sys/fs/autofs/autofs_vfsops.c stable/10/sys/fs/autofs/autofs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.h ============================================================================== --- stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:45:34 2014 (r274235) +++ stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:47:22 2014 (r274236) @@ -138,6 +138,6 @@ int autofs_node_find(struct autofs_node const char *name, int namelen, struct autofs_node **anpp); void autofs_node_delete(struct autofs_node *anp); int autofs_node_vn(struct autofs_node *anp, struct mount *mp, - struct vnode **vpp); + int flags, struct vnode **vpp); #endif /* !AUTOFS_H */ Modified: stable/10/sys/fs/autofs/autofs_vfsops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vfsops.c Fri Nov 7 15:45:34 2014 (r274235) +++ stable/10/sys/fs/autofs/autofs_vfsops.c Fri Nov 7 15:47:22 2014 (r274236) @@ -88,6 +88,10 @@ autofs_mount(struct mount *mp) vfs_getnewfsid(mp); + MNT_ILOCK(mp); + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; + MNT_IUNLOCK(mp); + AUTOFS_XLOCK(amp); error = autofs_node_new(NULL, amp, ".", -1, &->am_root); if (error != 0) { @@ -177,7 +181,7 @@ autofs_root(struct mount *mp, int flags, amp = VFSTOAUTOFS(mp); - error = autofs_node_vn(amp->am_root, mp, vpp); + error = autofs_node_vn(amp->am_root, mp, flags, vpp); return (error); } Modified: stable/10/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:45:34 2014 (r274235) +++ stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:47:22 2014 (r274236) @@ -198,12 +198,12 @@ mounted: } static int -autofs_vget_callback(struct mount *mp, void *arg, int lkflags __unused, +autofs_vget_callback(struct mount *mp, void *arg, int flags, struct vnode **vpp) { - return (autofs_node_vn(arg, mp, vpp)); + return (autofs_node_vn(arg, mp, flags, vpp)); } static int @@ -233,7 +233,7 @@ autofs_lookup(struct vop_lookup_args *ap * use vn_vget_ino_gen() which takes care of all that. */ error = vn_vget_ino_gen(dvp, autofs_vget_callback, - anp->an_parent, 0, vpp); + anp->an_parent, cnp->cn_lkflags, vpp); if (error != 0) { AUTOFS_WARN("vn_vget_ino_gen() failed with error %d", error); @@ -294,7 +294,7 @@ autofs_lookup(struct vop_lookup_args *ap */ AUTOFS_SUNLOCK(amp); - error = autofs_node_vn(child, mp, vpp); + error = autofs_node_vn(child, mp, cnp->cn_lkflags, vpp); if (error != 0) { if ((cnp->cn_flags & ISLASTCN) && cnp->cn_nameiop == CREATE) return (EJUSTRETURN); @@ -334,7 +334,7 @@ autofs_mkdir(struct vop_mkdir_args *ap) } AUTOFS_XUNLOCK(amp); - error = autofs_node_vn(child, vp->v_mount, ap->a_vpp); + error = autofs_node_vn(child, vp->v_mount, LK_EXCLUSIVE, ap->a_vpp); return (error); } @@ -581,7 +581,8 @@ autofs_node_delete(struct autofs_node *a } int -autofs_node_vn(struct autofs_node *anp, struct mount *mp, struct vnode **vpp) +autofs_node_vn(struct autofs_node *anp, struct mount *mp, int flags, + struct vnode **vpp) { struct vnode *vp; int error; @@ -592,7 +593,7 @@ autofs_node_vn(struct autofs_node *anp, vp = anp->an_vnode; if (vp != NULL) { - error = vget(vp, LK_EXCLUSIVE | LK_RETRY, curthread); + error = vget(vp, flags | LK_RETRY, curthread); if (error != 0) { AUTOFS_WARN("vget failed with error %d", error); sx_xunlock(&anp->an_vnode_lock); @@ -632,6 +633,8 @@ autofs_node_vn(struct autofs_node *anp, vp->v_vflag |= VV_ROOT; vp->v_data = anp; + VN_LOCK_ASHARE(vp); + error = insmntque(vp, mp); if (error != 0) { AUTOFS_WARN("insmntque() failed with error %d", error); From owner-svn-src-stable@FreeBSD.ORG Fri Nov 7 15:49:05 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A90BF886; Fri, 7 Nov 2014 15:49:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 947AE7C9; Fri, 7 Nov 2014 15:49:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7Fn5tl002194; Fri, 7 Nov 2014 15:49:05 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7Fn5OQ002193; Fri, 7 Nov 2014 15:49:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071549.sA7Fn5OQ002193@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:49: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: r274237 - stable/10/sys/fs/autofs 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.18-1 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, 07 Nov 2014 15:49:05 -0000 Author: trasz Date: Fri Nov 7 15:49:04 2014 New Revision: 274237 URL: https://svnweb.freebsd.org/changeset/base/274237 Log: MFC r272743: Simplify; no functional changes. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.c ============================================================================== --- stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:47:22 2014 (r274236) +++ stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:49:04 2014 (r274237) @@ -367,7 +367,7 @@ autofs_trigger_one(struct autofs_node *a char *key, *path; int error = 0, request_error, last; - amp = VFSTOAUTOFS(anp->an_vnode->v_mount); + amp = anp->an_mount; sx_assert(&autofs_softc->sc_lock, SA_XLOCKED); From owner-svn-src-stable@FreeBSD.ORG Fri Nov 7 15:50:41 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CC77A37; Fri, 7 Nov 2014 15:50:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08B6E7DE; Fri, 7 Nov 2014 15:50:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7FoelO004326; Fri, 7 Nov 2014 15:50:40 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7Foet4004325; Fri, 7 Nov 2014 15:50:40 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071550.sA7Foet4004325@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:50: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: r274238 - stable/10/sys/fs/autofs 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.18-1 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, 07 Nov 2014 15:50:41 -0000 Author: trasz Date: Fri Nov 7 15:50:40 2014 New Revision: 274238 URL: https://svnweb.freebsd.org/changeset/base/274238 Log: MFC r272836: Remove remnants of some cleanup; no functional changes. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:49:04 2014 (r274237) +++ stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:50:40 2014 (r274238) @@ -459,8 +459,8 @@ autofs_readdir(struct vop_readdir_args * static int autofs_reclaim(struct vop_reclaim_args *ap) { - struct vnode *vp = ap->a_vp; - struct autofs_node *anp = vp->v_data; + struct vnode *vp; + struct autofs_node *anp; vp = ap->a_vp; anp = vp->v_data; From owner-svn-src-stable@FreeBSD.ORG Fri Nov 7 15:52:33 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7621BD1; Fri, 7 Nov 2014 15:52:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92A6B88A; Fri, 7 Nov 2014 15:52:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7FqX8E006124; Fri, 7 Nov 2014 15:52:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7FqXZw006123; Fri, 7 Nov 2014 15:52:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071552.sA7FqXZw006123@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:52: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: r274239 - stable/10/sys/fs/autofs 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.18-1 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, 07 Nov 2014 15:52:33 -0000 Author: trasz Date: Fri Nov 7 15:52:32 2014 New Revision: 274239 URL: https://svnweb.freebsd.org/changeset/base/274239 Log: MFC r272931: Add assertion to catch duplicated nodes. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:50:40 2014 (r274238) +++ stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:52:32 2014 (r274239) @@ -504,9 +504,13 @@ autofs_node_new(struct autofs_node *pare { struct autofs_node *anp; - if (parent != NULL) + if (parent != NULL) { AUTOFS_ASSERT_XLOCKED(parent->an_mount); + KASSERT(autofs_node_find(parent, name, namelen, NULL) == ENOENT, + ("node \"%s\" already exists", name)); + } + anp = uma_zalloc(autofs_node_zone, M_WAITOK | M_ZERO); if (namelen >= 0) anp->an_name = strndup(name, namelen, M_AUTOFS); From owner-svn-src-stable@FreeBSD.ORG Sat Nov 8 00:42:12 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16244964; Sat, 8 Nov 2014 00:42:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01764342; Sat, 8 Nov 2014 00:42:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA80gBhb061155; Sat, 8 Nov 2014 00:42:11 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA80gBs5061154; Sat, 8 Nov 2014 00:42:11 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201411080042.sA80gBs5061154@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 8 Nov 2014 00:42: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: r274259 - stable/10/tools/tools/netmap 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.18-1 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, 08 Nov 2014 00:42:12 -0000 Author: gnn Date: Sat Nov 8 00:42:11 2014 New Revision: 274259 URL: https://svnweb.freebsd.org/changeset/base/274259 Log: MFC: 272962 Add a new option, -P, to pkt-gen which reads a single packet from a stored pcap file and transmits it instead of the default UDP packet. Reviewed by: luigi Modified: stable/10/tools/tools/netmap/pkt-gen.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/netmap/pkt-gen.c ============================================================================== --- stable/10/tools/tools/netmap/pkt-gen.c Fri Nov 7 23:14:11 2014 (r274258) +++ stable/10/tools/tools/netmap/pkt-gen.c Sat Nov 8 00:42:11 2014 (r274259) @@ -202,6 +202,7 @@ struct glob_arg { int dummy_send; int virt_header; /* send also the virt_header */ int extra_bufs; /* goes in nr_arg3 */ + char *packet_file; /* -P option */ }; enum dev_type { DEV_NONE, DEV_NETMAP, DEV_PCAP, DEV_TAP }; @@ -224,6 +225,7 @@ struct targ { int affinity; struct pkt pkt; + void *frame; }; @@ -613,6 +615,28 @@ initialize_packet(struct targ *targ) indirect_payload : default_payload; int i, l0 = strlen(payload); + char errbuf[PCAP_ERRBUF_SIZE]; + pcap_t *file; + struct pcap_pkthdr *header; + const unsigned char *packet; + + /* Read a packet from a PCAP file if asked. */ + if (targ->g->packet_file != NULL) { + if ((file = pcap_open_offline(targ->g->packet_file, + errbuf)) == NULL) + D("failed to open pcap file %s", + targ->g->packet_file); + if (pcap_next_ex(file, &header, &packet) < 0) + D("failed to read packet from %s", + targ->g->packet_file); + if ((targ->frame = malloc(header->caplen)) == NULL) + D("out of memory"); + bcopy(packet, (unsigned char *)targ->frame, header->caplen); + targ->g->pkt_size = header->caplen; + pcap_close(file); + return; + } + /* create a nice NUL-terminated string */ for (i = 0; i < paylen; i += l0) { if (l0 > paylen - i) @@ -783,7 +807,6 @@ pinger_body(void *data) frame += sizeof(targ->pkt.vh) - targ->g->virt_header; size = targ->g->pkt_size + targ->g->virt_header; - if (targ->g->nthreads > 1) { D("can only ping with 1 thread"); return NULL; @@ -1038,10 +1061,15 @@ sender_body(void *data) void *frame; int size; - frame = pkt; - frame += sizeof(pkt->vh) - targ->g->virt_header; - size = targ->g->pkt_size + targ->g->virt_header; - + if (targ->frame == NULL) { + frame = pkt; + frame += sizeof(pkt->vh) - targ->g->virt_header; + size = targ->g->pkt_size + targ->g->virt_header; + } else { + frame = targ->frame; + size = targ->g->pkt_size; + } + D("start, fd %d main_fd %d", targ->fd, targ->g->main_fd); if (setaffinity(targ->thread, targ->affinity)) goto quit; @@ -1366,6 +1394,7 @@ usage(void) "\t-R rate in packets per second\n" "\t-X dump payload\n" "\t-H len add empty virtio-net-header with size 'len'\n" + "\t-P file load packet from pcap file" "", cmd); @@ -1638,7 +1667,7 @@ main(int arc, char **argv) g.virt_header = 0; while ( (ch = getopt(arc, argv, - "a:f:F:n:i:Il:d:s:D:S:b:c:o:p:T:w:WvR:XC:H:e:m:")) != -1) { + "a:f:F:n:i:Il:d:s:D:S:b:c:o:p:T:w:WvR:XC:H:e:m:P:")) != -1) { struct sf *fn; switch(ch) { @@ -1781,7 +1810,11 @@ main(int arc, char **argv) D("unrecognized monitor mode %s", optarg); } break; + case 'P': + g.packet_file = strdup(optarg); + break; } + } if (g.ifname == NULL) { From owner-svn-src-stable@FreeBSD.ORG Sat Nov 8 00:47:18 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D48EAD5; Sat, 8 Nov 2014 00:47:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F1DA36B; Sat, 8 Nov 2014 00:47:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA80lHvq061929; Sat, 8 Nov 2014 00:47:17 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA80lHVH061927; Sat, 8 Nov 2014 00:47:17 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201411080047.sA80lHVH061927@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 8 Nov 2014 00:47:17 +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: r274260 - in stable/10/sys/cam: ata scsi 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.18-1 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, 08 Nov 2014 00:47:18 -0000 Author: gnn Date: Sat Nov 8 00:47:16 2014 New Revision: 274260 URL: https://svnweb.freebsd.org/changeset/base/274260 Log: MFC: 273279 Add new quirks for the latest Samsung SSD, model 850. Submitted by: sbruno Modified: stable/10/sys/cam/ata/ata_da.c stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ata/ata_da.c ============================================================================== --- stable/10/sys/cam/ata/ata_da.c Sat Nov 8 00:42:11 2014 (r274259) +++ stable/10/sys/cam/ata/ata_da.c Sat Nov 8 00:47:16 2014 (r274260) @@ -451,6 +451,30 @@ static struct ada_quirk_entry ada_quirk_ }, { /* + * Samsung 843T Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG MZ7WD*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Samsung 850 SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Samsung SSD 850*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Samsung PM853T Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG MZ7GE*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* * SuperTalent TeraDrive CT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Sat Nov 8 00:42:11 2014 (r274259) +++ stable/10/sys/cam/scsi/scsi_da.c Sat Nov 8 00:47:16 2014 (r274260) @@ -1126,6 +1126,30 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * Samsung 843T Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG MZ7WD*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Samsung 850 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Samsung SSD 850*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Samsung PM853T Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG MZ7GE*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* * SuperTalent TeraDrive CT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ From owner-svn-src-stable@FreeBSD.ORG Sat Nov 8 00:49:46 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3079EC23; Sat, 8 Nov 2014 00:49:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 195EC37B; Sat, 8 Nov 2014 00:49:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA80nkbm062289; Sat, 8 Nov 2014 00:49:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA80nk0H062287; Sat, 8 Nov 2014 00:49:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411080049.sA80nk0H062287@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 8 Nov 2014 00:49: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: r274261 - in stable/10/contrib/xz: . src/liblzma/api/lzma src/liblzma/check src/liblzma/lzma src/xz 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.18-1 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, 08 Nov 2014 00:49:46 -0000 Author: delphij Date: Sat Nov 8 00:49:45 2014 New Revision: 274261 URL: https://svnweb.freebsd.org/changeset/base/274261 Log: MFC r273498: MFV r273494: xz 5.0.7. Modified: stable/10/contrib/xz/ChangeLog stable/10/contrib/xz/THANKS stable/10/contrib/xz/TODO stable/10/contrib/xz/src/liblzma/api/lzma/block.h stable/10/contrib/xz/src/liblzma/api/lzma/version.h stable/10/contrib/xz/src/liblzma/check/crc32_fast.c stable/10/contrib/xz/src/liblzma/check/sha256.c stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c stable/10/contrib/xz/src/xz/coder.c stable/10/contrib/xz/src/xz/signals.c stable/10/contrib/xz/src/xz/suffix.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/xz/ChangeLog ============================================================================== --- stable/10/contrib/xz/ChangeLog Sat Nov 8 00:47:16 2014 (r274260) +++ stable/10/contrib/xz/ChangeLog Sat Nov 8 00:49:45 2014 (r274261) @@ -1,6 +1,337 @@ +commit 495aaf3a5b7200a5d2bf449bbbcc0e18834607af +Author: Lasse Collin +Date: 2014-09-20 20:44:32 +0300 + + Bump version and soname for 5.0.7. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit ac6c8921d1d8d2d749d5c97f9a0b0594cc863cea +Author: Lasse Collin +Date: 2014-09-20 20:43:29 +0300 + + Update NEWS for 5.0.7. + + NEWS | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit d1b0276aafd441a3d4db9dfd5dd9880e9f834d49 +Author: Lasse Collin +Date: 2014-09-20 20:21:18 +0300 + + liblzma: Fix invalid Libs.private value in liblzma.pc. + + src/liblzma/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cac72956b1e56788182ac14bfb25519636afd503 +Author: Lasse Collin +Date: 2014-09-20 19:42:56 +0300 + + liblzma: Fix a portability problem in Makefile.am. + + POSIX supports $< only in inference rules (suffix rules). + Using it elsewhere is a GNU make extension and doesn't + work e.g. with OpenBSD make. + + Thanks to Christian Weisgerber for the patch. + + src/liblzma/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2cdf0875dedca3e89b02ad5ac8aa1109f902ae11 +Author: Lasse Collin +Date: 2014-09-14 19:35:45 +0300 + + Bump version and soname for 5.0.6. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 0168b6c8fbc88cae61b1f5fb41d6c33c9e127967 +Author: Lasse Collin +Date: 2014-09-14 19:33:46 +0300 + + Update NEWS for 5.0.6. + + NEWS | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 13337714e89d002af7af48d6853f977de985d7de +Author: Lasse Collin +Date: 2014-06-13 19:21:54 +0300 + + xzgrep: List xzgrep_expected_output in tests/Makefile.am. + + tests/Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit ccc728d8290c0464c7af62790b1c5528eceaae35 +Author: Lasse Collin +Date: 2014-06-13 18:58:22 +0300 + + xzgrep: Improve the test script. + + Now it should be close to the functionality of the original + version by Pavel Raiskup. + + tests/Makefile.am | 3 ++- + tests/test_scripts.sh | 24 ++++++++++++++---------- + tests/xzgrep_expected_output | 39 +++++++++++++++++++++++++++++++++++++++ + 3 files changed, 55 insertions(+), 11 deletions(-) + +commit 948f5865fe65061e215baa8ed63be570bae152ea +Author: Lasse Collin +Date: 2014-06-11 21:03:25 +0300 + + xzgrep: Add a test for the previous fix. + + This is a simplified version of Pavel Raiskup's + original patch. + + tests/test_scripts.sh | 26 ++++++++++++++++++++++---- + 1 file changed, 22 insertions(+), 4 deletions(-) + +commit 64228d0d5cd75af31e5c330cc3a792016413fabf +Author: Lasse Collin +Date: 2014-06-11 20:43:28 +0300 + + xzgrep: exit 0 when at least one file matches. + + Mimic the original grep behavior and return exit_success when + at least one xz compressed file matches given pattern. + + Original bugreport: + https://bugzilla.redhat.com/show_bug.cgi?id=1108085 + + Thanks to Pavel Raiskup for the patch. + + src/scripts/xzgrep.in | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +commit 98d3368ef4bff0face78d6932f2156730c8cb658 +Author: Lasse Collin +Date: 2014-04-25 17:53:42 +0300 + + Build: Fix the combination of --disable-xzdec --enable-lzmadec. + + In this case "make install" could fail if the man page directory + didn't already exist at the destination. If it did exist, a + dangling symlink was created there. Now the link is omitted + instead. This isn't the best fix but it's better than the old + behavior. + + src/xzdec/Makefile.am | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit ba3b5dd082db2cb5973e877a74221d739c663fb4 +Author: Lasse Collin +Date: 2014-04-25 17:44:26 +0300 + + Build: Add --disable-doc to configure. + + INSTALL | 6 ++++++ + Makefile.am | 2 ++ + configure.ac | 6 ++++++ + 3 files changed, 14 insertions(+) + +commit 3d4575f2367fe8f1f2dcacba014e6c0aef388535 +Author: Lasse Collin +Date: 2014-04-24 18:06:24 +0300 + + Update INSTALL. + + Add a note about failing "make check". The source of + the problem should be fixed in libtool (if it really is + a libtool bug and not mine) but I'm unable to spend time + on that for now. Thanks to Nelson H. F. Beebe for reporting + the issue. + + Add a note about a possible need to run "ldconfig" after + "make install". + + INSTALL | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +commit b9f0584e3eff421eadbb6604de0b0b40bf87e129 +Author: Lasse Collin +Date: 2014-04-09 17:26:10 +0300 + + xz: Rename a variable to avoid a namespace collision on Solaris. + + I don't know the details but I have an impression that there's + no problem in practice if using GCC since people have built xz + with GCC (without patching xz), but renaming the variable cannot + hurt either. + + Thanks to Mark Ashley. + + src/xz/signals.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +commit cc41bcaf77c9c27ec09ef033fb3300e994e828e6 +Author: Lasse Collin +Date: 2014-04-26 08:45:49 +0300 + + xz: Fix a comment. + + src/xz/coder.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e34025d666852839388f997d076e3577847dd10f +Author: Lasse Collin +Date: 2014-01-12 16:44:52 +0200 + + liblzma: Avoid C99 compound literal arrays. + + MSVC 2013 doesn't like them. Maybe they aren't so good + for readability either since many aren't used to them. + + src/liblzma/lzma/lzma_encoder_presets.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit 0b6168974f1fac3a06157039235b66e4161b9b42 +Author: Lasse Collin +Date: 2014-01-12 12:50:30 +0200 + + liblzma: Remove a useless C99ism from sha256.c. + + Unsurprisingly it makes no difference in compiled output. + + src/liblzma/check/sha256.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 41e436076cfdcccc7e853de73b0d56b3d6d42053 +Author: Lasse Collin +Date: 2014-01-12 12:17:08 +0200 + + xz: Fix use of wrong variable. + + Since the only call to suffix_set() uses optarg + as the argument, fixing this bug doesn't change + the behavior of the program. + + src/xz/suffix.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c33efefd4ef0931e5795e13725d4bd2203571ce0 +Author: Lasse Collin +Date: 2014-04-26 08:37:00 +0300 + + Fix typos in comments. + + src/liblzma/check/crc32_fast.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e560c82f1f5693d88db9dc71f656436135f17595 +Author: Lasse Collin +Date: 2013-11-26 18:20:16 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 05192b32e553eac5dfbd646b6102d10187f29a05 +Author: Lasse Collin +Date: 2013-11-26 18:20:09 +0200 + + liblzma: Document the need for block->check for lzma_block_header_decode(). + + Thanks to Tomer Chachamu. + + src/liblzma/api/lzma/block.h | 3 +++ + 1 file changed, 3 insertions(+) + +commit 0f35eafe51db7b1eb0711bc8cc829ea6896b34f4 +Author: Lasse Collin +Date: 2013-10-26 12:47:04 +0300 + + Update TODO. + + TODO | 4 ---- + 1 file changed, 4 deletions(-) + +commit fc9eaf81d718488b052e5c65f9d6f08acc858873 +Author: Lasse Collin +Date: 2013-09-11 14:40:35 +0300 + + Build: Remove a comment about Automake 1.10 from configure.ac. + + The previous commit supports silent rules and that requires + Automake 1.11. + + configure.ac | 2 -- + 1 file changed, 2 deletions(-) + +commit 090c69dda59e00fc86d0792879bd921bb1156029 +Author: Lasse Collin +Date: 2013-09-09 20:37:03 +0300 + + Build: Create liblzma.pc in a src/liblzma/Makefile.am. + + Previously it was done in configure, but doing that goes + against the Autoconf manual. Autoconf requires that it is + possible to override e.g. prefix after running configure + and that doesn't work correctly if liblzma.pc is created + by configure. + + A potential downside of this change is that now e.g. + libdir in liblzma.pc is a standalone string instead of + being defined via ${prefix}, so if one overrides prefix + when running pkg-config the libdir won't get the new value. + I don't know if this matters in practice. + + Thanks to Vincent Torri. + + configure.ac | 1 - + src/liblzma/Makefile.am | 20 ++++++++++++++++++++ + 2 files changed, 20 insertions(+), 1 deletion(-) + +commit 1f35331332273de01c46897cafdb37f8e6e285db +Author: Anders F Bjorklund +Date: 2013-08-02 15:59:46 +0200 + + macosx: separate liblzma package + + macosx/build.sh | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +commit 1415f1d94644f28e07d544bc1e06b0636081abee +Author: Anders F Bjorklund +Date: 2013-08-02 15:58:44 +0200 + + macosx: set minimum to leopard + + macosx/build.sh | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +commit 41913949b93414a21ae9fb1a8e9b7cdde8b37f98 +Author: Anders F Bjorklund +Date: 2011-08-07 13:13:30 +0200 + + move configurables into variables + + macosx/build.sh | 25 ++++++++++++++++++------- + 1 file changed, 18 insertions(+), 7 deletions(-) + +commit 3dffda33f47dc220bb1738564fe02effa9da4c8e +Author: Lasse Collin +Date: 2013-07-15 14:08:02 +0300 + + Build: Fix the detection of missing CRC32. + + Thanks to Vincent Torri. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit b69900ed0b2f914fc6c0a180dcb522dbe5b80ea7 Author: Lasse Collin -Date: Sun Jun 30 18:02:27 2013 +0300 +Date: 2013-06-30 18:02:27 +0300 Man pages: Use similar syntax for synopsis as in xz. @@ -10,38 +341,56 @@ Date: Sun Jun 30 18:02:27 2013 +0300 didn't mention these man pages in his bug report, but it's nice to be consistent. + src/lzmainfo/lzmainfo.1 | 4 ++-- + src/scripts/xzmore.1 | 6 +++--- + src/xzdec/xzdec.1 | 10 +++++----- + 3 files changed, 10 insertions(+), 10 deletions(-) + commit cf4a1e1879d89be314ef3c064bd2656ea452f87e Author: Lasse Collin -Date: Sun Jun 30 15:55:09 2013 +0300 +Date: 2013-06-30 15:55:09 +0300 Update NEWS for 5.0.5. + NEWS | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 52 insertions(+) + commit cb94bb6d1f34e1e93c2d634ea9c3b7dfb3981d05 Author: Lasse Collin -Date: Sun Jun 30 15:54:38 2013 +0300 +Date: 2013-06-30 15:54:38 +0300 Bump version and soname for 5.0.5. + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + commit b7dee202d5b041ccae028d0c5433b83cecbe9e5d Author: Lasse Collin -Date: Fri Jun 28 23:56:17 2013 +0300 +Date: 2013-06-28 23:56:17 +0300 xz: Fix return value type in io_write_buf(). It didn't affect the behavior of the code since -1 becomes true anyway. + src/xz/file_io.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit 265e7b44d804b47373f10b7da28350db7611cea6 Author: Lasse Collin -Date: Fri Jun 28 18:46:13 2013 +0300 +Date: 2013-06-28 18:46:13 +0300 xz: Remove an outdated NetBSD-specific comment. Nowadays errno == EFTYPE is documented in open(2). + src/xz/file_io.c | 4 ---- + 1 file changed, 4 deletions(-) + commit 78c2f8db902195468b8249c432252a6b281db836 Author: Lasse Collin -Date: Fri Jun 28 18:09:47 2013 +0300 +Date: 2013-06-28 18:09:47 +0300 xz: Fix error detection of fcntl(fd, F_SETFL, flags) calls. @@ -51,9 +400,12 @@ Date: Fri Jun 28 18:09:47 2013 +0300 F_SETFL is always 0 (at least accorinding to fcntl(2) from man-pages 3.51). + src/xz/file_io.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + commit 91750dff8f2c654ff636f12a2acdffe5492374b3 Author: Lasse Collin -Date: Fri Jun 28 17:36:47 2013 +0300 +Date: 2013-06-28 17:36:47 +0300 xz: Fix use of wrong variable in a fcntl() call. @@ -69,9 +421,12 @@ Date: Fri Jun 28 17:36:47 2013 +0300 indicate when the flags should be restored instead of relying on a special value in stdout_flags. + src/xz/file_io.c | 24 +++++++++++++----------- + 1 file changed, 13 insertions(+), 11 deletions(-) + commit e11888a79a4a77a69afde60445880d44f63d01aa Author: Lasse Collin -Date: Wed Jun 26 13:30:57 2013 +0300 +Date: 2013-06-26 13:30:57 +0300 xz: Check the value of lzma_stream_flags.version in --list. @@ -80,9 +435,12 @@ Date: Wed Jun 26 13:30:57 2013 +0300 then this check becomes important and will stop the old xz from trying to parse files that it won't understand. + src/xz/list.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + commit f39ddd88f3222219ada88998cf30abfdd3e0e96c Author: Lasse Collin -Date: Wed Jun 26 12:17:00 2013 +0300 +Date: 2013-06-26 12:17:00 +0300 Build: Require Automake 1.12 and use serial-tests option. @@ -95,9 +453,12 @@ Date: Wed Jun 26 12:17:00 2013 +0300 in XZ Utils but they hide the progress output from test_compress.sh. + configure.ac | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + commit cb84e278027a90e9827a6f4d3bb0b4d4744a2fbb Author: Lasse Collin -Date: Sun Jun 23 17:36:47 2013 +0300 +Date: 2013-06-23 17:36:47 +0300 xz: Validate Uncompressed Size from Block Header in list.c. @@ -107,23 +468,32 @@ Date: Sun Jun 23 17:36:47 2013 +0300 show such files as corrupt instead of showing the Uncompressed Size from Index. + src/xz/list.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + commit f01780fce454c7489f7dcbf806299b50da5f51b7 Author: Lasse Collin -Date: Wed Jun 26 10:58:58 2013 +0300 +Date: 2013-06-26 10:58:58 +0300 Update THANKS. + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + commit d98ede7d700b892e32d9c2f46563b6ebc566786d Author: Lasse Collin -Date: Fri Jun 21 22:04:45 2013 +0300 +Date: 2013-06-21 22:04:45 +0300 xz: Make the man page more friendly to doclifter. Thanks to Eric S. Raymond. + src/xz/xz.1 | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + commit 19b447b64b3f520cd5b11429000b092f7c76709b Author: Lasse Collin -Date: Fri Jun 21 21:54:59 2013 +0300 +Date: 2013-06-21 21:54:59 +0300 xz: A couple of man page fixes. @@ -133,9 +503,12 @@ Date: Fri Jun 21 21:54:59 2013 +0300 Thanks to DevHC who reported these issues on IRC to me on 2012-12-14. + src/xz/xz.1 | 35 +++++++++++++++++++++++------------ + 1 file changed, 23 insertions(+), 12 deletions(-) + commit 45edf2966fc9a4d2eae8f84b2fa027fb4fa1df8b Author: Lasse Collin -Date: Fri Jun 21 21:50:26 2013 +0300 +Date: 2013-06-21 21:50:26 +0300 xz: Fix interaction between preset and custom filter chains. @@ -158,15 +531,22 @@ Date: Fri Jun 21 21:50:26 2013 +0300 Thanks to Conley Moorhous. + src/xz/coder.c | 35 +++++++++++++++++++++-------------- + 1 file changed, 21 insertions(+), 14 deletions(-) + commit b065984e5a9272eb50bc0c6d3731e6199c0ae8a8 Author: Lasse Collin -Date: Fri Apr 8 17:53:05 2011 +0300 +Date: 2011-04-08 17:53:05 +0300 xz: Change size_t to uint32_t in a few places. + src/xz/coder.c | 6 +++--- + src/xz/coder.h | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + commit 32be621f52f2e1686db88baa7b01dc1ae338f426 Author: Lasse Collin -Date: Sat Apr 27 22:07:46 2013 +0300 +Date: 2013-04-27 22:07:46 +0300 Build: Use -Wvla with GCC if supported. @@ -175,9 +555,12 @@ Date: Sat Apr 27 22:07:46 2013 +0300 future either to stay compatible with C11 without requiring any optional C11 features. + configure.ac | 1 + + 1 file changed, 1 insertion(+) + commit efb07cfba65e9e05984c02cd796c1b0338ce04dc Author: Lasse Collin -Date: Mon Apr 15 19:29:09 2013 +0300 +Date: 2013-04-15 19:29:09 +0300 xzdec: Improve the --help message. @@ -189,23 +572,32 @@ Date: Mon Apr 15 19:29:09 2013 +0300 because I find it easier to spot the ignored vs. non-ignored options from the list that way. + src/xzdec/xzdec.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + commit e3c8be13699e2813f5e2879d8187444b46d82d89 Author: Lasse Collin -Date: Fri Apr 5 19:25:40 2013 +0300 +Date: 2013-04-05 19:25:40 +0300 Update THANKS. + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + commit ad8282efe483612f6b5544f9a0d2e4914fb2532a Author: Jeff Bastian -Date: Wed Apr 3 13:59:17 2013 +0200 +Date: 2013-04-03 13:59:17 +0200 xzgrep: make the '-h' option to be --no-filename equivalent * src/scripts/xzgrep.in: Accept the '-h' option in argument parsing. + src/scripts/xzgrep.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit 9271a3eb0e022b23e8712154be851d0afe4c02e4 Author: Lasse Collin -Date: Fri Apr 5 19:34:09 2013 +0300 +Date: 2013-04-05 19:34:09 +0300 liblzma: Be less picky in lzma_alone_decoder(). @@ -231,9 +623,14 @@ Date: Fri Apr 5 19:34:09 2013 +0300 src/liblzma/common/alone_decoder.c src/liblzma/common/alone_decoder.h + src/liblzma/common/alone_decoder.c | 22 ++++++++++++++-------- + src/liblzma/common/alone_decoder.h | 5 +++-- + src/liblzma/common/auto_decoder.c | 2 +- + 3 files changed, 18 insertions(+), 11 deletions(-) + commit 211b931cee58626c1d2e021810cb108cb5cbc10f Author: Lasse Collin -Date: Tue Mar 5 19:14:50 2013 +0200 +Date: 2013-03-05 19:14:50 +0200 Avoid unneeded use of awk in xzless. @@ -243,9 +640,12 @@ Date: Tue Mar 5 19:14:50 2013 +0200 Thanks to Ariel P for the patch. + src/scripts/xzless.in | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + commit 9f62fd9605eade23b62b07a235d1f02156f7a5c6 Author: Jonathan Nieder -Date: Mon Nov 19 00:10:10 2012 -0800 +Date: 2012-11-19 00:10:10 -0800 xzless: Make "less -V" parsing more robust @@ -282,46 +682,66 @@ Date: Mon Nov 19 00:10:10 2012 -0800 Reported-by: Jörg-Volker Peetz Signed-off-by: Jonathan Nieder + src/scripts/xzless.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + commit 1d05980f5b5c2c94d833001daccacce4a466876e Author: Lasse Collin -Date: Wed Oct 3 15:54:24 2012 +0300 +Date: 2012-10-03 15:54:24 +0300 xz: Fix the note about --rsyncable on the man page. + src/xz/xz.1 | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + commit fb68497333598688d309a92838d91fd560f7e9f0 Author: Lasse Collin -Date: Fri Sep 28 20:11:09 2012 +0300 +Date: 2012-09-28 20:11:09 +0300 xz: Improve handling of failed realloc in xrealloc. Thanks to Jim Meyering. + src/xz/util.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + commit 75013db6d4d63c195bd8b8d45729b4be0665a812 Author: Lasse Collin -Date: Sat Dec 15 20:01:02 2012 +0200 +Date: 2012-12-15 20:01:02 +0200 A few typo fixes to comments and the xz man page. Thanks to Jim Meyering. + configure.ac | 2 +- + src/liblzma/check/sha256.c | 1 - + src/xz/xz.1 | 4 ++-- + 3 files changed, 3 insertions(+), 4 deletions(-) + commit e44b21839b1dcbac5097be39b87dd2ddb6e114fd Author: Lasse Collin -Date: Thu Aug 2 17:13:30 2012 +0300 +Date: 2012-08-02 17:13:30 +0300 Build: Bump gettext version requirement to 0.18. Otherwise too old version of m4/lib-link.m4 gets included when autoreconf -fi is run. + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit fd3dbb23ca7e75a7a888d7e897c381dc06308307 Author: Lasse Collin -Date: Thu Jul 5 07:36:28 2012 +0300 +Date: 2012-07-05 07:36:28 +0300 Tests: Remove tests/test_block.c that had gotten committed accidentally. + tests/test_block.c | 52 ---------------------------------------------------- + 1 file changed, 52 deletions(-) + commit 05a735d279d74af437c31f25f69aded4713c1a3d Author: Lasse Collin -Date: Thu Jul 5 07:33:35 2012 +0300 +Date: 2012-07-05 07:33:35 +0300 Build: Include macosx/build.sh in the distribution. @@ -329,55 +749,81 @@ Date: Thu Jul 5 07:33:35 2012 +0300 few people have seen it since it hasn't been included in the release tarballs. :-( + Makefile.am | 1 + + 1 file changed, 1 insertion(+) + commit 4e6d62793b5e7b87edcc93c7ded072c1ecd94173 Author: Lasse Collin -Date: Thu Jul 5 07:24:45 2012 +0300 +Date: 2012-07-05 07:24:45 +0300 Docs: Fix the name LZMA Utils -> XZ Utils in debug/README. + debug/README | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit dd95b5e7614baf1f07a1316b5106bd616a9efa79 Author: Lasse Collin -Date: Thu Jul 5 07:23:17 2012 +0300 +Date: 2012-07-05 07:23:17 +0300 Include debug/translation.bash in the distribution. Also fix the script name mentioned in README. + README | 4 ++-- + debug/Makefile.am | 3 +++ + 2 files changed, 5 insertions(+), 2 deletions(-) + commit 20778053a07eb90c159c1377ca8dc05a90fd530b Author: Lasse Collin -Date: Fri Jun 22 14:36:16 2012 +0300 +Date: 2012-06-22 14:36:16 +0300 xz: Update man page date to match the latest update. + src/xz/xz.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit 2cefa84af676da37d7e9c466d55d46c67ab00c22 Author: Lasse Collin -Date: Fri Jun 22 10:25:43 2012 +0300 +Date: 2012-06-22 10:25:43 +0300 Bump version and soname for 5.0.4. + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + commit 433fec191a17e45690809e54146ea7a773f54cff Author: Lasse Collin -Date: Fri Jun 22 10:25:09 2012 +0300 +Date: 2012-06-22 10:25:09 +0300 Update NEWS for 5.0.4. + NEWS | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) + commit 711fa680f552a4003df73b37e6dc4d6e00b47bcd Author: Lasse Collin -Date: Mon Jun 18 21:27:47 2012 +0300 +Date: 2012-06-18 21:27:47 +0300 Docs: Language fix to 01_compress_easy.c. Thanks to Jonathan Nieder. + doc/examples/01_compress_easy.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit 3d7ab1dc61a75c560828be5df96598388b771456 Author: Lasse Collin -Date: Thu Jun 14 20:15:30 2012 +0300 +Date: 2012-06-14 20:15:30 +0300 Fix the top-level Makefile.am for the new example programs. + Makefile.am | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + commit ef8b8e5f111469b5bc005975f7abb9abbd372b25 Author: Lasse Collin -Date: Thu Jun 14 10:52:33 2012 +0300 +Date: 2012-06-14 10:52:33 +0300 Docs: Add new example programs. @@ -385,9 +831,16 @@ Date: Thu Jun 14 10:52:33 2012 +0300 human-readable error messages. More tutorial-like examples are needed but these are a start. + doc/examples/00_README.txt | 27 ++++ + doc/examples/01_compress_easy.c | 297 ++++++++++++++++++++++++++++++++++++++ + doc/examples/02_decompress.c | 287 ++++++++++++++++++++++++++++++++++++ + doc/examples/03_compress_custom.c | 193 +++++++++++++++++++++++++ + doc/examples/Makefile | 23 +++ + 5 files changed, 827 insertions(+) + commit 75c149bc8045a26f8bc719cb8ed20668dab79091 Author: Lasse Collin -Date: Thu Jun 14 10:33:27 2012 +0300 +Date: 2012-06-14 10:33:27 +0300 Docs: Move xz_pipe_comp.c and xz_pipe_decomp.c to doc/examples_old. @@ -395,49 +848,73 @@ Date: Thu Jun 14 10:33:27 2012 +0300 copied the decompressor bug from xz_pipe_decomp.c he has an example how to easily fix it. + doc/examples/xz_pipe_comp.c | 127 -------------------------------------- + doc/examples/xz_pipe_decomp.c | 123 ------------------------------------ + doc/examples_old/xz_pipe_comp.c | 127 ++++++++++++++++++++++++++++++++++++++ + doc/examples_old/xz_pipe_decomp.c | 123 ++++++++++++++++++++++++++++++++++++ + 4 files changed, 250 insertions(+), 250 deletions(-) + commit 456307ebf947a5f50bd995d617b99c1215572308 Author: Lasse Collin -Date: Thu Jun 14 10:33:01 2012 +0300 +Date: 2012-06-14 10:33:01 +0300 Docs: Fix a bug in xz_pipe_decomp.c example program. + doc/examples/xz_pipe_decomp.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + commit 4c310b8a29bc257e6ccbd2310f12f258678f3fef Author: Lasse Collin -Date: Thu May 31 15:53:25 2012 +0300 +Date: 2012-05-31 15:53:25 +0300 Translations: Update the Italian translation. Thanks to Milo Casagrande. + po/it.po | 311 ++++++++++++++++++++++++++++++--------------------------------- + 1 file changed, 146 insertions(+), 165 deletions(-) + commit ec32b79366dc47a55ea877589df9e8509ba113a7 Author: Lasse Collin -Date: Wed May 30 23:15:07 2012 +0300 +Date: 2012-05-30 23:15:07 +0300 Translations: Update the French translation. Thanks to Adrien Nader. + po/fr.po | 237 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 118 insertions(+), 119 deletions(-) + commit dd06f40e4dd7649525e4f28d890dc238a3aa37e5 Author: Lasse Collin -Date: Tue May 29 22:26:27 2012 +0300 +Date: 2012-05-29 22:26:27 +0300 Translations: Update the German translation. + po/de.po | 169 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 91 insertions(+), 78 deletions(-) + commit c66808d1f55d0149ed57c536cc9b52e9c8b583bc Author: Lasse Collin -Date: Tue May 29 22:12:57 2012 +0300 +Date: 2012-05-29 22:12:57 +0300 Translations: Update Polish translation. + po/pl.po | 150 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 82 insertions(+), 68 deletions(-) + commit 556c22dfed195c1466b298183b850d6c28544900 Author: Lasse Collin -Date: Tue May 29 13:10:36 2012 +0300 +Date: 2012-05-29 13:10:36 +0300 Preliminary NEWS for 5.0.4. + NEWS | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + commit dd13b66bf582f49d3aec36e3410ff8541b7506da Author: Lasse Collin -Date: Mon May 28 20:42:11 2012 +0300 +Date: 2012-05-28 20:42:11 +0300 liblzma: Fix possibility of incorrect LZMA_BUF_ERROR. @@ -465,21 +942,32 @@ Date: Mon May 28 20:42:11 2012 +0300 A similar bug was fixed in XZ Embedded on 2011-09-19. + src/liblzma/simple/simple_coder.c | 2 +- + tests/Makefile.am | 4 +- + tests/test_bcj_exact_size.c | 112 ++++++++++++++++++++++++++++++++++++++ + 3 files changed, 116 insertions(+), 2 deletions(-) + commit a0223bf796fdaad51a11ad02c4195c694849cc78 Author: Lasse Collin -Date: Mon May 28 15:38:32 2012 +0300 +Date: 2012-05-28 15:38:32 +0300 Update THANKS. + THANKS | 1 + + 1 file changed, 1 insertion(+) + commit 86e57e4bfefe3fd8e13615c41604165bb2359501 Author: Lasse Collin -Date: Mon May 28 15:37:43 2012 +0300 +Date: 2012-05-28 15:37:43 +0300 xz: Don't show a huge number in -vv when memory limit is disabled. + src/xz/message.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + commit 13e44a94da19d1ef14832ff12d3877a6fd2c54c0 Author: Lasse Collin -Date: Sun May 27 22:30:17 2012 +0300 +Date: 2012-05-27 22:30:17 +0300 xz: Document the "summary" lines of --robot -lvv. @@ -487,30 +975,43 @@ Date: Sun May 27 22:30:17 2012 +0300 The new columns added in the master branch aren't necessarily stable yet. + src/xz/xz.1 | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + commit 2f90345e13ab8fea4de45a4f1caa73ebc63a62e7 Author: Lasse Collin -Date: Sun May 27 21:53:20 2012 +0300 +Date: 2012-05-27 21:53:20 +0300 xz: Fix output of verbose --robot --list modes. It printed the filename in "filename (x/y)" format which it obviously shouldn't do in robot mode. + src/xz/message.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit 8d4864f53ffae5d862c691a0b334a6b69bc5366e Author: Lasse Collin -Date: Thu May 10 21:15:17 2012 +0300 +Date: 2012-05-10 21:15:17 +0300 Update THANKS. + THANKS | 1 + + 1 file changed, 1 insertion(+) + commit 35e9c58abb0ce3993da844aaeaa3e7231cd2be8f Author: Lasse Collin -Date: Thu May 10 21:14:16 2012 +0300 +Date: 2012-05-10 21:14:16 +0300 Docs: Cleanup line wrapping a bit. + README | 12 ++++++------ + doc/history.txt | 49 +++++++++++++++++++++++++------------------------ + 2 files changed, 31 insertions(+), 30 deletions(-) + commit 532b3e4c568a228309b56f95c13435fd078dbe02 Author: Benno Schulenberg -Date: Tue Mar 13 22:04:04 2012 +0100 +Date: 2012-03-13 22:04:04 +0100 Fix a few typos and add some missing articles in some documents. @@ -518,42 +1019,64 @@ Date: Tue Mar 13 22:04:04 2012 +0100 Signed-off-by: Benno Schulenberg + AUTHORS | 6 +++--- + README | 42 ++++++++++++++++++++--------------------- + doc/faq.txt | 24 ++++++++++++------------ + doc/history.txt | 58 ++++++++++++++++++++++++++++----------------------------- + 4 files changed, 65 insertions(+), 65 deletions(-) + commit afb6ce8c82ffef8f2505a3759da72a733c7b0b8f Author: Lasse Collin -Date: Sun Apr 29 11:51:25 2012 +0300 +Date: 2012-04-29 11:51:25 +0300 Windows: Update notes about static linking with MSVC. + windows/README-Windows.txt | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + commit 7c3ba2ed5c3c878d4a14ca549b46dbff60c6d565 Author: Lasse Collin -Date: Thu Apr 19 15:25:26 2012 +0300 +Date: 2012-04-19 15:25:26 +0300 liblzma: Remove outdated comments. + src/liblzma/simple/simple_coder.c | 3 --- + src/liblzma/simple/simple_private.h | 3 +-- + 2 files changed, 1 insertion(+), 5 deletions(-) + commit f55db9c187651094f43881c49db2b2d9ffee6b80 Author: Lasse Collin -Date: Thu Apr 19 14:17:52 2012 +0300 +Date: 2012-04-19 14:17:52 +0300 DOS: Link against DJGPP's libemu to support FPU emulation. This way xz should work on 386SX and 486SX. Floating point only is needed for verbose output in xz. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sat Nov 8 00:51:33 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D7A9D5D; Sat, 8 Nov 2014 00:51:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E0EC5FE; Sat, 8 Nov 2014 00:51:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA80pWqw065542; Sat, 8 Nov 2014 00:51:32 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA80pVGt065532; Sat, 8 Nov 2014 00:51:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411080051.sA80pVGt065532@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 8 Nov 2014 00:51: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: r274262 - stable/10/usr.bin/gzip 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.18-1 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, 08 Nov 2014 00:51:33 -0000 Author: delphij Date: Sat Nov 8 00:51:31 2014 New Revision: 274262 URL: https://svnweb.freebsd.org/changeset/base/274262 Log: MFC r273507: Sync with NetBSD. Modified: stable/10/usr.bin/gzip/Makefile stable/10/usr.bin/gzip/gzip.1 stable/10/usr.bin/gzip/gzip.c stable/10/usr.bin/gzip/zmore stable/10/usr.bin/gzip/zmore.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/gzip/Makefile ============================================================================== --- stable/10/usr.bin/gzip/Makefile Sat Nov 8 00:49:45 2014 (r274261) +++ stable/10/usr.bin/gzip/Makefile Sat Nov 8 00:51:31 2014 (r274262) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.16 2011/06/21 13:25:45 joerg Exp $ +# $NetBSD: Makefile,v 1.18 2013/11/13 11:12:24 pettai Exp $ # $FreeBSD$ .include @@ -21,7 +21,8 @@ SCRIPTS= gzexe zdiff zforce zmore znew MLINKS+= gzip.1 gunzip.1 \ gzip.1 gzcat.1 \ gzip.1 zcat.1 \ - zdiff.1 zcmp.1 + zdiff.1 zcmp.1 \ + zmore.1 zless.1 LINKS+= ${BINDIR}/gzip ${BINDIR}/gunzip \ ${BINDIR}/gzip ${BINDIR}/gzcat \ Modified: stable/10/usr.bin/gzip/gzip.1 ============================================================================== --- stable/10/usr.bin/gzip/gzip.1 Sat Nov 8 00:49:45 2014 (r274261) +++ stable/10/usr.bin/gzip/gzip.1 Sat Nov 8 00:51:31 2014 (r274262) @@ -1,4 +1,4 @@ -.\" $NetBSD: gzip.1,v 1.21 2011/06/19 02:22:36 christos Exp $ +.\" $NetBSD: gzip.1,v 1.23 2014/03/18 18:20:45 riastradh Exp $ .\" .\" Copyright (c) 1997, 2003, 2004 Matthew R. Green .\" All rights reserved. Modified: stable/10/usr.bin/gzip/gzip.c ============================================================================== --- stable/10/usr.bin/gzip/gzip.c Sat Nov 8 00:49:45 2014 (r274261) +++ stable/10/usr.bin/gzip/gzip.c Sat Nov 8 00:51:31 2014 (r274262) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.105 2011/08/30 23:06:00 joerg Exp $ */ +/* $NetBSD: gzip.c,v 1.106 2014/10/18 08:33:30 snj Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -158,7 +158,7 @@ static suffixes_t suffixes[] = { #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) #define SUFFIX_MAXLEN 30 -static const char gzip_version[] = "FreeBSD gzip 20111009"; +static const char gzip_version[] = "FreeBSD gzip 20141022"; #ifndef SMALL static const char gzip_copyright[] = \ @@ -1769,7 +1769,7 @@ handle_stdout(void) return; } #endif - /* If stdin is a file use it's mtime, otherwise use current time */ + /* If stdin is a file use its mtime, otherwise use current time */ ret = fstat(STDIN_FILENO, &sb); #ifndef SMALL @@ -2110,7 +2110,7 @@ static void display_license(void) { - fprintf(stderr, "%s (based on NetBSD gzip 20111009)\n", gzip_version); + fprintf(stderr, "%s (based on NetBSD gzip 20141018)\n", gzip_version); fprintf(stderr, "%s\n", gzip_copyright); exit(0); } Modified: stable/10/usr.bin/gzip/zmore ============================================================================== --- stable/10/usr.bin/gzip/zmore Sat Nov 8 00:49:45 2014 (r274261) +++ stable/10/usr.bin/gzip/zmore Sat Nov 8 00:51:31 2014 (r274262) @@ -1,7 +1,8 @@ #!/bin/sh - # -# $NetBSD: zmore,v 1.3 2004/03/29 09:59:42 wiz Exp $ -# $OpenBSD: zmore,v 1.4 2003/07/29 07:42:45 otto Exp $ +# $NetBSD: zmore,v 1.5 2013/12/06 13:33:15 pettai Exp $ +# +# $OpenBSD: zmore,v 1.6 2008/08/20 09:22:02 mpf Exp $ # #- # Copyright (c) 2003 Todd C. Miller @@ -42,15 +43,21 @@ while test $# -ne 0; do esac done +if [ `basename $0` = "zless" ] ; then + pager=${PAGER-less} +else + pager=${PAGER-more} +fi + # No files means read from stdin if [ $# -eq 0 ]; then - gzip -cdfq 2>&1 | ${PAGER-more} $flags + gzip -cdfq 2>&1 | $pager $flags exit 0 fi oterm=`stty -g 2>/dev/null` while test $# -ne 0; do - gzip -cdfq "$1" 2>&1 | ${PAGER-more} $flags + gzip -cdfq "$1" 2>&1 | $pager $flags prev="$1" shift if tty -s && test -n "$oterm" -a $# -gt 0; then Modified: stable/10/usr.bin/gzip/zmore.1 ============================================================================== --- stable/10/usr.bin/gzip/zmore.1 Sat Nov 8 00:49:45 2014 (r274261) +++ stable/10/usr.bin/gzip/zmore.1 Sat Nov 8 00:51:31 2014 (r274262) @@ -1,5 +1,5 @@ -.\" $NetBSD: zmore.1,v 1.3 2003/12/28 12:47:52 wiz Exp $ -.\" $OpenBSD: zmore.1,v 1.3 2003/06/23 21:00:48 deraadt Exp $ +.\" $NetBSD: zmore.1,v 1.4 2013/11/12 21:58:37 pettai Exp $ +.\" $OpenBSD: zmore.1,v 1.10 2009/08/16 09:41:08 sobrado Exp $ .\" .\" Copyright (c) 2003 Todd C. Miller .\" @@ -20,16 +20,20 @@ .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" .\" $FreeBSD$ -.Dd February 6, 2011 +.Dd October 22, 2014 .Dt ZMORE 1 .Os .Sh NAME -.Nm zmore +.Nm zmore , +.Nm zless .Nd view compressed files .Sh SYNOPSIS .Nm zmore .Op Ar flags -.Op Ar file ... +.Op Ar +.Nm zless +.Op Ar flags +.Op Ar .Sh DESCRIPTION .Nm is a filter that allows the viewing of files compressed with Lempel-Ziv @@ -51,6 +55,14 @@ that are specified are passed to the use .Pa /usr/bin/more by default). .Pp +.Nm zless +is equivalent to +.Nm zmore +but uses +.Xr less 1 +as a pager instead of +.Xr more 1 . +.Pp When multiple files are specified, .Nm will pause at the end of each file and present the following prompt to the user: @@ -86,7 +98,11 @@ style compression since there is no suff Program used to display files. If unset, .Pa /usr/bin/more -is used. +is used +.Pq Nm zmore +or +.Pa /usr/bin/less +.Pq Nm zless . .El .Sh SEE ALSO .Xr compress 1 , From owner-svn-src-stable@FreeBSD.ORG Sat Nov 8 00:55:07 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 331B0EB1; Sat, 8 Nov 2014 00:55:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04E65615; Sat, 8 Nov 2014 00:55:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA80t6wC066517; Sat, 8 Nov 2014 00:55:06 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA80t6Mq066516; Sat, 8 Nov 2014 00:55:06 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411080055.sA80t6Mq066516@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 8 Nov 2014 00:55: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: r274263 - 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.18-1 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, 08 Nov 2014 00:55:07 -0000 Author: delphij Date: Sat Nov 8 00:55:06 2014 New Revision: 274263 URL: https://svnweb.freebsd.org/changeset/base/274263 Log: MFC r273619: MFV r273617: netcat from OpenBSD 5.6. Modified: stable/10/contrib/netcat/netcat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netcat/netcat.c ============================================================================== --- stable/10/contrib/netcat/netcat.c Sat Nov 8 00:51:31 2014 (r274262) +++ stable/10/contrib/netcat/netcat.c Sat Nov 8 00:55:06 2014 (r274263) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.117 2013/10/26 21:33:29 sthen Exp $ */ +/* $OpenBSD: netcat.c,v 1.122 2014/07/20 01:38:40 guenther Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -155,9 +155,6 @@ main(int argc, char *argv[]) host = NULL; uport = NULL; sv = NULL; -#if 0 - rtableid = getrtable(); -#endif while ((ch = getopt_long(argc, argv, "46DdEe:FhI:i:klNnoO:P:p:rSs:tT:UuV:vw:X:x:z", @@ -662,7 +659,7 @@ remote_connect(const char *host, const c if (bind(s, (struct sockaddr *)ares->ai_addr, ares->ai_addrlen) < 0) - errx(1, "bind failed: %s", strerror(errno)); + err(1, "bind failed"); freeaddrinfo(ares); } @@ -751,7 +748,7 @@ local_listen(char *host, char *port, str res0->ai_protocol)) < 0) continue; - if (rtableid >= 0 && (setsockopt(s, IPPROTO_IP, SO_SETFIB, + if (rtableid >= 0 && (setsockopt(s, SOL_SOCKET, SO_SETFIB, &rtableid, sizeof(rtableid)) == -1)) err(1, "setsockopt SO_SETFIB"); @@ -796,12 +793,12 @@ void readwrite(int nfd) { struct pollfd pfd[2]; - unsigned char buf[16384]; + unsigned char buf[16 * 1024]; int n, wfd = fileno(stdin); int lfd = fileno(stdout); int plen; - plen = 2048; + plen = sizeof(buf); /* Setup Network FD */ pfd[0].fd = nfd; @@ -816,8 +813,9 @@ readwrite(int nfd) sleep(iflag); if ((n = poll(pfd, 2 - dflag, timeout)) < 0) { + int saved_errno = errno; close(nfd); - err(1, "Polling Error"); + errc(1, saved_errno, "Polling Error"); } if (n == 0) From owner-svn-src-stable@FreeBSD.ORG Sat Nov 8 02:40:01 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDACB9A8; Sat, 8 Nov 2014 02:40:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A95ECE36; Sat, 8 Nov 2014 02:40:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA82e1da013107; Sat, 8 Nov 2014 02:40:01 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA82e1AZ013106; Sat, 8 Nov 2014 02:40:01 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411080240.sA82e1AZ013106@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sat, 8 Nov 2014 02:40: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: r274264 - 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.18-1 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, 08 Nov 2014 02:40:01 -0000 Author: bryanv Date: Sat Nov 8 02:40:00 2014 New Revision: 274264 URL: https://svnweb.freebsd.org/changeset/base/274264 Log: MFC r272797: Check for mbuf copy failure when there are multiple multicast sockets This partitular case is the only path where the mbuf could be NULL. udp_append() checked for a NULL mbuf only after invoking the tunneling callback. Our only in tree tunneling callback - SCTP - assumed a non NULL mbuf, and it is a bit odd to make the callbacks responsible for checking this condition. This also reduces the differences between the IPv4 and IPv6 code. Modified: stable/10/sys/netinet/udp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/udp_usrreq.c ============================================================================== --- stable/10/sys/netinet/udp_usrreq.c Sat Nov 8 00:55:06 2014 (r274263) +++ stable/10/sys/netinet/udp_usrreq.c Sat Nov 8 02:40:00 2014 (r274264) @@ -307,9 +307,6 @@ udp_append(struct inpcb *inp, struct ip return; } - if (n == NULL) - return; - off += sizeof(struct udphdr); #ifdef IPSEC @@ -568,8 +565,10 @@ udp_input(struct mbuf *m, int off) if (last != NULL) { struct mbuf *n; - n = m_copy(m, 0, M_COPYALL); - udp_append(last, ip, n, iphlen, &udp_in); + if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { + udp_append(last, ip, n, iphlen, + &udp_in); + } INP_RUNLOCK(last); } last = inp; From owner-svn-src-stable@FreeBSD.ORG Sat Nov 8 02:47:24 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3E76C0F; Sat, 8 Nov 2014 02:47:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5C5BF03; Sat, 8 Nov 2014 02:47:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA82lNNB017364; Sat, 8 Nov 2014 02:47:23 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA82lNBP017363; Sat, 8 Nov 2014 02:47:23 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411080247.sA82lNBP017363@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sat, 8 Nov 2014 02:47: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: r274265 - 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.18-1 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, 08 Nov 2014 02:47:24 -0000 Author: bryanv Date: Sat Nov 8 02:47:23 2014 New Revision: 274265 URL: https://svnweb.freebsd.org/changeset/base/274265 Log: MFC r272801: Move the calls to u_tun_func() into udp6_append() A similar cleanup for UDPv4 was performed in r220620. Modified: stable/10/sys/netinet6/udp6_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/10/sys/netinet6/udp6_usrreq.c Sat Nov 8 02:40:00 2014 (r274264) +++ stable/10/sys/netinet6/udp6_usrreq.c Sat Nov 8 02:47:23 2014 (r274265) @@ -139,9 +139,18 @@ udp6_append(struct inpcb *inp, struct mb { struct socket *so; struct mbuf *opts; + struct udpcb *up; INP_LOCK_ASSERT(inp); + /* + * Engage the tunneling protocol. + */ + up = intoudpcb(inp); + if (up->u_tun_func != NULL) { + (*up->u_tun_func)(n, off, inp); + return; + } #ifdef IPSEC /* Check AH/ESP integrity. */ if (ipsec6_in_reject(n, inp)) { @@ -359,20 +368,7 @@ udp6_input(struct mbuf **mp, int *offp, if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { INP_RLOCK(last); - up = intoudpcb(last); - if (up->u_tun_func == NULL) { - udp6_append(last, n, off, &fromsa); - } else { - /* - * Engage the tunneling - * protocol we will have to - * leave the info_lock up, - * since we are hunting - * through multiple UDP's. - * - */ - (*up->u_tun_func)(n, off, last); - } + udp6_append(last, n, off, &fromsa); INP_RUNLOCK(last); } } @@ -402,16 +398,8 @@ udp6_input(struct mbuf **mp, int *offp, } INP_RLOCK(last); INP_INFO_RUNLOCK(pcbinfo); - up = intoudpcb(last); UDP_PROBE(receive, NULL, last, ip6, last, uh); - if (up->u_tun_func == NULL) { - udp6_append(last, m, off, &fromsa); - } else { - /* - * Engage the tunneling protocol. - */ - (*up->u_tun_func)(m, off, last); - } + udp6_append(last, m, off, &fromsa); INP_RUNLOCK(last); return (IPPROTO_DONE); } @@ -490,15 +478,7 @@ udp6_input(struct mbuf **mp, int *offp, } } UDP_PROBE(receive, NULL, inp, ip6, inp, uh); - if (up->u_tun_func == NULL) { - udp6_append(inp, m, off, &fromsa); - } else { - /* - * Engage the tunneling protocol. - */ - - (*up->u_tun_func)(m, off, inp); - } + udp6_append(inp, m, off, &fromsa); INP_RUNLOCK(inp); return (IPPROTO_DONE); From owner-svn-src-stable@FreeBSD.ORG Sat Nov 8 02:53:56 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DC66DF3; Sat, 8 Nov 2014 02:53:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 874FFFC4; Sat, 8 Nov 2014 02:53:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA82ru4D021532; Sat, 8 Nov 2014 02:53:56 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA82ru4G021530; Sat, 8 Nov 2014 02:53:56 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411080253.sA82ru4G021530@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sat, 8 Nov 2014 02:53: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: r274266 - 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.18-1 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, 08 Nov 2014 02:53:56 -0000 Author: bryanv Date: Sat Nov 8 02:53:55 2014 New Revision: 274266 URL: https://svnweb.freebsd.org/changeset/base/274266 Log: MFC r272844: Add missing UDP multicast receive dtrace probes Modified: stable/10/sys/netinet/udp_usrreq.c stable/10/sys/netinet6/udp6_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/udp_usrreq.c ============================================================================== --- stable/10/sys/netinet/udp_usrreq.c Sat Nov 8 02:47:23 2014 (r274265) +++ stable/10/sys/netinet/udp_usrreq.c Sat Nov 8 02:53:55 2014 (r274266) @@ -566,6 +566,8 @@ udp_input(struct mbuf *m, int off) struct mbuf *n; if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { + UDP_PROBE(receive, NULL, last, ip, + last, uh); udp_append(last, ip, n, iphlen, &udp_in); } @@ -597,6 +599,7 @@ udp_input(struct mbuf *m, int off) INP_INFO_RUNLOCK(pcbinfo); goto badunlocked; } + UDP_PROBE(receive, NULL, last, ip, last, uh); udp_append(last, ip, m, iphlen, &udp_in); INP_RUNLOCK(last); INP_INFO_RUNLOCK(pcbinfo); Modified: stable/10/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/10/sys/netinet6/udp6_usrreq.c Sat Nov 8 02:47:23 2014 (r274265) +++ stable/10/sys/netinet6/udp6_usrreq.c Sat Nov 8 02:53:55 2014 (r274266) @@ -368,6 +368,8 @@ udp6_input(struct mbuf **mp, int *offp, if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { INP_RLOCK(last); + UDP_PROBE(receive, NULL, last, ip6, + last, uh); udp6_append(last, n, off, &fromsa); INP_RUNLOCK(last); } From owner-svn-src-stable@FreeBSD.ORG Sat Nov 8 03:42:20 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D91E466A; Sat, 8 Nov 2014 03:42:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4933774; Sat, 8 Nov 2014 03:42:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA83gKUJ045216; Sat, 8 Nov 2014 03:42:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA83gKCO045213; Sat, 8 Nov 2014 03:42:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411080342.sA83gKCO045213@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 8 Nov 2014 03:42: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: r274268 - in stable/10/sys: arm/arm arm/at91 conf 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.18-1 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, 08 Nov 2014 03:42:21 -0000 Author: ian Date: Sat Nov 8 03:42:19 2014 New Revision: 274268 URL: https://svnweb.freebsd.org/changeset/base/274268 Log: MFC r273703: Remove the ARM_DEVICE_MULTIPASS option and make its effect be the default. Modified: stable/10/sys/arm/arm/nexus.c stable/10/sys/arm/at91/std.atmel stable/10/sys/conf/options.arm Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/nexus.c ============================================================================== --- stable/10/sys/arm/arm/nexus.c Sat Nov 8 03:20:56 2014 (r274267) +++ stable/10/sys/arm/arm/nexus.c Sat Nov 8 03:42:19 2014 (r274268) @@ -125,12 +125,8 @@ static driver_t nexus_driver = { nexus_methods, 1 /* no softc */ }; -#ifdef ARM_DEVICE_MULTIPASS EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_EARLY); -#else -DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); -#endif static int nexus_probe(device_t dev) Modified: stable/10/sys/arm/at91/std.atmel ============================================================================== --- stable/10/sys/arm/at91/std.atmel Sat Nov 8 03:20:56 2014 (r274267) +++ stable/10/sys/arm/at91/std.atmel Sat Nov 8 03:42:19 2014 (r274268) @@ -11,3 +11,4 @@ device at91sam9x5 # bring in the sam specific timers and such device at91sam9 + Modified: stable/10/sys/conf/options.arm ============================================================================== --- stable/10/sys/conf/options.arm Sat Nov 8 03:20:56 2014 (r274267) +++ stable/10/sys/conf/options.arm Sat Nov 8 03:42:19 2014 (r274268) @@ -1,7 +1,6 @@ #$FreeBSD$ ARM9_CACHE_WRITE_THROUGH opt_global.h ARM_CACHE_LOCK_ENABLE opt_global.h -ARM_DEVICE_MULTIPASS opt_global.h ARM_KERN_DIRECTMAP opt_vm.h ARM_L2_PIPT opt_global.h ARM_MANY_BOARD opt_global.h From owner-svn-src-stable@FreeBSD.ORG Sat Nov 8 04:18:34 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83380D12; Sat, 8 Nov 2014 04:18:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 551A8A99; Sat, 8 Nov 2014 04:18:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA84IYWn060196; Sat, 8 Nov 2014 04:18:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA84IXYx060193; Sat, 8 Nov 2014 04:18:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411080418.sA84IXYx060193@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 8 Nov 2014 04:18: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: r274269 - stable/10/sys/boot/fdt/dts/arm 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.18-1 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, 08 Nov 2014 04:18:34 -0000 Author: ian Date: Sat Nov 8 04:18:33 2014 New Revision: 274269 URL: https://svnweb.freebsd.org/changeset/base/274269 Log: MFC r268836: Fix a typo in a gpio node name. Modified: stable/10/sys/boot/fdt/dts/arm/wandboard-dual.dts stable/10/sys/boot/fdt/dts/arm/wandboard-quad.dts stable/10/sys/boot/fdt/dts/arm/wandboard-solo.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/arm/wandboard-dual.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/wandboard-dual.dts Sat Nov 8 03:42:19 2014 (r274268) +++ stable/10/sys/boot/fdt/dts/arm/wandboard-dual.dts Sat Nov 8 04:18:33 2014 (r274269) @@ -48,7 +48,7 @@ gpio@020a0000 { status = "okay"; }; gpio@020a4000 { status = "okay"; }; gpio@020a8000 { status = "okay"; }; - gpio@020aC000 { status = "okay"; }; + gpio@020ac000 { status = "okay"; }; gpio@020b0000 { status = "okay"; }; gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; Modified: stable/10/sys/boot/fdt/dts/arm/wandboard-quad.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/wandboard-quad.dts Sat Nov 8 03:42:19 2014 (r274268) +++ stable/10/sys/boot/fdt/dts/arm/wandboard-quad.dts Sat Nov 8 04:18:33 2014 (r274269) @@ -48,7 +48,7 @@ gpio@020a0000 { status = "okay"; }; gpio@020a4000 { status = "okay"; }; gpio@020a8000 { status = "okay"; }; - gpio@020aC000 { status = "okay"; }; + gpio@020ac000 { status = "okay"; }; gpio@020b0000 { status = "okay"; }; gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; Modified: stable/10/sys/boot/fdt/dts/arm/wandboard-solo.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/wandboard-solo.dts Sat Nov 8 03:42:19 2014 (r274268) +++ stable/10/sys/boot/fdt/dts/arm/wandboard-solo.dts Sat Nov 8 04:18:33 2014 (r274269) @@ -48,7 +48,7 @@ gpio@020a0000 { status = "okay"; }; gpio@020a4000 { status = "okay"; }; gpio@020a8000 { status = "okay"; }; - gpio@020aC000 { status = "okay"; }; + gpio@020ac000 { status = "okay"; }; gpio@020b0000 { status = "okay"; }; gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; };